MR
Mayur Rathi
@mayurrathi
⭐ 5 GitHub stars

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 ...

mkdir -p ./skills/stripe-integration && curl -sfL https://raw.githubusercontent.com/mayurrathi/awesome-agent-skills/main/skills/stripe-integration/SKILL.md -o ./skills/stripe-integration/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# Stripe Integration


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


Do not use this skill when


- The task is unrelated to stripe integration

- You need a different domain or tool outside this scope


Instructions


- Clarify goals, constraints, and required inputs.

- Apply relevant best practices and validate outcomes.

- Provide actionable steps and verification.

- If detailed examples are required, open `resources/implementation-playbook.md`.


Use this skill when


- 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 Session (Hosted)**

- Stripe-hosted payment page

- Minimal PCI compliance burden

- Fastest implementation

- Supports one-time and recurring payments


**Payment Intents (Custom UI)**

- Full control over payment UI

- Requires Stripe.js for PCI compliance

- More complex implementation

- Better customization options


**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


```python

import stripe


stripe.api_key = "sk_test_..."


# Create a checkout session

session = stripe.checkout.Session.create(

payment_method_types=['card'],

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)

```


Payment Implementation Patterns


Pattern 1: One-Time Payment (Hosted Checkout)

```python

def create_checkout_session(amount, currency='usd'):

"""Create a one-time payment checkout session."""

try:

session = stripe.checkout.Session.create(

payment_method_types=['card'],

line_items=[{

'price_data': {

'currency': currency,

'product_data': {

'name': 'Purchase',

'images': ['https://example.com/product.jpg'],

},

'unit_amount': amount, # Amount in cents

},

'quantity': 1,

}],

mode='payment',

success_url='https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}',

cancel_url='https://yourdomain.com/cancel',

metadata={

'order_id': 'order_123',

'user_id': 'user_456'

}

)

return session

except stripe.error.StripeError as e:

# Handle error

print(f"S

🎯 Best For

  • UI designers
  • Product designers
  • Claude users
  • Software engineers
  • Development teams

💡 Use Cases

  • Generating component mockups
  • Creating design system tokens
  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Stripe Integration to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Does this work with Figma?

Some design skills integrate with Figma plugins. Check the Works With section for supported tools.

Is Stripe Integration compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Stripe Integration?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Stripe Integration?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/stripe-integration/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping usability testing

AI-generated designs should be validated with real users before development.

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills