Work Log 2022.01.12: Stripe Integration + Oura Update
[This is an experimental type of post I’m trying out. I want to record and publish more about my journey of building a solo SaaS company, and I think frequent, brief, and casual posts about what I’ve been working on and thinking about will be a good way to do so.]
I spent several hours the past few days setting up payments using Stripe Checkout and Stripe Customer Portal. I have the Checkout working, so you can go to the Billing tab in the Canopy Charts dashboard and select a plan to subscribe to, which will direct you to a Stripe-hosted checkout page where you enter payment info and make the payment.
I also have the Customer Portal working, so once you have a subscription, the Billing dashboard will show a “Manage Your Subscription” link which takes you to a Stripe-hosted page where you can make changes to your subscription.
One thing I’m happy about with this implementation is my dynamic Billing page. I don’t store any of the product or pricing info in my database; it’s all in Stripe. I don’t have any duplicated or hardcoded pricing information since I just pull it all from Stripe in order to render the Billing page. This means I can go into Stripe and make changes to my pricing structure, like say increase the price on one of my plans, and that change will be reflected next time someone loads the Billing page.
It was a little extra work to set things up this way but I’m glad I did it because it will for sure save time and potential headaches down the line.
What’s left to do to finish off the payments integration is
- Test all my webhook endpoints to make sure they handle events properly
- Add guards around the relevant features so they are only accessible if you have a sufficient subscription level
I’m guessing that work will take me through this weekend. I may also use this as an opportunity to set up some automated testing, since I think the payment flow is important enough to warrant that investment.
In other news, my Oura ring should come tomorrow which will allow me to start working on the Oura integration. You can’t get access to their API without a ring, so I had to order one before starting the work on that.