/**
  * {@inheritDoc}
  */
 public function createConfig(array $config = array())
 {
     $config = ArrayObject::ensureArrayObject($config);
     $config->defaults($this->defaultConfig);
     $config->defaults($this->coreGatewayFactory->createConfig());
     $config->defaults(array('payum.action.capture' => new CaptureAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.status' => new StatusAction()));
     if (false == $config['payum.api']) {
         $config['payum.required_options'] = array('type');
         $config->defaults(array('options' => array()));
         $config['payum.api.gateway'] = function (ArrayObject $config) {
             $config->validateNotEmpty($config['payum.required_options']);
             $gatewayFactory = Omnipay::getFactory();
             $gatewayFactory->find();
             $supportedTypes = $gatewayFactory->all();
             if (false == in_array($config['type'], $supportedTypes)) {
                 throw new LogicException(sprintf('Given type %s is not supported. Try one of supported types: %s.', $config['type'], implode(', ', $supportedTypes)));
             }
             $gateway = $gatewayFactory->create($config['type']);
             foreach ($config['options'] as $name => $value) {
                 $gateway->{'set' . strtoupper($name)}($value);
             }
             return $gateway;
         };
     }
     return (array) $config;
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function createConfig(array $config = array())
 {
     $config = ArrayObject::ensureArrayObject($config);
     $config->defaults($this->defaultConfig);
     $config->defaults($this->coreGatewayFactory->createConfig((array) $config));
     return (array) $config;
 }
Пример #3
0
 /**
  * {@inheritDoc}
  */
 public function createConfig(array $config = array())
 {
     $config = ArrayObject::ensureArrayObject($config);
     $config->defaults($this->defaultConfig);
     $config->defaults($this->coreGatewayFactory->createConfig((array) $config));
     $template = false != $config['payum.template.capture'] ? $config['payum.template.capture'] : '@PayumSips/Action/capture.html.twig';
     $apiConfig = false != $config['payum.api_config'] ? (array) $config['payum.api_config'] : array();
     $config->defaults(array('payum.factory_name' => 'Atos SIPS', 'payum.factory_title' => 'Atos SIPS', 'payum.action.capture' => new CaptureAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.call_request' => new CallRequestAction($template), 'payum.action.call_response' => new CallResponseAction(), 'payum.action.sync' => new SyncAction(), 'payum.action.status' => new StatusAction()));
     $defaultOptions = array();
     $requiredOptions = array();
     if (false == $config['payum.client']) {
         $defaultOptions['client'] = array('merchant_id' => null, 'merchant_country' => 'fr', 'pathfile' => null, 'request_bin' => null, 'response_bin' => null);
         $requiredOptions[] = 'client';
         $config['payum.client'] = function (ArrayObject $config) {
             $config->validateNotEmpty($config['payum.required_options']);
             new Client($config['client']);
         };
     }
     if (false == $config['payum.api']) {
         $defaultOptions['api'] = array_replace(array('language' => null, 'payment_means' => null, 'header_flag' => null, 'bgcolor' => null, 'block_align' => null, 'block_order' => null, 'textcolor' => null, 'normal_return_logo' => null, 'cancel_return_logo' => null, 'submit_logo' => null, 'logo_id' => null, 'logo_id2' => null, 'advert' => null, 'background_id' => null, 'templatefile' => null), $apiConfig);
         $requiredOptions[] = 'api';
         $config['payum.api'] = function (ArrayObject $config) {
             $config->validateNotEmpty($config['payum.required_options']);
             $client = $config['payum.client'] instanceof \Closure ? $config['payum.client']($config) : $config['payum.client'];
             return new Api($config['api'], $client);
         };
     }
     $config['payum.default_options'] = $defaultOptions;
     $config['payum.required_options'] = $requiredOptions;
     $config->defaults($config['payum.default_options']);
     return (array) $config;
 }
Пример #4
0
 /**
  * {@inheritDoc}
  */
 public function createConfig(array $config = array())
 {
     $config = ArrayObject::ensureArrayObject($config);
     $config->defaults($this->defaultConfig);
     $config->defaults($this->coreGatewayFactory->createConfig((array) $config));
     $config->defaults(array('payum.factory_name' => 'offline', 'payum.factory_title' => 'Offline', 'payum.action.capture' => new CaptureAction(), 'payum.action.status' => new StatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction()));
     return (array) $config;
 }
Пример #5
0
 /**
  * {@inheritDoc}
  */
 public function createConfig(array $config = array())
 {
     $config = ArrayObject::ensureArrayObject($config);
     $config->defaults($this->defaultConfig);
     $config->defaults($this->gatewayFactory->createConfig((array) $config));
     $config->defaults(array('payum.factory_name' => 'sagepay_offsite', 'payum.factory_title' => 'Sagepay Offsite', 'payum.action.capture' => new CaptureOffsiteAction(), 'payum.action.status' => new StatusAction(), 'payum.action.notify' => new NotifyAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.execute_same_request_with_model_details' => new ExecuteSameRequestWithModelDetailsAction(), 'payum.extension.endless_cycle_detector' => new EndlessCycleDetectorExtension()));
     if (false == $config['payum.api']) {
         $config['options.required'] = array('vendor');
         $config->defaults(array('sandbox' => true));
         $config['payum.api'] = function (ArrayObject $config) {
             $config->validateNotEmpty($config['options.required']);
             $sagepayConfig = array('vendor' => $config['vendor'], 'sandbox' => $config['sandbox']);
             return new Api($sagepayConfig, $config['buzz.client']);
         };
     }
     return (array) $config;
 }
 /**
  * {@inheritdoc}
  */
 public function createConfig(array $config = array())
 {
     $config = ArrayObject::ensureArrayObject($config);
     $config->defaults($this->defaultConfig);
     $config->defaults($this->coreGatewayFactory->createConfig((array) $config));
     $config->defaults(array('payum.factory_name' => 'sofort', 'payum.factory_title' => 'Sofort', 'payum.action.capture' => new CaptureAction(), 'payum.action.status' => new StatusAction(), 'payum.action.notify' => new NotifyAction(), 'payum.action.sync' => new SyncAction(), 'payum.action.refund' => new RefundAction(), 'payum.action.api.create_transaction' => new CreateTransactionAction(), 'payum.action.api.get_transaction_data' => new GetTransactionDataAction(), 'payum.action.api.refund_transaction' => new RefundTransactionAction()));
     if (false == $config['payum.api']) {
         $config['payum.default_options'] = array('config_key' => '', 'abort_url' => '');
         $config->defaults($config['payum.default_options']);
         $config['payum.required_options'] = array('config_key');
         $config['payum.api'] = function (ArrayObject $config) {
             $config->validateNotEmpty($config['payum.required_options']);
             $paypalConfig = array('config_key' => $config['config_key'], 'abort_url' => $config['abort_url']);
             return new Api($paypalConfig);
         };
     }
     return (array) $config;
 }
 /**
  * {@inheritDoc}
  */
 public function createConfig(array $config = array())
 {
     $config = ArrayObject::ensureArrayObject($config);
     $config->defaults($this->defaultConfig);
     $config->defaults($this->coreGatewayFactory->createConfig());
     $config->defaults(array('payum.factory_name' => 'redsys', 'payum.factory_title' => 'Redsys', 'payum.action.capture' => new CaptureAction(), 'payum.action.notify' => new NotifyAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.status' => new StatusAction()));
     if (false == $config['payum.api']) {
         $config['payum.default_options'] = array('merchant_code' => '', 'terminal' => '', 'secret_key' => '', 'sandbox' => true);
         $config->defaults($config['payum.default_options']);
         $config['payum.required_options'] = array('merchant_code', 'terminal', 'secret_key');
         $config['payum.api'] = function (ArrayObject $config) {
             $config->validateNotEmpty($config['payum.required_options']);
             $redsysConfig = array('merchant_code' => $config['merchant_code'], 'terminal' => $config['terminal'], 'secret_key' => $config['secret_key'], 'sandbox' => $config['sandbox']);
             return new Api($redsysConfig);
         };
     }
     return (array) $config;
 }
 /**
  * {@inheritDoc}
  */
 public function createConfig(array $config = array())
 {
     $config = ArrayObject::ensureArrayObject($config);
     $config->defaults($this->defaultConfig);
     $config->defaults($this->coreGatewayFactory->createConfig((array) $config));
     $config->defaults(array('payum.factory_name' => 'paypal_express_checkout_nvp', 'payum.factory_title' => 'PayPal ExpressCheckout', 'payum.action.capture' => new CaptureAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.notify' => new NotifyAction(), 'payum.action.status' => new PaymentDetailsStatusAction(), 'payum.action.sync' => new PaymentDetailsSyncAction(), 'payum.action.recurring_status' => new RecurringPaymentDetailsStatusAction(), 'payum.action.recurring_sync' => new RecurringPaymentDetailsSyncAction(), 'payum.action.api.set_express_checkout' => new SetExpressCheckoutAction(), 'payum.action.api.get_express_checkout_details' => new GetExpressCheckoutDetailsAction(), 'payum.action.api.get_transaction_details' => new GetTransactionDetailsAction(), 'payum.action.api.do_express_checkout_payment' => new DoExpressCheckoutPaymentAction(), 'payum.action.api.create_recurring_payment_profile' => new CreateRecurringPaymentProfileAction(), 'payum.action.api.get_recurring_payments_profile_details' => new GetRecurringPaymentsProfileDetailsAction(), 'payum.action.api.cancel_recurring_payments_profile' => new CancelRecurringPaymentsProfileAction(), 'payum.action.api.manage_recurring_payments_profile_status' => new ManageRecurringPaymentsProfileStatusAction(), 'payum.action.api.create_billing_agreement' => new CreateBillingAgreementAction(), 'payum.action.api.do_reference_transaction' => new DoReferenceTransactionAction(), 'payum.action.api.authorize_token' => new AuthorizeTokenAction()));
     if (false == $config['payum.api']) {
         $config['payum.default_options'] = array('username' => '', 'password' => '', 'signature' => '', 'sandbox' => true);
         $config->defaults($config['payum.default_options']);
         $config['payum.required_options'] = array('username', 'password', 'signature');
         $config['payum.api'] = function (ArrayObject $config) {
             $config->validateNotEmpty($config['payum.required_options']);
             $paypalConfig = array('username' => $config['username'], 'password' => $config['password'], 'signature' => $config['signature'], 'sandbox' => $config['sandbox']);
             return new Api($paypalConfig, $config['buzz.client']);
         };
     }
     return (array) $config;
 }
 /**
  * {@inheritDoc}
  */
 public function createConfig(array $config = array())
 {
     $config = ArrayObject::ensureArrayObject($config);
     $config->defaults($this->defaultConfig);
     $config->defaults($this->coreGatewayFactory->createConfig());
     $config->defaults(array('payum.factory_name' => 'cashnpay', 'payum.factory_title' => 'CASH\'nPAY', 'payum.action.capture' => new CaptureAction(), 'payum.action.notify' => new NotifyAction(), 'payum.action.status' => new StatusAction(), 'payum.action.api.generate_voucher' => new GenerateVoucherAction(), 'payum.action.api.validate_voucher' => new ValidateVoucherAction()));
     // If CASHnPAY is not initialized
     if (false == $config['payum.api']) {
         $config['payum.default_options'] = array('product_id' => null, 'secret_key' => null, 'sandbox' => true);
         $config->defaults($config['payum.default_options']);
         $config['payum.required_options'] = array('product_id', 'secret_key');
         // CashnPay API
         $config['payum.api'] = function (ArrayObject $config) {
             $config->validateNotEmpty($config['payum.required_options']);
             $cashnPayConfig = array('product_id' => $config['product_id'], 'secret_key' => $config['secret_key'], 'sandbox' => $config['sandbox']);
             return new CashnPay($cashnPayConfig);
         };
     }
     return (array) $config;
 }