Transaction Orders History
All transaction orders have supports for bulk fetches view "list" API method. For instance, you can list of all orders.
In order to interact with PAYON's API. First you need to Obtain your API Key. Next generate API's signature for authorization between Merchant and PAYON's server.
PG Transaction Orders History
POST
{{URL}}/pg/orders
These list API share a common structure, taking at least these some parameters fromDate, ToDate, index, limit, merchantId, termId.
Request Body
[
{
"txDt": "20201124",
"txSeqNo": "2020112400001250",
"txStCd": "09",
"trt": "10",
"payDvCd": "8",
"paymentType": "02",
"merchantId": "C0000143",
"termId": "CT03000003",
"tracNo": "1606193062038",
"amount": 1,
"currencyCode": "USD",
"settleYn": "N",
"cancelYn": "N",
"refundYn": "N",
"apprNo": "190879",
"apprDttm": "24/11/2020 11:47:01",
"resultCd": "0000",
"resultMsg": "Success",
"stan": "001032"
},
{
"txDt": "20201124",
"txSeqNo": "2020112400001251",
"txStCd": "09",
"trt": "10",
"payDvCd": "8",
"paymentType": "02",
"merchantId": "C0000143",
"termId": "CT03000003",
"tracNo": "1606199421698",
"amount": 1,
"currencyCode": "USD",
"settleYn": "N",
"cancelYn": "N",
"refundYn": "N",
"apprNo": "193202",
"apprDttm": "24/11/2020 01:30:29",
"resultCd": "0000",
"resultMsg": "Success",
"stan": "001033"
}
]
Example Request
curl --location --request POST 'http://pgtest.payon.com.kh/pg/orders' \
--data-raw '{
"fromDate":"01112018",
"toDate":"24112020",
"index":1,
"limit":5,
"trt":"10",
"merchantId":"C0000143",
"termId":"CT03000003"
}'
POST /pg/orders HTTP/1.1
Host: pgtest.payon.com.kh
{
"fromDate":"01112018",
"toDate":"24112020",
"index":1,
"limit":5,
"trt":"10",
"merchantId":"C0000143",
"termId":"CT03000003"
}
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('http://pgtest.payon.com.kh/pg/orders');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Cookie' => 'SESSION=2e99ea42-84d2-4853-8c24-d5e541673468'
));
$request->setBody('{\n "fromDate":"01112018",\n "toDate":"24112020",\n "index":1,\n "limit":5,\n "trt":"10",\n "merchantId":"C0000143",\n "termId":"CT03000003"\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();
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://pgtest.payon.com.kh/pg/orders",
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 =>"{\n \"fromDate\":\"01112018\",\n \"toDate\":\"24112020\",\n \"index\":1,\n \"limit\":5,\n \"trt\":\"10\",\n \"merchantId\":\"C0000143\",\n \"termId\":\"CT03000003\"\n}",
CURLOPT_HTTPHEADER => array(
"Cookie: SESSION=2e99ea42-84d2-4853-8c24-d5e541673468"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "http://pgtest.payon.com.kh/pg/orders",
"method": "POST",
"timeout": 0,
"headers": {
"Cookie": "SESSION=2e99ea42-84d2-4853-8c24-d5e541673468"
},
"data": "{\n \"fromDate\":\"01112018\",\n \"toDate\":\"24112020\",\n \"index\":1,\n \"limit\":5,\n \"trt\":\"10\",\n \"merchantId\":\"C0000143\",\n \"termId\":\"CT03000003\"\n}",
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = "{\n \"fromDate\":\"01112018\",\n \"toDate\":\"24112020\",\n \"index\":1,\n \"limit\":5,\n \"trt\":\"10\",\n \"merchantId\":\"C0000143\",\n \"termId\":\"CT03000003\"\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/orders");
xhr.setRequestHeader("Cookie", "SESSION=2e99ea42-84d2-4853-8c24-d5e541673468");
xhr.send(data);
Last updated