#m0uka-connect-refund
1 messages · Page 1 of 1 (latest)
Can look in to this but I haven't tested refunds much lately. Where does the refund show as incomplete temporarily?
Currently the status is pending and no webhooks have been dispatched updating the status, I want it to mark as suceeded and call the refund.updated webhook
hmm, hold on, the status is apparently succeeded
but no webhooks dispatched
Can you send me the ID of the payment? I got an immediate succeeded status back on a refund for a card payment that I just tested
the ID is pi_3NdIjOHAN7AGL0N61Vuu5NQA, I also see succeeded instantly, however our integration listens for the refund updated webhook
can the status be succeeded instantly in live mode like this? should we check for that, or can we rely on the refund.updated webhook
It looks like a charge.refunded event was triggered for this refund and the status was succeeded on that event https://dashboard.stripe.com/test/events/evt_3NdIjOHAN7AGL0N61yBmr7le
The event names cause a bit of confusion but you will want to listen to the charge.refunded and charge.refund.updated events for this. The refund.* events are related to specifically when funds are sent back from a customer's cash balance which is part of a specific PaymentMethod's flow. https://stripe.com/docs/api/events/types#event_types-charge.refunded
https://stripe.com/docs/api/events/types#event_types-refund.created
I will double check but I think refunds are expected to start in a succeeded status and then you may get a charge.refund.updated event if the refund fails
so a refund can fail even if it's in the succeeded status?
is the pending status used?
Yes, it can fail for up to 30 days after the refund is issued. https://stripe.com/docs/refunds#failed-refunds
also, charge.refunded is called on refund success, or creation? i'm kinda confused with the flow here
i see. so there's no way to tell if when a refund actually succeeded (without failing later)?
just noticed the issue might be related to the issue related above, i'll have a quick read through it haha
So refunds are created in a succeeded state when the refund is sent off to the bank at which point you will get a charge.refunded event. In very rare circumstances the refund will fail, at which point you will get a charge.refund.updated event.
I agree it is a bit confusing but it mirrors the conversation between Stripe and the bank. We give you the best info that we have on the status of the refund when we have it.
got it, i'll refactor the application logic then.
thanks!