#will_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/1403455190010433700
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- will_api, 1 day ago, 22 messages
To clarify, I'm trying to figure out which event indicates that all automatic retries have failed, and thus the payment will never be captured.
There's a couple ways you can do this. It might be invoice.marked_uncollectible, but that completely depends on your subscriptoin settings. You can configure different behaviors for what happens when all attempts have been made
But you could just listen for invoice.payment_failed and examine https://docs.stripe.com/api/invoices/object#invoice_object-next_payment_attempt
That will be null after the last attempt
Terrific! No further questions your honor
Recommend testing in test mode or sandbox before going life to see how it all works
Actually hold up I do think there's a caveat with next_payment_attempt
Holding...
The next_payment_attempt attribute on the invoice indicates the date when Stripe will attempt the next collection. For automations users, next_payment_attempt is no longer set in invoice.payment_failed webhooks but is set in invoice.updated webhooks.
So I recommend checking in invoice.updated
Got it, so listen for invoice.updated, and check if next_payment_attempt is null โ
But you original suggestion works as well if your subscription settings are set up to mark invoices uncollectible on all attempts being completed
That's completely fine to do it that way
Okay understood
Oh before this gets deleted, can I ask: if I attach a payment intent to an invoice with attachPayment and then the payment fails, will the invoice attempt automatic retries for that payment intent?
Good question. I'm not sure offhand
Let me ask a colleague
My assumption is no but I'll get back to you
Apologies for the delay here, we're not 100% sure if we'll attempt automatic retries for PaymentIntents that were attached to an Invoice. Please reach out via support@stripe.com. They should be able to get you the answer to that question.
Okay, will do. When someone successfully pays an attached payment intent that comprises an entire invoice, triggering the invoice's status to become "Paid", will a receipt automatically be sent according to my invoice email receipt settings, or would it be controlled by my payment intent email settings?