<?php
$request['sid']="27";
$rcode ="xxxxxxxx";
$request['card_type'] = 'visa';
$request['email'] = '[email protected]';
$request['tx_action'] ='PAYMENT';
$request['card_no'] = '4111111111111111'; // or the ref no account authorize transaction eg. 58-9-2036956
$request['card_ccv'] = '123';
$request['card_exp_month'] = '11';
$request['card_exp_year'] = '2022';
$request['card_name'] = 'test';
$request['firstname'] = 'ALan';
$request['lastname'] = 'Lai';
$request['phone'] = '123445666';
$request['email'] = '[email protected]';
$request['address'] = 'xxx';
$request['suburb_city'] = 'xxx';
$request['state'] = 'xxx';
$request['postcode'] = 'xxx';
$request['country'] = 'MY';
$request['timestamp'] = '0123456789';
$request['currency'] = 'USD';
$request['tid'] = '1234567892';
$request['amount_shipping'] ='0.00';
$request['amount_coupon'] ='0.00';
$request['postback_url'] ="http:// testpostbackreturn.php";
$request['amount_tax'] ='0.00';
$request['item_quantity[]']= '1';
$request['item_name[]'] = 'NA';
$request['item_no[]'] = 'NA';
$request['item_description[]'] = 'NA';
$request['item_amount_unit[]'] ='10.00';
$item_quantity = $request['item_quantity[]'];
$item_amount_unit = $request['item_amount_unit[]'];
$amounttotal = $item_quantity * $item_amount_unit;
$amounttotal = $amounttotal + $request[amount_tax] + $request[amount_shipping] -$request[amount_coupon];
$amounttotal='10.00';
$request[hash] = md5($request['sid']. $request[timestamp] . $amounttotal . $request[currency] . $rcode);
if(!$curl = curl_init('http://office.paywiser.com/api/v1/index.php/27/singletx')) echo "cURL initialization failure:
".curl_error($curl);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request)); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
if ( !$response = curl_exec($curl))
echo "cURL execution failure: ".curl_error($curl);
curl_close ($curl);
echo "Response: "; echo "
<pre>"; print_r($response); echo "</pre>";
Non 3D Asynchronous Response Sample:
{
"sid":"27",
"status":"OK",
"parent_txid":"1234567",
"txid":"7654321",
"tx_acti on":"PAYMENT",
"amount":"10.00",
"currency":"USD",
"tid":"1234567892",
"ref1":" ",
"ref2":"",
"ref3":"",
"ref4":"",
"comment":"\"Payment Success\"",
"descriptor":"AcqraS2S USD",
"rebillkey":"",
"settlementamount":"10.00",
"settlementcurrency":"USD",
" paymentinfo":""
}
3D Asynchronous Response Sample :
{
"sid":"xx",
"status":"REQ",
"parent_txid":"1619750629xxxxx",
"txid":"16197506 369xxxx",
"tx_action":"PAYMENT",
"amount":"1.00",
"currency":"USD",
"tid":"",
"ref1":"{\"webUrl\":\"https:\\\/\\\/oats.allinpay.com\\\/payh5\\\/cnp_pay\\\/ directCashier?accessCode=xxxxx&mchtId=852999956xxxxx&accessOrderId=21043010 4353xxxxxx&language=en\"}",
"ref2":"",
"ref3":"",
"ref4":"",
"comment":"",
"descriptor":"PF_VISA_USD_NEW",
"rebillkey":"",
"error":{
"type":"WAIT3D",
"sys":"",
"msg":"Awaiting 3DSecure",
"info":"{\"webUrl\":\"https:\\\/\\\/oats.allinpay.com\\\/payh5\\\\ /cnp_pay\\\/directCashier?accessCode=85200061&mchtId=852999956610024&access OrderId=2104301043530790477&language=en\"}",
"code":""
},
"settlementamount":"0.00",
"settlementcurrency":"USD",
"paymentinfo":""
}