Implementing a Rails Stripe subscription when there are no obvious plans

I am trying to use Stripe on an Airbnb clone as part of a tutorial excersise.

The current subscription requires a plan to be selected or created, this is normal for standard SaaS billing where there are certain plans.

In my use case, I want the room owner to be able to set a price, I then take that price and apply the markup, and then the Visitor can book the room for a monthly monthly fee.

I can't seem to find a solution for this in the Stack or Stripe API docs - I'm trying to learn, so please be kind :)

+3


source to share


2 answers


Personally, I won't create dynamic plans for every scenario, as you will have an unwavering number of plans. Instead, you can create a plan for $ 1 and then use the parameter quantity

to create a plan in any amount (well, any multiple of $ 1).

https://support.stripe.com/questions/how-can-i-create-plans-that-dont-have-a-fixed-price



Best, Larry

PS I'm working on support on Stripe.

+2


source


You can create a plan on the fly using the API and then sign a customer for that plan.



https://stripe.com/docs/api#create_plan

0


source







All Articles