Refund callback
After requesting a refund, the AppotaPay system calls back the results to the partner's system
Note
- Using the
signature
parameter to check the integrity of the received data, the partner creates a signature from the data received by AppotaPay and then compares it with thesignature
parameter sent by AppotaPay.
Web callback
AppotaPay will send the results via the API URL of the partner sending AppotaPay for configuration, the partner server checks the data integrity through the signature
parameter then updates the status of refund.
Header
{
"Content-Type": "applicaton/json"
}
Request params
Method: POST
Param | Type | Description |
---|---|---|
data | String | Transaction information is encode with base64encode & json_encode format |
signature | String | Signature to check data signature = |
time | String | Response time |
Decode
- Partners use the
Base64Decode
function to decode data in string form. - Use the
JSON_Decode
function to decode the data a second time in json form.
Tham số | Yêu cầu | Kiểu dữ liệu | Mô tả |
---|---|---|---|
event | Required | String | Event: - refund.succeeded: Refund transaction successful - refund.failed: Refund transaction failed |
data | Required | Object | Data |
data.refundId | Required | String | Refund transaction code on AppotaPay's side |
data.attemptId | Required | String | Identifier for the corresponding successful payment attempt of cycle to be refunded. It's returned in cycle callback |
data.refundRefId | Required | String | Partner's refund transaction reference code |
data.amount | Required | Integer | The refunded amount |
data.currency | Required | String | Currency unit |
data.reason | Required | String | Reason for refund - FRAUDULENT: Fraudulent - DUPLICATE: Duplicate - REQUESTED_BY_CUSTOMER: Requested by customer - CANCELLATION: Cancellation - OTHER: Others |
data.status | Required | String | Refund status |
data.createdAt | Required | String | Transaction execution time (ISO 8601) |
data.updatedAt | Required | String | Transaction update time (ISO 8601) |
Response format
- The partner needs to respond to AppotaPay to confirm that they have received the result
- The response is considered successful when HTTP code = 200