#xmy_best-practices

1 messages ยท Page 1 of 1 (latest)

frozen swiftBOT
#

๐Ÿ‘‹ 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/1303029177871503473

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

shut arrow
#

I am wondering if I should also use a schedule for the second state for recurring customers so I can use the same logic.
It depends on if you want to schedule the upgrade or just apply the upgrade immediately.
If latter, then you don't need a schedule as you can just call the update subscription API directly

proven sandal
#

Yeah I want to upgrade it immediately

#

How would I apply it for the state 1. Would I release first and then do the same as in state 2?

shut arrow
proven sandal
#

Yeah I am just wondering how I retain the same behavior as in updating the subscription directly

#

E.g. proration behavior

#

I suppose I just add this key to the phase that I'm adding and it will be the same?

shut arrow
#

Yup, I'd recommend testing it out in test mode as that would clear things up

proven sandal
#

But there is nothing bad if I decide to just create a schedule for option 2, correct? Just searching for a way to do less conditional logic

shut arrow
#

Subscription Schedules are used for scheduling updates versus immediate updates. There's no way to immediately trigger an update with a schedule unless you update the current phase to end and next phase to start for a particular timestamp.

Managing phases imo is a bit more tedious than immediately updating the subscription directly - https://docs.stripe.com/billing/subscriptions/upgrade-downgrade

proven sandal
#

Yeah that's why I was wondering it it might be easier to just release the subscription from the schedule (it will always be the second phase) and then update it directly as the state 2

#

But I'll experiment around a little bit. Thank you ๐Ÿ™

shut arrow
#

NP! ๐Ÿ™‚ Good luck