ablevarghese/ios-claude-toolkit/stripe-best-practices
Claude Code and agent skill by ablevarghese/ios-claude-toolkit
- community
Checking that the SKILL.md file is still in the repository.
Accept payments, Stripe integration, subscription billing, payment flow design. Stripe integration design patterns and official best practices — CheckoutSessions, PaymentIntents, PaymentSheet, Connect marketplace, webhook security, deprecated API migration. Trigger on: 'add payments', 'set up Stripe', 'which Stripe API to use', 'build a checkout flow', 'implement subscriptions', 'Connect marketplace', 'handle refunds', or any payment architecture decision. For Stripe CLI testing and test cards, use hermes-stripe. For StoreKit/IAP, use cupertino-apple.
Install
npx vskill@latest install ablevarghese/ios-claude-toolkit/stripe-best-practicesSKILL.md
The same SKILL.md was published earlier as ablevarghese/ios-claude-toolkit/stripe-best-practices.
Stripe Best Practices
Iron Law: "Never store raw card data. Never use deprecated Stripe APIs. Never skip webhook signature verification."
Official Stripe integration best practices. Reference these guidelines when building, reviewing, or debugging Stripe integrations.
Source: github.com/stripe/ai
Rationalizations (Do Not Skip)
| Rationalization | Why It's Wrong | Required Action | |
|---|---|---|---|
| "The Charges API still works" | The Charges API lacks 3D Secure support, SCA compliance, dynamic payment methods, and modern error handling. It will eventually be removed. Every new integration using Charges is technical debt from day one. | Use CheckoutSessions (preferred) or PaymentIntents. Migrate existing Charges integrations using Stripe's migration guide. | |
| "We don't need webhook verification in development" | If you don't verify signatures in dev, you won't catch verification bugs until production. You're also training developers to skip a critical security step. The webhook signing secret takes 30 seconds to configure. | Always verify webhook signatures. Use stripe listen --forward-to for local development, which provides a signing secret. | |
| "We'll migrate to the new API later" | Every month on deprecated APIs increases migration cost. New features only ship on modern APIs. You're falling further behind while accumulating more code to migrate. | Start migration now. Stripe provides incremental migration paths -- you don't need to rewrite everything at once. | |
| "Manual testing is sufficient" | Payment integrations have 20+ distinct scenarios (success, decline codes, 3DS flows, webhook races, refunds, disputes). Manual testing catches 3-5 of them. The other 15+ fail in production. | Use systematic test card coverage. Write automated tests for every webhook handler. Test every decline scenario. See references/payment-flows.md. | |
| "We can log the full Stripe response for debugging" | Stripe responses can contain PII and partial card data. Logging raw responses may violate PCI requirements and privacy regulations. | Log only: Stripe event ID, event type, payment intent ID, error code. Never log full response bodies in production. | |
| "Idempotency keys are optional" | Without idempotency keys, network retries or user double-clicks create duplicate charges. This is the #1 source of payment disputes from integration bugs. | Add idempotency keys to every POST request. Use a deterministic key (e.g., {user_id}_{action}_{timestamp} or UUID stored before the request). |
Red Flags -- STOP
- Using deprecated APIs: Charges API, Sources API, Tokens API, legacy Card Element. These are missing SCA support, modern payment methods, and will be deprecated. Migrate immediately.
- Missing webhook signature verification:
stripe.webhooks.constructEvent()must use the endpoint signing secret. Without verification, anyone can send fake events to your webhook endpoint. - Logging card numbers: Even partial PANs in logs violate PCI. Use Stripe Dashboard or request IDs for debugging.
- Missing idempotency keys: All POST requests to Stripe must include
Idempotency-Keyheaders. Without them, retries create duplicates. - Service role / secret key in client code: Stripe secret keys must NEVER appear in iOS app bundles, JavaScript, or any client-side code. Only publishable keys on the client.
- Hardcoded payment_method_types: Use dynamic payment methods (enabled in Dashboard). Hardcoding types prevents Stripe from optimizing for the customer's location and preferences.
When NOT to Use This Skill
- Apple In-App Purchase flows: Digital goods and subscriptions sold within iOS apps must use StoreKit, not Stripe. See cupertino-apple for IAP rules.
- Stripe CLI testing operations: For test card numbers, webhook forwarding, and CLI commands, see hermes-stripe.
- Database schema for payment records: For designing the database tables that store payment records, see supabase-postgres-best-practices.
- Security review of payment code: For a security-focused review of payment handling, see cipher-security or trailofbits-differential-review.
Decision Framework
Primary APIs
CheckoutSessions (Preferred)
Stripe's primary API for modeling on-session payments is CheckoutSessions. It supports one-time payments and subscriptions and allows you to model taxes and discounts.
PaymentIntents (For Custom Flows)
Use when you need to model checkout state yourself:
Deprecated APIs (Never Recommend)
- Charges API: Never recommend. Migrate to PaymentIntents.
- Sources API: Deprecated. Never recommend.
- Tokens API: Avoid unless there is a specific need and absolutely no other way.
- Legacy Card Element: Never recommend. Migrate to Payment Element.
Confirmation Tokens
If a user wants to render the Payment Element before creating a PaymentIntent or SetupIntent (e.g., to inspect card details for surcharging), advise them to use Stripe Confirmation Tokens. Do not recommend createPaymentMethod or createToken Stripe.js functions.
PCI Compliance
If a PCI compliant user asks about sending server-side raw PAN data, suggest they might be required to prove PCI compliance to gain access to such an option (e.g., payment_method_data). Point users migrating PAN data from another processor to the migration process.
Mobile / iOS Integration (PaymentSheet)
For iOS apps using the Stripe iOS SDK:
PaymentSheet.FlowController
Separate payment method selection from confirmation:
Webhook Best Practices
Signature Verification (Non-Negotiable)
Idempotent Event Processing
Critical Events to Handle
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/stripe-best-practices/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ablevarghese/ios-claude-toolkit/stripe-best-practices)