#juangomez0120_webhooks
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/1379923403800313856
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello there
Hey!
You would want to listen for invoice.marked_uncollectible here
That will fire when the Invoice is marked as uncollectible
Okay thanks!
Does the invoice.marked_uncollectible event be sent after the payment_intent object is created?
Asking because I'm thinking on setting a specific internal state to the payment entity in our database in case the failure comes from an uncollectible failure
Overall, yes, as the PaymentIntent is created upon the Invoice finalizing. However, if it was finalized and immediately marked uncollectible then potentially no, as you should never rely on order of Events, see: https://docs.stripe.com/webhooks#event-ordering
Hm okay, is there any way I can determine if a payment intent failed because of an invoice being set as uncollectible without depending on the invoice entity?
Hi there,
taking over from my colleague who had to step away
Let me do a quick test on this
Hey! Thanks
I was thinking on using the charges object inside the payment intent. Seems that the .data is empty whenever the payment intent is linked to an uncollectible invoice
When the invoice gets marked as "uncollectible", the payment intent would remain "open" in the requires_payment_method state.
Only if you void an Invoice, the attached Payment Intent would get canceled.
In my case the payment_method status is being set to requires_confirmation
pi_3RWNn2BsYzIqHjob3zmDDSb3
The charge object in the Payment Intent will be null, until we actually try a Payment Attempt.
Okay thanks
The reason why your Payment Intent are in the requires_confirmation state is because you paused the collection on the subscription