Refund
When the Refund button is clicked from the back office (located on the payment page), we will send the transaction’s charge key to your app.
This charge_key value is the same one we received from your app when the initial transaction occurred, so you know the exact transaction ID that needs refunding.
POST /refund body request:
{
amount: "150.00",
charge_key: "f19a69904a5c11efb6f81d470603b3b1",
currency: "USD"
}
Expected response when the refund process completes on your payment gateway:
{
success: true
}
Partial refunds
Refunds can be partial and not necessarilly fully cover the original payment request amount. For instance, it's possible that a business is refunding $50 out of a total payment of $150, thus you may want to have some logic in place that checks the transaction's original amount (baed on the transaction_id provided in the request payload), whether there were additioanl refunds for that transaction, and whether the sum of refunds sums up to the transaction total amount, that's in case you have some business logic that's depended on the total payment refund status.
Updated 3 months ago