#juangomez0120_webhooks

1 messages ¡ Page 1 of 1 (latest)

unkempt gullBOT
#

👋 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.

snow knot
#

Hello there

worthy sail
#

Hey!

snow knot
#

You would want to listen for invoice.marked_uncollectible here

#

That will fire when the Invoice is marked as uncollectible

worthy sail
#

Okay thanks!

unkempt gullBOT
worthy sail
#

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

snow knot
#

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

worthy sail
#

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?

nimble dock
#

Hi there,
taking over from my colleague who had to step away

#

Let me do a quick test on this

worthy sail
#

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

nimble dock
#

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.

worthy sail
#

In my case the payment_method status is being set to requires_confirmation
pi_3RWNn2BsYzIqHjob3zmDDSb3

nimble dock
#

The charge object in the Payment Intent will be null, until we actually try a Payment Attempt.

worthy sail
#

Okay thanks

nimble dock
#

The reason why your Payment Intent are in the requires_confirmation state is because you paused the collection on the subscription