Skip to main content
skill CX Codex

payment-gateway-integration · secondsky — Claude Code skill: take payments

A skill for wiring Stripe, PayPal or Square into your app: payment intents, subscriptions, webhooks and refunds. Useful when you build checkout or billing.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add secondsky/claude-skills --skill payment-gateway-integration -a claude-code
Open on GitHub

What payment-gateway-integration does

The skill hands your agent ready-made patterns for payment providers. It ships a Node.js PaymentService class for Stripe: creating a payment intent with the amount converted to cents, starting a subscription from a priceId, and refunding a payment_intent. A separate section covers webhooks — the signature goes through stripe.webhooks.constructEvent, and events like payment_intent.succeeded and invoice.payment_failed branch into their own handlers.

PayPal lives in references/paypal-integration.md: order creation and capture, refunds, webhooks, frontend SDK wiring, success and cancel callbacks. There is also a security checklist — official SDK only, verified webhook signatures, HTTPS on every payment route, idempotency keys, retry logic.

Stripe keys come from environment variables, STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET. Hardcode them and webhook signature verification stops meaning anything, so move the secrets out before the first run. Test keys in production break things just as fast.

What it helps with

  • create a payment intent and convert the amount to cents
  • start a subscription with an incomplete first payment
  • verify an incoming Stripe webhook signature
  • refund a payment intent in full or in part
  • route succeeded and failed payment events to separate handlers

Example prompts for the agent

  • Add Stripe checkout to this project: payment intent, subscription and refund
  • Set up the /webhooks/stripe route with signature verification and a payment_intent.succeeded handler
  • Walk me through the PayPal setup in references/paypal-integration.md

How to install payment-gateway-integration

1Skills CLI (Vercel)

npx skills add secondsky/claude-skills --skill payment-gateway-integration -a claude-code

2Manually: put the files in place

~/.claude/skills/payment-gateway-integration/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/payment-gateway-integration/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about payment-gateway-integration

How do I install payment-gateway-integration in Claude?

Run npx skills add secondsky/claude-skills --skill payment-gateway-integration -a claude-code. The skill lands in ~/.claude/skills/payment-gateway-integration/SKILL.md.

What does payment-gateway-integration do?

It integrates payment processing through Stripe, PayPal or Square: checkout flows, recurring billing, webhooks, refunds and disputes. It also covers PCI compliance and safe handling of card data.

Which keys does it need?

The Stripe code reads STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET from the environment. Without the webhook secret, signature verification fails.

Source text

SKILL.md · MIT
---
name: payment-gateway-integration
description: Integrates payment processing with Stripe, PayPal, or Square including subscriptions, webhooks, and PCI compliance. Use when implementing checkout flows, recurring billing, or handling refunds and disputes.
license: MIT
---

# Payment Gateway Integration

Integrate secure payment processing with proper error handling and compliance.

## Stripe Integration (Node.js)

```javascript
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);

class PaymentService {
  async createPaymentIntent(amount, currency, customerId) {
    return stripe.paymentIntents.create({
      amount: Math.round(amount * 100), // Convert to cents
      currency,
      customer: customerId,
      automatic_payment_methods: { enabled: true }
    });
  }

  async createSubscription(customerId, priceId) {
    return stripe.subscriptions.create({
      customer: customerId,
      items: [{ price: priceId }],
      payment_behavior: 'default_incomplete',
      expand: ['latest_invoice.payment_intent']
    });
  }

  async refund(paymentIntentId, amount = null) {
    const params = { payment_intent: paymentIntentId };
    if (amount) params.amount = Math.round(amount * 100);
    return stripe.refunds.create(params);
  }
}
```

## Webhook Handling

```javascript
app.post('/webhooks/stripe', express.raw({ type: 'application/json' }), (req, res) => {
  const sig = req.headers['stripe-signature'];

  let event;
  try {
    event = stripe.webhooks.constructEvent(req.body, sig, process.env.STRIPE_WEBHOOK_SECRET);
  } catch (err) {
    return res.status(400).send(`Webhook Error: ${err.message}`);
  }

  switch (event.type) {
    case 'payment_intent.succeeded':
      await handlePaymentSuccess(event.data.object);
      break;
    case 'invoice.payment_failed':
      await handlePaymentFailed(event.data.object);
      break;
  }

  res.json({ received: true });
});
```

