stripe-testing
Test and debug Stripe payment integrations. Use when someone needs to verify webhook handling, simulate payment flows, debug failed charges, validate subscription lifecycle, or troubleshoot Stripe API errors. Trigger words: stripe, payment testing, webhook debugging, charge failed, subscription error, payment intent, checkout session.
Best use case
stripe-testing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Test and debug Stripe payment integrations. Use when someone needs to verify webhook handling, simulate payment flows, debug failed charges, validate subscription lifecycle, or troubleshoot Stripe API errors. Trigger words: stripe, payment testing, webhook debugging, charge failed, subscription error, payment intent, checkout session.
Teams using stripe-testing should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/stripe-testing/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How stripe-testing Compares
| Feature / Agent | stripe-testing | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Test and debug Stripe payment integrations. Use when someone needs to verify webhook handling, simulate payment flows, debug failed charges, validate subscription lifecycle, or troubleshoot Stripe API errors. Trigger words: stripe, payment testing, webhook debugging, charge failed, subscription error, payment intent, checkout session.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Stripe Testing ## Overview This skill helps you test and debug Stripe payment integrations end-to-end. It covers webhook verification, payment flow simulation using Stripe CLI and test mode, charge failure diagnosis, and subscription lifecycle validation. ## Instructions ### Setting Up the Test Environment 1. Verify Stripe CLI is installed: `stripe --version` 2. Check for a test API key in environment variables (`STRIPE_SECRET_KEY` starting with `sk_test_`) 3. If no key is found, instruct the user to set one from the Stripe Dashboard → Developers → API keys 4. Run `stripe listen --forward-to localhost:<port>/webhooks/stripe` to forward webhooks locally ### Debugging Failed Charges 1. Ask for the payment intent ID or charge ID (starts with `pi_` or `ch_`) 2. Retrieve details: `stripe payment_intents retrieve <id> --api-key $STRIPE_SECRET_KEY` 3. Check the `last_payment_error` field for the decline reason 4. Common decline codes and fixes: - `card_declined` → Use test card `4000000000000002` to reproduce - `insufficient_funds` → Test with `4000000000009995` - `expired_card` → Test with `4000000000000069` - `incorrect_cvc` → Test with `4000000000000127` 5. Check the Events tab: `stripe events list --limit 5 --api-key $STRIPE_SECRET_KEY` ### Testing Webhook Handlers 1. List registered webhook endpoints: `stripe webhook_endpoints list --api-key $STRIPE_SECRET_KEY` 2. Trigger a specific event: `stripe trigger <event_type>` (e.g., `stripe trigger payment_intent.succeeded`) 3. Verify the local server received and processed the event correctly 4. Check webhook signature verification in the handler code — look for `stripe.webhooks.constructEvent()` 5. Common webhook events to test: - `checkout.session.completed` - `invoice.payment_succeeded` - `invoice.payment_failed` - `customer.subscription.updated` - `customer.subscription.deleted` ### Validating Subscription Lifecycle 1. Create a test customer: `stripe customers create --name "Test User" --email test@example.com --api-key $STRIPE_SECRET_KEY` 2. Create a subscription with a test clock for time simulation: ``` stripe test_clocks create --frozen-time $(date +%s) --api-key $STRIPE_SECRET_KEY ``` 3. Advance the test clock to simulate billing cycles: ``` stripe test_clocks advance <clock_id> --frozen-time <future_timestamp> --api-key $STRIPE_SECRET_KEY ``` 4. Verify subscription status transitions: `trialing` → `active` → `past_due` → `canceled` ### Reading Server-Side Logs 1. Search the application logs for Stripe-related entries (look for `stripe`, `webhook`, `payment`) 2. Check for HTTP 4xx/5xx responses to Stripe webhook deliveries 3. Verify idempotency — duplicate webhook deliveries should not create duplicate records ## Examples ### Example 1: Debug a Failed Checkout **User prompt:** ``` Our checkout is failing for some customers. The last failed payment intent is pi_3OxR2aKX8dVqS71m0abc1234. Can you figure out what's going wrong? ``` **Agent actions:** ```bash stripe payment_intents retrieve pi_3OxR2aKX8dVqS71m0abc1234 --api-key $STRIPE_SECRET_KEY ``` **Agent output:** ``` Payment Intent pi_3OxR2aKX8dVqS71m0abc1234: Status: requires_payment_method Last error: card_declined (generic_decline) Amount: $49.00 USD Customer: cus_PqR7xYz Analysis: 1. The card was declined with a generic decline — this means the issuing bank refused it 2. This is NOT a code issue — the customer's bank rejected the charge 3. Your error handling looks correct — the PI moved to requires_payment_method Recommendations: - Ensure your frontend shows a clear "card declined" message - Offer alternative payment methods (Apple Pay, Google Pay, bank transfer) - Check if you have retry logic for `invoice.payment_failed` webhooks ``` ### Example 2: Verify Webhook Handler Works **User prompt:** ``` I just deployed a new webhook handler for subscription cancellations. Can you test it? ``` **Agent actions:** ```bash stripe listen --forward-to localhost:3000/api/webhooks/stripe & stripe trigger customer.subscription.deleted ``` **Agent output:** ``` Webhook forwarding active on localhost:3000/api/webhooks/stripe Triggered: customer.subscription.deleted → Delivered to localhost:3000/api/webhooks/stripe [200 OK] in 145ms Verified: ✓ Webhook received and acknowledged with 200 ✓ Signature verification passed (using whsec_ signing secret) ✓ Event type correctly matched to handler Next steps: - Check your database: was the subscription marked as canceled? - Verify the customer received a cancellation email - Test edge case: trigger it twice to confirm idempotency ``` ## Guidelines - Always use test mode keys (`sk_test_`) — never use live keys for testing - Use Stripe's built-in test card numbers rather than real card data - Test clocks are essential for subscription testing — they let you fast-forward time - Always verify webhook signature validation is implemented correctly - Check for race conditions: webhooks can arrive before the redirect completes - Monitor the Stripe Dashboard → Developers → Webhooks for delivery failures - Use `--api-key` flag explicitly rather than relying on environment to avoid mistakes
Related Skills
testing-library
Test UI components the way users interact with them using Testing Library — query by role, text, and label instead of implementation details. Use when someone asks to "test React components", "Testing Library", "user-centric testing", "test accessibility", "test without implementation details", or "render and query components in tests". Covers React Testing Library, queries, user events, async testing, and accessibility assertions.
stripe-connect
Build marketplace and platform payment flows with Stripe Connect. Use when: building two-sided marketplaces, splitting payments between buyers and sellers, onboarding sellers/providers to accept payments, handling platform fees and payouts, or managing connected accounts for a platform.
stripe-billing
You are an expert in Stripe Billing, the complete billing platform for SaaS businesses. You help developers implement subscription management, usage-based billing, metered pricing, free trials, proration, invoicing, customer portal, and webhook-driven lifecycle management — building everything from simple monthly plans to complex per-seat + usage hybrid pricing.
playwright-testing
Write and maintain end-to-end tests with Playwright. Use when someone asks to "add e2e tests", "test my web app", "set up Playwright", "write browser tests", "test login flow", "visual regression testing", "test across browsers", or "automate UI testing". Covers test setup, page objects, authentication, API mocking, visual comparisons, and CI integration.
ai-pentesting
Run autonomous AI-driven penetration tests on web applications using tools like Shannon, PentAGI, and similar frameworks. Use when tasks involve setting up automated penetration testing pipelines, combining AI agents with security tools (nmap, subfinder, nuclei, sqlmap), building autonomous exploit chains, generating pentest reports with proof-of-concept exploits, or integrating AI pentesting into CI/CD pipelines. Covers the full pentest lifecycle from reconnaissance to reporting using AI orchestration.
zustand
You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.
zoho
Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.
zod
You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.
zipkin
Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.
zig
Expert guidance for Zig, the systems programming language focused on performance, safety, and readability. Helps developers write high-performance code with compile-time evaluation, seamless C interop, no hidden control flow, and no garbage collector. Zig is used for game engines, operating systems, networking, and as a C/C++ replacement.
zed
Expert guidance for Zed, the high-performance code editor built in Rust with native collaboration, AI integration, and GPU-accelerated rendering. Helps developers configure Zed, create custom extensions, set up collaborative editing sessions, and integrate AI assistants for productive coding.
zeabur
Expert guidance for Zeabur, the cloud deployment platform that auto-detects frameworks, builds and deploys applications with zero configuration, and provides managed services like databases and message queues. Helps developers deploy full-stack applications with automatic scaling and one-click marketplace services.