2017 © Pedro Peláez
 

library omnipay-interswitch

Interswitch driver for the Omnipay payment processing library

image

djade007/omnipay-interswitch

Interswitch driver for the Omnipay payment processing library

  • Saturday, October 22, 2016
  • by djade007
  • Repository
  • 2 Watchers
  • 3 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 10 % Grown

The README.md

Omnipay: Interswitch

Interswitch driver for the Omnipay payment processing library, (*1)

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Interswitch support for Omnipay., (*2)

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:, (*3)

{
    "require": {
        "djade007/omnipay-interswitch": "dev-master"
    }
}

And run composer to update your dependencies:, (*4)

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Basic Usage

For general usage instructions, please see the main Omnipay repository., (*5)

$gateway = Omnipay::create('Interswitch');

$gateway->initialize([
    'macKey' => 'D3D1D05AFE42AD50818167EAC73C109168A0F108F32645C8B59E897FA930DA44F9230910DAC9E20641823799A107A02068F7BC0F4CC41D2952E249552255710F',
    'productId' => 6205,
    'payItemId' => 101,
    'currency' => 'NGN',
]);


$transaction = $gateway->purchase([
    'returnUrl' => '{URL}',
    'amount' => 100000,
    'transactionId' => {RANDOM_DIGITS}
]);

$response = $transaction->send();

if ($response->isSuccessful()) {
    echo('success');
} elseif ($response->isRedirect()) {
    return $response->redirect(); // this will automatically forward the customer to interswitch
} else {
    echo('fail');
}

On Redirect Route {URL}, (*6)

$gateway = Omnipay::create('Interswitch');
// same initialize values 
$gateway->initialize([
    'macKey' => 'D3D1D05AFE42AD50818167EAC73C109168A0F108F32645C8B59E897FA930DA44F9230910DAC9E20641823799A107A02068F7BC0F4CC41D2952E249552255710F',
    'productId' => 6205,
    'payItemId' => 101,
    'currency' => 'NGN'
]);

$response = $gateway->completePurchase(['txnref' => $_POST['txnref']])->send();

if ($response->isSuccessful()) {
    echo('success');
} else {
    echo "failed\n";
    echo $response->getMessage();
}

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found., (*7)

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to., (*8)

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request., (*9)

The Versions

22/10 2016

dev-master

9999999-dev https://github.com/djade007/omnipay-interswitch

Interswitch driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Olajide Afeez

payment omnipay card interswitch