#adrian_subscription-proration
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/1220151367675547721
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
@wispy anchor that's something we support yes but mostly by having you decide how to handle this in your own code really. See https://stripe.com/docs/billing/subscriptions/upgrade-downgrade as a first step.
The idea is that when someone upgrades you might want to either charge them for the difference immediately with proration_behavior: 'always_invoice' or even reset the billing cycle to right now.
When they downgrade you instead might want to defer the change until the end of the period which can be done with a SubscriptionSchedule, see: https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#downgrading-subscriptions
adrian_subscription-proration
so one thing im not sure about is that i use the billing portal API from stripe and create a configuration right, and if the default is proration_behavior: 'always_invoice' , when they downgrade they will see that they will pay immediately. But if on the backend side im changing it to bill end of period, they wont know
do you get what i mean?
Not really no
So lets say a user is downgrading, default behaviour is proration_behavior: 'always_invoice'. They will see this right (see img).
but if i manually change it based on the condition that they are downgrading, they wont be able to see that they will pay end of billing period.
Yeah I'm sorry I don't really get your picture and what;'s wrong with it exactly?
hahahaha ok let me try again
So, if a user Upgrades to a higher plan, i want to invoice/bill immediately. If they Downgrade to a lower plan, i want to invoice end of billing period.
I need a way of changing the proration_behaviour depending on the above condition. Right now i only of setting a default one. I need a way of updating it based on the plan they chose.
so you create two separate CustomerPortal Configurations, one for each case and you use the right one depending on whether to upgrade or downgrade
Ah right, how will i determine which plan they chose tho since they are choosing it in the Billing Portal UI?
because at that point, they are already on a billing portal with a default configuration.
Yes sorry that's what I was trying to say. What you want to do is impossible right now. If you want to have a different proration behaviour based on whether they upgrade or downgrade you have to make two separate CustomerPortal Configurations entirely. One for upgrade and one for downgrade. You can't let the portal offer both and then change the proration logic based on that
I see. One issue with that is i have a deeplink for the subscription update page so they can upgrade/downgrade to a different plan.
Sceneario:
- User chooses to downgrade and gets redirected to billing portal subscription update with a default configuration of
proration_behaviour: create_prorations. - Once they checkout (downgrade their plan), they can go back to the start page of teh billing portal.
- Since this portal session has teh default configuration of
proration_behaviour: create_prorations, if they try to upgrade their plan, they will be billed end of period instead of immeditaly since they are still using that downgrade billing protal configuration session.
yeah you basically have to not use a default configuration for cases like this one I think
im trying something right now where i set 2 different configs like u said and then assign it to downgrade/upgrade plan button on my app that redirects the user to the billing portal.
๐ค
Oh sick it worked. Created 2 different configs and only added the products in the subscription_update that apply to that case so user wont be able to upgrade via a billing portal thats meant for downgrading
and invoices per specified proration period
Yay! Sorry it's a bit convoluted
hahah na allgs lol i explained it very poorly. Thanks alot for the help