# Callback Service
TripLink supports callback to customer interfaces in multiple business scenarios. Customers can implement their own business logic in the callback interface.
The callback is based on the HTTP/HTTPS protocol with the POST method, and all request bodies are in JSON
format with all characters encoded in UTF-8
.
The callback process is considered Failed if any of the following situations occur: request failure, request timeout, or response status code other than 2XX
.
The callback is divided into Synchronous and Asynchronous types. Synchronous requests must respond in a timely manner and have no retry mechanism, while asynchronous requests do not need to respond in a timely manner and have a retry mechanism.
# Callback List
Name | Type | Response Time | Retry Count | Retry Interval |
---|---|---|---|---|
Authorization Decision Callback | Synchronous | 3s | N/A | N/A |
Authorization Result Notification | Asynchronous | 9s | 20 | N × 2min |
# Authorization Decision Callback
Before approving an authorization request, TripLink will call back to this customer interface, allowing the customer to implement their own risk control and authorization decisions.
If the callback fails, TripLink will degrade to using default decision results for the customer, as outlined in the Callback Parameters.
If the callback fails continuously for 10
times, the system will no longer request the customer interface and will directly degrade, requiring the customer to manually re-enable it.
# Request Body
Name | Type | Description | Note |
---|---|---|---|
bizContent | String | Actual message. | Needs to be deserialized through JSON .See AuthorizationDecision for details. |
sign | String | Signature of the original bizContent . | Verify the signature with the RSA public key of the API. See Preparation for details. |
AuthorizationDecision
Name | Type | Description | Note |
---|---|---|---|
authId | String | ID | Unique globally. |
transactionId | String | Transaction ID | The transactionId of the reversal transaction is same as the corresponding authorized transaction. |
cardLogId | String | Card ID | TripLink-specific card identifier. |
localDate | String | Transaction Local date | In local time zone, formatted as yyyyMMdd . |
localTime | Sreing | Transaction Local time | In local time zone, formatted as HHmmss . |
occurTime | String | Transaction Occurrence time | In card time zone, formatted as yyyy-MM-dd HH:mm:ss . |
messageType | String | Transaction type | Enum value, 4 digits, see **authorization type ** dropdown list for details. |
messageTypeDesc | String | Transaction type description | See **authorization type ** dropdown list for details. |
transCurrency | String | Transaction currency | ISO 4217 currency code, consisting of 3 digits. |
transCurrencyAmt | String | Transaction amount | Decimal number, corresponding to the transaction currency. |
localCurrency | String | Card currency | ISO 4217 currency code, consisting of 3 digits. |
localCurrencyAmt | String | Card transaction amount | Decimal number, corresponding to the card currency. For refund transactions , the card transaction amount is 0. |
cardAvailableBalance | String | Card available balance | Decimal number, corresponding to the card currency. |
merchantId | String | Merchant ID | |
merchantName | String | Merchant name | |
merchantCategoryCode | String | Merchant MCC | ISO 18245 merchant category code, a 4-digit number. |
merchantCountry | String | Merchant country | (unstandardized) |
isoMerchantCountryCode | String | Merchant country | ISO 3166 country code, 3 letters.(maybe empty) |
merchantCity | String | Merchant city | |
acquirerId | String | Acquirer ID | |
useRef1Txt | String | User-defined field 1 | |
useRef2Txt | String | User-defined field 2 | |
useRef3Txt | String | User-defined field 3 | |
useRef4Txt | String | User-defined field 4 | |
useRef5Txt | String | User-defined field 5 |
authorization type
messageType | messageTypeDesc |
---|---|
6810 | Authorization Approval |
6510 | Auth Refund Approval |
6820 | Authorization Query |
request body sample
{
"bizContent": "{\"authId\":\"311503c7-0466-4d01-a500-551c40b91cf6\",\"cardLogId\":\"51a50ffbbd0437ff10fffb93d1620e213441a30a3fa16164d57d98cade066ba0\",\"localTime\":\"025900\",\"localDate\":\"20220623\",\"occurTime\":\"2022-06-23 10:59:00\",\"merchantCategoryCode\":\"0011\",\"merchantName\":\"\",\"merchantCountry\":\"\",\"state\":\"\",\"merchantCity\":\"\",\"messageType\":\"6810\",\"messageTypeDesc\":\"Authorization Approval\",\"acquirerId\":\"213457\",\"merchantId\":\"080000100003\",\"transCurrency\":\"840\",\"transCurrencyAmt\":\"55.66\",\"localCurrency\":\"840\",\"localCurrencyAmt\":\"55.66\",\"useRef1Txt\":\"anything\",\"useRef2Txt\":\"\",\"useRef3Txt\":\"\",\"useRef4Txt\":\"\",\"useRef5Txt\":\"\",\"cardAvailableBalance\":\"955.57\"}",
"sign": "k2/HGZOYIFnYI+WZwW1R1YYryOmYd6ds5rAoioKstfslmeBJvVo1KkPOr5zMt86uZ9XFqJV1vDvavreClLnTBbALvtuF44JLZQsGngMe4MvKcWM2oJX4cCcqptqXkz7XpgCuSST0HeTJ8EHuAIQuF+W87/u86pcUMCBjDus1NuNf5MbS/y/eMW3qCwA5s6q1sp7AR2zmXna+eI+n+JEc9tylxo14Kr17pLGX0NRx+iwuw4H/tnazGDN49vW3kbFzRhj/jxN4vB2rvWIdrL1/pdhI2wFRt5b8AfIwhv5ae0GxP3AuaRCNU3LL+YvkvdIA2o+7RctkGhlbe4upzYARog=="
}
2
3
4
# Response Body
Clients must identify the authorization decision result through the code
field in the response body.
If the value of the code
field is 0
, it means authorization is granted. If the value is not 0
, it means authorization is denied.
Name | Type | Required | Description | Note |
---|---|---|---|---|
code | String | Y | Result code | 0 : Authorization granted; non-0 : Authorization denied. |
msg | String | N | Result code description |
response body sample
{
"code": "0",
"msg": "success"
}
2
3
4
# Authorization Result Notification
TripLink will send the authorization results to this customer interface asynchronously after the authorization is completed.
If the notification fails, it will be Retried. After the maximum number of retries is reached, this notification will no longer be sent, but other notifications will not be affected.
# Request Body
Name | Type | Description | Note |
---|---|---|---|
noticeType | String | Notification type | auth . |
bizContent | String | Actual message | It needs to be deserialized through JSON .See AuthorizationNotification for details. |
sign | String | Signature | Verify the signature with the RSA public key of the API. See Preparation for details. |
AuthorizationNotification
Name | Type | Description | Note |
---|---|---|---|
authId | String | ID | Unique globally. |
transactionId | String | Transaction ID | The transactionId of the reversal transaction is same as the corresponding authorized transaction. |
cardLogId | String | Card ID | TripLink-specific card identifier. |
occurTime | String | Transaction Occurrence time | In card time zone, formatted as yyyy-MM-dd HH:mm:ss . |
messageType | String | Transaction type | Enum value, 4 digits, see authorization type dropdown list for details. |
messageTypeDesc | String | Transaction type description | See authorization type dropdown list for details. |
reversalType | String | Reversal Type | Only valid when the authorization type is 6930 or 6940 .0 : System reversal; 1 : Non-system reversal. |
respCode | String | Transaction Response Code | Enumerated value, 4 digits.See response code dropdown for details. |
respCodeDesc | String | Transaction Response Code Description | See response code dropdown for details. |
approveCode | String | Authorization Code | Random 6 digits. |
transCurrency | String | Transaction currency | ISO 4217 currency code, consisting of 3 digits. |
transCurrencyAmt | String | Transaction amount | Decimal number, corresponding to the transaction currency. |
localCurrency | String | Card currency | ISO 4217 currency code, consisting of 3 digits. |
localCurrencyAmt | String | Card transaction amount | Decimal number, corresponding to the card currency. For refund transactions , the card transaction amount is 0. |
cardAvailableBalance | String | Card available balance | Decimal number, corresponding to the card currency. |
merchantId | String | Merchant ID | |
merchantName | String | Merchant name | |
merchantCategoryCode | String | Merchant MCC | ISO 18245 merchant category code, a 4-digit number. |
merchantCountry | String | Merchant country | (unstandardized) |
isoMerchantCountryCode | String | Merchant country | ISO 3166 country code, 3 letters.(maybe empty) |
merchantCity | String | Merchant city | |
acquirerId | String | Acquirer ID | |
crossBorderType | String | Cross-border type | 0 : Domestic; 1 : Overseas. |
useRef1Txt | String | User-defined field 1 | |
useRef2Txt | String | User-defined field 2 | |
useRef3Txt | String | User-defined field 3 | |
useRef4Txt | String | User-defined field 4 | |
useRef5Txt | String | User-defined field 5 |
authorization type
messageType | messageTypeDesc |
---|---|
6810 | Authorization Approval |
6890 | Authorization Decline |
6510 | Auth Refund Approval |
6590 | Auth Refund Decline |
6930 | Authorization Reversal Approval |
6940 | Auth Refund Reversal Approval |
6820 | Authorization Query |
response code(6810 Authorization Approval)
respCode | respCodeDesc |
---|---|
0000 | Authorization Approval |
response code(6890 Authorization Decline)
respCode | respCodeDesc |
---|---|
1002 | High Risk Transaction |
1003 | Invalid Account |
1101 | Abnormal Customer Status |
1102 | Card canceled |
1103 | Authorization Amount Error |
1104 | VAN Amount Limit Error |
1105 | Invalid Expiry Date |
1106 | Transaction Count Over Limit |
1107 | Invalid CVV2 |
1108 | VAN Amount Limit Error |
1110 | Trans Currency Not Allowed |
1111 | MCC Error |
1112 | VAN credit limit greater than max Limit |
1113 | VAN credit limit less than min Limit |
1114 | Transaction Date before card activeDate |
1115 | Transaction Date after card inactiveDate |
1116 | Auth Amount greater than available VAN credit limit |
1117 | Auth Amount greater than available account credit limit |
1118 | Limited usage with abnormal card status |
1201 | Authorization already in process, please wait until the last authorization completed |
1203 | Not support 3ds |
2012 | Cardholder cancels identity verification |
2014 | Cardholder fails to complete identity verification within the specified time |
2019 | Cardholder fails to complete identity verification within the specified number of attempts |
2022 | Merchant requests invalid information |
2222 | Authorization decision reject |
2299 | Authorization decision downgrade reject |
3004 | Abnormal Card Scheme Network |
9000 | Unknow Error |
response code(6510 Auth Refund Approval)
respCode | respCodeDesc |
---|---|
0000 | Authorization Approval |
response code(6590 Auth Refund Decline)
respCode | respCodeDesc |
---|---|
1002 | High Risk Transaction |
1003 | Invalid Account |
1101 | Abnormal Customer Status |
1107 | Invalid CVV2 |
1110 | Trans Currency Not Allowed |
1111 | MCC Error |
response code(6930 Authorization Reversal Approval)
respCode | respCodeDesc |
---|---|
0000 | Authorization Approval |
1002 | High Risk Transaction |
1003 | Invalid Account |
1101 | Abnormal Customer Status |
1105 | Invalid Expiry Date |
2001 | Original Transaction Unmatch |
2002 | Original Transaction Unmatch |
response code(6940 Auth Refund Reversal Approval)
respCode | respCodeDesc |
---|---|
0000 | Authorization Approval |
1002 | High Risk Transaction |
1003 | Invalid Account |
2001 | Original Transaction Unmatch |
2002 | Original Transaction Unmatch |
response code(6820 Authorization Query)
respCode | respCodeDesc |
---|---|
0000 | Authorization Approval |
1002 | High Risk Transaction |
1003 | Invalid Account |
1102 | Card canceled |
1118 | Limited usage with abnormal card status |
request body sample
{
"noticeType": "auth",
"bizContent": "{\"customerId\":\"CSR47184A93E35E4\",\"authId\":\"7f1e58b6-e1da-4647-9054-0c1e5b85df4a\",\"cardLogId\":\"51a50ffbbd0437ff10fffb93d1620e213441a30a3fa16164d57d98cade066ba0\",\"cardAvailableBalance\":\"955.57\",\"occurTime\":\"2022-06-23 14:52:35\",\"transCurrency\":\"840\",\"transCurrencyAmt\":\"44.55\",\"localCurrency\":\"840\",\"localCurrencyAmt\":\"44.55\",\"respCode\":\"0000\",\"respCodeDesc\":\"Authorization Approval\",\"approveCode\":\"164913\",\"messageType\":\"6810\",\"messageTypeDesc\":\"Authorization Approval\",\"useRef1Txt\":\"anything\",\"merchantName\":\"\",\"merchantCategoryCode\":\"0011\",\"merchantId\":\"080000100003\",\"merchantCountry\":\"\",\"merchantCity\":\"\",\"merchantPostcode\":\"\",\"acquirerId\":\"213457\",\"state\":\"\"}",
"sign": "raqtzxjjWGyjrPDkn3aR+N+ZU6kpyiLeJNeFzQXmfoqsomkxsccg783FraLPWBrPgn0nhjtuVQLIWMply1chS7g1jgdGaFiGSXCwgL+XIVX0n2J1Z8YtDBEqeJLbRcmWiGAavQk8JSjBtDigJIopjL5mAT9+X5vrf4a6YxpAoky7DemuClKNb50OuH15ADICWednwQZsI0wJ8WTpZNb4f9jrMGdlztXvj/Nf7Gk2Uwx1v/morWEDe1BFD8FWFUsmKwdBxYS8iMT3f5YiAWzYt7VItOl6ymlNSdZmGazXYQ2MPScunPQXdSf2fQ6NM8NVlz7or5w5cj7aiZAgzpHUrQ=="
}
2
3
4
5
# Response Body
The customer must identify the notification receiving result through the code
field in the response body
If the value of the code
field is 0
, it means receiving success. If the value is not 0
, it means receiving failure.
Name | Type | Required | Description | Note |
---|---|---|---|---|
code | String | Y | Result code | 0 : receiving success; non-0 : receiving failure. |
msg | String | N | Result code description |
response body sample
{
"code": "0",
"msg": "success"
}
2
3
4
# Notification Query and Resend
Customers can query all result notifications in the merchant system (Transaction Management - Notification Query) and support resend (single/batch).
# Signature Verification SDK example
Java SDK
public void rsaVerify() {
String bizContent = "{\"customerId\":\"CSR47184A93E35E4\",\"authId\":\"07c93b59-23b2-4aa0-8cff-55a026b02329\",\"cardLogId\":\"42f4d634e184351e6b035eb58ea4892620ce2eaa5347fcd206646fe24ffae905\",\"cardAvailableBalance\":\"966.68\",\"occurTime\":\"2022-06-23 14:06:36\",\"transCurrency\":\"840\",\"transCurrencyAmt\":\"33.44\",\"localCurrency\":\"840\",\"localCurrencyAmt\":\"33.44\",\"respCode\":\"0000\",\"respCodeDesc\":\"Authorization Approval\",\"approveCode\":\"057685\",\"messageType\":\"6810\",\"messageTypeDesc\":\"Authorization Approval\",\"useRef1Txt\":\"anything\",\"merchantName\":\"\",\"merchantCategoryCode\":\"0011\",\"merchantId\":\"080000100003\",\"merchantCountry\":\"\",\"merchantCity\":\"\",\"merchantPostcode\":\"\",\"acquirerId\":\"213457\",\"state\":\"\"}";
String sign = "tNNvnZBcvb7IR4qkPM9j+5/Hun1qj7MlnmcqeLKAO0Q8R4EB2OYLPTf/q50Rlq/gJf5x93OWSbSg9QqhktgZM0abZIKoAnidzNdGoLdINPSfdhkB/bkrpC8LctqEsLXwU2Kn3LHK3qAgDDJAf5AGmZmzn9SXnO2tvdVMvLbSj8vACpMm12g/zQyUPJ5NlCI7Hf5DXQeQy/Hd0hSyAFuhHO/V++a4TdEDZ3wqh9a1JVs0cy7t63vI0IT6r6l6hjiInoahW7H/zVZ1jcdhxNc1hGJRaM6GvlwsSFH9+gqIYv/DIPxIqTP2Bk6IDc0JaPBx/ClH7mefkunRerzCXFKC+g==";
boolean verified = CipherUtils.rsaVerify(TRIPLINK_PUBLIC_KEY, bizContent, sign);
Assert.assertTrue(verified);
}
2
3
4
5
6
7
8
PHP SDK
public function testRsaVerify(): void {
$bizContent = '{"customerId":"CSR47184A93E35E4","authId":"07c93b59-23b2-4aa0-8cff-55a026b02329","cardLogId":"42f4d634e184351e6b035eb58ea4892620ce2eaa5347fcd206646fe24ffae905","cardAvailableBalance":"966.68","occurTime":"2022-06-23 14:06:36","transCurrency":"840","transCurrencyAmt":"33.44","localCurrency":"840","localCurrencyAmt":"33.44","respCode":"0000","respCodeDesc":"Authorization Approval","approveCode":"057685","messageType":"6810","messageTypeDesc":"Authorization Approval","useRef1Txt":"anything","merchantName":"","merchantCategoryCode":"0011","merchantId":"080000100003","merchantCountry":"","merchantCity":"","merchantPostcode":"","acquirerId":"213457","state":""}';
$sign = 'tNNvnZBcvb7IR4qkPM9j+5/Hun1qj7MlnmcqeLKAO0Q8R4EB2OYLPTf/q50Rlq/gJf5x93OWSbSg9QqhktgZM0abZIKoAnidzNdGoLdINPSfdhkB/bkrpC8LctqEsLXwU2Kn3LHK3qAgDDJAf5AGmZmzn9SXnO2tvdVMvLbSj8vACpMm12g/zQyUPJ5NlCI7Hf5DXQeQy/Hd0hSyAFuhHO/V++a4TdEDZ3wqh9a1JVs0cy7t63vI0IT6r6l6hjiInoahW7H/zVZ1jcdhxNc1hGJRaM6GvlwsSFH9+gqIYv/DIPxIqTP2Bk6IDc0JaPBx/ClH7mefkunRerzCXFKC+g==';
$verified = CipherUtils::rsaVerify(TRIPLINK_PUBLIC_KEY, $bizContent, $sign);
$this->assertTrue($verified);
}
2
3
4
5
6
7
8
TRIPLINK_PUBLIC_KEY
:TripLink RSA public key.