Introduction to Stripe Subscriptions in Bubble
This Bubble tutorial is a quick tip for when you're using Stripe as a payment gateway in your Bubble app. You may have noticed that both your Bubble app and Stripe have both got a development version and a live version. When you come to adding in the subscription, like I've got set up here, I've just got a button, I've added the subscribe user to a plan, action. It can be a little bit confusing how you fill this in, especially because when you add your Stripe API details into the Stripe plugin, the one built by Bubble, it will pull across the Stripe plan names from your Stripe test or development version, because you are in editing your Bubble test or development app.
Importance of Subscribing and Additional Resources
Now before I show you this quick tip, if you find videos like this useful, we really appreciate a subscribe and a like. And if you're learning Bubble, there are even more videos available on our website. You can't find them on YouTube. They're only available to members on our website. Loads and loads of hundreds of Bubble tutorials available for you to kickstart and accelerate your Bubble development journey now.
The Confusion with Stripe Plan IDs
This is confusing. And so it can lead to your live Bubble app using your Stripe test plan ID, which means it's not going to work. So a quick solution to this is to simply say, make the plan dynamic and then use the isn't live version and then format as text.
Solution: Using Dynamic Plan IDs
So if it isn't live, it's your dev version, which means that in here, you would put your whatever your plan ID from Stripe is for your dev version. And in here, you would copy and paste these rather than type them in. You would put your plan ID for your live version. That way that when Bubble runs this workflow, whether it's in the dev version, your app or the live version of your app, it automatically using this statement here isn't live version, will insert the right plan ID based on whether you are testing it as a user in your development version or whether you are a live user.
The Importance of Correct Plan IDs
One of your real customers, they will be subscribed to a subscription plan in your Stripe live section. Okay, now this hopefully that is useful because this is something which when I first came to it many years ago, trying to add in a Stripe subscription into my Bubble app. It just I just went around and around the circle trying to work out why it didn't work, how to get dev data and live data separated.
Conclusion: Implementing the Solution
Anyway, really simple. Just use the isn't live statement, modify as text and insert your dev one and your live Stripe plan IDs in here.