stripe-testing
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "stripe-testing" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-8033641abc1dcc0866edda6bbd8c78081a15b13be73a5db6257e21ca1cc85e53. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
For testing and debugging Stripe payment integrations. Suitable for validating webhook handling, simulating payment flows, debugging failed charges, verifying subscription lifecycles, or investigating Stripe API errors.
Introduction source: third_party · TerminalSkills · 1.0.0 Reference
SkillPi interpretation
- Testing
- Not tested
Browse files
Frontmatter
name: stripe-testing
description: >-
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.
license: Apache-2.0
compatibility: "Requires Stripe CLI installed (brew install stripe/stripe-cli/stripe) and a Stripe test API key"
metadata:
author: terminal-skills
version: "1.0.0"
category: development
tags: ["stripe", "payments", "webhooks", "testing", "debugging"]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
- Verify Stripe CLI is installed:
stripe --version - Check for a test API key in environment variables (
STRIPE_SECRET_KEYstarting withsk_test_) - If no key is found, instruct the user to set one from the Stripe Dashboard → Developers → API keys
- Run
stripe listen --forward-to localhost:<port>/webhooks/stripeto forward webhooks locally
Debugging Failed Charges
- Ask for the payment intent ID or charge ID (starts with
pi_orch_) - Retrieve details:
stripe payment_intents retrieve <id> --api-key $STRIPE_SECRET_KEY - Check the
last_payment_errorfield for the decline reason - Common decline codes and fixes:
card_declined→ Use test card4000000000000002to reproduceinsufficient_funds→ Test with4000000000009995expired_card→ Test with4000000000000069incorrect_cvc→ Test with4000000000000127
- Check the Events tab:
stripe events list --limit 5 --api-key $STRIPE_SECRET_KEY
Testing Webhook Handlers
- List registered webhook endpoints:
stripe webhook_endpoints list --api-key $STRIPE_SECRET_KEY - Trigger a specific event:
stripe trigger <event_type>(e.g.,stripe trigger payment_intent.succeeded) - Verify the local server received and processed the event correctly
- Check webhook signature verification in the handler code — look for
stripe.webhooks.constructEvent() - Common webhook events to test:
checkout.session.completedinvoice.payment_succeededinvoice.payment_failedcustomer.subscription.updatedcustomer.subscription.deleted
Validating Subscription Lifecycle
- Create a test customer:
stripe customers create --name "Test User" --email test@example.com --api-key $STRIPE_SECRET_KEY - Create a subscription with a test clock for time simulation:
stripe test_clocks create --frozen-time $(date +%s) --api-key $STRIPE_SECRET_KEY - Advance the test clock to simulate billing cycles:
stripe test_clocks advance <clock_id> --frozen-time <future_timestamp> --api-key $STRIPE_SECRET_KEY - Verify subscription status transitions:
trialing→active→past_due→canceled
Reading Server-Side Logs
- Search the application logs for Stripe-related entries (look for
stripe,webhook,payment) - Check for HTTP 4xx/5xx responses to Stripe webhook deliveries
- 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 (
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-keyflag explicitly rather than relying on environment to avoid mistakes
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对 Stripe 支付集成的测试和调试,解决开发者高频刚需场景
- 提供 webhook 验证、支付流程模拟、失败诊断等完整闭环能力
- 覆盖订阅生命周期验证、测试时钟等高级功能
Highlights
- 触发词覆盖完整且边界清晰:stripe、支付测试、webhook 调试等
- 不易与其他技能混淆,触发精准度高
Areas to improve
-
缺少 When to Use 显式章节 Reported severity: Minor
文档结构完整但缺少显式的 When to Use 章节
Recommendation: 建议添加 When to Use 章节以进一步提升文档规范性
Highlights
- Phase/步骤清晰:环境设置、失败调试、webhook 测试、订阅验证等
- 包含端到端示例,frontmatter 完整,单文件未超限
Highlights
- 工具来源明确(Stripe CLI),参数正确
- 覆盖主要异常场景,不可逆操作有确认机制
- 提供完整的错误处理建议和最佳实践
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 10 -
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 10, 29, 36, 43, 47
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.