#mnshyn-refund-failed

1 messages · Page 1 of 1 (latest)

oblique pond
tepid rain
#

looking here

#

When a refund is issued, it would go into a 'pending' state. Then, it would go into 'Succeded' or 'Failed' state.

radiant flare
#

In tests I've done in test mode, I've seen that the response from the refund API call is successful right away, and in a conversation I have had here on this channel, the dev told me that the success state is immediate unless the balance isn't enough; I can't test failures though in test mode, unless there are parameters that I'm not aware of that can help test this.

tepid rain
#

Let me test this real quick on my end. You're testing card refunds correct?

radiant flare
#

correct

tepid rain
#

you are correct here

#

Refunds will always end in succeeded and really there is no way to test failed refunds in test mode I'm afraid.

wooden vector
#

https://stripe.com/docs/testing#refunds

4000000000005126: The charge succeeds. If you initiate a refund, its status begins as succeeded. Some time later, its status transitions to failed and sends a charge.refund.updated webhook event.

radiant flare
#

ok, so if I understand this correctly, in a scenario where the refund ultimately fails, it will start as succeeded, but will change to failed later?

tepid rain
#

That is right!

radiant flare
#

i see. so that status then on the refund can be misleading.

wooden vector
#

it's because card refunds fail extremely rarely

#

only way to know is to basically assume it succeeds until we get the funds returned days later

radiant flare
#

understood. so to be clear, the scenarios would be:

refund succeeds, no issues:
refund triggered -> status succeeded

refund fails:
refund triggered -> status succeeded -> status failed

refund succeeds, but with delay due to insufficient balance:
refund triggered -> status pending -> status succeeded

refund fails, with delay due to insufficient balance:
refund triggered -> status pending -> status failed

#

does the charges.refunded webhook coincide with the status changing to succeeded?

wooden vector
#

no the last one is pending -> succeeded -> failed

#

does the charges.refunded webhook coincide with the status changing to succeeded?
no, charge.refunded is sent on refund creation, whether it goes to pending or succeeded doesn't matter

radiant flare
#

ok got it

#

ok i think i have what i need. appreciate the help!