This endpoint allows you to register card binding without payment.
200 Binding successfully registered.
Copy {
"txDt": null,
"txSeqNo": null,
"merchantId": "C0000143",
"termId": "CT03000003",
"wdlAcNo": "520473**1003",
"wdlExpiry": "202512",
"wdlNm": null,
"clientId": "C0000143CT0300000302",
"phone": null,
"email": null,
"bindingId": "7ce4dda7-b9f8-4343-883b-e5ff6295e5f9",
"resultCode": "0000",
"resultMsg": "Success"
}
cURL Http PHP_Http-Request2 PHP_ cURL Javascript-Jquery Javascript- XHR
Copy curl --location --request POST 'http://pgtest.payon.com.kh/pg/createBinding' \
--data-raw '{
"merchantId":"C0000143",
"termId":"CT03000003",
"clientId":"02",
"wdlAcNo":"5204730000001003",
"wdlCvv":"100",
"wdlExpiry":"202512",
"wdlNm":"MC",
"phone":"855964444781",
"email":"",
"pin":"123456"
}'
Copy POST /pg/createBinding HTTP / 1.1
Host : pgtest.payon.com.kh
Content-Length : 242
{
"merchantId" : "C0000143" ,
"termId" : "CT03000003" ,
"clientId" : "02" ,
"wdlAcNo" : "5204730000001003" ,
"wdlCvv" : "100" ,
"wdlExpiry" : "202512" ,
"wdlNm" : "MC" ,
"phone" : "855964444781" ,
"email" : "" ,
"pin" : "123456"
}
Copy <? php
require_once 'HTTP/Request2.php' ;
$request = new HTTP_Request2 ();
$request -> setUrl ( 'http://pgtest.payon.com.kh/pg/createBinding' ) ;
$request -> setMethod ( HTTP_Request2 :: METHOD_POST ) ;
$request -> setConfig ( array (
'follow_redirects' => TRUE
) ) ;
$request->setBody('{\n "merchantId":"C0000143",\n "termId":"CT03000003",\n "clientId":"02",\n "wdlAcNo":"5204730000001003",\n "wdlCvv":"100",\n "wdlExpiry":"202512",\n "wdlNm":"MC",\n "phone":"855964444781",\n "email":"",\n "pin":"123456"\n\n}');
try {
$response = $request -> send () ;
if ($response -> getStatus () == 200 ) {
echo $response -> getBody () ;
}
else {
echo 'Unexpected HTTP status: ' . $response -> getStatus () . ' ' .
$response -> getReasonPhrase () ;
}
}
catch ( HTTP_Request2_Exception $e) {
echo 'Error: ' . $e -> getMessage () ;
}
Copy <? php
$curl = curl_init () ;
curl_setopt_array ( $curl , array(
CURLOPT_URL => 'http://pgtest.payon.com.kh/pg/createBinding' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_ENCODING => '' ,
CURLOPT_MAXREDIRS => 10 ,
CURLOPT_TIMEOUT => 0 ,
CURLOPT_FOLLOWLOCATION => true ,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ,
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_POSTFIELDS => '{
"merchantId":"C0000143",
"termId":"CT03000003",
"clientId":"02",
"wdlAcNo":"5204730000001003",
"wdlCvv":"100",
"wdlExpiry":"202512",
"wdlNm":"MC",
"phone":"855964444781",
"email":"",
"pin":"123456"
}' ,
) ) ;
$response = curl_exec ( $curl ) ;
curl_close ( $curl ) ;
echo $response;
Copy var settings = {
"url" : "http://pgtest.payon.com.kh/pg/createBinding" ,
"method" : "POST" ,
"timeout" : 0 ,
"data": "{\n \"merchantId\":\"C0000143\",\n \"termId\":\"CT03000003\",\n \"clientId\":\"02\",\n \"wdlAcNo\":\"5204730000001003\",\n \"wdlCvv\":\"100\",\n \"wdlExpiry\":\"202512\",\n \"wdlNm\":\"MC\",\n \"phone\":\"855964444781\",\n \"email\":\"\",\n \"pin\":\"123456\"\n\n}",
};
$ .ajax (settings) .done ( function (response) {
console .log (response);
});
Copy var data = "{\n \"merchantId\":\"C0000143\",\n \"termId\":\"CT03000003\",\n \"txId\":\"1614595772233350\",\n \"amount\":\"1\"\n\n\n}";
var xhr = new XMLHttpRequest ();
xhr .withCredentials = true ;
xhr .addEventListener ( "readystatechange" , function () {
if ( this .readyState === 4 ) {
console .log ( this .responseText);
}
});
xhr .open ( "POST" , "http://pgtest.payon.com.kh/pg/payonApp/payment" );
xhr .send (data);