#kerneldeimos_subscription-proration-logic
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/1305639282626527337
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- kerneldeimos_api, 6 days ago, 25 messages
....However now $25->$10->$25 results in the user being charged again instead of consuming what was credited to them when they downgraded
Hi, can you share the two request ids where you saw these two different behaviors? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Ok... this might take me a bit because it looks like this logs every single GET request.
You can also share the subscription id, it starts with sub_
Ok, found the filter. req_RU8v590V63brLP looks to be the one
The subscription is sub_1QK4F8ADHjrVFvnFeSeMRgNx. This subscription was started at the $25-tier, then was moved to the $10-tier with proration_behavior set to create_prorations, then upgraded to the $25-tier with proration_behavior set to always_invoice (which we had to do to avoid the issue I mentioned earlier)
This is not on test mode btw, as we're doing testing with the real keys now as we're hoping to launch this billing feature as soon as possible
Please do not test in live mode. You would want to test this using Test Clock in Test mode, https://docs.stripe.com/billing/testing/test-clocks.
Can you share the subscription id where you had the same proration_behavior set to create_prorations ?
Please do not test in live mode.
I understand the sentiment; we've done testing in test mode and we were getting ready to deploy our integration when we noticed this issue. I understand the test clock helps us test things that happen over some duration of time, but the issue I'm describing here doesn't fit that description
Can you share the subscription id where you had the same proration_behavior set to create_prorations ?
This subscription was updated using two different values for theproration_behaviordepending on whether it was a downgrade or upgrade, under the conditions I described earlier. There shouldn't be any other subscription ID involved; the user has one subscription and we're updating that subscription.
So you're asking why it's behaving differently with the two different prorations enums you passed?
I'm asking how I can get the expected behavior of, upon upgrading:
- if amount was prorated after a previous downgrade, consume that and subtract it from the charge
- charge the user (if the charge wasn't completely covered by a prorated amount)
We could manage state on our end to track the amount that was prorated, but then we have to manage state - so far we haven't had to do that with Stripe, which has been really great. On top of that, it completely defeats the purpose of Stripe managing proration for us if we have to also have to manage proration on our end.
Hi ๐
I'm stepping in as my colleague needs to go
now $25->$10->$25 results in the user being charged again
Can you explain what value you passed toproration_behaviorfor this to occur?
$25->$10 was with create_prorations, $10-$25 was with always_invoice.
We had to set always_invoice in order for the user to get charged when upgrading, but really what we want is more like consume_proration_and_invoice_if_charge_is_necessary
Which...isn't a setting
You would need to know before making the API call, which setting would be approriate
How to integrators usually handle this? Nothing seems to cover what looks like the most logical flow. A user gets charged if they upgrade, but they don't if they downgrade and upgrade back. They get charged a partial amount if they start at some middle tier, then go down, then go up - that sort of thing.
If a user wants to implement something like that they build their own logic to define what settings to pass
...which setting would be approriate
To make matters worse it's not just this setting, it's also the amount to charge, and also removing the prorated amount that was credited from a prior downgrade.
Yeah I think that would be a mess IMO.
All the options we have for managing upgrades/downgrades are documented here: https://docs.stripe.com/billing/subscriptions/upgrade-downgrade
Although it kind of sounds like what you want would involve a customer_balance
that's the same thing as prorations, right? I assume the prorated amount is added to the customer balance. If that's the case, that makes this a bit easier. The doc seems to suggest this is the case.
No it's not the same thing as prorations
Prorations can result in a customer credit balance but only if the proration is such that it results in a negative amount
Thanks for the info, I think we're just gonna hold off on improving this for now then. I asked a few people I know and it seems this is how people expect to be charged when they upgrade/downgrade on a tiered subscription model. I find it hard to believe this isn't easier.