Refund Flow
When a customer cancels an order or submits a return request, Fynd Commerce initiates the refund process by calling the initiateRefundSession API of the Payment Extension with the necessary refund details. The Payment Extension then creates a refund request with the designated PG. The PG processes the refund and returns the refund status to the Payment Extension. The Payment Extension, in turn, responds to the initiateRefundSession API with the refund details and the refund status received from the PG.
The accepted refund statuses for initiateRefundSession API are:
refund_initiated
: The refund request is created by Fynd Commerce.refund_pending
: The refund is pending with the PG.refund_done
: The refund has been finalized and completed by the PG.refund_failed
: The refund has failed.refund_rejected
: The refund request was rejected by the PG.refund_disputed
: The refund has been disputed.
The Fynd Commerce then displays the refund status to the customer. If the PG provides an updated refund status via a webhook to the Payment Extension. Then, the Payment Extension calls the updateRefundSession API to reflect the new status. The accepted refund statuses remain the same as previously mentioned. Once the updated refund status is received, Fynd Commerce ensures that the latest refund information is displayed to the customer, keeping them informed about the progress of their refund request.
Crons Jobs
Fynd Commerce runs regular cron jobs to check the status of refund transactions by sending a get
request to Payment Extension on the getRefundStatus API. Payment Extension is expected to respond with the status of the refund transaction corresponding to the gid
parameter.
Accepted values of payment status for initiateRefundSession API are:
refund_initiated
: The refund request is created by Fynd Commerce.refund_pending
: The refund state is pending from PG.refund_done
: The refund has been finalized and completed by PG.refund_failed
: Refund failed.refund_rejected
: Refund rejected by PG.refund_disputed
: Refund disputed.
To implement the refund processing flow within your payment extension, the following APIs need to be implemented on extension’s end: