- Home
- Skills
- APIs & Backend
- Payment Integration Lite — Stripe Checkout Quickstart
Payment Integration Lite — Stripe Checkout Quickstart
Secure Stripe Checkout integration with server-side session creation and verified webhook fulfillment.
Free
Payment Integration Lite — Stripe Checkout Quickstart
Example session with this skill installed
I need to add Stripe Checkout to my Express app for a $19 one-time payment. Show me the session creation and the webhook handler for fulfillment.
- Read your context and instructions
- Compiled the payment integration lite
I will implement a server-side Stripe Checkout flow. This includes a session creation endpoint with idempotency keys and a signature-verified webhook handler to process the checkout.session.completed event safely.
Stripe Checkout Integration
// 1. Create Checkout Session
// Route to initiate payment
app.post('/create-checkout-session', async (req, res) => {
const { orderId, userId } = req.body;
// map orderId to your server-side price catalog
const PRICE_ID = 'price_12345';
try {
const session = await stripe.checkout.sessions.create({
mode: 'payment',
line_items: [{ price: PRICE_ID, quantity: 1 }],
success_url: `${process.env.APP_URL}/success?session_id={CHECKOUT_SESSION_ID}`,
cancel_url: `${process.env.APP_URL}/pricing`,
client_reference_id: userId,
metadata: { user_id: userId, order_id: orderId },
}, {
idempotencyKey: `checkout-${orderId}`
});
res.redirect(303, session.url);
} catch (e) {
res.status(500).json({ error: e.message });
}
});
// 2. Verified Webhook Handler
// Use express.raw() for this specific route to keep the body untouched
app.post('/webhook', express.raw({ type: 'application/json' }), async (req, res) => {
let event;
const sig = req.headers['stripe-signature'];
try {
event = stripe.webhooks.constructEvent(
req.body,
sig,
process.env.STRIPE_WEBHOOK_SECRET
);
} catch (err) {
return res.status(400).send(`Webhook Error: ${err.message}`);
}
// Handle the fulfillment
if (event.type === 'checkout.session.completed') {
const session = event.data.object;
// Check if we already processed this event ID in our DB
const isNewEvent = await db.processedEvents.insertIfAbsent(event.id);
if (isNewEvent) {
await fulfillOrder(session);
}
}
res.sendStatus(200);
});
async function fulfillOrder(session) {
// Verify payment_status is 'paid' before delivering
if (session.payment_status === 'paid') {
await db.orders.update(session.metadata.order_id, { status: 'fulfilled' });
// Trigger digital delivery logic here
}
}
Next steps
- Replace
PRICE_IDwith a real price ID from your Stripe Dashboard test mode. - Install the Stripe CLI and run
stripe listen --forward-to localhost:4242/webhookto get your localwhsec_secret. - Test the flow using the
4242test card to confirm your database updates correctly.
Connects securely to your tools. The creator never sees your data.
About this skill
Free quickstart version of the Payment Integration Skill: get a Stripe Checkout payment page live the safe way — server-side amounts, a verified webhook handler, exactly-once fulfillment, and the test cards to prove it works before you go live. The three safety rules that prevent the classic money bugs are included in full. General information, not legal or financial advice.
Supports one-time payments only. No logic for subscriptions, trials, refunds, or disputes. Requires manual setup of Stripe SDK and environment variables.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 3 days ago
- Free with an Agensi account
Permissions
What's inside
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.