Skip to content

Commit 851f821

Browse files
authored
Merge pull request #13 from sudiptpa/sudiptpa-patch-1
Update README.md
2 parents 0d80eed + 9f27bf5 commit 851f821

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,59 @@ The following gateways are provided by this package:
110110

111111
```
112112

113+
### NAB Transact DirectPost v2 UnionPay Online Payment
114+
115+
```php
116+
$gateway = Omnipay::create('NABTransact_UnionPay');
117+
118+
$gateway->setMerchantId('XYZ0010');
119+
$gateway->setTransactionPassword('abcd1234');
120+
121+
$gateway->setTestMode(true);
122+
123+
/*
124+
* The parameter transactionId must be alpha-numeric and 8 to 32 characters in length
125+
*/
126+
127+
$response = $gateway->purchase(array(
128+
'amount' => '12.00',
129+
'transactionId' => '1234566789205067',
130+
'currency' => 'AUD',
131+
'returnUrl' => 'http://example.com/payment/response',
132+
))
133+
->send();
134+
135+
if ($response->isRedirect()) {
136+
$response->redirect();
137+
}
138+
```
139+
140+
#### Complete Purchase
141+
142+
```php
143+
$gateway = Omnipay::create('NABTransact_UnionPay');
144+
145+
$gateway->setMerchantId('XYZ0010');
146+
$gateway->setTransactionPassword('abcd1234');
147+
148+
$gateway->setTestMode(true);
149+
150+
$response = $gateway->completePurchase(array(
151+
'amount' => '12.00',
152+
'transactionId' => '1234566789205067',
153+
'currency' => 'AUD',
154+
'returnUrl' => 'http://example.com/payment/response',
155+
))
156+
->send();
157+
158+
if ($response->isSuccessful()) {
159+
echo sprintf('Transaction %s was successful!', $response->getTransactionReference());
160+
} else {
161+
echo sprintf('Transaction %s failed: %s', $response->getTransactionReference(), $response->getMessage());
162+
}
163+
164+
```
165+
113166
For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)
114167
repository.
115168

0 commit comments

Comments
 (0)