2017 © Pedro Peláez
 

library omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

image

sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

  • Saturday, May 26, 2018
  • by sudiptpa
  • Repository
  • 1 Watchers
  • 5 Stars
  • 677 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 9 Versions
  • 12 % Grown

The README.md

Omnipay: NAB Transact

NAB Transact driver for the Omnipay PHP payment processing library, (*1)

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

StyleCI Build Status Latest Stable Version Total Downloads GitHub license, (*3)

Installation

Omnipay is installed via Composer. To install, simply require league/omnipay and sudiptpa/omnipay-nabtransact with Composer:, (*4)

composer require league/omnipay sudiptpa/omnipay-nabtransact

Basic Usage

The following gateways are provided by this package:, (*5)

  • NABTransact_DirectPost (NAB Transact Direct Post v2)
  • NABTransact_SecureXML (NAB Transact SecurePay XML)
  • NABTransact_UnionPay (UnionPay via NAB Transact)

NAB Transact SecureXML API

    use Omnipay\Omnipay;
    use Omnipay\Common\CreditCard;

    $gateway = Omnipay::create('NABTransact_SecureXML');
    $gateway->setMerchantId('XYZ0010');
    $gateway->setTransactionPassword('abcd1234');
    $gateway->setTestMode(true);

    $card = new CreditCard([
            'firstName' => 'Sujip',
            'lastName' => 'Thapa',
            'number'      => '4444333322221111',
            'expiryMonth' => '06',
            'expiryYear'  => '2030',
            'cvv'         => '123',
        ]
    );

    $transaction = $gateway->purchase([
            'amount'        => '10.00',
            'currency'      => 'AUD',
            'transactionId' => 'XYZ100',
            'card'          => $card,
        ]
    );

    $response = $transaction->send();

    if ($response->isSuccessful()) {
        echo sprintf('Transaction %s was successful!', $response->getTransactionReference());
    } else {
        echo sprintf('Transaction %s failed: %s', $response->getTransactionReference(), $response->getMessage());
    }

NAB Transact SecureXML API with Risk Management

    use Omnipay\Omnipay;
    use Omnipay\Common\CreditCard;

    $gateway = Omnipay::create('NABTransact_SecureXML');
    $gateway->setMerchantId('XYZ0010');
    $gateway->setTransactionPassword('abcd1234');
    $gateway->setTestMode(true);
    $gateway->setRiskManagement(true);

    $card = new CreditCard([
            'firstName' => 'Sujip',
            'lastName' => 'Thapa',
            'number'      => '4444333322221111',
            'expiryMonth' => '06',
            'expiryYear'  => '2030',
            'cvv'         => '123',
        ]
    );

    $transaction = $gateway->purchase([
            'amount'        => '10.00',
            'currency'      => 'AUD',
            'transactionId' => 'XYZ100',
            'card'          => $card,
            'ip'            => '1.1.1.1',
        ]
    );

    $response = $transaction->send();

    if ($response->isSuccessful()) {
        echo sprintf('Transaction %s was successful!', $response->getTransactionReference());
    } else {
        echo sprintf('Transaction %s failed: %s', $response->getTransactionReference(), $response->getMessage());
    }

NAB Transact DirectPost v2

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

    $gateway->setMerchantId('XYZ0010');
    $gateway->setTransactionPassword('abcd1234');
    $gateway->setTestMode(true);
    $gateway->setHasEMV3DSEnabled(true);

    $card = new CreditCard(array(
        'firstName' => 'Sujip',
        'lastName' => 'Thapa',
        'number' => '4444333322221111',
        'expiryMonth' => '10',
        'expiryYear' => '2030',
        'cvv' => '123',
    ));

    $response = $gateway->purchase(array(
        'amount' => '12.00',
        'transactionId' => 'ORDER-ZYX8',
        'transactionReference' => '11fc42b0-bb7a-41a4-8b3c-096b3fd4d402'
        'currency' => 'AUD',
        'card' => $card,
        'clientIp' => '192.168.1.1'
    ))
        ->send();

    if ($response->isRedirect()) {
        $response->redirect();
    }

    if ($response->isSuccessful()) {
        echo sprintf('Transaction %s was successful!', $response->getTransactionReference());
    } else {
        echo sprintf('Transaction %s failed: %s', $response->getTransactionReference(), $response->getMessage());
    }

NAB Transact DirectPost v2 UnionPay Online Payment

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

    $gateway->setMerchantId('XYZ0010');
    $gateway->setTransactionPassword('abcd1234');

    $gateway->setTestMode(true);

    /*
     * The parameter transactionId must be alpha-numeric and 8 to 32 characters in length
     */

    $response = $gateway->purchase(array(
        'amount' => '12.00',
        'transactionId' => '1234566789205067',
        'currency' => 'AUD',
        'returnUrl' => 'http://example.com/payment/response',
    ))
        ->send();

    if ($response->isRedirect()) {
        $response->redirect();
    }

Complete Purchase

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

    $gateway->setMerchantId('XYZ0010');
    $gateway->setTransactionPassword('abcd1234');

    $gateway->setTestMode(true);

    $response = $gateway->completePurchase(array(
        'amount' => '12.00',
        'transactionId' => '1234566789205067',
        'transactionReference' => '11fc42b0-bb7a-41a4-8b3c-096b3fd4d402'
        'currency' => 'AUD',
        'returnUrl' => 'http://example.com/payment/response',
    ))
        ->send();

    if ($response->isSuccessful()) {
        echo sprintf('Transaction %s was successful!', $response->getTransactionReference());
    } else {
        echo sprintf('Transaction %s failed: %s', $response->getTransactionReference(), $response->getMessage());
    }

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

Contributing

Contributions are welcome and will be fully credited., (*7)

Contributions can be made via a Pull Request on Github., (*8)

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

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

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

The Versions

26/05 2018

dev-master

9999999-dev https://github.com/sudiptpa/nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

  Sources   Download

MIT

The Requires

 

The Development Requires

payment pay gateway merchant omnipay nabtransact

26/05 2018

v3.0.0

3.0.0.0 https://github.com/sudiptpa/nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

  Sources   Download

MIT

The Requires

 

The Development Requires

payment pay gateway merchant omnipay nabtransact

26/05 2018

dev-upgrading-v3

dev-upgrading-v3 https://github.com/sudiptpa/nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

  Sources   Download

MIT

The Requires

 

The Development Requires

payment pay gateway merchant omnipay nabtransact

12/06 2017

2.2.3

2.2.3.0 https://github.com/sudiptpa/nabtransact

NAB Transact driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

payment pay gateway merchant omnipay nabtransact

05/01 2017

2.2.2

2.2.2.0 https://github.com/sudiptpa/nabtransact

NAB Transact driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

payment pay gateway merchant omnipay nabtransact

28/11 2016

2.2.1

2.2.1.0 https://github.com/sudiptpa/nabtransact

NAB Transact driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

payment pay gateway merchant omnipay nabtransact

26/11 2016

2.2.0

2.2.0.0 https://github.com/sudiptpa/nabtransact

NAB Transact driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

payment pay gateway merchant omnipay nabtransact

21/11 2016

2.0.0

2.0.0.0 https://github.com/sudiptpa/nabtransact

NAB Transact driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

payment pay gateway merchant omnipay nabtransact

21/11 2016

2.0.1

2.0.1.0 https://github.com/sudiptpa/nabtransact

NAB Transact driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

payment pay gateway merchant omnipay nabtransact