Skip to main content
All skills

Subscription & Billing Lifecycle

Billing is a state machine wearing a pricing page. Almost every unpleasant subscription bug is a state nobody drew — a failed renewal, a mid-cycle downgrade, a card that recovers three days late.

How I use it

  1. Entitlement derived from billing state

    Access resolved from the subscription rather than copied into a flag at checkout. The copy is always correct until the first failed payment, then it is silently wrong for everyone it happened to.

  2. Grace periods and dunning

    A payment failure should degrade access, not detonate it. Most involuntary churn is a recoverable card treated as a cancellation.

  3. Webhook handling

    Stripe and Square webhooks handled idempotently and ordered by event rather than arrival. They will duplicate and they will race, and both are the receiver’s problem to solve.

What I use

  • Stripe
  • Square
  • PostgreSQL
  • Drizzle ORM

Related skills

Want the detail behind any of this?

I can walk through any of it in as much depth as you want.

Get in touch