Payments
Handle every subscription state
Signing up to a plan works, and nothing happens when a card fails or someone cancels.
- What you get
- One table of plan states and what the app does in each, with the missing ones built.
- Paste it into
- Your AI tool, in your project
The prompt
Check that this app handles subscriptions past the first payment. List every state a subscription can be in with my provider: trial, active, past due, cancelled but paid until the period ends, ended, paused, refunded. For each one, tell me what the app does today and what the user sees. Fill the gaps: keep access until the paid period ends after a cancel, warn and retry on a failed payment before removing access, handle upgrades and downgrades mid-period, and let users manage or cancel without emailing me. One place in the code should decide what a user can access. Test each state with the provider's test clocks or test events.
Use it
Open your AI tool (Claude Code, Codex or Cursor) in your project folder and paste it in.
More in Payments
Add payments the safe way
Checkout looks done when the success page shows, and that page proves nothing.
Make payment webhooks reliable
A customer pays, the webhook fails or arrives twice, and their account is wrong.
Someone paid and didn’t get access
The money arrived and the account still says free. Or the reverse.
Switch payments from test to live
Everything works with test cards, and live mode has its own keys, webhooks and settings.