curl --request POST \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RevokeTokenize \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json-patch+json' \
--header 'cap-signature: <cap-signature>' \
--data '
{
"username": "username",
"channelId": 123,
"timestamp": 1621851652617,
"tenantId": 123
}
'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RevokeTokenize"
payload = {
"username": "username",
"channelId": 123,
"timestamp": 1621851652617,
"tenantId": 123
}
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({username: 'username', channelId: 123, timestamp: 1621851652617, tenantId: 123})
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RevokeTokenize', 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/RevokeTokenize",
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([
'username' => 'username',
'channelId' => 123,
'timestamp' => 1621851652617,
'tenantId' => 123
]),
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/RevokeTokenize"
payload := strings.NewReader("{\n \"username\": \"username\",\n \"channelId\": 123,\n \"timestamp\": 1621851652617,\n \"tenantId\": 123\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/RevokeTokenize")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"username\": \"username\",\n \"channelId\": 123,\n \"timestamp\": 1621851652617,\n \"tenantId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RevokeTokenize")
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 \"username\": \"username\",\n \"channelId\": 123,\n \"timestamp\": 1621851652617,\n \"tenantId\": 123\n}"
response = http.request(request)
puts response.read_bodyRevoke Saved Payment
Revoke a customer’s saved payment method in Payment Gateway
Allow merchants to permanently remove a customer’s previously saved (tokenized) payment details for a given channel. Once revoked, the saved payment method can no longer be used for future payments — the customer must save their payment method again (via the Add Saved Payment Endpoint) if they wish to pay this way again.
- Merchants shall pass their customer’s Unique Id to the “username” parameter — the same Unique Id originally supplied to
customer.usernamewhen the payment method was saved.- Channel Id may refer to the Get Channel List.
- Only channels/providers that support saved payments can be revoked through this endpoint. If the channel does not support it, or no saved payment is found for the given username on that channel, the request will fail.
- This endpoint returns no response body on success (HTTP 200, empty). Treat the absence of an error as confirmation the saved payment method was revoked.
curl --request POST \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RevokeTokenize \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json-patch+json' \
--header 'cap-signature: <cap-signature>' \
--data '
{
"username": "username",
"channelId": 123,
"timestamp": 1621851652617,
"tenantId": 123
}
'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RevokeTokenize"
payload = {
"username": "username",
"channelId": 123,
"timestamp": 1621851652617,
"tenantId": 123
}
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({username: 'username', channelId: 123, timestamp: 1621851652617, tenantId: 123})
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RevokeTokenize', 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/RevokeTokenize",
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([
'username' => 'username',
'channelId' => 123,
'timestamp' => 1621851652617,
'tenantId' => 123
]),
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/RevokeTokenize"
payload := strings.NewReader("{\n \"username\": \"username\",\n \"channelId\": 123,\n \"timestamp\": 1621851652617,\n \"tenantId\": 123\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/RevokeTokenize")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"username\": \"username\",\n \"channelId\": 123,\n \"timestamp\": 1621851652617,\n \"tenantId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RevokeTokenize")
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 \"username\": \"username\",\n \"channelId\": 123,\n \"timestamp\": 1621851652617,\n \"tenantId\": 123\n}"
response = http.request(request)
puts response.read_bodyHeaders
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
Customer's unique ID whose saved payment method should be revoked. Same value originally passed to customer.username when the payment method was saved.
"username"
An identifier that represents a CommercePay payments channel. Refer id on response end points Get Channel List.
new Date().getTime()
1621851652617
Fill in provided Tenant Id.
Response
Success
