#napolean-solo_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/1480910033087762432
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hey there ๐ so essentially, you want the addition of the new item to be conditional on the payment's success (i.e. if the payment fails, the subscription update never applies) - is that correct?
the Pending Updates feature is designed for exactly this use case: https://docs.stripe.com/billing/subscriptions/pending-updates
if you pass payment_behavior=pending_if_incomplete and proration_behavior=always_invoice when calling Update Subscription, the update will only be applied after the payment succeeds
otherwise, the subscription remains in the pre-update state
so if it was active, it will remain active right?
yep!
okay but how is the invoice behaviour handled in this case? Usually, stripe retries but after a given number of retries it usually changes the subscription to incomplete or past_due right? so in this case what happens to a stale invoice by which i mean if the user never pays for it.
if the invoice isn't paid, the pending update will expire after 23 hours, and Stripe voids the invoice
https://docs.stripe.com/billing/subscriptions/pending-updates#expiration
alright gotcha!