Payments
Make payment webhooks reliable
A customer pays, the webhook fails or arrives twice, and their account is wrong.
- What you get
- Webhooks verified, safe to receive twice, and logged so you can replay a failed one.
- Paste it into
- Your AI tool, in your project
The prompt
Review how this project handles webhooks from my payment provider. Check that the handler verifies the signature using the raw request body, answers quickly and does slow work afterwards, records each event ID so a repeated event does nothing the second time, copes with events arriving out of order, and returns an error only when a retry would help. List which event types we listen for, and which ones we need and don't handle, such as failed renewals, refunds and cancellations. Fix the gaps. Then show me how to send test events locally with the provider's tool, send the same event twice, and prove the second one changed nothing.
Use it
Open your AI tool (Claude Code, Codex or Cursor) in your project folder and paste it in.
More in Payments
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.
Handle every subscription state
Signing up to a plan works, and nothing happens when a card fails or someone cancels.
Add payments the safe way
Checkout looks done when the success page shows, and that page proves nothing.