curl --request GET \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'cap-signature: <cap-signature>'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query"
headers = {
"Abp-TenantId": "<abp-tenantid>",
"Authorization": "<authorization>",
"cap-signature": "<cap-signature>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'Abp-TenantId': '<abp-tenantid>',
Authorization: '<authorization>',
'cap-signature': '<cap-signature>'
}
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Abp-TenantId: <abp-tenantid>",
"Authorization: <authorization>",
"cap-signature: <cap-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Abp-TenantId", "<abp-tenantid>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("cap-signature", "<cap-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Abp-TenantId"] = '<abp-tenantid>'
request["Authorization"] = '<authorization>'
request["cap-signature"] = '<cap-signature>'
response = http.request(request)
puts response.read_body{
"transactionNumber": "<string>",
"paymentSessionNumber": "<string>",
"referenceCode": "<string>",
"status": 0,
"currencyCode": "MYR",
"amount": 100,
"channelId": 123,
"providerTransactionNumber": "<string>",
"creationTime": "2022-02-10T08:50:30.565Z",
"remark": "<string>",
"providerChannelId": "<string>",
"providerPaymentMethod": "<string>",
"providerErrorMessage": "<string>",
"loyaltyType": 1,
"redemptionPoint": 123,
"redemptionAmount": 123,
"rewardPoint": 123,
"paidAmount": 100,
"loyaltyRedemptionStatus": 0,
"loyaltyRewardStatus": 0
}Query Payment
Payment gateway checks the existing payment status.
The following input parameters are expected to be provided by the merchant to verify transaction status or to obtain more details on the payment before approving the customer’s order.
curl --request GET \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'cap-signature: <cap-signature>'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query"
headers = {
"Abp-TenantId": "<abp-tenantid>",
"Authorization": "<authorization>",
"cap-signature": "<cap-signature>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'Abp-TenantId': '<abp-tenantid>',
Authorization: '<authorization>',
'cap-signature': '<cap-signature>'
}
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Abp-TenantId: <abp-tenantid>",
"Authorization: <authorization>",
"cap-signature: <cap-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Abp-TenantId", "<abp-tenantid>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("cap-signature", "<cap-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/Query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Abp-TenantId"] = '<abp-tenantid>'
request["Authorization"] = '<authorization>'
request["cap-signature"] = '<cap-signature>'
response = http.request(request)
puts response.read_body{
"transactionNumber": "<string>",
"paymentSessionNumber": "<string>",
"referenceCode": "<string>",
"status": 0,
"currencyCode": "MYR",
"amount": 100,
"channelId": 123,
"providerTransactionNumber": "<string>",
"creationTime": "2022-02-10T08:50:30.565Z",
"remark": "<string>",
"providerChannelId": "<string>",
"providerPaymentMethod": "<string>",
"providerErrorMessage": "<string>",
"loyaltyType": 1,
"redemptionPoint": 123,
"redemptionAmount": 123,
"rewardPoint": 123,
"paidAmount": 100,
"loyaltyRedemptionStatus": 0,
"loyaltyRewardStatus": 0
}Headers
Your unique Merchant ID assigned by CommercePay.
Your API credentials used for authentication (typically a Bearer token).
A unique security hash used to verify the integrity of the request body. See Generate Signature for how to generate this.
Query Parameters
Unique CAP Transaction Number (Conditional: If it is query for specific transaction in either normal transaction or session transaction, then need pass the transaction number)
24new Date().getTime()
1621851652617
Unique CAP Session Number (Conditional: If the query is query the session, then need pass the session number)
24Response
Success
Unique CAP transaction number
24Unique CAP session number
24Merchant Reference Code
50Payment Status: Refer on Appendix 3.1 Payment Status Code Table
0, 1, 2, 3, 4, 5, 6, 7 Currency code with a 3-letter ISO 4217 standard code
3"MYR"
This is Request Amount.
100
Refer to endpoints in Get Channel List
Provider Transaction Number
Payment Transaction Creation Time
"2022-02-10T08:50:30.565Z"
A description that additional information or clarify details for the transaction.
An identifier that represents the payment provider channel
Provider Payment Method
Provider Error Message
[Conditional for Loyalty Payment]
1 = BCard
1 [Conditional for Loyalty Payment] Redemption Point.
[Conditional for Loyalty Payment] Redemption Amount.
[Conditional for Loyalty Payment] Reward Point.
[Conditional for Loyalty Payment] This is Paid Amount.
100
[Conditional for Loyalty Payment]
0 = Pending, 1 = Success, 2 = Failed, 3 = Void
0, 1, 2, 3 [Conditional for Loyalty Payment]
0 = Pending, 1 = Success, 2 = Failed, 3 = Void
0, 1, 2, 3 