baasith6/cursor-skills/adding-stripe
Claude Code and agent skill by baasith6/cursor-skills
- community
Checking that the SKILL.md file is still in the repository.
Integrate Stripe payments into a web application, including checkout sessions, webhooks, and customer portal.
Install
npx vskill@latest install baasith6/cursor-skills/adding-stripeSKILL.md
The same SKILL.md was published earlier as spencerpauly/awesome-cursor-skills/adding-stripe.
Add Stripe Payments
Use this skill when the user asks to add payments, billing, subscriptions, or Stripe integration.
Steps
- Install the SDK
``bash npm install stripe @stripe/stripe-js ``
- Add environment variables
`` STRIPE_SECRET_KEY=sk_test_... NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_... STRIPE_WEBHOOK_SECRET=whsec_... ``
- Create a Stripe client module — create
lib/stripe.ts:
```ts import Stripe from "stripe";
export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, { apiVersion: "2024-12-18.acacia", }); ```
- Create a checkout API route — create an endpoint that creates a Stripe Checkout session:
``ts const session = await stripe.checkout.sessions.create({ mode: "subscription", // or "payment" for one-time payment_method_types: ["card"], line_items: [{ price: priceId, quantity: 1 }], success_url: ${origin}/success?session_id={CHECKOUT_SESSION_ID}, cancel_url: ${origin}/pricing, customer_email: userEmail, }); return redirect(session.url!); ``
- Create a webhook handler — create a
POSTendpoint at/api/webhooks/stripe:
- Verify the webhook signature using
stripe.webhooks.constructEvent. - Handle key events:
checkout.session.completed,customer.subscription.updated,customer.subscription.deleted,invoice.payment_failed. - Update your database with the subscription status.
- Add customer portal (optional) — create an endpoint that redirects to
stripe.billingPortal.sessions.createso users can manage their subscription.
- Add pricing page UI — create a pricing page with plan cards that call the checkout API route.
Notes
- Always verify webhook signatures — never trust unverified payloads.
- Use Stripe CLI (
stripe listen --forward-to localhost:3000/api/webhooks/stripe) for local webhook testing. - Store the Stripe customer ID in your user database to avoid creating duplicate customers.
- Use
stripe.prices.listto fetch prices dynamically instead of hardcoding them.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingresources/adding-stripe/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/baasith6/cursor-skills/adding-stripe)