@@ -33,7 +33,7 @@ And run composer to update your dependencies:
3333
3434The following gateways are provided by this package:
3535
36- * NAB Transact SecureXML API
36+ ### NAB Transact SecureXML API
3737
3838``` php
3939 use Omnipay\Omnipay;
@@ -70,6 +70,44 @@ The following gateways are provided by this package:
7070 echo sprintf('Transaction %s failed: %s', $response->getTransactionReference(), $response->getMessage());
7171 }
7272
73+ ```
74+ ### NAB Transact DirectPost v2
75+
76+ ``` php
77+ $gateway = Omnipay::create('NABTransact_DirectPost');
78+
79+ $gateway->setMerchantId('XYZ0010');
80+ $gateway->setTransactionPassword('abcd1234');
81+
82+ $gateway->setTestMode(true);
83+
84+ $card = new CreditCard(array(
85+ 'firstName' => 'Sujip',
86+ 'lastName' => 'Thapa',
87+ 'number' => '4444333322221111',
88+ 'expiryMonth' => '10',
89+ 'expiryYear' => '2030',
90+ 'cvv' => '123',
91+ ));
92+
93+ $response = $gateway->purchase(array(
94+ 'amount' => '12.00',
95+ 'transactionId' => 'ORDER-ZYX8',
96+ 'currency' => 'AUD',
97+ 'card' => $card,
98+ ))
99+ ->send();
100+
101+ if ($response->isRedirect()) {
102+ $response->redirect();
103+ }
104+
105+ if ($response->isSuccessful()) {
106+ echo sprintf('Transaction %s was successful!', $response->getTransactionReference());
107+ } else {
108+ echo sprintf('Transaction %s failed: %s', $response->getTransactionReference(), $response->getMessage());
109+ }
110+
73111```
74112
75113For general usage instructions, please see the main [ Omnipay] ( https://github.com/thephpleague/omnipay )
0 commit comments