/**
  * {@inheritdoc}
  */
 public function create(ContainerBuilder $container, $contextName, array $config)
 {
     if (false == class_exists('Payum\\OmnipayBridge\\PaymentFactory')) {
         throw new RuntimeException('Cannot find OmnipayBridge payment factory class. Have you installed payum/omnipay-bridge package?');
     }
     $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config/payment'));
     $loader->load('omnipay_bridge.xml');
     return parent::create($container, $contextName, $config);
 }
 /**
  * {@inheritdoc}
  */
 public function create(ContainerBuilder $container, $contextName, array $config)
 {
     if (false == class_exists('Payum\\Paypal\\ExpressCheckout\\Nvp\\PaymentFactory')) {
         throw new RuntimeException('Cannot find paypal express checkout payment factory class. Have you installed payum/paypal-express-checkout-nvp package?');
     }
     $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config/payment'));
     $loader->load('paypal_express_checkout_nvp.xml');
     return parent::create($container, $contextName, $config);
 }
 /**
  * {@inheritDoc}
  */
 public function create(ContainerBuilder $container, $contextName, array $config)
 {
     if (false == class_exists('Payum\\AuthorizeNet\\Aim\\PaymentFactory')) {
         throw new RuntimeException('Cannot find Authorize.net payment factory class. Have you installed payum/authorize-net-aim package?');
     }
     $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config/payment'));
     $loader->load('authorize_net_aim.xml');
     return parent::create($container, $contextName, $config);
 }
 /**
  * {@inheritDoc}
  */
 public function create(ContainerBuilder $container, $contextName, array $config)
 {
     if (false == class_exists('Payum\\Klarna\\Checkout\\PaymentFactory')) {
         throw new RuntimeException('Cannot find klarna checkout payment factory class. Have you installed payum/klarna-checkout package?');
     }
     $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config/payment'));
     $loader->load('klarna_checkout.xml');
     return parent::create($container, $contextName, $config);
 }
    /**
     * {@inheritDoc}
     */
    public function create(ContainerBuilder $container, $paymentName, array $config)
    {
        if (false == class_exists('Payum\Klarna\Invoice\PaymentFactory')) {
            throw new RuntimeException('Cannot find Klarna Invoice payment factory class. Have you installed payum/klarna-invoice package?');
        }

        //autoload Klarna
        \Klarna::BETA;

        return parent::create($container, $paymentName, $config);
    }
 /**
  * {@inheritDoc}
  */
 public function create(ContainerBuilder $container, $contextName, array $config)
 {
     $paymentId = parent::create($container, $contextName, $config);
     $paymentDefinition = $container->getDefinition($paymentId);
     $paymentDefinition->addMethodCall('addApi', array(new Reference($config['plugin_controller_service'])));
     $captureActionDefinition = new Definition();
     $captureActionDefinition->setClass('Payum\\Bridge\\JMSPayment\\Action\\CaptureAction');
     $captureActionId = 'payum.context.' . $contextName . '.action.capture';
     $container->setDefinition($captureActionId, $captureActionDefinition);
     $paymentDefinition->addMethodCall('addAction', array(new Reference($captureActionId)));
     $statusActionDefinition = new Definition();
     $statusActionDefinition->setClass('Payum\\Bridge\\JMSPayment\\Action\\StatusAction');
     $statusActionId = 'payum.context.' . $contextName . '.action.status';
     $container->setDefinition($statusActionId, $statusActionDefinition);
     $paymentDefinition->addMethodCall('addAction', array(new Reference($statusActionId)));
     return $paymentId;
 }