Stripe Integration skill for Claude

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks.

When Claude uses it

Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

Stripe Integration SKILL.md

The full skill file from wshobson/agents (MIT).

Stripe Integration

Master Stripe payment processing integration for robust, PCI-compliant payment flows including checkout, subscriptions, webhooks, and refunds.

When to Use This Skill

  • Implementing payment processing in web/mobile applications
  • Setting up subscription billing systems
  • Handling one-time payments and recurring charges
  • Processing refunds and disputes
  • Managing customer payment methods
  • Implementing SCA (Strong Customer Authentication) for European payments
  • Building marketplace payment flows with Stripe Connect

Core Concepts

1. Payment Flows

Checkout Sessions

  • Recommended for most integrations
  • Supports all UI paths:
    • Stripe-hosted checkout page
    • Embedded checkout form
    • Custom UI with Elements (Payment Element, Express Checkout Element) using ui_mode='custom'
  • Provides built-in checkout capabilities (line items, discounts, tax, shipping, address collection, saved payment methods, and checkout lifecycle events)
  • Lower integration and maintenance burden than Payment Intents

Payment Intents (Bespoke control)

  • You calculate the final amount with taxes, discounts, subscriptions, and currency conversion yourself.
  • More complex implementation and long-term maintenance burden
  • Requires Stripe.js for PCI compliance

Setup Intents (Save Payment Methods)

  • Collect payment method without charging
  • Used for subscriptions and future payments
  • Requires customer confirmation

2. Webhooks

Critical Events:

  • payment_intent.succeeded: Payment completed
  • payment_intent.payment_failed: Payment failed
  • customer.subscription.updated: Subscription changed
  • customer.subscription.deleted: Subscription canceled
  • charge.refunded: Refund processed
  • invoice.payment_succeeded: Subscription payment successful

3. Subscriptions

Components:

  • Product: What you're selling
  • Price: How much and how often
  • Subscription: Customer's recurring payment
  • Invoice: Generated for each billing cycle

4. Customer Management

  • Create and manage customer records
  • Store multiple payment methods
  • Track customer metadata
  • Manage billing details

Quick Start

import stripe

stripe.api_key = "sk_test_..."

# Create a checkout session
session = stripe.checkout.Session.create(
    line_items=[{
        'price_data': {
            'currency': 'usd',
            'product_data': {
                'name': 'Premium Subscription',
            },
            'unit_amount': 2000,  # $20.00
            'recurring': {
                'interval': 'month',
            },
        },
        'quantity': 1,
    }],
    mode='subscription',
    success_url='https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}',
    cancel_url='https://yourdomain.com/cancel'
)

# Redirect user to session.url
print(session.url)

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Testing

# Use test mode keys
stripe.api_key = "sk_test_..."

# Test card numbers
TEST_CARDS = {
    'success': '4242424242424242',
    'declined': '4000000000000002',
    '3d_secure': '4000002500003155',
    'insufficient_funds': '4000000000009995'
}

def test_payment_flow():
    """Test complete payment flow."""
    # Create test customer
    customer = stripe.Customer.create(
        email="test@example.com"
    )

    # Create payment intent
    intent = stripe.PaymentIntent.create(
        amount=1000,
        automatic_payment_methods={
            'enabled': True
        },
        currency='usd',
        customer=customer.id
    )

    # Confirm with test card
    confirmed = stripe.PaymentIntent.confirm(
        intent.id,
        payment_method='pm_card_visa'  # Test payment method
    )

    assert confirmed.status == 'succeeded'

How to install Stripe Integration

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit wshobson/agents/plugins/payment-processing/skills/stripe-integration#main ~/.claude/skills/stripe-integration

Codex

npx degit wshobson/agents/plugins/payment-processing/skills/stripe-integration#main ~/.codex/skills/stripe-integration

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Stripe Integration skill do?

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

+How do I install Stripe Integration in Claude Code?

Copy the skill folder into ~/.claude/skills/stripe-integration, for example with "npx degit wshobson/agents/plugins/payment-processing/skills/stripe-integration#main ~/.claude/skills/stripe-integration". Claude Code loads it automatically and uses it when a task matches.

+Does Stripe Integration work with ChatGPT or Codex?

Yes. Stripe Integration uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/stripe-integration. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Stripe Integration free?

Stripe Integration is published on GitHub by wshobson under the MIT license, which allows free use.

Related finance skills

  1. Finance Skills

    Pick the right finance skill: ratios, DCF, forecasts (financial-analyst), ARR, churn, CAC, LTV (saas-metrics-coach), month-end-close.

    alirezarezvani/claude-skills★ 30k
  2. Pricing

    When the user wants to set pricing and packaging, or asks what to charge, whether to raise prices, or how to move existing customers:…

    coreyhaines31/marketingskills★ 61k
  3. Invoice Organizer

    Automatically organizes invoices and receipts for tax preparation by reading messy files, extracting key information, renaming them…

    ComposioHQ/awesome-claude-skills★ 80k
  4. Churn Prevention

    Use when designing a cancel flow, save offers, exit surveys or dunning emails, or cutting failed-payment churn.

    alirezarezvani/claude-skills★ 30k
  5. Financial Analyst

    Analyze financial statements, value a company with a DCF, explain budget variance, build rolling forecasts.

    alirezarezvani/claude-skills★ 30k
  6. Pricing Strategist

    Use when choosing or revisiting pricing: seat, usage, value-based, freemium or hybrid, Van Westendorp willingness-to-pay analysis, or…

    alirezarezvani/claude-skills★ 30k
  7. Pricing Strategy

    Use for SaaS pricing tiers, value metric, packaging, a pricing page or a price increase, before proposing numbers.

    alirezarezvani/claude-skills★ 30k
  8. Slo Architect

    Use when defining or reviewing SLOs, SLIs, error budgets or burn-rate alerts.

    alirezarezvani/claude-skills★ 30k
  9. Stock Analysis

    Analyze, research or value a listed stock or company (US, global, NSE or BSE) with verified data, ratios, scores and valuation.

    alirezarezvani/claude-skills★ 30k

See all finance skills →

More skills from wshobson

  1. Superself

    Use when a project keeps its state in Superself (a `<!-- superself:begin` block in AGENTS.md or CLAUDE.md, or `self setup` resolves the…

    wshobson/agents★ 43k
  2. Task Coordination Strategies

    Decompose complex tasks, design dependency graphs, and coordinate multi-agent work with proper task descriptions and workload balancing.

    wshobson/agents★ 43k
  3. Team Communication Protocols

    Structured messaging protocols for agent team communication including message type selection, plan approval, shutdown procedures, and…

    wshobson/agents★ 43k

All skills by wshobson →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.