terminalskills/skills

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.

First seen Mar 13, 2026

Installation

$ npx skills add terminalskills/skills --skill stripe-testing

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from terminalskills/skills · top by installs.

npx skills add terminalskills/skills

Browse all from terminalskills/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 146
License LICENSE
Default branch main
Open issues 1
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0
LicenseApache-2.0
CompatibilityRequires Stripe CLI installed (brew install stripe/stripe-cli/stripe) and a Stripe test API key
More metadata
author
terminal-skills
version
1.0.0
category
development
tags
["stripe","payments","webhooks","testing","debugging"]

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 5,909 B
  • docs SUMMARY.md 358 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 3 installs

SKILL.md

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 (STRIPESECRETKEY starting with sktest)
  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 paymentintents retrieve <id> --api-key $STRIPESECRET_KEY
  3. Check the lastpaymenterror field for the decline reason
  4. Common decline codes and fixes:

- carddeclined → Use test card 4000000000000002 to reproduce - insufficientfunds → Test with 4000000000009995 - expiredcard → Test with 4000000000000069 - incorrectcvc → Test with 4000000000000127

  1. Check the Events tab: stripe events list --limit 5 --api-key $STRIPESECRETKEY

Testing Webhook Handlers

  1. List registered webhook endpoints: stripe webhookendpoints list --api-key $STRIPESECRET_KEY
  2. Trigger a specific event: stripe trigger <eventtype> (e.g., stripe trigger paymentintent.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.paymentsucceeded - invoice.paymentfailed - customer.subscription.updated - customer.subscription.deleted

Validating Subscription Lifecycle

  1. Create a test customer: stripe customers create --name "Test User" --email [email protected] --api-key $STRIPESECRETKEY
  2. Create a subscription with a test clock for time simulation:

`` stripe testclocks create --frozen-time $(date +%s) --api-key $STRIPESECRET_KEY ``

  1. Advance the test clock to simulate billing cycles:

`` stripe testclocks advance <clockid> --frozen-time <futuretimestamp> --api-key $STRIPESECRET_KEY ``

  1. Verify subscription status transitions: trialingactivepast_duecanceled

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:

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:

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 (sktest) — 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