DEV Community

loading...

Discussion on: Stripe - Upgrading a subscription synchronously (immediately charge for a proration without webhooks)

Collapse
risafj profile image
Risa Fujii Author

Regarding the part of the docs you quoted - I believe this is expected behaviour.

With proration disabled, the customer is billed the full amount for the new plan when the next invoice is generated. The customer is still moved to the new plan immediately, however, even though they don’t pay for the new plan until the next billing cycle.

Let me illustrate with the example plans I used in the post ($5/month standard plan and $10/month premium plan).

What would happen normally in Stripe:

  • Sep 1 (start of billing cycle): I sign up with the standard plan and pay $5 for September
  • Sep 15 (midpoint of cycle): I upgrade to the premium plan and don’t pay anything
  • Oct 1 (start of next cycle): I pay roughly $12.50 ($10 for the charge for October, $5 for the premium plan portion I started using half a month ago, and $2.50 refund for the unused portion of the standard plan after the upgrade.)

What we’re trying to achieve in the gist:

  • Sep 1 (start of billing cycle): I sign up with the standard plan and pay $5 for September
  • Sep 15 (midpoint of cycle): I upgrade to the $10 plan and pay roughly $2.50 ($5 charge for the premium plan for the rest of September, minus $2.50 for the unused portion of the standard plan after the upgrade.)
  • Oct 1 (start of next cycle): I pay $10 for October

When they say “the customer is billed the full amount for the new plan”, I think they just mean the customer gets billed normally for the upcoming month, i.e. $10 for October.
The fact that no proration is applied to the next billing cycle’s invoice is also tested in my gist, in the final assertion (JPY 1,000 is the monthly price for the premium plan).

Hope this makes sense! Please let me know if I’m misinformed/you need more clarifications.

Thread Thread
zer0pants profile image
Mike Roberts • Edited

Legend! Thanks for such a thorough reply. The proration stuff all makes sense, it's that last point that gets me which is what will show on the final invoice? I want exactly the outcome you describe.

So I think I need to get off this board and prototype this functionality today ;) Thanks again for the post 💪

Update: Confirmed the approach works 🥳

Thread Thread
risafj profile image
Risa Fujii Author

Good luck, let me know if it works! :)