/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { if (!class_exists('Klarna_Checkout_Order')) { throw new \LogicException('You must install "klarna/checkout" library.'); } $config->defaults(array('payum.factory_name' => 'klarna_checkout', 'payum.factory_title' => 'Klarna Checkout', 'payum.template.authorize' => '@PayumKlarnaCheckout/Action/capture.html.twig', 'contentType' => Constants::CONTENT_TYPE_AGGREGATED_ORDER_V2, 'sandbox' => true)); $config->defaults(array('payum.action.authorize_recurring' => new AuthorizeRecurringAction(), 'payum.action.authorize' => new AuthorizeAction($config['payum.template.authorize']), 'payum.action.notify' => new NotifyAction(), 'payum.action.status' => new StatusAction(), 'payum.action.sync' => new SyncAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.api.create_order' => new CreateOrderAction(), 'payum.action.api.update_order' => new UpdateOrderAction(), 'payum.action.api.fetch_order' => new FetchOrderAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('merchant_id' => '', 'secret' => '', 'terms_uri' => '', 'checkout_uri' => '', 'sandbox' => true); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('merchant_id', 'secret'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $klarnaConfig = new Config(); $klarnaConfig->merchantId = $config['merchant_id']; $klarnaConfig->secret = $config['secret']; $klarnaConfig->contentType = $config['contentType']; $klarnaConfig->termsUri = $config['termsUri']; $klarnaConfig->checkoutUri = $config['checkoutUri']; $klarnaConfig->baseUri = $config['sandbox'] ? Constants::BASE_URI_SANDBOX : Constants::BASE_URI_LIVE; return $klarnaConfig; }; } $config['payum.paths'] = array_replace(['PayumKlarnaCheckout' => __DIR__ . '/Resources/views'], $config['payum.paths'] ?: []); }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.action.capture' => new CaptureAction(), 'payum.action.capture_offsite' => new OffsiteCaptureAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.status' => new StatusAction()]); if (false == $config['payum.api']) { //BC layer if ($config['options']) { $config->defaults($config['options']); } $config->defaults(['type' => $this->omnipayGatewayTypeOrClass]); // omnipay does not provide required options. $config['payum.required_options'] = ['type']; $gateway = null; if ($config['type']) { try { /** @var GatewayInterface $gateway */ $gateway = $this->omnipayGatewayFactory->create($config['type']); } catch (OmnipayException $e) { throw new LogicException(sprintf('Given omnipay gateway type %s or class is not supported. Supported: %s', $config['type'], implode(', ', $this->omnipayGatewayFactory->getSupportedGateways())), 0, $e); } $config['payum.default_options'] = array_replace(['testMode' => true], $gateway->getDefaultParameters()); $config->defaults($config['payum.default_options']); } $config['payum.api'] = function (ArrayObject $config) use($gateway) { $config->validateNotEmpty($config['payum.required_options']); $gateway->initialize((array) $config); return $gateway; }; } }
/** * {@inheritdoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'sofortuberweisung', 'payum.factory_title' => 'Sofortuberweisung payment gateway', 'payum.action.capture' => new CaptureAction(), 'payum.action.status' => new StatusAction(), 'payum.action.sync' => new AuthorizeAction(), 'payum.action.authorize' => new SyncAction(), 'payum.action.convert' => new ConvertAction(), 'payum.action.api.request_sofort_uberweisung' => new RequestSofortUberweisungAction(), 'payum.action.api.get_transaction_data' => new GetTransactionDataAction(), 'payum.action.api.fill_order_details' => new ConvertAction(), 'payum.extension.endless_cycle_detector' => new EndlessCycleDetectorExtension()]); if (false == $config['payum.api']) { $config['payum.default_options'] = ['configkey' => '', 'timeout' => 1800]; $config->defaults($config['payum.default_options']); $config['payum.required_options'] = ['configkey']; $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Api($config->getArrayCopy()); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'perfectmoney', 'payum.factory_title' => 'Perfect Money', 'payum.action.capture' => new CaptureAction(), 'payum.action.status' => new StatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction()]); if (false == $config['payum.api']) { $config['payum.default_options'] = ['sandbox' => true, 'alternate_passphrase' => null, 'payee_account' => null, 'display_name' => null]; $config->defaults($config['payum.default_options']); $config['payum.required_options'] = ['payee_account', 'alternate_passphrase', 'display_name']; $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Api((array) $config, $config['payum.http_client']); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(array('payum.factory_name' => 'be2bill_direct', 'payum.factory_title' => 'Be2Bill Direct', 'payum.action.capture' => new CaptureAction(), 'payum.action.status' => new StatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('identifier' => '', 'password' => '', 'sandbox' => true); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('identifier', 'password'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Api(array('identifier' => $config['identifier'], 'password' => $config['password'], 'sandbox' => $config['sandbox']), $config['payum.http_client'], $config['httplug.message_factory']); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'skeleton', 'payum.factory_title' => 'skeleton', 'payum.action.capture' => new CaptureAction(), 'payum.action.authorize' => new AuthorizeAction(), 'payum.action.refund' => new RefundAction(), 'payum.action.cancel' => new CancelAction(), 'payum.action.notify' => new NotifyAction(), 'payum.action.status' => new StatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction()]); if (false == $config['payum.api']) { $config['payum.default_options'] = array('sandbox' => true); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = []; $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Api((array) $config, $config['payum.http_client'], $config['httplug.message_factory']); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'paymill', 'payum.factory_title' => 'Paymill', 'payum.action.capture' => new CaptureAction(), 'payum.action.transaction' => new TransactionAction(), 'payum.action.status' => new StatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction()]); if (false == $config['payum.api']) { $config['payum.default_options'] = array('api_private_key' => '', 'api_public_key' => '', 'test_private_key' => '', 'test_public_key' => '', 'sandbox' => true); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = []; $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Api((array) $config, $config['payum.http_client']); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(array('payum.factory_name' => 'paypal_masspay_nvp', 'payum.factory_title' => 'PayPal Masspay', 'payum.action.payout' => new PayoutAction(), 'payum.action.api.masspay' => new MasspayAction(), 'payum.action.convert_payout' => new ConvertPayoutAction(), 'payum.action.get_payout_status' => new GetPayoutStatusAction())); 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 = ['username' => $config['username'], 'password' => $config['password'], 'signature' => $config['signature'], 'sandbox' => $config['sandbox']]; return new Api($paypalConfig, $config['payum.http_client'], $config['httplug.message_factory']); }; } }
/** * * @param ArrayObject $config */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'dotpay', 'payum.factory_title' => 'Dotpay', 'payum.action.capture' => new CaptureAction(), 'payum.action.status' => new StatusAction(), 'payum.action.notify' => new NotifyAction(), 'payum.action.sync' => new SyncAction($config), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.api.do_payment' => new DoPaymentAction()]); if (false == $config['payum.api']) { $config['payum.default_options'] = ['id' => '', 'URLC' => '', 'endpoint' => Api::DEFAULT_ENDPOINT, 'method' => 'GET']; $config->defaults($config['payum.default_options']); $config['payum.required_options'] = ['id']; $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $dotpayConfig = ['id' => $config['id'], 'URLC' => $config['URLC'], 'endpoint' => $config['endpoint'], 'method' => $config['method'], 'url' => $config['url'], 'type' => $config['type'], 'PIN' => $config['PIN'], 'ip' => $config['ip']]; return new Api($dotpayConfig, $config['payum.http_client']); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(array('payum.factory_name' => 'yandex_money', 'payum.factory_title' => 'Yandex Money', 'payum.action.capture' => new CaptureAction(), 'payum.action.notify' => new NotifyAction($config['payum.security.token_storage']), 'payum.action.notify_null' => new NotifyNullAction(), 'payum.action.status' => new StatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('account' => null, 'secret' => null); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('account'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $apiConfig = array('account' => $config['account'], 'secret' => $config['secret']); return new Api($apiConfig); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $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.update_recurring_payment_profile' => new UpdateRecurringPaymentProfileAction(), '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['payum.http_client']); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(array('payum.factory_name' => 'paypal_pro_checkout_nvp', 'payum.factory_title' => 'PayPal ProCheckout', 'payum.action.capture' => new CaptureAction(), 'payum.action.refund' => new RefundAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.status' => new StatusAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('username' => '', 'password' => '', 'partner' => '', 'vendor' => '', 'tender' => '', 'sandbox' => true); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('username', 'password', 'partner', 'vendor', 'tender'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $paypalConfig = array('username' => $config['username'], 'password' => $config['password'], 'partner' => $config['partner'], 'vendor' => $config['vendor'], 'tender' => $config['tender'], 'sandbox' => $config['sandbox']); return new Api($paypalConfig, $config['payum.http_client'], $config['httplug.message_factory']); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'paypal_pro_hosted', 'payum.factory_title' => 'Paypal Pro Hosted', 'payum.action.capture' => new CaptureAction(), 'payum.action.notify' => new NotifyAction(), 'payum.action.status' => new StatusAction(), 'payum.action.sync' => new SyncAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.api.get_transaction_details' => new GetTransactionDetailsAction(), 'payum.action.api.create_button_payment' => new CreateButtonPaymentAction()]); if (false == $config['payum.api']) { $config['payum.default_options'] = ['username' => '', 'password' => '', 'signature' => '', 'business' => '', 'sandbox' => true]; $config->defaults($config['payum.default_options']); $config['payum.required_options'] = ['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'], 'business' => $config['business'], 'sandbox' => $config['sandbox']); return new Api($paypalConfig, $config['payum.http_client'], $config['httplug.message_factory']); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(array('payum.factory_name' => 'payu', 'payum.factory_title' => 'PayU', 'payum.action.capture' => new CaptureAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.status' => new StatusAction(), 'payum.action.set_payu' => new SetPayUAction(), 'payum.action.notify' => new NotifyAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('environment' => 'secure', 'pos_id' => '', 'signature_key' => ''); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('environment', 'pos_id', 'signature_key'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $payuConfig = array('environment' => $config['environment'], 'pos_id' => $config['pos_id'], 'signature_key' => $config['signature_key']); return $payuConfig; }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'adyen', 'payum.factory_title' => 'Adyen']); $config->defaults(['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'] = ['skinCode' => '', 'merchantAccount' => '', 'hmacKey' => '', 'sandbox' => true, 'notification_method' => 'basic', 'default_payment_fields' => []]; $config->defaults($config['payum.default_options']); $config['payum.required_options'] = ['skinCode', 'merchantAccount', 'hmacKey']; $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Api(['skinCode' => $config['skinCode'], 'merchantAccount' => $config['merchantAccount'], 'hmacKey' => $config['hmacKey'], 'sandbox' => $config['sandbox'], 'notification_method' => $config['notification_method'], 'default_payment_fields' => $config['default_payment_fields']], $config['payum.http_client']); }; } }
/** * {@inheritdoc} */ protected function populateConfig(ArrayObject $config) { if (false == class_exists(Sofortueberweisung::class)) { throw new LogicException('You must install "sofort/sofortlib-php:^3.0" library.'); } $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.convert_payment' => new ConvertPaymentAction(), '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'] = ['config_key' => '', 'abort_url' => '']; $config->defaults($config['payum.default_options']); $config['payum.required_options'] = ['config_key']; $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Api(['config_key' => $config['config_key'], 'abort_url' => $config['abort_url']]); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'paybox', 'payum.factory_title' => 'Paybox', 'payum.action.capture' => new CaptureAction(), 'payum.action.refund' => new RefundAction(), 'payum.action.cancel' => new CancelAction(), 'payum.action.notify' => new NotifyAction(), 'payum.action.status' => new StatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.template.chosse_card_type' => '@PayumPaybox/Action/choose_payment_type.html.twig', 'payum.action.choose_payment_type' => function (ArrayObject $config) { return new ChoosePaymentTypeAction($config['payum.template.chosse_card_type']); }]); if (false == $config['payum.api']) { $config['payum.default_options'] = array('site' => '', 'rang' => '', 'identifiant' => '', 'hmac' => '', 'hash' => 'SHA512', 'retour' => 'Mt:M;Ref:R;Auto:A;error_code:E', 'sandbox' => true, 'type_paiement' => '', 'type_carte' => ''); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('site', 'rang', 'identifiant', 'hmac'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Api((array) $config, $config['payum.http_client'], $config['httplug.message_factory']); }; } $config['payum.paths'] = array_replace(['PayumPaybox' => __DIR__ . '/Resources/views'], $config['payum.paths'] ?: []); }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { if (!class_exists(\AuthorizeNetCIM::class)) { throw new \LogicException('You must install "authorizenet/authorizenet" library.'); } $config->defaults(array('payum.factory_name' => 'authorize_net_cim', 'payum.factory_title' => 'Authorize.NET CIM', 'payum.action.create_customer_profile' => new CreateCustomerProfileAction(), 'payum.action.create_customer_shipping_address' => new CreateCustomerShippingAddressAction(), 'payum.action.create_customer_profile_transaction' => new CreateCustomerProfileTransactionAction(), 'payum.action.create_customer_payment_profile' => new CreateCustomerPaymentProfileAction(), 'payum.action.delete_customer_payment_profile' => new DeleteCustomerPaymentProfileAction(), 'payum.action.delete_customer_profile' => new DeleteCustomerProfileAction(), 'payum.action.delete_customer_shipping_address' => new DeleteCustomerShippingAddressAction(), 'payum.action.get_customer_payment_profile' => new GetCustomerPaymentProfileAction(), 'payum.action.get_customer_profile_ids' => new GetCustomerProfileIdsAction(), 'payum.action.get_hosted_profile_page_request' => new GetHostedProfilePageRequestAction(), 'payum.action.get_customer_profile' => new GetCustomerProfileAction(), 'payum.action.get_customer_shipping_address' => new GetCustomerShippingAddressAction(), 'payum.action.update_split_tender_group' => new UpdateSplitTenderGroupAction(), 'payum.action.update_customer_shipping_address' => new UpdateCustomerShippingAddressAction(), 'payum.action.update_customer_payment_profile' => new UpdateCustomerPaymentProfileAction(), 'payum.action.update_customer_profile' => new UpdateCustomerProfileAction(), 'payum.action.validate_customer_payment_profile' => new ValidateCustomerPaymentProfileAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('login_id' => '', 'transaction_key' => '', 'sandbox' => true); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('login_id', 'transaction_key'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $api = new AuthorizeNetCIM($config['login_id'], $config['transaction_key']); $api->setSandbox($config['sandbox']); return $api; }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { if (!class_exists('Stripe')) { throw new \LogicException('You must install "stripe/stripe-php" library.'); } $config->defaults(array('payum.factory_name' => 'stripe_checkout', 'payum.factory_title' => 'Stripe Checkout', 'payum.template.obtain_token' => '@PayumStripe/Action/obtain_checkout_token.html.twig', 'payum.action.capture' => new CaptureAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.status' => new StatusAction(), 'payum.action.obtain_token' => function (ArrayObject $config) { return new ObtainTokenAction($config['payum.template.obtain_token']); }, 'payum.action.create_charge' => new CreateChargeAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('publishable_key' => '', 'secret_key' => ''); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('publishable_key', 'secret_key'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Keys($config['publishable_key'], $config['secret_key']); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { if (!class_exists(\AuthorizeNetAIM::class)) { throw new \LogicException('You must install "authorizenet/authorizenet" library.'); } $config->defaults(array('payum.factory_name' => 'authorize_net_aim', 'payum.factory_title' => 'Authorize.NET AIM', 'payum.action.capture' => new CaptureAction(), 'payum.action.status' => new StatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('login_id' => '', 'transaction_key' => '', 'sandbox' => true); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('login_id', 'transaction_key'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $api = new AuthorizeNetAIM($config['login_id'], $config['transaction_key']); $api->setSandbox($config['sandbox']); return $api; }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { if (false == class_exists(Stripe::class)) { throw new LogicException('You must install "stripe/stripe-php:~2.0|~3.0" library.'); } $config->defaults(['payum.factory_name' => 'stripe_checkout', 'payum.factory_title' => 'Stripe Checkout', 'payum.template.obtain_token' => '@PayumStripe/Action/obtain_checkout_token.html.twig', 'payum.action.capture' => new CaptureAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.status' => new StatusAction(), 'payum.action.get_credit_card_token' => new GetCreditCardTokenAction(), 'payum.action.obtain_token' => function (ArrayObject $config) { return new ObtainTokenAction($config['payum.template.obtain_token']); }, 'payum.action.create_charge' => new CreateChargeAction(), 'payum.action.create_customer' => new CreateCustomerAction(), 'payum.action.create_plan' => new CreatePlanAction(), 'payum.action.create_token' => new CreateTokenAction(), 'payum.extension.create_customer' => new CreateCustomerExtension()]); if (false == $config['payum.api']) { $config['payum.default_options'] = ['publishable_key' => '', 'secret_key' => '']; $config->defaults($config['payum.default_options']); $config['payum.required_options'] = ['publishable_key', 'secret_key']; $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); return new Keys($config['publishable_key'], $config['secret_key']); }; } $config['payum.paths'] = array_replace(['PayumStripe' => __DIR__ . '/Resources/views'], $config['payum.paths'] ?: []); }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { if (!class_exists('\\PayPal\\Api\\Payment')) { throw new \LogicException('You must install "paypal/rest-api-sdk-php" library.'); } $config->defaults(array('payum.factory_name' => 'paypal_rest', 'payum.factory_title' => 'PayPal Rest', 'payum.action.capture' => new CaptureAction(), 'payum.action.sync' => new SyncAction(), 'payum.action.status' => new StatusAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('client_id' => '', 'client_secret' => '', 'config_path' => '', 'mode' => 'sandbox', 'logging' => true, 'log_file' => '/tmp/paypal.log', 'log_level' => 'INFO'); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('client_id', 'client_secret'); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $credential = new OAuthTokenCredential($config['client_id'], $config['client_secret']); $apiContext = new ApiContext($credential); $apiContext->setConfig(['mode' => $config['mode'], 'log.LogEnabled' => $config['logging'], 'log.FileName' => $config['log_file'], 'log.LogLevel' => $config['log_level']]); return $apiContext; }; } $config['payum.paths'] = array_replace(['PayumPaypalPlus' => __DIR__ . '/Resources/views'], $config['payum.paths'] ?: []); }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { if (false == class_exists(ApiContext::class)) { throw new \LogicException('You must install "paypal/rest-api-sdk-php" library.'); } $config->defaults(['payum.factory_name' => 'paypal_rest', 'payum.factory_title' => 'PayPal Rest', 'payum.action.capture' => new CaptureAction(), 'payum.action.sync' => new SyncAction(), 'payum.action.status' => new StatusAction()]); if (false == $config['payum.api']) { $config['payum.default_options'] = ['client_id' => '', 'client_secret' => '', 'config_path' => '']; $config->defaults($config['payum.default_options']); $config['payum.required_options'] = ['client_id', 'client_secret', 'config_path']; $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); if (false == defined('PP_CONFIG_PATH')) { define('PP_CONFIG_PATH', $config['config_path']); } elseif (PP_CONFIG_PATH !== $config['config_path']) { throw new InvalidArgumentException(sprintf('Given "config_path" is invalid. Should be equal to the defined "PP_CONFIG_PATH": %s.', PP_CONFIG_PATH)); } $credential = new OAuthTokenCredential($config['client_id'], $config['client_secret']); return new ApiContext($credential); }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { if (!class_exists('SoapClient')) { throw new \LogicException('You must install "ext-soap" extension.'); } $config['payum.default_options'] = array('account_number' => '', 'encryption_key' => '', 'sandbox' => true); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('account_number', 'encryption_key'); $config->defaults(array('payum.factory_name' => 'payex', 'payum.factory_title' => 'Payex', 'soap.client_factory' => new SoapClientFactory(), 'payum.api.order' => function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $payexConfig = array('account_number' => $config['account_number'], 'encryption_key' => $config['encryption_key'], 'sandbox' => $config['sandbox']); return new OrderApi($config['soap.client_factory'], $payexConfig); }, 'payum.api.agreement' => function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $payexConfig = array('account_number' => $config['account_number'], 'encryption_key' => $config['encryption_key'], 'sandbox' => $config['sandbox']); return new AgreementApi($config['soap.client_factory'], $payexConfig); }, 'payum.api.recurring' => function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $payexConfig = array('account_number' => $config['account_number'], 'encryption_key' => $config['encryption_key'], 'sandbox' => $config['sandbox']); return new RecurringApi($config['soap.client_factory'], $payexConfig); }, 'payum.action.capture' => new PaymentDetailsCaptureAction(), 'payum.action.status' => new PaymentDetailsStatusAction(), 'payum.action.sync' => new PaymentDetailsSyncAction(), 'payum.action.auto_pay_capture' => new AutoPayPaymentDetailsCaptureAction(), 'payum.action.auto_pay_status' => new AutoPayPaymentDetailsStatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction(), 'payum.action.api.agreement_details_status' => new AgreementDetailsStatusAction(), 'payum.action.api.agreement_details_sync' => new AgreementDetailsSyncAction(), 'payum.action.api.create_agreement' => new CreateAgreementAction(), 'payum.action.api.delete_agreement' => new DeleteAgreementAction(), 'payum.action.api.check_agreement' => new CheckAgreementAction(), 'payum.action.api.auto_pay_agreement' => new AutoPayAgreementAction(), 'payum.action.api.start_recurring_gateway' => new StartRecurringPaymentAction(), 'payum.action.api.stop_recurring_gateway' => new StopRecurringPaymentAction(), 'payum.action.api.check_recurring_gateway' => new CheckRecurringPaymentAction(), 'payum.action.api.initialize_order' => new InitializeOrderAction(), 'payum.action.api.complete_order' => new CompleteOrderAction(), 'payum.action.api.check_order' => new CheckOrderAction())); }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { if (!class_exists('KlarnaCurrency')) { throw new \LogicException('You must install "fp/klarna-invoice" library.'); } $config->defaults(array('payum.factory_name' => 'klarna_invoice', 'payum.factory_title' => 'Klarna Invoice', 'sandbox' => true, 'pClassStorage' => 'json', 'pClassStoragePath' => './pclasses.json', 'xmlRpcVerifyHost' => 2, 'xmlRpcVerifyPeer' => true, 'payum.action.capture' => new CaptureAction(), 'payum.action.authorize' => new AuthorizeAction(), 'payum.action.status' => new StatusAction(), 'payum.action.sync' => new SyncAction(), 'payum.action.refund' => new RefundAction(), 'payum.action.api.activate' => new ActivateAction(), 'payum.action.api.activate_reservation' => new ActivateReservationAction(), 'payum.action.api.cancel_reservation' => new CancelReservationAction(), 'payum.action.api.check_order_status' => new CheckOrderStatusAction(), 'payum.action.api.get_addresses' => new GetAddressesAction(), 'payum.action.api.populate_klarna_from_details' => new PopulateKlarnaFromDetailsAction(), 'payum.action.api.credit_invoice' => new CreditInvoiceAction(), 'payum.action.api.credit_part' => new CreditPartAction(), 'payum.action.api.reserve_amount' => new ReserveAmountAction(), 'payum.action.api.return_amount' => new ReturnAmountAction(), 'payum.action.api.email_invoice' => new EmailInvoiceAction(), 'payum.action.api.send_invoice' => new SendInvoiceAction(), 'payum.action.api.update' => new UpdateAction())); if (false == $config['payum.api']) { $config['payum.default_options'] = array('eid' => '', 'secret' => '', 'country' => '', 'language' => '', 'currency' => '', 'sandbox' => true); $config->defaults($config['payum.default_options']); $config['payum.required_options'] = array('eid', 'secret', 'country', 'language', 'currency'); $config->defaults(array('sandbox' => true)); $config['payum.api'] = function (ArrayObject $config) { $config->validateNotEmpty($config['payum.required_options']); $config['mode'] = $config['sandbox'] ? \Klarna::BETA : \Klarna::LIVE; if (null === ($country = \KlarnaCountry::fromCode($config['country']))) { throw new LogicException(sprintf('Given %s country code is not valid. Klarna cannot recognize it.', $config['country'])); } if (null === ($language = \KlarnaLanguage::fromCode($config['language']))) { throw new LogicException(sprintf('Given %s language code is not valid. Klarna cannot recognize it.', $config['language'])); } if (null === ($currency = \KlarnaCurrency::fromCode($config['currency']))) { throw new LogicException(sprintf('Given %s currency code is not valid. Klarna cannot recognize it.', $config['currency'])); } $klarnaConfig = new Config(); $klarnaConfig->eid = $config['eid']; $klarnaConfig->secret = $config['secret']; $klarnaConfig->mode = $config['mode']; $klarnaConfig->country = $country; $klarnaConfig->language = $language; $klarnaConfig->currency = $currency; $klarnaConfig->pClassStorage = $config['pClassStorage']; $klarnaConfig->pClassStoragePath = $config['pClassStoragePath']; $klarnaConfig->xmlRpcVerifyHost = $config['xmlRpcVerifyHost']; $klarnaConfig->xmlRpcVerifyHost = $config['xmlRpcVerifyHost']; return $klarnaConfig; }; } }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'be2bill_offsite', 'payum.factory_title' => 'Be2Bill Offsite', 'payum.action.capture' => new CaptureOffsiteAction(), 'payum.action.capture_null' => new CaptureOffsiteNullAction(), 'payum.action.notify_null' => new NotifyNullAction(), 'payum.action.notify' => new NotifyAction()]); parent::populateConfig($config); }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'offline', 'payum.factory_title' => 'Offline', 'payum.action.capture' => new CaptureAction(), 'payum.action.authorize' => new AuthorizeAction(), 'payum.action.status' => new StatusAction(), 'payum.action.convert_payment' => new ConvertPaymentAction()]); }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(['payum.factory_name' => 'stripe_direct', 'payum.factory_title' => 'Stripe Direct', 'payum.action.obtain_token' => new ObtainTokenForCreditCardAction()]); parent::populateConfig($config); }
/** * @test */ public function shouldAllowSetDefaultValues() { $arrayObject = new ArrayObject(); $arrayObject['foo'] = 'fooVal'; $arrayObject->defaults(array('foo' => 'fooDefVal', 'bar' => 'barDefVal')); $this->assertEquals('fooVal', $arrayObject['foo']); $this->assertEquals('barDefVal', $arrayObject['bar']); }
/** * {@inheritDoc} */ protected function populateConfig(ArrayObject $config) { $config->defaults(array('payum.factory_name' => 'stripe_js', 'payum.factory_title' => 'Stripe.Js', 'payum.template.obtain_token' => '@PayumStripe/Action/obtain_js_token.html.twig')); parent::populateConfig($config); }