#dahan.han

1 messages · Page 1 of 1 (latest)

steady ravenBOT
hot plover
#

Both charge.refunded and charge.refund.updated events should be listened. Once the refund event is received, its status in the event body can be checked for the refund outcome.

tulip pasture
#
  • Does the status value received in the webhook with the charge.refund.updated type being simply succeeded mean that this is the only criterion for judgment?
  • The ID value of the Event I created for testing is evt_1NrVQZJ1hPrjN8V40iffVxlM.
hot plover
#

Does the status value received in the webhook with the charge.refund.updated type being simply succeeded mean that this is the only criterion for judgment?
Most of the time, yes.

From https://stripe.com/docs/refunds#failed-refunds:

In the rare instance that a refund fails, we notify you using the charge.refund.updated webhook event. You’ll then need to arrange an alternative way of providing your customer with a refund.

It's possible that the bank or payment method provider only updates Stripe about refund failure much later time.

Learn how to cancel or refund a payment.

tulip pasture
#
  • In the document you provided, are you saying that the FAILURE REASON value is defined in the status field of the webhook triggered by charge.refund.updated?
  • Example) data.object.status = "charge_for_pending_refund_disputed"
hot plover
#

In charge.refund.updated event, the refund outcome can be found in status field: https://stripe.com/docs/api/refunds/object#refund_object-status

The value of status can be pending, requires_action, succeeded, failed, or canceled.

In case of refund failure, the reason can be found in failure_reason field: https://stripe.com/docs/api/refunds/object#refund_object-failure_reason

tulip pasture
#
  • Based on the information you have provided so far, I have understood it as follows. Is my understanding correct?

    1. For Refunds with a payment type of customer_balance, in order to detect the refund completion moment, both charge.refunded and charge.refund.updated webhook events need to be monitored.
    1. The moment when the status value in the dashboard (PAYMENT) changes to Refunded is when the status value in the charge.refund.updated webhook event is succeeded.
    1. In the case of a refund failure, the reason can be determined through the failure_reason field in the charge.refund.updated webhook event.
hot plover
#

This looks right to me!

tulip pasture
#

Thank you for your kind responses. they have been very helpful. 😄