Stripe Payments
Key Capabilities
- Checkout Sessions: Hosted payment pages for one-time payments and subscriptions
- Payment Intents: Custom payment flows with full control
- Subscriptions: Recurring billing with flexible pricing
- Customers, Invoices, Refunds, Payment Methods
Best Practices
- Always prefer Checkout Sessions for standard payment flows
- Use Payment Intents only for custom checkout UI or off-session payments
- Never use deprecated Charges API or Sources API
- Enable dynamic payment methods in Dashboard instead of hardcoding payment_method_types
- Use Setup Intents to save payment methods for future use
- Handle webhooks for all async events
- Implement idempotency keys for safe retries
- Never expose secret keys in client-side code
- Do not include API version in code snippets
Common Workflows
One-Time Payment
- Create Checkout Session (mode: "payment")
- Redirect customer to session.url
- Handle webhook for payment_intent.succeeded
Subscription
- Create/retrieve customer
- Create Checkout Session (mode: "subscription")
- Handle webhook for customer.subscription.created
Refund
- Retrieve payment intent
- Create refund (full or partial with amount in cents)
- Handle webhook for charge.refunded
MCP Server Config
{
"mcpServers": {
"stripe": {
"url": "https://mcp.stripe.com"
}
}
}