Rails Implementation Guide · Coming soon · $27

Billing in Rails 8

Build subscription billing that survives beyond the first successful Stripe Checkout.

A focused guide to Stripe, Pay, stable application plans, durable Checkout, local subscription state, entitlements, limits, plan changes, recovery, and reconciliation.

One $27 product · PDF, EPUB, HTML, reference implementation, and Agent Companion

Cover of Billing in Rails 8 by Rob Race

The architecture

Stripe and Pay should not become your product model.

Stripe owns money and provider-side billing machinery. Pay owns repetitive Rails integration plumbing. Your application owns stable plan identity, product policy, entitlements, limits, and the customer experience.

Ordinary rendering and access checks stay local. Provider calls happen during explicit Checkout, plan-change, synchronization, and reconciliation operations.

StripePayBillingPlanCatalogEntitlements + LimitsProduct behavior

What the guide gets strict about

Clear boundaries for the parts most likely to drift.

Stable plan identity

Product code understands :free, :pro, and :business. Stripe Price IDs remain centralized provider mappings.

Durable Checkout

Persist local intent before the network call, reject conflicting live operations, and never treat a browser redirect as billing truth.

Local subscription semantics

Separate billing relationship, provider access, paid product access, cancellation state, and configuration errors.

Product policy

Keep Boolean entitlements, quantitative limits, and user authorization separate, then enforce them at server-side mutation boundaries.

Safe plan changes

Let Rails choose the intended plan while hosted provider flows present proration and payment consequences.

Explicit repair

Reconcile provider and local state deliberately, report unknown mappings, and keep ordinary page reads fast and local.

Inside the guide

Twelve chapters from first principles through operations.

01

Billing Is More Than Taking a Payment

02

Understand the Stripe Machinery

03

Own Your Plan Catalog

04

Put Pay Behind Your Billing Boundary

05

Build Checkout, Then Make It Reliable

06

Keep Subscription State Local

07

Turn Plans Into Product Access

08

Build the Billing Experience

09

Upgrade, Downgrade, and Change Billing Cycles

10

Trials, Cancellation, and Failed Payments

11

Reconcile and Debug Billing State

12

Test the System You Actually Built

Plus: a short appendix explaining when add-ons, metering, multiple items, replacement Prices, grandfathering, and complex account overrides force the model to grow.

Everything included

One product. No artificial editions.

Book

The complete implementation guide

  • 111-page PDF, plus EPUB and HTML
  • Stripe machinery explained before the abstractions
  • Pay-backed Rails architecture and billing UX
  • Checkout, lifecycle, changes, recovery, and reconciliation
Reference

Adaptable Rails implementation

  • Plan catalog, Billing boundary, entitlements, and limits
  • Durable Checkout model, migration, controller, and view
  • Downgrade validation and reconciliation job
  • Focused Rails and PostgreSQL tests
Agent Companion

Implementation context for coding agents

  • Shared capability and architectural contracts
  • Recipes for adding and changing billing behavior
  • Concrete examples and billing review checklist
  • Thin Codex and Claude Code entrypoints

Coming soon

Billing in Rails 8 will be $27.

The complete book, all three formats, the adaptable reference implementation, and the Agent Companion will ship together.

Email me when it is ready