> Stripe Payments Integration

Accept payments with Stripe. Checkout sessions, subscriptions, webhooks, and customer management.

fetch
$curl "https://skillshub.wtf/skillshub-team/catalog-batch5/stripe-payments?format=md"
SKILL.mdStripe Payments Integration

Stripe Payments

Setup

npm install stripe

Checkout Session

import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);

const session = await stripe.checkout.sessions.create({
    mode: 'payment',
    line_items: [{ price: 'price_xxx', quantity: 1 }],
    success_url: 'https://app.com/success?session_id={CHECKOUT_SESSION_ID}',
    cancel_url: 'https://app.com/cancel',
});
// Redirect to session.url

Subscriptions

const session = await stripe.checkout.sessions.create({
    mode: 'subscription',
    line_items: [{ price: 'price_monthly', quantity: 1 }],
    success_url: '...',
});

Webhooks

app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
    const sig = req.headers['stripe-signature'];
    const event = stripe.webhooks.constructEvent(req.body, sig, WEBHOOK_SECRET);
    switch (event.type) {
        case 'checkout.session.completed': handlePayment(event.data.object); break;
        case 'customer.subscription.deleted': handleCancellation(event.data.object); break;
    }
    res.json({ received: true });
});

Customer Portal: stripe.billingPortal.sessions.create({ customer })

┌ stats

installs/wk0
░░░░░░░░░░
first seenMar 18, 2026
└────────────

┌ tags

└────────────