-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
37 lines (28 loc) · 823 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
require __DIR__.'/vendor/autoload.php';
use Omnipay\Common\CreditCard;
use Omnipay\Omnipay;
$gateway = Omnipay::create('NABTransact_SecureXML');
$gateway->setMerchantId('XYZ0010');
$gateway->setTransactionPassword('abcd1234');
$gateway->setTestMode(true);
$card = new CreditCard([
'firstName' => 'Sujip',
'lastName' => 'Thapa',
'number' => '4444333322221111',
'expiryMonth' => '12',
'expiryYear' => date('Y'),
'cvv' => '123',
]);
$response = $gateway->purchase([
'amount' => '12.00',
'transactionId' => 'ORDER-ZYX8789',
'currency' => 'AUD',
'card' => $card,
])->send();
$message = sprintf(
'Transaction with reference code (%s) - %s',
$response->getTransactionReference(),
$response->getMessage()
);
echo $message;