Home > OS >  How to handle this workflow on Stripe?
How to handle this workflow on Stripe?

Time:09-14

I have 3 situations I would like to ask:

  1. How to handle free products? I have 4 plans: free, $5/mo, $10/mo, $20/mo.

When the user is created I automatically assign the new user the free plan. So every user starts with the free plan and can automatically start using the app without ever having to touch Stripe at all. Cancelling a paid plan, means having the free plan.

So far I thought about handling the free plan as if there is no plan. But I believe this could become a pain point if I ever decide to charge for the free plan because if I have all the products on Stripe the code will be ready for it from the get go, which would allow for a single point of operation when the user changes from one product to the other, regardless of whether is free or paid.

Not sure if I am thinking this approach right, any thoughts?

  1. Each product on Stripe has one price and I only want the user to have a single valid subscription at the same time.

What is happening now is that every time the user changes the plan a new product is purchased. So more and more subscriptions start to coexist on Stripe. I am saving those subscriptions in a Subscription model, but I handle the settings of what "the current" subscription is in the User model. Changing subscriptions override those values in the User model and the app behavior for this User is defined by those single values, regardless of how many "active" subscriptions are in the Subscription model for that User, and how many "active" subscriptions are on Stripe for this User.

How would you handle (whatever different approach you would use) having 4 options from $0 to $20 on Stripe, but only having 1 single valid subscription at a time, so changing subcriptions would basically adjust the price (and the user allowances) while at the same time refunding/charging whatever is needed for the new subscription.

  1. Every transaction creates another Customer on Stripe. How would you approach preventing the user and the subscriptions to be duplicated but at the same time allowing the user to change it's subscription any time?

Thanks a lot in advance!

CodePudding user response:

For your first question, it's recommended to model both free and paid plans as Prices inside Stripe. That way you can use Stripe's features to work across both free and paid plans, like the pricing table, or the customer portal.

For your second question, it's hard to say for sure as your question is somewhat vague, but I think you may want to have a single Product in Stripe with multiple Prices. When a Product in Stripe has multiple Prices it's easy to move a customer from one Price to another as they upgrade and downgrade, for example.

For your third question, you need to handle customer logins and authentication on your end, and associate the customer records on your end with Stripe Customer objects. You can then build an integration that allows your customers to make changes, or use the Stripe customer portal linked above.

  • Related