vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
6.23k stars 1.27k forks source link

subscription.prices.products.name still has the name of the previous plan after I just changed my plan #137

Open VincentLu91 opened 1 year ago

VincentLu91 commented 1 year ago

I just changed my subscription plan to a new plan before the end of billing cycle.

However I checked my Supabase subscriptions table and it still shows the price_id of the previous subscription plan I used.

Not sure why, but I know this behaviour because on the frontend when I go to the Account page it still says "You are currently on the ${subscriptionName} plan" where

const subscriptionName = subscription && subscription.prices.products.name;

And the value I see there is the name of the previous subscription plan!

Whereas on the Stripe checkout I see that the plan I'm using is the new one.

Does the subscription plan name in the DB change on the next billing cycle?

mworks-proj commented 1 year ago

Yes, if don't allow changes to product during billing cycle is checked in stripe. This prevents customers from canceling before billing cycle has ended. I would review settings in stripe and update supabase db. Let me know how it goes.

Happy coding.