## PayPal Integration

See [references/paypal-integration.md](references/paypal-integration.md) for complete PayPal implementation with:
- Order creation and capture
- Refund processing
- Webhook handling
- Frontend SDK integration
- Success/cancel callbacks

## Security Checklist

- [ ] Use official SDK only
- [ ] Verify webhook signatures
- [ ] Never log full card numbers
- [ ] Store minimal payment data
- [ ] Test in sandbox first
- [ ] HTTPS for all payment routes
- [ ] Handle all error cases
- [ ] Use idempotency keys
- [ ] Implement retry logic

## Best Practices

**Do:**
- Use official SDK libraries
- Verify all webhook signatures
- Log transaction IDs (not card data)
- Test in sandbox environment
- Handle all payment states
- Implement proper error messages

**Don't:**
- Process raw card data directly
- Store sensitive payment info
- Hardcode API keys
- Skip webhook signature validation
- Ignore failed payment events
- Use test keys in production

© secondsky · MIT · secondsky/claude-skills

Similar skills

Everything for Backend and APIs →

payment-gateway-integration by other authors comes first.

payment-gateway-integration aj-geddes A skill for wiring Stripe, PayPal and Square into your backend: charges, subscriptions, webhooks. Useful when you build billing or a store. CX Codex +1 524installs payment-integration mrgoonie A skill for wiring up payments: SePay and VietQR, Polar, Stripe, Paddle, Creem.io. Useful when you need checkout, subscriptions and webhooks in one pass. CX Codex +1 349installs payment-processing Seth Hobson A plugin for payment work: wires up Stripe and PayPal, helps build checkout, subscriptions and PCI compliance. Useful when payment code has to go into a project and you would rather not start from scratch. CX Codex ★ 41,729repo stars stripe-integration Seth Hobson This skill covers Stripe Checkout, subscriptions, webhooks, refunds, and saved payment methods. Use it when a project needs one-time or recurring payments. CX Codex 13,404installs payment-testing kindlmann A testing skill for end-to-end payment flows against Stripe, Adyen, and PayPal sandboxes. Helps automate card declines, 3DS challenges, and webhook verification. CX Codex +1 978installs stripe-best-practices stripe This skill guides Stripe API choices, payment flows, and integration security. Use it when building, testing, or reviewing Stripe code. CX Codex +1 98,100installs stripe-payments jezweb This skill wires Stripe payments into a web app: Checkout Sessions, subscriptions, webhooks and the customer portal. Useful when you need to start taking money. CX Codex +1 1,100installs

From the same set89

mobile-app-testing A skill for testing mobile apps: unit tests, UI automation, E2E and performance. Useful when you need to set up test infrastructure. CX Codex +1 467installs bun-test-basics A skill that feeds your agent the bun:test syntax: assertions, describe/it, skip/only/each modifiers and how to run the suite. CX Codex +1 458installs threejs A skill with reference files and working examples for Three.js: scenes, materials, lighting, shaders, GLTF loading. Useful when you build 3D in the browser. CX Codex +1 460installs ml-model-training A skill that walks the agent through the full model training cycle: data prep, splitting, training and evaluation. Useful when you need a classifier or regressor without skipping steps. CX Codex +1 457installs api-reference-documentation Turns an OpenAPI spec into a developer-facing API reference: endpoints, auth, request and response examples. Useful for SDK docs and developer portals. CX Codex +1 454installs csrf-protection A skill that walks your agent through CSRF protection: synchronizer tokens, double-submit cookies and SameSite attributes. CX Codex +1 453installs bun-hono-integration A skill that tells the agent how to build Hono APIs on Bun: routes, middleware, Zod validation, RPC client. Useful when your project already runs on Bun. CX Codex +1 452installs interaction-design A skill for designing interface feedback: loading states, errors, empty screens, animation timing and accessibility. Useful when you need to plan how UI behaves, not just how it looks. CX Codex +1 441installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor