$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
PaymentsintermediateNew

Stripe Integration

Share

Integrate Stripe payments with checkout and payment intents

Works with OpenClaude

You are a backend payment integration engineer. The user wants to integrate Stripe payments with checkout flow and payment intents.

What to check first

  • Run npm list stripe to verify the Stripe Node.js library is installed (npm install stripe)
  • Confirm your Stripe API keys are set in environment variables: STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY
  • Check your Node.js version supports async/await (v7.6+)

Steps

  1. Initialize the Stripe client with your secret key at the top of your payment module
  2. Create a Payment Intent before charging to handle asynchronous payment confirmation
  3. Implement the /create-payment-intent endpoint that returns the client secret
  4. Call stripe.paymentIntents.create() with amount in cents, currency, and metadata
  5. Return the client_secret to your frontend for Stripe.js to confirm
  6. Handle the confirmation response and check payment_intent.status for success
  7. Implement webhook listener for payment_intent.succeeded and payment_intent.payment_failed events
  8. Verify webhook signatures using stripe.webhooks.constructEvent() before processing

Code

const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
const express = require('express');
const app = express();

app.use(express.json());

// Create Payment Intent endpoint
app.post('/create-payment-intent', async (req, res) => {
  const { amount, currency = 'usd', customerId, metadata = {} } = req.body;

  try {
    const paymentIntent = await stripe.paymentIntents.create({
      amount: Math.round(amount * 100), // Convert dollars to cents
      currency,
      customer: customerId,
      metadata,
      automatic_payment_methods: {
        enabled: true,
      },
    });

    res.json({ clientSecret: paymentIntent.client_secret });
  } catch (error) {
    res.status(400).json({ error: error.message });
  }
});

// Confirm payment from frontend, then verify on backend
app.post('/confirm-payment', async (req, res) => {
  const { paymentIntentId } = req.body;

  try {
    const paymentIntent = await stripe.paymentIntents.retrieve(paymentIntentId);

    if (paymentIntent.status === 'succeeded') {
      res.json({ success: true, paymentIntent });
    } else if (paymentIntent.status === 'requires_payment_method') {
      res.status(400).json({ error: 'Payment method required' });
    } else {
      res.status(400).json({ error: `Payment status: ${paymentIntent.status}` });
    }
  } catch (error) {
    res.status(400).json({ error: error.message });
  }
});

// Webhook handler for async

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryPayments
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
paymentsstripecheckout

Install command:

curl -o ~/.claude/skills/stripe-integration.md https://claude-skills-hub.vercel.app/skills/payments/stripe-integration.md

Related Payments Skills

Other Claude Code skills in the same category — free to download.

Want a Payments skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.