Skip to main content

Implement refund flow

Overview

This guide provides a step-by-step overview of the refund process facilitated by the Fynd Platform for its payment extension integration. It outlines the interaction between the various components involved, including the customer, the Fynd Platform, the Payment Extension, and the Payment Gateway. This interaction is illustrated in the following diagram:

QG4

  1. Customer cancels an order or places a return request.
  2. Fynd Platform calls initiateRefundSession API of payment extension with refund details.
  3. Payment Extension creates a refund request with the payment gateway
  4. Payment Gateway process the refund and sends refund status to Payment Extension.
  5. Payment Extension responds to the initiateRefundSession API with the refund details and refund status received from Payment Gateway. Only following refund status are accepted
    1. refund_initiated: When refund request is created by Fynd Platform, it's in refund_initiated state.
    2. refund_pending: When refund state is pending from Payment Gateway, it's status should be updated as refund_pending.
    3. refund_done: When refund has been finalized and completed by Payment Gateway, it's state should be updated to refund_done.
    4. refund_failed: Refund failed.
    5. refund_rejected: Refund rejected by Payment Gateway.
    6. refund_disputed: Refund disputed.
  6. Fynd Platform shows the refund status to the customer.
  7. Payment Gateway sends webhook to Payment Extension with updated refund status.
  8. Payment Extension calls updateRefundSession API with updated refund status. Accepted values of refund status are:
    1. refund_initiated: When refund request is created by Fynd Platform, it's in refund_initiated state.
    2. refund_pending: When refund state is pending from Payment Gateway, it's status should be updated as refund_pending.
    3. refund_done: When refund has been finalized and completed by Payment Gateway, it's state should be updated to refund_done.
    4. refund_failed: Refund failed.
    5. refund_rejected: Refund rejected by Payment Gateway.
    6. refund_disputed: Refund disputed.
  9. Fynd Platform shows updated refund status to the customer.

Crons Jobs

Fynd Platform runs regular cron jobs to check the status of refund transactions by sending a GET request to Payment Extension on getRefundStatus API. Payment Extension is expected to respond with status of refund transaction corresponding to gid parameter. Accepted values of payment status are refund_initiated, refund_pending, refund_done,refund_failed, refund_rejected and refund_disputed.

  1. refund_initiated: When refund request is created by Fynd Platform, it's in refund_initiated state.
  2. refund_pending: When refund state is pending from Payment Gateway, it's status should be updated as refund_pending.
  3. refund_done: When refund has been finalized and completed by Payment Gateway, it's state should be updated to refund_done.
  4. refund_failed: Refund failed.
  5. refund_rejected: Refund rejected by Payment Gateway.
  6. refund_disputed: Refund disputed.