Webhook Notification Service
Webhook Notification Service
Transfermate will send payment status notifications when the Payment status has been
changed.
The payload will be sent via HTTP POST method and content type:
application/x-www-form-urlencoded to an endpoint specified by the clients in the
initial account setup.
The endpoint must respond with an HTTP Status Code: 200 OK, otherwise the Webhook
Service will attempt to resend the message up to 5 times.
Prerequisites:
- A Default Webhook URL to which Transfermate Education will send the notifications. This URL can be changed per each payment request if the webhook_url is provided in the MakeAPayment/InvoicePayment request.
- Order ID – The Order ID has to be provided per each payment submitted via the MakeAPayment/InvoicePayment request, otherwise the notifications will not be triggered.
- A Secret Key known by both parties – This key will be generated for your sandbox
and production environment by Transfermate and sent to you via secure communication
channel.
If you didn’t receive you Secret Key yet, please contact Transfermate.
How to verify the integrity and the authenticity of a webhook message:
- Remove all parameters which contains empty values from the message.
- Remove hmac_signature parameter from the message.
- Sort the remaining parameters lexicographically in ascending order. (Based on the key)
- Separate the remaining parameter’s values using colons (:)
- Apply the HMAC-SHA256 algorithm to the string produced in Step 4.
- Compare the computed HMAC with the hmac_signature value. TME always uses lower-case hex characters.
Example:
Message Payload:
param_4=value_4¶m_3=value_3¶m2=¶m_1=0&hmac_signature=f2b5eb73adc34c1d46d112803c8cc7a8e1794fc2234755b9f89e8ad8cdedf068
Secret Key: !TestSecret123!
Plain String (after step 4): 0:value_3:value_4
HMAC-SHA256 [Plain Text, Secret Key] =
f2b5eb73adc34c1d46d112803c8cc7a8e1794fc2234755b9f89e8ad8cdedf068
Webhook Notification Parameters
Context TRANSACTION: In addition to the above statuses, TransferMate can also forward 3rd party statuses (Credit Card & APM’s statuses) when the payment flow is Redirect. Please note that the third-party statuses will be sent to your endpoint with a context of 3RDPTY so you can differentiate between a TransferMate transaction status and a third-party status.
Parameter Name | Value | Data Type | Max Char. Length / Range | Description |
---|---|---|---|---|
order_id | [order_id] | string | 128 | The Order ID that was set at the time of the registration. |
response_id | [id] | integer | - | The Response ID appointed by TM Webhoook Notification service. |
response_context | TRANSACTION | string | 11 | The status context. |
event_type | status_update | string | 13 | The event which triggered the notification. |
payment_method | [payment method abbreviation] | sting | 2 - 3 | An abbreviation of the Payment Method that was used when the transaction was registered. Possible values: BT - Bank Transfer CARD - Credit / Debit Card APM - Alternative Payment Method |
transaction_id | [transaction_id] | integer | - | The Transaction ID appointed by TM system when the payment was registered. |
ref_number | [reference number] | string | 1 - 100 | The Payment Reference Number. |
transaction_status_id | [id] | integer | - | The current transaction status ID Possible Values: 0 - Registered (Payment Logged) 1 - Pending (Funds Received) 2 - Paid (Funds paid out) 3 - Inactive (Payment Canceled) |
transaction_status | [status name] | string | 4 - 20 | The current transaction status name. Possible Values: Registered Pending Paid Inactive |
payable_amount | [amount] | float | - | The amount which TM will transfer to the client's bank account. |
payable_currency | [currency code] | string | 3 | The payable amount currency. ISO 4217 currency code |
paid_amount | [amount] | float | - | The actual amount transferred to the client's bank account. Only available when the transaction status is "Paid" otherwise fixed to 0. |
paid_currency | [currency code] | string | 3 | The paid amount currency. ISO 4217 currency code |
registered_date | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The Registered status date and time in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
pending_date | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The Pending status date and time in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
paid_date | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The Paid status date and time in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
inactive_date | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The Inactive status date and time in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
status_updated_at | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The exact date and time at which the current transaction status was changed in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
response_sent_at | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The date and time at which the response was sent in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
hmac_signature | [hash] | string | 64 | Signature for verifyin the data integrity and the authenticity of the message. HMAC-SHA256 |
Parameter Name | Value | Data Type | Max Char. Length / Range | Description |
---|---|---|---|---|
cc_status | [status name] | string | 4 - 20 | Deprecated as of API v4.2. Replaced by: third_party_status |
cc_status_id | [id] | integer | - | Deprecated as of API v4.2. Replaced by: third_party_status_id |
cc_status_updated_at | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | Deprecated as of API v4.2. Replaced by: third_party_status_updated_at |
third_party_status | [status name] | string | 4 - 20 | The name of the status returned by the third party PSP (Payment Service Provider) Possible Values: Successful Cancelled |
third_party_status_id | [id] | integer | - | The status ID returned by the third party PSP. Possible Values: 2- Successful 3 - Cancelled |
third_party_status_updated_at | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The date and time at which the PSP status was updated. ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
order_id | [order_id] | string | 128 | The Order ID that was set at the time of the registration. |
response_id | [id] | integer | - | The Response ID appointed by TM Webhoook Notification service. |
response_context | 3RDPTY | string | 11 | The status context. |
event_type | status_update | string | 13 | The event which triggered the notification. |
payment_method | [payment method abbreviation] | sting | 2 - 3 | An abbreviation of the Payment Method that was used when the transaction was registered. Possible values: BT - Bank Transfer CARD - Credit / Debit Card APM - Alternative Payment Method |
transaction_id | [transaction_id] | integer | - | The Transaction ID appointed by TM system when the payment was registered. |
ref_number | [reference number] | string | 1 - 100 | The Payment Reference Number. |
transaction_status_id | [id] | integer | - | The current transaction status ID Possible Values: 0 - Registered 1 - Pending (Funds Received) 2 - Paid 3 - Inactive |
transaction_status | [status name] | string | 4 - 20 | The current transaction status name. Possible Values: Registered Pending Paid Inactive |
payable_amount | [amount] | float | - | The amount which TM will transfer to the client's bank account. |
payable_currency | [currency code] | string | 3 | The payable amount currency. ISO 4217 currency code |
paid_amount | [amount] | float | - | The actual amount transferred to the client's bank account. Only available when the transaction status is "Paid" otherwise fixed to 0. |
paid_currency | [currency code] | string | 3 | The paid amount currency. ISO 4217 currency code |
registered_date | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The Registered status date and time in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
pending_date | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The Pending status date and time in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
paid_date | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The Paid status date and time in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
inactive_date | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The Inactive status date and time in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
status_updated_at | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The exact date and time at which the current transaction status was changed in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
response_sent_at | [YYYY-MM-DDThh:mm:ss+TZ] | string | 25 | The date and time at which the response was sent in UTC ISO 8601 format, exmple: 2021-06-01T15:10:40+00:00 (1st of June, 2021 @ 3:10pm UTC) |
hmac_signature | [hash] | string | 64 | Signature for verifyin the data integrity and the authenticity of the message. HMAC-SHA256 |