#gtabeo
1 messages · Page 1 of 1 (latest)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You need to use expansion to retrieve the charge object with any refunds included
expand[]=refunds when retrieving the charge
Alternatively use the Refunds List API and supply the charge ID or Payment Intent ID: https://stripe.com/docs/api/refunds/list#list_refunds-charge
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes sure, but how you get which refund triggered this webhook charge.refunded?
You don't -- if you need to know about the refund, rather than the charge, you should listen to charge.refund.updated:
https://stripe.com/docs/api/events/types#event_types-charge.refund.updated
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
This will flip things around, its the refund object, which has a reference to the charge
this webhook is never triggered on a successfull refund
check here:
pi_3NL9KRJ1zjQpWMSp0wZRcAJ4
@dense cedar can you please confirm that the webhook you recommend is always sent?
No, you're right, i was mistaken and looking at the wrong thing
Just checking more now
I'd suggest then using either exansion or the list api as i suggested, these will be listed most recent first, so you can take signal from that
yes, I can take a signal but it's not 100% reliable .
Do you believe that I can assume that a refund is successful if I don't check the charge.refunded object ?
If the refund is cancelled at some point in the future I will catch the charge.refund.updated and I will do the required actions
As long as you listen to those events, yes, that's the default
https://stripe.com/docs/refunds#failed-refunds