#MarkoBoras

1 messages · Page 1 of 1 (latest)

cosmic tangleBOT
fiery stream
#

Hi there!

#

which event should I listen on webhook endpoint when refund succeeds
A refund succeeds by default, but you can listen to charge.refund.updated in case the refunds fails. This is covered here: https://stripe.com/docs/refunds#failed-refunds

cold folio
#

Refund always succeeds? I don't understand that?

#

I need to do some database updates on successful refund.

fiery stream
#

Sorry I wasn't clear.
When you create the refund you will direclty get a reponse from Stripe that contains the refund status: https://stripe.com/docs/api/refunds/object#refund_object-status
So no need for a webhook event, just check the status. But if the status is succeeded, note that it can sometimes fail later. That's why we recommend listening to charge.refund.updated

cold folio
#

aaaaa

#

so you recommend to do like this

#

Create refund in my backend function.
Listen for charge.refund.updated event
Update my database on charge.refund.updated

#

?

fiery stream
#

Oh wait I was wrong. What we recommend doing is:

  • Listen to charge.refunded to mark the refund as successful
  • And listen to charge.refund.updated to update the refund status accordingly
cold folio
#

what property should I read in charge.refund.updated to know if refund went successfull or failed?

fiery stream
cold folio
#

ok

#

tnx