#zuohao
1 messages · Page 1 of 1 (latest)
hello! are you only collecting card payments? or you're accepting other types of payments as well?
You would want to listen for the charge.refund.updated event for refunds : https://stripe.com/docs/refunds#failed-refunds
it's pretty unfortunate, but from v2022-11-15 (https://stripe.com/docs/upgrades#2022-11-15), if you're using that version (or newer), the Charge object no longer auto expands the refunds, so you would probably have to list all refunds for a particular charge (https://stripe.com/docs/api/refunds/list#list_refunds-charge) to view the status of the relevant refund
When I receive a charge.refund event with a status of "succeeded", but when I query the https://stripe.com/docs/api/refunds/list#list_refunds-charge API, the returned refund object has a status of "pending".
[{"amount":100,"balanceTransaction":"txn_1NGcIT2eZvKYlo2Cjc0Y05dv","charge":"py_3NGcH92eZvKYlo2C18fJG4hE","created":1686205573,"currency":"usd","id":"pyr_1NGcIT2eZvKYlo2CAC6tAhqB","metadata":{},"object":"refund","paymentIntent":"pi_3NGcH92eZvKYlo2C1yoFTJ3B","status":"pending","testHelpers":{}}]
the charge.refund.updated event reflects the charge status
it doesn't display the the refund(s) and their corresponding status if you're using v2022-11-15 API or newer
you need to retrieve the refund to view what's the status of the relevant refund like i've mentioned
I tried using the charge.refund.updated event to listen for successful refunds, but in the testing environment, I often don't receive this event even though the refund API call is successful.
What's the re_xxx ID?
I only have pyr_1NGcZI2eZvKYlo2CLlPxTFfC and py_3NGcH92eZvKYlo2C18fJG4hE.
The refund did not receive the charge.refund.updated callback event.
Hmm, I see a charge.refund.updated event: https://dashboard.stripe.com/test/events/evt_1NGcfZ2eZvKYlo2CZuXsQv0S
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So depends what you mean by 'don't receive this event'
Will I receive the charge.refund.updated event every time I initiate a refund, regardless of the payment method used?
@digital wigeon sorry i made a mistake earlier - charge.refunded reflects the Charge object and doesn't auto expand the refunds parameters.
charge.refund.updated would reflect the refund object.
I double-checked, and I did receive the charge.refund.updated event at 2023-06-08 14:50:06. However, I initiated the refund at 2023-06-08 14:43:35, which is a difference of almost 6 minutes. This made me think that I missed the charge.refund.updated event. Is this time interval normal?
The event evt_1NGcfZ2eZvKYlo2CZuXsQv0S
Sure, refunds can be async so there can be a delay (and why we support that event in the first place)
In the "charge.refund.updated" event, if the status of the refund object is "succeeded," can I confirm that the refund has been successful? If the refund fails, what would be the status of this event, or is there a document with status enumerations available?
if the status of the refund object is "succeeded," can I confirm that the refund has been successful
Sure, that's what thestatusfield denotes
If the refund fails, what would be the status of this event, or is there a document with status enumerations available?
It'd befailed: https://stripe.com/docs/api/refunds/object#refund_object-status
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.