#piyush_docs
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/1425797602959560724
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
You'd need to set cancel_at_period_end in a separate update call
since i have restricted PM types to card, and hence the charging being synchronous(mean update will return the status of the generated invoice), i can do after the invoice has been paid, right? just after receiving the pending update call's response.
Hi there, I'm going to step in for my colleague. Let me catch up
sure, can you go through the conversation?
It seems like it would be simpler to set cancel_at_period_end: false before making the update
then what if the payment fails(prorated invoice) for that upgrade?
That depends on what you want to happen, like marking the sub as cancelled again
But are you having a problem with calling cancel_at_period_end: false after upgrading the subscription?
I mean if i am upgrading, then if its unsuccessful then no point of reverting the cancellation? Only it should happen after the payment has successful
Right. So would calling cancel_at_period_end: false after upgrading the subscription, and the payment succeeding work for you?
yes, i want to revert only if payment succeed for upgrade and so I was asking should i do second update(for reverting the cancellation) after the first update's response(considering it will contain the prorated invoice's status), so if invoice is paid, i will revert the cancellation.
Yeah, sounds good
is it guaranteed that charging will be synchronous for PM type card?
Yes, this should be synchronous for card or link PM types, as the Subscription in the response will either be updated (in case of payment success), or have the pending_update hash otherwise: https://docs.stripe.com/billing/subscriptions/pending-updates#update-subscription