#mehdi_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/1293723067071205407
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! To make sure i'm understanding things correctly, at the end of all the subscription schedule phases, you want to cancel the subscription?
no, we want to prevent the schedule from advancing into further phases
in our case, we have a subscription schedule where the first phase has a 11 month interval, and the second phase has a a yearly interval
(we use this so that we can bill the user 1 month before the "yearly" mark)
but we want to bill a "renew" toggle
right now, it seems like if the user sets to not renew, we will have to release it from the schedule and then set the subscription to not renew
but then if they toggle renew back on, we will have to rebuild the schedule
which is brittle
i see....hmm, there isn't really a better way unfortunately than what you essentially described I'm afraid. The only thing I can suggest here is to make sure you save the original schedule in your DB so that it's easy to (re)update the subscription schedule, but you're probably currently already doing that
ahh yeah okay, we'll go with that approach then
to add a bit more detail though - if the user toggles to not renew, I would update the subscription schedule to remove phase 2 and then release at phase 1. Subsequently, if the user toggles (renews) again, then update the subscription schedule back to what it originally was
ahhh yeah, i think i'll go with that
will make it easier than creating new schedules
it's okay to have a subscription schedule with just a single phase?
yep, that's totally fine. As usual though, I definitely recommend testing things out throughly to make sure everything works as per what you expect. in case you haven't seen this yet, you can use test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks
ah awesome, will do