pixers / payum-adyen
Adyen gateway for Payum
Installs: 8 614
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 10
Forks: 4
Open Issues: 1
Requires
- php: >=5.5.0
- payum/core: ^1.3
Requires (Dev)
- phpunit/phpunit: ~4.0
README
The Payum extension for Adyen.
Instalation
The preferred way to install the library is using composer.
Run:
php composer.phar require "pixers/payum-adyen"
Configuration
<?php // configure.php use Payum\Core\GatewayFactoryInterface; use Payum\Core\Model\Payment; use Payum\Core\PayumBuilder; $paymentClass = Payment::class; $gatewayName = 'adyen'; $defaultConfig = [ 'factory' => $gatewayName, 'sandbox' => true, // Spec 'skinCode' => '', 'merchantAccount' => '', 'hmacKey' => '', ]; $payum = (new PayumBuilder()) ->addGatewayFactory($gatewayName, function(array $config, GatewayFactoryInterface $coreGatewayFactory) { return new \Payum\Adyen\AdyenGatewayFactory($config, $coreGatewayFactory); }) ->addGateway($gatewayName, $defaultConfig); ->getPayum() ;
Symfony Integration (payum-bundle < 2.0)
Add AdyenGatewayFactory to payum:
<?php // src/Acme/PaymentBundle/AcmePaymentBundle.php namespace Acme\PaymentBundle; use Payum\Adyen\Bridge\Symfony\AdyenGatewayFactory; use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\DependencyInjection\ContainerBuilder; class AcmePaymentBundle extends Bundle { public function build(ContainerBuilder $container) { parent::build($container); $extension = $container->getExtension('paum'); $extension->addPaymentFactory(new AdyenGatewayFactory()); } }
Configuration in config.yml:
You should remember that HMAC is SHA-256 (SHA-1 is deprecated).
payum: gateways: adyen_gateway: adyen: sandbox: true skinCode: ADYEN_SKINCODE merchantAccount: ADYEN_ACCOUNT hmacKey: SECRET_KEY notification_method: basic default_payment_fields: shopperLocale: de
Symfony Integration (payum-bundle >= 2.0)
Add AdyenGatewayFactory to payum in services.yml:
adyen_gateway: class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder arguments: [Payum\Adyen\AdyenGatewayFactory] tags: - { name: payum.gateway_factory_builder, factory: adyen_gateway }
Configuration in config.yml:
You should remember that HMAC is SHA-256 (SHA-1 is deprecated).
payum: gateways: adyen_gateway: factory: adyen sandbox: true skinCode: ADYEN_SKINCODE merchantAccount: ADYEN_ACCOUNT hmacKey: SECRET_KEY notification_method: basic default_payment_fields: shopperLocale: de
Resources
License
Copyright 2016 PIXERS Ltd - www.pixersize.com
Licensed under the BSD 3-Clause