PHPackages                             sudiptpa/omnipay-nabtransact - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. sudiptpa/omnipay-nabtransact

ActiveLibrary[Payment Processing](/categories/payments)

sudiptpa/omnipay-nabtransact
============================

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

v3.4.0(2mo ago)1017.2k↓32.9%5MITPHPPHP ^7.2 || ^8.0CI passing

Since Nov 21Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/sudiptpa/omnipay-nabtransact)[ Packagist](https://packagist.org/packages/sudiptpa/omnipay-nabtransact)[ Docs](https://github.com/sudiptpa/omnipay-nabtransact)[ RSS](/packages/sudiptpa-omnipay-nabtransact/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (31)Used By (0)

Omnipay: NAB Transact
=====================

[](#omnipay-nab-transact)

**NAB Transact driver for the Omnipay PHP payment processing library**

[![CI](https://github.com/sudiptpa/omnipay-nabtransact/actions/workflows/ci.yml/badge.svg)](https://github.com/sudiptpa/omnipay-nabtransact/actions/workflows/ci.yml) [![Latest Version](https://camo.githubusercontent.com/4cd2abf9ee865814ad4f61be81797903c36ce5887bcdb49d7684ef363ccc881a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73756469707470612f6f6d6e697061792d6e61627472616e73616374)](https://packagist.org/packages/sudiptpa/omnipay-nabtransact) [![Downloads](https://camo.githubusercontent.com/179da9b756abef921715849d467b557055317282351dc33a363ab5686e0e2202/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73756469707470612f6f6d6e697061792d6e61627472616e73616374)](https://packagist.org/packages/sudiptpa/omnipay-nabtransact) [![License](https://camo.githubusercontent.com/39970530972fd1268a8bc242f71c6ff815c55e31f8c9feaad5dd22a9b1f582a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73756469707470612f6f6d6e697061792d6e61627472616e73616374)](https://packagist.org/packages/sudiptpa/omnipay-nabtransact)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP. This package implements NAB Transact support for Omnipay.

Compatibility
-------------

[](#compatibility)

- PHP `^7.2 || ^8.0`
- `omnipay/common:^3`

Installation
------------

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply require `league/omnipay` and `sudiptpa/omnipay-nabtransact` with Composer:

```
composer require league/omnipay sudiptpa/omnipay-nabtransact

```

Start Here: Choose the Right Integration Flow
---------------------------------------------

[](#start-here-choose-the-right-integration-flow)

- SecureXML (server-to-server):
    - Use `NABTransact_SecureXML`
    - Main methods: `authorize()`, `purchase()`, `capture()`, `refund()`, `echoTest()`
- DirectPost (redirect + callback):
    - Use `NABTransact_DirectPost`
    - Start methods: `purchase()` or `authorize()`
    - Callback methods: `completePurchase()`, `completeAuthorize()`
- DirectPost operations API (server-to-server):
    - Use `capture()`, `refund()`, `void()`, `store()`, `createEMV3DSOrder()`
- Hosted Payment Page:
    - Use `NABTransact_HostedPayment`
    - Methods: `purchase()`, `completePurchase()`
- UnionPay:
    - Use `NABTransact_UnionPay`
    - Methods: `purchase()`, `completePurchase()`

Basic Usage
-----------

[](#basic-usage)

The following gateways are provided by this package:

- NABTransact\_DirectPost (NAB Transact Direct Post v2)
- NABTransact\_SecureXML (NAB Transact SecurePay XML)
- NABTransact\_HostedPayment (NAB Hosted Payment Page)
- NABTransact\_UnionPay (UnionPay via NAB Transact)

### NAB Transact SecureXML API

[](#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

[](#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

[](#nab-transact-directpost-v2)

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

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

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

    $response = $gateway->purchase([
        '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());
    }
```

#### DirectPost Store Only

[](#directpost-store-only)

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

    $response = $gateway->store([
        'transactionId' => 'STORE-ORDER-100',
        'returnUrl' => 'http://example.com/payment/response',
        'card' => $card,
    ])->send();

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

#### DirectPost Capture (Complete Preauth, Server-to-Server)

[](#directpost-capture-complete-preauth-server-to-server)

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

    $response = $gateway->capture([
        'transactionId' => 'CAPTURE-ORDER-100',
        'transactionReference' => 'NAB-ORIGINAL-TXN-ID',
        'amount' => '12.00',
        'currency' => 'AUD',
    ])->send();

    if ($response->isSuccessful()) {
        echo 'Capture successful: '.$response->getTransactionReference();
    }
```

#### DirectPost Refund (Server-to-Server)

[](#directpost-refund-server-to-server)

```
    $response = $gateway->refund([
        'transactionId' => 'REFUND-ORDER-100',
        'transactionReference' => 'NAB-SETTLED-TXN-ID',
        'amount' => '5.00',
        'currency' => 'AUD',
    ])->send();
```

#### DirectPost Reversal/Void (Server-to-Server)

[](#directpost-reversalvoid-server-to-server)

```
    $response = $gateway->void([
        'transactionId' => 'VOID-ORDER-100',
        'transactionReference' => 'NAB-AUTH-TXN-ID',
        'amount' => '12.00',
    ])->send();
```

#### EMV 3DS Order Creation API

[](#emv-3ds-order-creation-api)

```
    $response = $gateway->createEMV3DSOrder([
        'amount' => '12.00',
        'currency' => 'AUD',
        'clientIp' => '203.0.113.10',
        'transactionReference' => 'ORDER-REF-100',
    ])->send();

    if ($response->isSuccessful()) {
        echo 'Order ID: '.$response->getOrderId();
        echo 'Simple Token: '.$response->getSimpleToken();
    }
```

#### DirectPost Advanced Optional Parameters

[](#directpost-advanced-optional-parameters)

```
    $response = $gateway->purchase([
        'amount' => '112.00',
        'currency' => 'AUD',
        'transactionId' => 'ORDER-ADV-100',
        'card' => $card,
        'returnUrl' => 'https://example.com/payment/response',
        'notifyUrl' => 'https://example.com/payment/callback',

        // Optional reporting/callback field control
        'resultParams' => 'merchant,refid,rescode,restext',
        'callbackParams' => 'merchant,refid,rescode,restext',

        // Optional surcharge reporting fields
        'surchargeEnabled' => true,
        'surchargeAmount' => '12.00',
        'surchargeRate' => '5.00',
        'surchargeFee' => '7.00',

        // Optional MCR route hint
        'cardScheme' => 'scheme', // or 'eftpos'
    ])->send();
```

### NAB Transact DirectPost v2 UnionPay Online Payment

[](#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([
        'amount' => '12.00',
        'transactionId' => '1234566789205067',
        'currency' => 'AUD',
        'returnUrl' => 'http://example.com/payment/response',
    ])
        ->send();

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

#### Complete Purchase

[](#complete-purchase)

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

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

    $gateway->setTestMode(true);

    $response = $gateway->completePurchase([
        '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](https://github.com/thephpleague/omnipay)repository.

Framework-Agnostic Transport Option
-----------------------------------

[](#framework-agnostic-transport-option)

Omnipay support remains the default behavior. SecureXML requests can now also use a framework-agnostic cURL transport:

```
use Omnipay\NABTransact\Transport\CurlTransport;

$request = $gateway->purchase([
    'amount' => '10.00',
    'transactionId' => 'ORDER-1000',
    'card' => $card,
]);

$request->setTransport(new CurlTransport());
$response = $request->send();
```

DirectPost server-to-server operations (`capture`, `refund`, `void`, `createEMV3DSOrder`) can use the same transport injection pattern.

See `ARCHITECTURE.md` for design details and extension points.

NAB Feature Coverage
--------------------

[](#nab-feature-coverage)

Core payment features are mapped in `docs/feature-matrix.md` with request/response classes and test coverage. For a contributor-friendly package map, see `docs/features-implemented-tree.md`. This package targets payment-processing API coverage and does not include NAB admin/reporting portal features.

Documentation Map
-----------------

[](#documentation-map)

- `README.md`: install + practical flow examples
- `ARCHITECTURE.md`: project structure, runtime flow, extension points
- `docs/feature-matrix.md`: feature-by-feature status map
- `docs/features-implemented-tree.md`: full implementation tree

Contributing
------------

[](#contributing)

Contributions are **welcome** and will be fully **credited**.

Contributions can be made via a Pull Request on [Github](https://github.com/sudiptpa/omnipay-nabtransact).

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

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](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/sudiptpa/nabtransact/issues), or better yet, fork the library and submit a pull request.

Architecture
------------

[](#architecture)

See `ARCHITECTURE.md` for package structure, flow, and extension points.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance83

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 96.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~130 days

Recently: every ~292 days

Total

27

Last Release

86d ago

Major Versions

2.2.3 → v3.0.02018-05-26

v2.3.2 → v3.2.02022-12-06

2.0.x-dev → v3.3.02026-02-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7222620?v=4)[Sujip Thapa](/maintainers/sudiptpa)[@sudiptpa](https://github.com/sudiptpa)

---

Top Contributors

[![sudiptpa](https://avatars.githubusercontent.com/u/7222620?v=4)](https://github.com/sudiptpa "sudiptpa (100 commits)")[![cseufert](https://avatars.githubusercontent.com/u/1734519?v=4)](https://github.com/cseufert "cseufert (2 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (2 commits)")

---

Tags

nabomnipayomnipay-gatewaypaymentpayment-gatewaypayment-gateway-intigrationpayment-integrationpayment-platformspaymentsphppaymentgatewaypaymerchantomnipaynabtransact

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sudiptpa-omnipay-nabtransact/health.svg)

```
[![Health](https://phpackages.com/badges/sudiptpa-omnipay-nabtransact/health.svg)](https://phpackages.com/packages/sudiptpa-omnipay-nabtransact)
```

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

587421.0k11](/packages/lokielse-omnipay-alipay)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

154.6k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
