Stripe Payments in 5 Minutes
How RailsFast handles subscriptions and one-time payments
By RailsFast Team
payments
stripe
subscriptions
Payments are one of the most critical features of any SaaS. Get it wrong and you lose revenue. Get it right and it just works invisibly in the background.
The Pay Gem
RailsFast uses the excellent Pay gem for Stripe integration:
# In your User model
class User < ApplicationRecord
pay_customer
end
# Create a subscription
user.payment_processor.subscribe(plan: "pro_monthly")
# Check subscription status
user.subscribed? # => true
user.on_trial? # => false
user.subscription.active? # => true
Webhooks Just Work
Stripe webhooks are pre-configured and ready:
customer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
No manual webhook handling required.
Revenue Dashboard
Track your MRR, subscriptions, and revenue trends with the built-in Profitable dashboard. See your business metrics at a glance without integrating external analytics tools.
Try It in This Demo
This demo has Stripe in test mode. Try the checkout flow:
- Go to the pricing page
- Select a plan
- Use test card
4242 4242 4242 4242 - Complete the checkout
You'll see the full subscription flow in action.