Implement Stripe payment processing for robust
Stripe integration

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.
--- name: stripe-integration description: 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. --- # 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
Overview
Master Stripe payment processing integration for robust, PCI-compliant payment flows including checkout, subscriptions, webhooks, and refunds.
Manual install (npx, ZIP)
npx skills add wshobson/agents --skill stripe-integration -g -a claude-codemkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/wshobson/agents/tar.gz/4236bb91f839 \
| tar -xz -C ~/.claude/skills --strip-components=4 agents-4236bb91f839/plugins/payment-processing/skills/stripe-integrationNew-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/30a6fc7602d922334dd3/stripe-integration.zip" -OutFile "$env:TEMP\stripe-integration.zip"; Expand-Archive "$env:TEMP\stripe-integration.zip" -DestinationPath "$HOME\.claude\skills" -ForceConnects with Agent Alley MCP · agentalley.io/mcp
Files included
SKILL.md4.1 KBreferences/1 file · 10.1 KB
Read the files here
Show the full text147 lines
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 completedpayment_intent.payment_failed: Payment failedcustomer.subscription.updated: Subscription changedcustomer.subscription.deleted: Subscription canceledcharge.refunded: Refund processedinvoice.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="[email protected]"
)
# 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'
| 1 | |
| 2 | name stripe-integration |
| 3 | description 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. |
| 4 | |
| 5 | |
| 6 | # Stripe Integration |
| 7 | |
| 8 | Master Stripe payment processing integration for robust, PCI-compliant payment flows including checkout, subscriptions, webhooks, and refunds. |
| 9 | |
| 10 | ## When to Use This Skill |
| 11 | |
| 12 | Implementing payment processing in web/mobile applications |
| 13 | Setting up subscription billing systems |
| 14 | Handling one-time payments and recurring charges |
| 15 | Processing refunds and disputes |
| 16 | Managing customer payment methods |
| 17 | Implementing SCA (Strong Customer Authentication) for European payments |
| 18 | Building marketplace payment flows with Stripe Connect |
| 19 | |
| 20 | ## Core Concepts |
| 21 | |
| 22 | ### 1. Payment Flows |
| 23 | |
| 24 | **Checkout Sessions** |
| 25 | |
| 26 | Recommended for most integrations |
| 27 | Supports all UI paths: |
| 28 | Stripe-hosted checkout page |
| 29 | Embedded checkout form |
| 30 | Custom UI with Elements (Payment Element, Express Checkout Element) using `ui_mode='custom'` |
| 31 | Provides built-in checkout capabilities (line items, discounts, tax, shipping, address collection, saved payment methods, and checkout lifecycle events) |
| 32 | Lower integration and maintenance burden than Payment Intents |
| 33 | |
| 34 | **Payment Intents (Bespoke control)** |
| 35 | |
| 36 | You calculate the final amount with taxes, discounts, subscriptions, and currency conversion yourself. |
| 37 | More complex implementation and long-term maintenance burden |
| 38 | Requires Stripe.js for PCI compliance |
| 39 | |
| 40 | **Setup Intents (Save Payment Methods)** |
| 41 | |
| 42 | Collect payment method without charging |
| 43 | Used for subscriptions and future payments |
| 44 | Requires customer confirmation |
| 45 | |
| 46 | ### 2. Webhooks |
| 47 | |
| 48 | **Critical Events:** |
| 49 | |
| 50 | `payment_intent.succeeded`: Payment completed |
| 51 | `payment_intent.payment_failed`: Payment failed |
| 52 | `customer.subscription.updated`: Subscription changed |
| 53 | `customer.subscription.deleted`: Subscription canceled |
| 54 | `charge.refunded`: Refund processed |
| 55 | `invoice.payment_succeeded`: Subscription payment successful |
| 56 | |
| 57 | ### 3. Subscriptions |
| 58 | |
| 59 | **Components:** |
| 60 | |
| 61 | **Product**: What you're selling |
| 62 | **Price**: How much and how often |
| 63 | **Subscription**: Customer's recurring payment |
| 64 | **Invoice**: Generated for each billing cycle |
| 65 | |
| 66 | ### 4. Customer Management |
| 67 | |
| 68 | Create and manage customer records |
| 69 | Store multiple payment methods |
| 70 | Track customer metadata |
| 71 | Manage billing details |
| 72 | |
| 73 | ## Quick Start |
| 74 | |
| 75 | |
| 76 | import stripe |
| 77 | |
| 78 | stripe.api_key = "sk_test_..." |
| 79 | |
| 80 | # Create a checkout session |
| 81 | session = stripe.checkout.Session.create( |
| 82 | line_items=[{ |
| 83 | 'price_data': { |
| 84 | 'currency': 'usd', |
| 85 | 'product_data': { |
| 86 | 'name': 'Premium Subscription', |
| 87 | }, |
| 88 | 'unit_amount': 2000, # $20.00 |
| 89 | 'recurring': { |
| 90 | 'interval': 'month', |
| 91 | }, |
| 92 | }, |
| 93 | 'quantity': 1, |
| 94 | }], |
| 95 | mode='subscription', |
| 96 | success_url='https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}', |
| 97 | cancel_url='https://yourdomain.com/cancel' |
| 98 | ) |
| 99 | |
| 100 | # Redirect user to session.url |
| 101 | print(session.url) |
| 102 | |
| 103 | |
| 104 | ## Detailed patterns and worked examples |
| 105 | |
| 106 | Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient. |
| 107 | |
| 108 | ## Testing |
| 109 | |
| 110 | |
| 111 | # Use test mode keys |
| 112 | stripe.api_key = "sk_test_..." |
| 113 | |
| 114 | # Test card numbers |
| 115 | TEST_CARDS = { |
| 116 | 'success': '4242424242424242', |
| 117 | 'declined': '4000000000000002', |
| 118 | '3d_secure': '4000002500003155', |
| 119 | 'insufficient_funds': '4000000000009995' |
| 120 | } |
| 121 | |
| 122 | def test_payment_flow(): |
| 123 | """Test complete payment flow.""" |
| 124 | # Create test customer |
| 125 | customer = stripe.Customer.create( |
| 126 | email="[email protected]" |
| 127 | ) |
| 128 | |
| 129 | # Create payment intent |
| 130 | intent = stripe.PaymentIntent.create( |
| 131 | amount=1000, |
| 132 | automatic_payment_methods={ |
| 133 | 'enabled': True |
| 134 | }, |
| 135 | currency='usd', |
| 136 | customer=customer.id |
| 137 | ) |
| 138 | |
| 139 | # Confirm with test card |
| 140 | confirmed = stripe.PaymentIntent.confirm( |
| 141 | intent.id, |
| 142 | payment_method='pm_card_visa' # Test payment method |
| 143 | ) |
| 144 | |
| 145 | assert confirmed.status == 'succeeded' |
| 146 | |
| 147 |
Details
- Updated
- Sep 21, 2026
- License
- MIT
- Stars on the repo
- ★ 39,857
- Checked
- Source
- wshobson/agents ↗
- Creator
- wshobson · 179 listings
Similar skills
See all →
SkillAI-powered financial analysis suiteAI Finance Ops
PromptAct as a Stripe payment setup assistantStripe payment builder
MCPExpert bookkeeper and controller specializing in day-to-day📒 Bookkeeper & Controller Agent
MCPIntegrate Stripe, PayPal, and payment processorsPayment integration
SkillAutomatically organizes invoices and receipts for taxInvoice organizer
MCPPayment systems integration specialistPayment integrationMore from wshobson
SkillMaster C/.NET backend development patterns for building
SkillImplement WCAG 2.2 compliant interfaces with mobileAccessibility compliance
SkillMaster Material Design 3 and Jetpack Compose patternsAndroid Mobile Design
SkillMigrate from AngularJS to Angular using hybrid modeAngular migration
SkillUnderstand anti-reversing, obfuscationAnti reversing techniques
SkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patterns