Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
wshobson avatar

Stripe Integration

  • 11.2k installs
  • 38.5k repo stars
  • Updated July 22, 2026
  • wshobson/agents

How to implement PCI-compliant payment processing using Stripe checkout sessions, payment intents, subscriptions, and webhook handlers.

About

This skill covers implementing Stripe payment processing including checkout sessions, payment intents, subscriptions, webhooks, and customer management. Developers use it when building payment flows for one-time purchases, recurring billing, or marketplace transactions. Core workflows include setting up checkout sessions (recommended for most cases), handling subscription lifecycle events via webhooks (payment_intent.succeeded, customer.subscription.updated), managing customer records and payment methods, and testing with Stripe's test mode and card numbers. The skill emphasizes PCI-compliant patterns and provides Python SDK examples for quick integration.

  • Checkout sessions recommended for most integrations with built-in support for discounts, tax, shipping, and saved paymen
  • Payment Intents for bespoke control when custom amount calculation (taxes, discounts, currency) is required
  • Setup Intents to collect and save payment methods without charging for future recurring payments
  • Critical webhook events: payment_intent.succeeded, payment_intent.payment_failed, customer.subscription.updated, custome
  • Test mode with predefined card numbers (4242424242424242 success, 4000000000000002 declined, 4000002500003155 3D Secure)

Stripe Integration by the numbers

  • 11,151 all-time installs (skills.sh)
  • +182 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #73 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: HIGH risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

stripe-integration capabilities & compatibility

Capabilities
create and manage checkout sessions · handle payment intents with custom amounts · implement webhook listeners for payment events · manage customer records and payment methods · process subscriptions and recurring charges · handle refunds and disputes · test with stripe test mode and card numbers
Works with
stripe
Use cases
api development
Platforms
macOS · Windows · Linux
Runs
Remote server
Pricing
Bring your own API key
npx skills add https://github.com/wshobson/agents --skill stripe-integration

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs11.2k
repo stars38.5k
Security audit2 / 3 scanners passed
Last updatedJuly 22, 2026
Repositorywshobson/agents

What it does

Integrate Stripe payment processing for checkout, subscriptions, and webhooks in web or mobile applications.

Who is it for?

Web/mobile apps requiring payment processing, SaaS platforms with subscription models, marketplaces, ecommerce stores, recurring billing systems.

Skip if: Applications that do not accept payments or use non-Stripe payment processors.

When should I use this skill?

Building checkout flow, implementing subscriptions, handling refunds, collecting payment methods, processing webhooks, or integrating marketplace payments.

What you get

Developers can integrate Stripe to accept payments, manage subscriptions, store payment methods, and handle refunds without building custom PCI-compliant infrastructure.

  • Checkout session creation code
  • Webhook listener implementation
  • Subscription management code

By the numbers

  • 6 critical webhook events documented: payment_intent.succeeded, payment_intent.payment_failed, customer.subscription.upd
  • 4 test card scenarios provided: success (4242424242424242), declined (4000000000000002), 3D Secure (4000002500003155), i
  • 3 core payment flow patterns: Checkout Sessions, Payment Intents, Setup Intents

Files

SKILL.mdMarkdownGitHub ↗

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'

Related skills

How it compares

Choose stripe-integration over generic payment tutorials when you need paste-ready Python Stripe SDK snippets aligned to Checkout Session fields.

FAQ

When should I use Checkout Sessions vs Payment Intents?

Use Checkout Sessions for most integrations (lower maintenance, built-in features like discounts/tax/shipping). Use Payment Intents when you need custom amount calculation or full bespoke control.

What is the difference between Setup Intents and Payment Intents?

Setup Intents collect and save payment methods without charging; use for subscriptions and future payments. Payment Intents both collect and charge immediately.

Which webhook events should I always listen for?

payment_intent.succeeded and payment_intent.payment_failed for payments; customer.subscription.updated, customer.subscription.deleted for subscriptions; charge.refunded for refunds.

Is Stripe Integration safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Backend & APIspaymentsecommerce

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.