#s2j20330_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1249828288764051466
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi there!
Are you trying to simulate this because you want to test some webhook handler code?
yes exactly
Also, just to be clear, are you testing disputes in the context of Stripe's Issuing product?
Just making sure we're looking at the correct documentation/reference for this
Not necesarily, I'm trying to test a dispute for a charge that's been made to an invoice
Gotcha
With events, events may not always be delivered to your endpoint in the order in which they're generated: https://docs.stripe.com/webhooks#event-ordering
If you receive charge.disputed first, you can inspect the Event payload to extract the related invoice, then make a request to retrieve that Invoice
Thanks for the context. Is there a way to receive charge.disputed after the invoice webhook tho?
Basically our invoice handler grants an access to our product.
Our dispute handler will revoke the access.
Usually we wouldn't have to worry about dispute events coming in first because user would first notice a charge and dispute later (meaning the invoice webhook has already been procssed)
But testing with Stripe test card, this is not possible because charge.disputed always arrives before the invoice
No, since event ordering is not guaranteed in a real life scenario, I don't recommend expecting your tests to receive the invoice event first