ruudk/payment-adyen-bundle

A Symfony2 Bundle that provides access to the Adyen API. Based on JMSPaymentCoreBundle.

Installs: 869

Dependents: 0

Stars: 2

Watchers: 1

Forks: 5

Open Issues: 1

Language: PHP

1.1.0 2014-11-07 08:30 UTC

README

A Symfony2 Bundle that provides access to the Adyen API. Based on JMSPaymentCoreBundle.

Installation

Step1: Require the package with Composer

php composer.phar require ruudk/payment-adyen-bundle

Step2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...

        new Ruudk\Payment\AdyenBundle\RuudkPaymentAdyenBundle(),
    );
}

Step3: Configure

Add the following to your routing.yml:

ruudk_payment_adyen_notifications:
    pattern:  /webhook/adyen
    defaults: { _controller: ruudk_payment_adyen.controller.notification:processNotification }
    methods:  [GET, POST]

Add the following to your 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

Make sure you set the return_url in the predefined_data for every payment method you enable:

$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...
    ),
));

See JMSPaymentCoreBundle documentation for more info.