ruudk / payment-adyen-bundle
此包已被废弃,不再维护。没有建议的替代包。
一个提供访问Adyen API的Symfony2 Bundle。基于JMSPaymentCoreBundle。
1.2.0
2015-10-25 11:40 UTC
Requires
- php: ^5.3.2|^7.0
- jms/payment-core-bundle: ~1.0
- kriswallsmith/buzz: >=0.7
- symfony/framework-bundle: ~2.0
README
一个提供访问Adyen API的Symfony2 Bundle。基于JMSPaymentCoreBundle。
安装
步骤1:使用Composer要求包
php composer.phar require ruudk/payment-adyen-bundle
步骤2:启用Bundle
在Kernel中启用Bundle
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Ruudk\Payment\AdyenBundle\RuudkPaymentAdyenBundle(), ); }
步骤3:配置
将以下内容添加到您的routing.yml中
ruudk_payment_adyen_notifications: pattern: /webhook/adyen defaults: { _controller: ruudk_payment_adyen.controller.notification:processNotification } methods: [GET, POST]
将以下内容添加到您的config.yml中
ruudk_payment_adyen: merchant_account: Your merchant account skin_code: Your skin code secret_key: Your secret key test: true/false # Default true logger: true/false # Default true timeout: the timeout in seconds # Default 5 shopper_locale: the locale Adyen should use # Default null methods: - ideal - mister_cash - giropay - direct_ebanking - credit_card # amex,visa,mc
确保为每个启用的支付方式在predefined_data
中设置return_url
$form = $this->getFormFactory()->create('jms_choose_payment_method', null, array( 'amount' => $order->getAmount(), 'currency' => 'EUR', 'predefined_data' => array( 'adyen_ideal' => array( 'return_url' => $this->generateUrl('order_complete', array(), true), ), 'adyen_giropay' => array( 'return_url' => $this->generateUrl('order_complete', array(), true), ), // etc... ), ));
有关更多信息,请参阅JMSPaymentCoreBundle文档。