ruudk/payment-multisafepay-bundle

This package is abandoned and no longer maintained. The author suggests using the Stripe package instead.

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

Installs: 26 969

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 3

Type:symfony-bundle

4.0 2018-05-29 08:46 UTC

This package is auto-updated.

Last update: 2022-02-01 12:27:52 UTC


README

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

Installation

Step1: Require the package with Composer

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

Step2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

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

        new Ruudk\Payment\MultisafepayBundle\RuudkPaymentMultisafepayBundle(),
    );
}

Step3: Configure

Add the following to your routing.yml:

ruudk_payment_multisafepay_notifications:
    pattern:  /webhook/multisafepay
    defaults: { _controller: ruudk_payment_multisafepay.controller.notification:processNotification }
    methods:  [GET, POST]

Add the following to your config.yml:

ruudk_payment_multisafepay:
    account_id:         Your account id
    site_id:            Your site id
    site_code:          Your secure site code
    test:               true/false   # Default true
    report_url:         http://host/webhook/multisafepay
    logger:             true/false   # Default true
    methods:
        - ideal
        - mister_cash
        - giropay
        - direct_ebanking
        - visa
        - mastercard
        - maestro
        - bank_transfer
        - direct_debit

Make sure you set the return_url, cancel_url and client_ip 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(
            'multisafepay_ideal' => array(
                'return_url' => $this->generateUrl('order_complete', array(), true),
                'cancel_url' => $this->generateUrl('payment_cancelled', array(), true),
                'client_ip' => $request->getClientIp(),
            ),
            'multisafepay_mister_cash' => array(
                'return_url' => $this->generateUrl('order_complete', array(), true),
                'cancel_url' => $this->generateUrl('payment_cancelled', array(), true),
                'client_ip' => $request->getClientIp(),
            ),
            // etc...
        ),
    ));

It's also possible to set a description for the transaction in the predefined_data.

See JMSPaymentCoreBundle documentation for more info.