Callback Message Transfer
Between Payment Gateway and Partner’s Website
Request Parameters
A server-to-server callback is sent from the payment gateway to the merchant's website to confirm payments and update the payment status. This data is transmitted as an HTTP POST request to the merchant's website.
Callback Data:
data
: Base64-encoded JSON document stringsign
: Signature, generated based on the data string
Example:
{
"data": "eyJ0cmFuc2FjdGlvbl9pZCI6IjMxMTExMTExIiwicmVmZXJlbmNlIjoiMTIzNDU2Nzg5IiwiYXBpX2tleSI6ImM4NGYxYWMwLWU0ZjAtMDEzMS01Mjk4LTcwOTIxYzU3YzJhMiIsImFtb3VudCI6IjMyNy43OCIsImN1cnJlbmN5IjoiVVNEIiwic3RhdHVzIjoiMyIsInN0YXR1c19uYW1lIjoic3VjY2VzcyIsInN5c3RlbV9hbW91bnQiOiIzMjcuNzgiLCJzeXN0ZW1fY3VycmVuY3kiOiJVU0QiLCJvcGVyYXRpb25fYW1vdW50IjoiMzI3Ljc4IiwiY29tbWlzc2lvbiI6IjAuMCIsInBheW1lbnRfc3lzdGVtX3R5cGUiOiJkaXJlY3QiLCJjYXJkX251bWJlciI6IjQxMTExMSoqKioqKjExMTEiLCJjYXJkX3BhbjYiOiI0MTExMTEiLCJjYXJkX3BhbjQiOiIxMTExIiwiY2FyZGhvbGRlcl9uYW1lIjoiVGFzdHkgVGVzdCIsInByb2Nlc3NpbmdfZXJyb3JfbXNnIjoiIiwiYXV0aG9yaXphdGlvbl9jb2RlIjoiIiwicGFyYW1zIjoie1widXNlcl9pZFwiPVx1MDAzZVwidGVzdF91c2VyXCIsIFwidXNlcl9lbWFpbFwiPVx1MDAzZVwidGVzdEB0ZXN0LmNvbVwiLCBcImZsYWdfZ2V0X3VybFwiPVx1MDAzZVwiMVwifSJ9",
"sign": "68e271b78aa3aa29f1c57f1894248b76"
}
Signature check (PHP example):
hash_hmac('md5', $_POST['data'], $secret_key) === $_POST['sign'])
Where:
secret_key
- shop password
JSON Callback Parameters
Parameter | Description |
---|---|
transaction_id | A unique transaction identifier in the payment gateway system. |
reference | A unique order number in the shop system. |
api_key | Shop key (identifier). |
amount | Basic payment price. |
currency | Good’s price currency. Possible values: EUR, USD. |
status | Processing status: 0 – Transaction is created (not processed, User is redirected to finish a payment, e.g., at 3DS verification); 1 – Successful authorization (funds hold); 2 – Successful unlock of funds; 3 – Successful payment; 4 – Successful refund; 8 – Processing incomplete; 98 – Expired (transaction expired); 99 – Processing error (unsuccessful payment). |
status_name | Status description |
system_amount | Final price, which is paid by User including a payment provider commission. |
system_currency | Payment system currency. |
operation_amount | Actual transaction’s price. |
commission | Payment system commission value (currency is system_currency). |
payment_system_type | Payment system type. |
card_number | Primary Account Number (Optional, depends on connection type and acquirer). |
card_pan6 | First 6 digits of card number. |
card_pan4 | Last 4 digits of card number. |
cardholder_name | Cardholder name (Optional, depends on connection type and acquirer). |
processing_error_msg | Processing error (if the processing status is 99). |
authorization_code | Payment system authorization code (Optional). |
pay_token | Token for recurrent payment formation (Optional, depends on payment gateway settings). |
params | Merchant’s parameters. |
refund_init_type | During a refund operation, a sign is generated initiator: api => 0 - Refund via API front => 1 - Refund via website admin => 2 - Refund via back-office |
The merchant's website should respond to the callback with the OK string.
The payment gateway will resend the callback if the Merchant website doesn’t respond with the OK string.
API Reference
You can view a Reference API implementation for this method at this link
Updated 3 months ago