#jonathan_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1354644871226331277
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! Are you looking for this: https://docs.stripe.com/testing#refunds:~:text=Asynchronous failure
no, because it says the refund begins as succeeded.
I'm trying to find out if its possible for a refund to begin as failed.
Ie, if using python and you call stripe.Refund.create(...), the return value will be a Refund object whose status is "failed"
We don't have a test card for that. Either way you will get the refund.failed event, so you can test your scenario based on that?
Yep, I can monitor for failures via webhook.
I just wanted to know whether at the time of calling Refund.create() I should check for the status being "failed" or not
.. I've inheritied some code that calls Refund.create(), doesnt look at the return value and assumes everything has worked.
And looking at the documentation, its not unreasonable to get the impression that refund statuses only become "failed" asynchronously
Hi @mighty drum I'm taking over this thread
If the refund creation request isn't successful, you'll receive an error response intead of a refund object. So yes you won't have refund object with its intial status=failed.
ok, thats good to know thanks.
sorry, does that mean an exception will be raised in the case of python?
Yes you are right
ok great - the code I have is in a try/except statement, so instant refund failures are being accounted for.
Thankyou for your time.
happy to help!