2017 © Pedro Peláez
 

zf2-module payline-zf2

ZF2 module to using Payline SDK

image

gawel1/payline-zf2

ZF2 module to using Payline SDK

  • Monday, September 22, 2014
  • by Gawel1
  • Repository
  • 4 Watchers
  • 4 Stars
  • 94 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 15 % Grown

The README.md

payline-zf2

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., (*1)

Installation

This is installable via Composer as gawel1/payline-zf2., (*2)

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 :, (*3)

$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., (*4)

To see more informations about the Payline SDK, download this document, (*5)

The Versions

22/09 2014

dev-master

9999999-dev

ZF2 module to using Payline SDK

  Sources   Download

by Gael CRISPYN

zf2 payline