#BruceWayne

1 messages · Page 1 of 1 (latest)

maiden fogBOT
jovial canyon
#

Webhook judges which type is the refund completion, and then gets the refund object?
You may listen to charge.refunded event and check for its status.

However, 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: https://stripe.com/docs/refunds#failed-refunds

chilly wolf
#

charge.refund.updated

#

this?

jovial canyon
#

charge.refund.updated will only be sent when there is an unexpected refund failure at the issuer side some time later. You should also listen to charge.refunded that will be sent for all refunds

chilly wolf
#

If the refund is successful, I should listen to charge.refunded, right? instead of charge.refund.updated

jovial canyon
#

Your system should listen to both. charge.refund.updated (refund failure) can still be sent after charge.refunded (successful refund) for unexpected circumstance

maiden fogBOT
chilly wolf
#

OK

#

charge.refunded does not work, this cannot get the refund object in the callback

chilly wolf
thorn sedge
#

Hi there, I'm taking over.

#

The data you get from the charge.refunded event is a charge, not a refund.

chilly wolf
#

What should I do to get the successful refund message from charge.refunded?

thorn sedge
#

As river mentioned. You should listen to both charge.refunded and charge.refund.udpated event.

If the refund is succeeded immediately, you'll receive a charge.refunded and its refunded is true (if it's a full refund).

If a refund needs time to process, its status would be pending first, and you'll get update of the refund through the charge.refund.udpated event.

chilly wolf
#

Is the code I posted just now ok? Any questions?

#

charge.refunded is useless, the refund will be sent as soon as it is created, and the refund object cannot be converted

#

Can you guys give me an example of listening for refunds, our technicians will follow your instructions

thorn sedge
#

Can you share wtih me the complete code? The implementation of charge.refund.udpated is cut off.

chilly wolf
#

Please wait for me, the technicians are eating,