#kerneldeimos_subscription-proration-logic

1 messages ยท Page 1 of 1 (latest)

crisp merlinBOT
#

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

arctic prairie
#

....However now $25->$10->$25 results in the user being charged again instead of consuming what was credited to them when they downgraded

dark sierra
arctic prairie
#

Ok... this might take me a bit because it looks like this logs every single GET request.

dark sierra
#

You can also share the subscription id, it starts with sub_

arctic prairie
#

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

dark sierra
#

Can you share the subscription id where you had the same proration_behavior set to create_prorations ?

arctic prairie
#

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 the proration_behavior depending 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.

crisp merlinBOT
dark sierra
#

So you're asking why it's behaving differently with the two different prorations enums you passed?

arctic prairie
#

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.

autumn cradle
#

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 to proration_behavior for this to occur?

arctic prairie
autumn cradle
#

Which...isn't a setting

#

You would need to know before making the API call, which setting would be approriate

arctic prairie
#

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.

autumn cradle
#

If a user wants to implement something like that they build their own logic to define what settings to pass

arctic prairie
#

...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.

autumn cradle
#

Yeah I think that would be a mess IMO.

#

Although it kind of sounds like what you want would involve a customer_balance

arctic prairie
autumn cradle
#

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

arctic prairie
#

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.