Check Saved Payment
curl --request POST \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/CheckSavedPayment \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json-patch+json' \
--header 'cap-signature: <cap-signature>' \
--data '
{
"uniqueAccountId": "<string>",
"channelId": 123,
"tenantId": 123,
"timestamp": 1621851652617
}
'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/CheckSavedPayment"
payload = {
"uniqueAccountId": "<string>",
"channelId": 123,
"tenantId": 123,
"timestamp": 1621851652617
}
headers = {
"Abp-TenantId": "<abp-tenantid>",
"Authorization": "<authorization>",
"cap-signature": "<cap-signature>",
"Content-Type": "application/json-patch+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-patch+json'
},
body: JSON.stringify({
uniqueAccountId: '<string>',
channelId: 123,
tenantId: 123,
timestamp: 1621851652617
})
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/CheckSavedPayment', 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/CheckSavedPayment",
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([
'uniqueAccountId' => '<string>',
'channelId' => 123,
'tenantId' => 123,
'timestamp' => 1621851652617
]),
CURLOPT_HTTPHEADER => [
"Abp-TenantId: <abp-tenantid>",
"Authorization: <authorization>",
"Content-Type: application/json-patch+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/CheckSavedPayment"
payload := strings.NewReader("{\n \"uniqueAccountId\": \"<string>\",\n \"channelId\": 123,\n \"tenantId\": 123,\n \"timestamp\": 1621851652617\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-patch+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/CheckSavedPayment")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"uniqueAccountId\": \"<string>\",\n \"channelId\": 123,\n \"tenantId\": 123,\n \"timestamp\": 1621851652617\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/CheckSavedPayment")
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-patch+json'
request.body = "{\n \"uniqueAccountId\": \"<string>\",\n \"channelId\": 123,\n \"tenantId\": 123,\n \"timestamp\": 1621851652617\n}"
response = http.request(request)
puts response.read_body{
"isSavedPayment": true,
"maskedAccountNumber": "string"
}Saved Payment APIs
Check Saved Payment
Payment gateway check existing saved payment status. (Only for TNG)
POST
/
api
/
services
/
app
/
PaymentGateway
/
CheckSavedPayment
Check Saved Payment
curl --request POST \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/CheckSavedPayment \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json-patch+json' \
--header 'cap-signature: <cap-signature>' \
--data '
{
"uniqueAccountId": "<string>",
"channelId": 123,
"tenantId": 123,
"timestamp": 1621851652617
}
'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/CheckSavedPayment"
payload = {
"uniqueAccountId": "<string>",
"channelId": 123,
"tenantId": 123,
"timestamp": 1621851652617
}
headers = {
"Abp-TenantId": "<abp-tenantid>",
"Authorization": "<authorization>",
"cap-signature": "<cap-signature>",
"Content-Type": "application/json-patch+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-patch+json'
},
body: JSON.stringify({
uniqueAccountId: '<string>',
channelId: 123,
tenantId: 123,
timestamp: 1621851652617
})
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/CheckSavedPayment', 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/CheckSavedPayment",
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([
'uniqueAccountId' => '<string>',
'channelId' => 123,
'tenantId' => 123,
'timestamp' => 1621851652617
]),
CURLOPT_HTTPHEADER => [
"Abp-TenantId: <abp-tenantid>",
"Authorization: <authorization>",
"Content-Type: application/json-patch+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/CheckSavedPayment"
payload := strings.NewReader("{\n \"uniqueAccountId\": \"<string>\",\n \"channelId\": 123,\n \"tenantId\": 123,\n \"timestamp\": 1621851652617\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-patch+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/CheckSavedPayment")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"uniqueAccountId\": \"<string>\",\n \"channelId\": 123,\n \"tenantId\": 123,\n \"timestamp\": 1621851652617\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/CheckSavedPayment")
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-patch+json'
request.body = "{\n \"uniqueAccountId\": \"<string>\",\n \"channelId\": 123,\n \"tenantId\": 123,\n \"timestamp\": 1621851652617\n}"
response = http.request(request)
puts response.read_body{
"isSavedPayment": true,
"maskedAccountNumber": "string"
}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
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
Transaction Username
An identifier that represents a CommercePay payment channel. Refer to the id from the response of the Get Channel List.
Your unique Merchant ID assigned by CommercePay.
Numeric timestamp in milliseconds representing request validation freshness, generated via new Date().getTime(). Example: 1621851652617.
Example:
1621851652617
