Stripe Payments
Add Stripe payments to a web app, Checkout Sessions, Payment Intents, subscriptions...
Install
npx skills add jezweb/claude-skills --skill stripe-payments -g -a claude-code -y- Repository
- jezweb/claude-skills1.1k
- Category
- AI and agents
- Updated
- 26d ago
- License
- MIT
- Context cost
- Mediumabout 2,354 tokens
- Runs scripts
- No, instructions only
What it does
Add Stripe payments to a web app, Checkout Sessions, Payment Intents, subscriptions, webhooks, customer portal, and pricing pages. Covers the decision of which Stripe API to use, produces working integration code, and handles webhook verification. No MCP server needed, uses Stripe npm package directly. Triggers: 'add payments', 'stripe', 'checkout', 'subscription', 'payment form', 'pricing page', 'billing', 'accept payments', 'stripe webhook', 'customer portal'.
Stripe Payments
Add Stripe payments to a web app. Covers the common patterns, one-time payments, subscriptions, webhooks, customer portal, with working code. No MCP server needed.
Which Stripe API Do I Need?
| You want to... | Use | Complexity |
|---|---|---|
| Accept a one-time payment | Checkout Sessions | Low, Stripe hosts the payment page |
| Embed a payment form in your UI | Payment Element + Payment Intents | Medium, you build the form, Stripe handles the card |
| Recurring billing / subscriptions | Checkout Sessions (subscription mode) | Low-Medium |
| Save a card for later | Setup Intents | Low |
| Marketplace / platform payments | Stripe Connect | High |
| Let customers manage billing | Customer Portal | Low, Stripe hosts it |
Default recommendation: Start with Checkout Sessions. It's the fastest path to accepting money. You can always add embedded forms later.
Setup
Install
npm install stripe @stripe/stripe-js
API Keys
# Get keys from: https://dashboard.stripe.com/apikeys
# Test keys start with sk_test_ and pk_test_
# Live keys start with sk_live_ and pk_live_
# For Cloudflare Workers, store as secrets:
npx wrangler secret put STRIPE_SECRET_KEY
npx wrangler secret put STRIPE_WEBHOOK_SECRET
# For local dev, .dev.vars:
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_PUBLISHABLE_KEY=pk_test_...
Server-Side Client
import Stripe from 'stripe';
// Cloudflare Workers
const stripe = new Stripe(c.env.STRIPE_SECRET_KEY);
// Node.js
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
One-Time Payment (Checkout Sessions)
The fastest way to accept payment. Stripe hosts the entire checkout page.
Create a Checkout Session (Server)
app.post('/api/checkout', async (c) => {
const { priceId, successUrl, cancelUrl } = await c.req.json();

