22
33** NAB Transact driver for the Omnipay PHP payment processing library**
44
5+ [ ![ CI] ( https://github.com/sudiptpa/omnipay-nabtransact/actions/workflows/ci.yml/badge.svg )] ( https://github.com/sudiptpa/omnipay-nabtransact/actions/workflows/ci.yml )
56[ Omnipay] ( https://github.com/thephpleague/omnipay ) is a framework agnostic, multi-gateway payment
67processing library for PHP. This package implements NAB Transact support for Omnipay.
78
8- [ ![ StyleCI] ( https://styleci.io/repos/74269379/shield?style=flat&branch=master )] ( https://styleci.io/repos/74269379 )
9- [ ![ Build Status] ( https://travis-ci.org/sudiptpa/omnipay-nabtransact.svg?branch=master&style=flat-square )] ( https://travis-ci.org/sudiptpa/omnipay-nabtransact )
109[ ![ Latest Stable Version] ( https://poser.pugx.org/sudiptpa/omnipay-nabtransact/v/stable?style=flat-square )] ( https://packagist.org/packages/sudiptpa/omnipay-nabtransact )
1110[ ![ Total Downloads] ( https://poser.pugx.org/sudiptpa/omnipay-nabtransact/downloads?style=flat-square )] ( https://packagist.org/packages/sudiptpa/omnipay-nabtransact )
1211[ ![ GitHub license] ( https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square )] ( https://raw.githubusercontent.com/sudiptpa/omnipay-nabtransact/master/LICENSE )
@@ -25,6 +24,7 @@ The following gateways are provided by this package:
2524
2625* NABTransact_DirectPost (NAB Transact Direct Post v2)
2726* NABTransact_SecureXML (NAB Transact SecurePay XML)
27+ * NABTransact_HostedPayment (NAB Hosted Payment Page)
2828* NABTransact_UnionPay (UnionPay via NAB Transact)
2929
3030### NAB Transact SecureXML API
@@ -117,23 +117,23 @@ The following gateways are provided by this package:
117117 $gateway->setTestMode(true);
118118 $gateway->setHasEMV3DSEnabled(true);
119119
120- $card = new CreditCard(array(
120+ $card = new CreditCard([
121121 'firstName' => 'Sujip',
122122 'lastName' => 'Thapa',
123123 'number' => '4444333322221111',
124124 'expiryMonth' => '10',
125125 'expiryYear' => '2030',
126126 'cvv' => '123',
127- ) );
127+ ] );
128128
129- $response = $gateway->purchase(array(
129+ $response = $gateway->purchase([
130130 'amount' => '12.00',
131131 'transactionId' => 'ORDER-ZYX8',
132- 'transactionReference' => '11fc42b0-bb7a-41a4-8b3c-096b3fd4d402'
132+ 'transactionReference' => '11fc42b0-bb7a-41a4-8b3c-096b3fd4d402',
133133 'currency' => 'AUD',
134134 'card' => $card,
135135 'clientIp' => '192.168.1.1'
136- ) )
136+ ] )
137137 ->send();
138138
139139 if ($response->isRedirect()) {
@@ -148,6 +148,82 @@ The following gateways are provided by this package:
148148
149149```
150150
151+ #### DirectPost Store Only
152+
153+ ``` php
154+ $gateway = Omnipay::create('NABTransact_DirectPost');
155+ $gateway->setMerchantId('XYZ0010');
156+ $gateway->setTransactionPassword('abcd1234');
157+ $gateway->setTestMode(true);
158+
159+ $response = $gateway->store([
160+ 'transactionId' => 'STORE-ORDER-100',
161+ 'returnUrl' => 'http://example.com/payment/response',
162+ 'card' => $card,
163+ ])->send();
164+
165+ if ($response->isRedirect()) {
166+ $response->redirect();
167+ }
168+ ```
169+
170+ #### DirectPost Capture (Complete Preauth, Server-to-Server)
171+
172+ ``` php
173+ $gateway = Omnipay::create('NABTransact_DirectPost');
174+ $gateway->setMerchantId('XYZ0010');
175+ $gateway->setTransactionPassword('abcd1234');
176+ $gateway->setTestMode(true);
177+
178+ $response = $gateway->capture([
179+ 'transactionId' => 'CAPTURE-ORDER-100',
180+ 'transactionReference' => 'NAB-ORIGINAL-TXN-ID',
181+ 'amount' => '12.00',
182+ 'currency' => 'AUD',
183+ ])->send();
184+
185+ if ($response->isSuccessful()) {
186+ echo 'Capture successful: '.$response->getTransactionReference();
187+ }
188+ ```
189+
190+ #### DirectPost Refund (Server-to-Server)
191+
192+ ``` php
193+ $response = $gateway->refund([
194+ 'transactionId' => 'REFUND-ORDER-100',
195+ 'transactionReference' => 'NAB-SETTLED-TXN-ID',
196+ 'amount' => '5.00',
197+ 'currency' => 'AUD',
198+ ])->send();
199+ ```
200+
201+ #### DirectPost Reversal/Void (Server-to-Server)
202+
203+ ``` php
204+ $response = $gateway->void([
205+ 'transactionId' => 'VOID-ORDER-100',
206+ 'transactionReference' => 'NAB-AUTH-TXN-ID',
207+ 'amount' => '12.00',
208+ ])->send();
209+ ```
210+
211+ #### EMV 3DS Order Creation API
212+
213+ ``` php
214+ $response = $gateway->createEMV3DSOrder([
215+ 'amount' => '12.00',
216+ 'currency' => 'AUD',
217+ 'clientIp' => '203.0.113.10',
218+ 'transactionReference' => 'ORDER-REF-100',
219+ ])->send();
220+
221+ if ($response->isSuccessful()) {
222+ echo 'Order ID: '.$response->getOrderId();
223+ echo 'Simple Token: '.$response->getSimpleToken();
224+ }
225+ ```
226+
151227### NAB Transact DirectPost v2 UnionPay Online Payment
152228
153229``` php
@@ -162,12 +238,12 @@ The following gateways are provided by this package:
162238 * The parameter transactionId must be alpha-numeric and 8 to 32 characters in length
163239 */
164240
165- $response = $gateway->purchase(array(
241+ $response = $gateway->purchase([
166242 'amount' => '12.00',
167243 'transactionId' => '1234566789205067',
168244 'currency' => 'AUD',
169245 'returnUrl' => 'http://example.com/payment/response',
170- ) )
246+ ] )
171247 ->send();
172248
173249 if ($response->isRedirect()) {
@@ -185,13 +261,13 @@ The following gateways are provided by this package:
185261
186262 $gateway->setTestMode(true);
187263
188- $response = $gateway->completePurchase(array(
264+ $response = $gateway->completePurchase([
189265 'amount' => '12.00',
190266 'transactionId' => '1234566789205067',
191- 'transactionReference' => '11fc42b0-bb7a-41a4-8b3c-096b3fd4d402'
267+ 'transactionReference' => '11fc42b0-bb7a-41a4-8b3c-096b3fd4d402',
192268 'currency' => 'AUD',
193269 'returnUrl' => 'http://example.com/payment/response',
194- ) )
270+ ] )
195271 ->send();
196272
197273 if ($response->isSuccessful()) {
@@ -205,6 +281,33 @@ The following gateways are provided by this package:
205281For general usage instructions, please see the main [ Omnipay] ( https://github.com/thephpleague/omnipay )
206282repository.
207283
284+ ## Framework-Agnostic Transport Option
285+
286+ Omnipay support remains the default behavior. SecureXML requests can now also use a framework-agnostic cURL transport:
287+
288+ ``` php
289+ use Omnipay\NABTransact\Transport\CurlTransport;
290+
291+ $request = $gateway->purchase([
292+ 'amount' => '10.00',
293+ 'transactionId' => 'ORDER-1000',
294+ 'card' => $card,
295+ ]);
296+
297+ $request->setTransport(new CurlTransport());
298+ $response = $request->send();
299+ ```
300+
301+ DirectPost server-to-server operations (` capture ` , ` refund ` , ` void ` , ` createEMV3DSOrder ` ) can use the same transport injection pattern.
302+
303+ See ` ARCHITECTURE.md ` for design details and extension points.
304+
305+ ## NAB Feature Coverage
306+
307+ Core payment features are mapped in ` docs/feature-matrix.md ` with request/response classes and test coverage.
308+ For a contributor-friendly package map, see ` docs/features-implemented-tree.md ` .
309+ This package targets payment-processing API coverage and does not include NAB admin/reporting portal features.
310+
208311## Contributing
209312
210313Contributions are ** welcome** and will be fully ** credited** .
@@ -223,3 +326,8 @@ you can subscribe to.
223326
224327If you believe you have found a bug, please report it using the [ GitHub issue tracker] ( https://github.com/sudiptpa/nabtransact/issues ) ,
225328or better yet, fork the library and submit a pull request.
329+
330+
331+ ## Architecture
332+
333+ See ` ARCHITECTURE.md ` for package structure, flow, and extension points.
0 commit comments