当前位置: 首页>>代码示例>>PHP>>正文


PHP ArrayObject::defaults方法代码示例

本文整理汇总了PHP中Payum\Core\Bridge\Spl\ArrayObject::defaults方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayObject::defaults方法的具体用法?PHP ArrayObject::defaults怎么用?PHP ArrayObject::defaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Payum\Core\Bridge\Spl\ArrayObject的用法示例。


在下文中一共展示了ArrayObject::defaults方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: populateConfig

 /**
  * {@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'] ?: []);
 }
开发者ID:eamador,项目名称:Payum,代码行数:28,代码来源:KlarnaCheckoutGatewayFactory.php

示例2: populateConfig

 /**
  * {@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;
         };
     }
 }
开发者ID:steffenbrem,项目名称:OmnipayBridge,代码行数:32,代码来源:OmnipayGatewayFactory.php

示例3: populateConfig

 /**
  * {@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());
         };
     }
 }
开发者ID:ZloeSabo,项目名称:payum-sofortuberweisung,代码行数:16,代码来源:SofortGatewayFactory.php

示例4: populateConfig

 /**
  * {@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']);
         };
     }
 }
开发者ID:antqa,项目名称:payum-perfectmoney,代码行数:16,代码来源:PerfectMoneyGatewayFactory.php

示例5: populateConfig

 /**
  * {@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']);
         };
     }
 }
开发者ID:payum,项目名称:be2bill,代码行数:16,代码来源:Be2BillDirectGatewayFactory.php

示例6: populateConfig

 /**
  * {@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']);
         };
     }
 }
开发者ID:Payum,项目名称:Skeleton,代码行数:16,代码来源:SkeletonGatewayFactory.php

示例7: populateConfig

 /**
  * {@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']);
         };
     }
 }
开发者ID:pixers,项目名称:payum-paymill,代码行数:16,代码来源:PaymillGatewayFactory.php

示例8: populateConfig

 /**
  * {@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']);
         };
     }
 }
开发者ID:payum,项目名称:payum,代码行数:17,代码来源:PaypalMasspayGatewayFactory.php

示例9: populateConfig

 /**
  * 
  * @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']);
         };
     }
 }
开发者ID:pixers,项目名称:payum-dotpay,代码行数:18,代码来源:DotpayGatewayFactory.php

示例10: populateConfig

 /**
  * {@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);
         };
     }
 }
开发者ID:boshurik,项目名称:payum-yandex-money,代码行数:17,代码来源:YandexMoneyGatewayFactory.php

示例11: populateConfig

 /**
  * {@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']);
         };
     }
 }
开发者ID:nksoo,项目名称:Payum,代码行数:17,代码来源:PaypalExpressCheckoutGatewayFactory.php

示例12: populateConfig

 /**
  * {@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']);
         };
     }
 }
开发者ID:payum,项目名称:payum,代码行数:17,代码来源:PaypalProCheckoutGatewayFactory.php

示例13: populateConfig

 /**
  * {@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']);
         };
     }
 }
开发者ID:payum,项目名称:payum,代码行数:17,代码来源:PaypalProHostedGatewayFactory.php

示例14: populateConfig

 /**
  * {@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;
         };
     }
 }
开发者ID:accesto,项目名称:PayumPayU,代码行数:17,代码来源:PayUGatewayFactory.php

示例15: populateConfig

 /**
  * {@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']);
         };
     }
 }
开发者ID:pixers,项目名称:payum-adyen,代码行数:17,代码来源:AdyenGatewayFactory.php


注:本文中的Payum\Core\Bridge\Spl\ArrayObject::defaults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。