gawel1/payline-zf2

There is no license information available for the latest version (dev-master) of this package.

ZF2 module to using Payline SDK

Installs: 1 313

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 4

Forks: 0

Open Issues: 0

Type:zf2-module

dev-master 2014-09-22 13:31 UTC

This package is not auto-updated.

Last update: 2024-05-07 05:24:54 UTC


README

Based on Payline SDK, Payline-zf2 allows you to use it in a zf2 service. Payline is a way to do credit card payments online.

Installation

This is installable via Composer as gawel1/payline-zf2.

Usage

Basic Usage

First, Copy the payline.local.php.dist in your application config and set the file with your own configuration. Then, you can get the payline service with the following code :

$this->getServiceLocator()->get('payline');

Do a web payment

       $uri = $this->getRequest()->getUri();
       $base = sprintf('%s://%s', $uri->getScheme(), $uri->getHost());
       $response = $this->getServiceLocator->get('payline')->doWebPayment([
           'returnURL'    => $base . $this->url()->fromRoute('home'),
            'cancelURL'    => $base . $this->url()->fromRoute('home'),
            'payment'      => [
                'amount'         => 100,
                'action'         => 101,
                'currency'       => 978,
                'mode'           => PaylineService::CASH_PAYMENT,
                'contractNumber' => $this->getServiceLocator()->get('config')['payline']['contractNumber']
            ],
            'order'        => [
                'amount'   => 100,
                'ref'      => 1,
                'currency' => 978
            ]
        ]);

Payline web services informations

To see more informations about Payline and the API's, download this document.

To see more informations about the Payline SDK, download this document