B
CursorWire subscriptions and webhooks into an existing API
Setup to Add Stripe Billing and Webhooks Safely
Setuproll editorial@setuproll84.0Overall score
A Cursor setup focused on the error-prone parts of payments: idempotent webhook handlers, signature verification and keeping your database tier in sync with Stripe. For SaaS builders adding billing who cannot afford a webhook that silently drops events.
84.0Score
5Components
Get this build
terminal
stripe login && stripe listen --forward-to localhost:3000/api/webhooks/stripeWhat gets written
- .cursor/rules/setuproll.mdc
- .cursor/mcp.json
Components
Model
- Claude Opus 5
MCP servers
- stripe
- postgres
- github
Stack
- Stripe SDK
- Stripe CLI for local webhooks
- Postgres
Rules
- Always verify the webhook signature before processing
- Make every handler idempotent on the Stripe event id
- Treat the webhook as the source of truth, not the redirect
How it works
- Stripe MCP reads products and prices so handlers match real ids
- Generates a signature-verified webhook with idempotency keys
- Maps checkout.session.completed and subscription.deleted to the tier column
- Stripe CLI replays events locally so flows are tested before deploy
Summary
A Cursor setup focused on the error-prone parts of payments: idempotent webhook handlers, signature verification and keeping your database tier in sync with Stripe. For SaaS builders adding billing who cannot afford a webhook that silently drops events.
84.0 score
0 Reviews
Your rating
Sign in to post
Loading discussion...