Notification
webhookNotification is sent in case of asynchronous flow (3D Secure confirmation by the customer) - when the transaction status has changed to it's final status, usually it's confirmation, cancellation or timeout.
The asynchronous flow can be recognized by the transaction status received in response - pending_async
.
{danger.fa-exclamation} IMPORTANT #1: In case if your API response contains
"status":-1
or responds in unrecognized format, the notification will be resent automatically within approximately 5 minutes.{danger.fa-exclamation} IMPORTANT #2: Sometimes
transaction_id
(PSP transaction identifier) is empty, this may happen in the cases when the PSP has rejected the processing attempt due to input validation or payment service unavailability.
Variable | Type | Description |
---|---|---|
amount | int(20) | Required. Processed amount in cents. Please note: for certain currencies (JPY, CLP, KRW, VND, BHD, IQD, JOD, LYD, OMR, TND) the amount is sent as-in without being converted to cents, this is important if you multiply by 100 to send the amount in cents |
currency | varchar(10) | Required. Processed currency |
merchant_id | varchar(50) | Required. Merchant API client account identifier |
order_id | varchar(50) | Required. Transaction identifier in your system |
trace_id | int(11) | Required. Transaction identifier in |
transaction_id | varchar(50) | Optional. Transaction identifier in PSP |
payment_processor | varchar(50) | Required. Payment processor |
gateway | varchar(32) | Required. Gateway doing the processing |
transaction_status | varchar(16) | Required. - pending - processing initiated, final response expected from PSP - approved - processing was successful - declined - processing failed - cancelled - processing cancelled by the merchant or client - requested - merchant action expected (approval) |
error_code | varchar(32) | Optional. Error code for rejected transactions |
error_details | varchar(256) | Optional. Error description for rejected transactions |
timestamp | int(11) | Required. Request time. URL will be active during 1 min after this time |
version | varchar(3) | Required. API version |
signature | varchar(96) | Required. sha384 HASH code of response (same algorithm as request signature) |
Variable | Type | Description |
---|---|---|
status | int | Required. - 0 if the request was successful - Negative integer if internal server/network error occurs - Positive integer if application/logical error occurs |
description | varchar(256) | Required. Accurate description of the result. Return the actual error for any exception as it helps to diagnose issues in production |
timestamp | int(11) | Required. Request time. URL will be active during 1 min after this time |
version | varchar(3) | Required. API version |
signature | varchar(96) | Required. sha384 HASH code of response (same algorithm as request signature) |
For example below: Merchant Secret = "MerchantSecretKey"
curl -X POST \ https://api.merchant.com/v1/deposits/tx-1560610955 \
-H 'Content-Type: application/json' \
-d '{
"amount": 100,
"currency": "USD",
"description": "Ok",
"error_code": "0",
"error_details": "Transaction status: approved",
"gateway": "s-pTSZyK23E1Ee5KZpcNbX_aFl0HuhQ0",
"merchant_id": "Test-Integration-Merchant",
"order_id": "test-1560610955",
"payment_processor": "TestPP",
"timestamp": 1579218094,
"trace_id": 1000000680,
"transaction_id": "15607165967613",
"transaction_status": "approved",
"version": "1.2",
"signature": "4b7471daa8f9caacec4baa6c645a73ff0138378ddaa5025c5ccb12eb01ec3996202ce2f5e1e76d7a6a0140bffe3d5962"
}'
{
"description":"Notification registered successfully",
"status":0,
"timestamp":1560644992,
"version":"1.2",
"signature":"8c9e2bc711f64671fec91dee9a948388496a1476ffc8c90de6d581ed3189f086432428fb7455bf074c0d8ce4c6949432"
}
{
"description": "Notification handling failed",
"status": 1,
"timestamp": 1579217988,
"version": "1.2",
"signature": "6ba6e5a9072d18e3e3ed11ac1447e9362a5c88c288c3220fc0ad174ee7049428d7c57df4114b122490c3bf1f1a32332d"
}
Please refer to How to Build Signature for details on signing the request.
You are currently viewing version 3.4 Latest version here