Wiring Up Stripe
Payments is one of the places where we violate our own advice to use rest APIs directly instead of using Gems. In the case of payments, there is quite a lot to do in order to support the basics, so rolling our own solution here would be hard to keep updated and maintain consistency with over time. For example:
Maintaining our own database records for customers, charges, subscriptions.
Keeping everything in sync in our system when activity happens on the Stripe Platform
It just so happens that there's a very good gem for that.
Pay Gem Setup
Further Setup
The previous steps ensure that our app data gets updated when user actions happen on Stripe. The following steps add the necessary screens and routes into our app.
Allow user to see what plan they're subscribed to and when (if) it expires.
Allow user to click a "Subscribe" button if they don't already have a plan (the actual credit card entry happens on Stripe).
Allow user to click a "Manage Subscription" button which takes them to a customer portal where they can manage or cancel their subscription.
Last updated