curl --request POST \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'cap-signature: <cap-signature>' \
--data '
{
"transactionNumber": "<string>",
"amount": 100,
"channelDetails": {
"cardNumber": "48481000XXXXXXXX",
"expiryMonth": "01",
"expiryYear": "99",
"holderName": "ALEXXXXXXXX",
"securityCode": "999",
"AuthType": 1
},
"savePayment": true,
"LastPayment": true
}
'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment"
payload = {
"transactionNumber": "<string>",
"amount": 100,
"channelDetails": {
"cardNumber": "48481000XXXXXXXX",
"expiryMonth": "01",
"expiryYear": "99",
"holderName": "ALEXXXXXXXX",
"securityCode": "999",
"AuthType": 1
},
"savePayment": True,
"LastPayment": True
}
headers = {
"Abp-TenantId": "<abp-tenantid>",
"Authorization": "<authorization>",
"cap-signature": "<cap-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Abp-TenantId': '<abp-tenantid>',
Authorization: '<authorization>',
'cap-signature': '<cap-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
transactionNumber: '<string>',
amount: 100,
channelDetails: {
cardNumber: '48481000XXXXXXXX',
expiryMonth: '01',
expiryYear: '99',
holderName: 'ALEXXXXXXXX',
securityCode: '999',
AuthType: 1
},
savePayment: true,
LastPayment: true
})
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment', 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/ProcessPayment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'transactionNumber' => '<string>',
'amount' => 100,
'channelDetails' => [
'cardNumber' => '48481000XXXXXXXX',
'expiryMonth' => '01',
'expiryYear' => '99',
'holderName' => 'ALEXXXXXXXX',
'securityCode' => '999',
'AuthType' => 1
],
'savePayment' => true,
'LastPayment' => true
]),
CURLOPT_HTTPHEADER => [
"Abp-TenantId: <abp-tenantid>",
"Authorization: <authorization>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment"
payload := strings.NewReader("{\n \"transactionNumber\": \"<string>\",\n \"amount\": 100,\n \"channelDetails\": {\n \"cardNumber\": \"48481000XXXXXXXX\",\n \"expiryMonth\": \"01\",\n \"expiryYear\": \"99\",\n \"holderName\": \"ALEXXXXXXXX\",\n \"securityCode\": \"999\",\n \"AuthType\": 1\n },\n \"savePayment\": true,\n \"LastPayment\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Abp-TenantId", "<abp-tenantid>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("cap-signature", "<cap-signature>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.header("Content-Type", "application/json")
.body("{\n \"transactionNumber\": \"<string>\",\n \"amount\": 100,\n \"channelDetails\": {\n \"cardNumber\": \"48481000XXXXXXXX\",\n \"expiryMonth\": \"01\",\n \"expiryYear\": \"99\",\n \"holderName\": \"ALEXXXXXXXX\",\n \"securityCode\": \"999\",\n \"AuthType\": 1\n },\n \"savePayment\": true,\n \"LastPayment\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Abp-TenantId"] = '<abp-tenantid>'
request["Authorization"] = '<authorization>'
request["cap-signature"] = '<cap-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionNumber\": \"<string>\",\n \"amount\": 100,\n \"channelDetails\": {\n \"cardNumber\": \"48481000XXXXXXXX\",\n \"expiryMonth\": \"01\",\n \"expiryYear\": \"99\",\n \"holderName\": \"ALEXXXXXXXX\",\n \"securityCode\": \"999\",\n \"AuthType\": 1\n },\n \"savePayment\": true,\n \"LastPayment\": true\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"type": 1,
"transactionNumber": "<string>",
"partialTransactionNumber": "<string>",
"amount": 100
}Process Payment
The payment gateway process a new payment
The following input parameters are expected to be provided by the merchant to perform pre-auth, full payment or partial payment operation.
curl --request POST \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'cap-signature: <cap-signature>' \
--data '
{
"transactionNumber": "<string>",
"amount": 100,
"channelDetails": {
"cardNumber": "48481000XXXXXXXX",
"expiryMonth": "01",
"expiryYear": "99",
"holderName": "ALEXXXXXXXX",
"securityCode": "999",
"AuthType": 1
},
"savePayment": true,
"LastPayment": true
}
'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment"
payload = {
"transactionNumber": "<string>",
"amount": 100,
"channelDetails": {
"cardNumber": "48481000XXXXXXXX",
"expiryMonth": "01",
"expiryYear": "99",
"holderName": "ALEXXXXXXXX",
"securityCode": "999",
"AuthType": 1
},
"savePayment": True,
"LastPayment": True
}
headers = {
"Abp-TenantId": "<abp-tenantid>",
"Authorization": "<authorization>",
"cap-signature": "<cap-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Abp-TenantId': '<abp-tenantid>',
Authorization: '<authorization>',
'cap-signature': '<cap-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
transactionNumber: '<string>',
amount: 100,
channelDetails: {
cardNumber: '48481000XXXXXXXX',
expiryMonth: '01',
expiryYear: '99',
holderName: 'ALEXXXXXXXX',
securityCode: '999',
AuthType: 1
},
savePayment: true,
LastPayment: true
})
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment', 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/ProcessPayment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'transactionNumber' => '<string>',
'amount' => 100,
'channelDetails' => [
'cardNumber' => '48481000XXXXXXXX',
'expiryMonth' => '01',
'expiryYear' => '99',
'holderName' => 'ALEXXXXXXXX',
'securityCode' => '999',
'AuthType' => 1
],
'savePayment' => true,
'LastPayment' => true
]),
CURLOPT_HTTPHEADER => [
"Abp-TenantId: <abp-tenantid>",
"Authorization: <authorization>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment"
payload := strings.NewReader("{\n \"transactionNumber\": \"<string>\",\n \"amount\": 100,\n \"channelDetails\": {\n \"cardNumber\": \"48481000XXXXXXXX\",\n \"expiryMonth\": \"01\",\n \"expiryYear\": \"99\",\n \"holderName\": \"ALEXXXXXXXX\",\n \"securityCode\": \"999\",\n \"AuthType\": 1\n },\n \"savePayment\": true,\n \"LastPayment\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Abp-TenantId", "<abp-tenantid>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("cap-signature", "<cap-signature>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.header("Content-Type", "application/json")
.body("{\n \"transactionNumber\": \"<string>\",\n \"amount\": 100,\n \"channelDetails\": {\n \"cardNumber\": \"48481000XXXXXXXX\",\n \"expiryMonth\": \"01\",\n \"expiryYear\": \"99\",\n \"holderName\": \"ALEXXXXXXXX\",\n \"securityCode\": \"999\",\n \"AuthType\": 1\n },\n \"savePayment\": true,\n \"LastPayment\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/ProcessPayment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Abp-TenantId"] = '<abp-tenantid>'
request["Authorization"] = '<authorization>'
request["cap-signature"] = '<cap-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionNumber\": \"<string>\",\n \"amount\": 100,\n \"channelDetails\": {\n \"cardNumber\": \"48481000XXXXXXXX\",\n \"expiryMonth\": \"01\",\n \"expiryYear\": \"99\",\n \"holderName\": \"ALEXXXXXXXX\",\n \"securityCode\": \"999\",\n \"AuthType\": 1\n },\n \"savePayment\": true,\n \"LastPayment\": true\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"type": 1,
"transactionNumber": "<string>",
"partialTransactionNumber": "<string>",
"amount": 100
}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.
Body
1 = PreAuth, 2 = FullPayment, 3 = PartialPayment, 4 = Verify
1, 2, 3, 4 Unique CAP Transaction Number
24Please take note: The Amount parameter only accepts integer units. For example, 1000 is equivalent to 10.00 for the backend.
Invalid Format: 1,000.00
100
[Optional]
Show child attributes
Show child attributes
[Conditional for Tokenize Payment] To save user info for subsequent payment
Response
Success
Payment Status: Refer on Appendix 3.1 Payment Status Code Table
0, 1, 2, 3, 4, 5, 6, 7 1 = PreAuth, 2 = FullPayment, 3 = PartialPayment, 4 = Verify
1, 2, 3, 4 Unique CAP Transaction Number
24Please take note: The Amount parameter only accepts integer units. For example, 1000 is equivalent to 10.00 for the backend.
Invalid Format: 1,000.00
100
