#mattwoberts-invoice
1 messages ยท Page 1 of 1 (latest)
Hi there ๐ I think leveraging attempt_count (to see if it matches the number of retry attempts in your schedule) or next_payment_attempt are probably your best bets.
https://stripe.com/docs/api/invoices/object#invoice_object-attempt_count
https://stripe.com/docs/api/invoices/object#invoice_object-next_payment_attempt
I don't recall off-hand what the next_payment_attempt value is set to when we stop retrying the payment, but you can use test clocks to get an Invoice into that state pretty quickly and check:
https://stripe.com/docs/billing/testing/test-clocks
THanks - I know I can't use the attempt_count - I was using that but then found a scenario where if you attempt to checkout a new sub and use a card that will fail - that card doesn't get stored against the customer and so no more attempts are made on it, so I can't rely on it.
I'll check the next_payment_attempt though, thanks
Any time!