Skip to content

Commit 9d090e6

Browse files
authored
Merge pull request #12 from sudiptpa/sudiptpa-patch-1
Update README.md
2 parents 26d4ad4 + 60663da commit 9d090e6

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ And run composer to update your dependencies:
3333

3434
The 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

75113
For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)

0 commit comments

Comments
 (0)