Subscribe user to payment plan using stripe.js


This is my first time with and so far I really love what I see. I build a lot of prototypes and will continue to do so, Bubble looks to become my go to tool after this experience.

I am having some issues with understanding how to use the plugin stripe.js. My main question is “How do I subscribe a customer to a Stripe plan, from my Bubble application?”

What I am trying to accomplish:
I work with a fintech company and for a new pilot project we want to sell one of our products by splitting up the cost in 4 instalments.

Payment logic
We want to split the cost of our product into 4. Lets say our product costs $100.

  1. $25 is charged immediately
  2. $25 is charged 1 month from now
  3. $25 is charged 2 months from now
  4. $25 is charged 3 months from now

What I have done is created the following workflow:

  1. Stripe.js - Customer - Create
  2. Sign the user up
  3. Convert card into Stripetoken A
  4. Charge the current user
  5. Create a subscription item
  6. Subscribe the user to plan

What happens:
User is charged - Great!
Then I get this error message: “The user isn’t subscribed to any plan, you can’t apply a coupon”

I haven’t touched any setting regarding coupons, so assume this error message is not 100% accurate. How do I subscribe this customer to a plan?

FYI regarding cancelling users to subscription plan after the 4th payment, we will do this with a script that calls Stripe API outside of Bubble.

Any help is deeply appreciated! Thanks

^^^best way to contact them, unless a member of the community knows

Hi @havard.muggerud

If you found a solution, please share with us :blush:

Thank you very much