Agent skill
stripe-webhook-testing
Set up Stripe CLI to forward webhooks to local development server for testing Stripe integrations
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/stripe-webhook-testing
SKILL.md
Stripe Webhook Testing Skill
This skill should be used when the user wants to test Stripe webhooks locally during development.
Prerequisites
- Stripe CLI installed (
brew install stripe/stripe-cli/stripeon macOS) - Backend server running on port 3000
- Stripe test mode API keys configured in
.env
Setup Process
Step 1: Ensure Webhook Endpoint Exists
The backend must have a webhook endpoint at /api/stripe/webhook. Verify this in:
backend/src/main.rs- route definitionbackend/src/handlers/stripe_handlers.rs- handler implementation
Step 2: Start Backend Server
Ensure the backend is running:
cd backend && cargo run
The server must be running before starting Stripe CLI forwarding.
Step 3: Start Stripe CLI Forwarding
Run the following command to forward webhooks to localhost:
stripe listen --forward-to localhost:3000/api/stripe/webhook
The CLI will output a webhook secret starting with whsec_....
Step 4: Configure Webhook Secret
- Copy the webhook secret from the CLI output
- Add or update
STRIPE_WEBHOOK_SECRETinbackend/.env:STRIPE_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxx - Restart the backend server to pick up the new secret
Step 5: Trigger Test Events
Use Stripe CLI to trigger test webhook events:
# Subscription events
stripe trigger customer.subscription.created
stripe trigger customer.subscription.updated
stripe trigger customer.subscription.deleted
# Checkout events
stripe trigger checkout.session.completed
# Invoice events
stripe trigger invoice.paid
stripe trigger invoice.payment_failed
Step 6: Verify in Logs
Check backend console output for:
- "Stripe webhook received"
- "Stripe signature header found"
- "Stripe event verified successfully"
- Processing messages for specific event types
Supported Webhook Events
The backend currently handles:
customer.subscription.created- New subscription activatedcustomer.subscription.updated- Subscription modifiedcustomer.subscription.deleted- Subscription cancelledcheckout.session.completed- Checkout completed
Troubleshooting
- Signature verification failed: Ensure
STRIPE_WEBHOOK_SECRETmatches the secret fromstripe listen - Endpoint not found: Verify backend is running on port 3000
- Events not triggering: Run
stripe listenfirst, then trigger events in a new terminal
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?