Skip to content
cccskills
FreePublished on GitHub

stripe-billing-verification

Test local Stripe webhook handling by forwarding payment and subscription events, checking signatures and response codes, and inspecting logs. Use Test Clocks, which advance simulated time, to verify billing lifecycle behavior in test mode.

OriginalShow the original description

Run Stripe webhook smoke tests and billing lifecycle simulations for stripe

Works withStripe

Run score Not tested

See how to install

Good for

  • Checking local receipt of payment and subscription events
  • Investigating webhook signature failures
  • Simulating subscription renewals with Test Clocks
  • Inspecting forwarding logs and API errors

Files included (2)

  • SKILL.md6.7 KB
  • references/cli-and-test-clocks.md4.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Task

Default to Stripe CLI forwarding for local work. Use ngrok only when the user specifically needs Stripe to deliver to a public HTTPS endpoint.

Quick Reference

export STRIPE_WEBHOOK_SECRET="$(stripe listen --print-secret | tr -d '\r\n')"
LISTENER_LOG=/tmp/stripe-billing-verification/stripe-listen.log
mkdir -p "$(dirname "$LISTENER_LOG")"
stripe listen --forward-to http://localhost:8700/webhooks/stripe \
  2>&1 | tee "$LISTENER_LOG"
stripe trigger payment_intent.succeeded
stripe trigger customer.subscription.created
curl -i http://localhost:8700/webhooks/stripe \
  -X POST \
  -H 'content-type: application/json' \
  -d '{}'
stripe test_helpers test_clocks create --frozen-time <unix-ts>
stripe test_helpers test_clocks advance <clock-id> --frozen-time <unix-ts>

Workflow

  1. Ensure local riptide-api is running on http://localhost:8700
  2. Capture the CLI forwarding secret with stripe listen --print-secret
  3. Export that value as STRIPE_WEBHOOK_SECRET
  4. Start a separate stripe listen --forward-to http://localhost:8700/webhooks/stripe process and tee its output to a file so the initial readiness output is preserved even though the process stays attached by design
  5. Trigger smoke-test events with stripe trigger ...
  6. For lifecycle validation, create a fresh Test Clock, attach a fresh customer, advance the clock, and wait for readiness before asserting results

Secret Rules

  • STRIPE_WEBHOOK_SECRET must match the delivery path in use
  • Stripe CLI forwarding uses a transient CLI session secret
  • Dashboard or Workbench endpoints use that endpoint's signing secret
  • these secrets are not interchangeable
  • if a signature check fails, first verify that the configured secret matches the traffic source

stripe listen --print-secret is the preferred non-interactive way to capture the local forwarding secret because it prints only the secret and exits. It does not keep the listener running.

Captured Output and Dev Logs

When starting the long-running Stripe listener, always tee its output to a file so you keep the immediate readiness lines and forwarded event feedback:

LISTENER_LOG=/tmp/stripe-billing-verification/stripe-listen.log
mkdir -p "$(dirname "$LISTENER_LOG")"
stripe listen --forward-to http://localhost:8700/webhooks/stripe \
  2>&1 | tee "$LISTENER_LOG"
  • the command hangs by design because the listener stays attached
  • tee keeps the live terminal output visible and also saves it for later inspection
  • after triggering events, inspect "$LISTENER_LOG" to confirm forwarding, event ids, and response codes

Riptide dev logs live in:

~/.humanlayer/riptide/logs/

To list recent dev logs:

ls -tr -la ~/.humanlayer/riptide/logs/ | tail -n 10
  • look for riptide-daemon-dev-... files when checking daemon-side errors
  • look for riptide-api-dev-... files when checking webhook handler behavior
  • use those files to verify accepted events or fetch stack traces and Stripe-related errors after a smoke test

Smoke-Test Procedure

  1. Export the CLI forwarding secret:
export STRIPE_WEBHOOK_SECRET="$(stripe listen --print-secret | tr -d '\r\n')"
  1. Start forwarding in a separate terminal:
LISTENER_LOG=/tmp/stripe-billing-verification/stripe-listen.log
mkdir -p "$(dirname "$LISTENER_LOG")"
stripe listen --forward-to http://localhost:8700/webhooks/stripe \
  2>&1 | tee "$LISTENER_LOG"
  1. Confirm unsigned traffic fails with 400:
curl -i http://localhost:8700/webhooks/stripe \
  -X POST \
  -H 'content-type: application/json' \
  -d '{}'
  1. Trigger one or more smoke events:
stripe trigger payment_intent.succeeded
stripe trigger customer.subscription.created
stripe trigger customer.subscription.updated
  1. Verify that the route returns 2xx for valid signed events and that logs include event id and type.

If you need to confirm the webhook made it through the rest of the local stack, also check the latest files in ~/.humanlayer/riptide/logs/.

Test Clock Workflow

Use Test Clocks for time-based billing scenarios in Stripe test mode.

  • create a fresh Test Clock
  • create a fresh customer attached to that clock
  • create the subscription or other billing object for that customer
  • advance time in steps
  • wait for the clock to reach ready
  • inspect resulting webhook traffic and Stripe object state

Important constraints:

  • Checkout and Test Clocks are separate workflows in Phase 2
  • Test Clocks work best with newly created customers
  • renewal-related events can require advancing slightly beyond the nominal boundary because invoice finalization may lag
  • if webhook acknowledgement fails, Stripe can delay lifecycle side effects

Safe Automation Guidance

Safe to automate:

  • capturing the CLI forwarding secret with stripe listen --print-secret
  • starting and stopping local Stripe CLI forwarding
  • teeing Stripe CLI listener output to a persistent file for later inspection
  • sending stripe trigger smoke events
  • polling Test Clock readiness
  • explaining the correct secret-selection flow
  • reading ~/.humanlayer/riptide/logs/ to confirm daemon or API-side errors

Keep manual or human-confirmed:

  • Stripe Dashboard or Workbench endpoint setup
  • copying endpoint signing secrets from the Dashboard
  • validating a public ngrok endpoint in the Stripe UI
  • decisions about which real environment endpoint to exercise

Troubleshooting

Invalid signature

Check whether:

  • STRIPE_WEBHOOK_SECRET matches the active delivery path
  • the API was restarted after the env change
  • the listener and --print-secret used the same Stripe account and mode
  • the route verified the untouched raw body rather than parsed JSON

stripe listen --print-secret succeeded, but forwarding does not happen

That is expected. Start the long-running listener separately:

LISTENER_LOG=/tmp/stripe-billing-verification/stripe-listen.log
mkdir -p "$(dirname "$LISTENER_LOG")"
stripe listen --forward-to http://localhost:8700/webhooks/stripe \
  2>&1 | tee "$LISTENER_LOG"

Need daemon or API errors after the trigger

List recent dev logs and inspect the newest -dev- file for the component you need:

ls -tr -la ~/.humanlayer/riptide/logs/ | tail -n 10

Use riptide-daemon-dev-... for daemon issues and riptide-api-dev-... for webhook-route issues.

stripe trigger does not match a real billing flow

That is also expected. stripe trigger is for smoke testing route acceptance and basic event intake. Use Test Clocks for lifecycle progression.

References

  • docs/stripe-billing-webhook-testing.md
  • .claude/skills/stripe-billing-verification/references/cli-and-test-clocks.md

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

agent-browser

FreeSummary

Automate website navigation, form entry, and clicks through a browser command line tool. Extract page text, capture screenshots, and compare page states to check interactions or test web app behavior across screen sizes.

  • Automate form entry and button clicks
  • Extract text from web pages
  • Save page screenshots and PDFs
humanlayer/humanlayer12.1KUpdated Oct 23, 2026

asd-ste100

FreeSummary

Rewrite dense or ambiguous English into short, direct sentences using principles from ASD-STE100, a standard for clear technical English. It preserves facts and conditions, identifies writing issues, and shows the original and revised text side by side.

  • Clarifying English instructions for another agent
  • Simplifying English tool descriptions and error messages
  • Making English easier for non-native readers
humanlayer/humanlayer12.1KUpdated Oct 23, 2026

Inspect GitHub pull requests, read review conversations, and investigate failed automated checks with dedicated scripts. Get consolidated status reports, unresolved discussion threads, and failing job or step logs, with full logs saved for further inspection.

  • Checking pull request status in one report
  • Reading unresolved review conversations
  • Investigating failed CI jobs and steps
humanlayer/humanlayer12.1KUpdated Oct 23, 2026

bump-version

FreeSummary

Update release base versions for supported packages, keep matching version fields in sync, and verify generated versions. The workflow covers committing and pushing the changes, with guidance for release steps after merging.

  • Prepare a package version update for release
  • Synchronize version fields across related files
  • Verify generated versions before pushing
humanlayer/humanlayer12.1KUpdated Oct 23, 2026

calldiff

FreeSummary

Compare function call structures across Git commits, branches, or working files to support code review. Display call trees and trace paths from an entry function to a target function, with support for 22 languages.

  • Compare function calls before and after a change
  • Review call structure changes between branches
  • Trace paths from an entry function to a target
humanlayer/humanlayer12.1KUpdated Oct 23, 2026

Automate browser tasks from the terminal using the chrome-devtools-mcp CLI. Inspect page elements, click and fill forms, navigate tabs, capture screenshots, and investigate network requests, console messages, performance, and memory through shell commands.

  • Automating form input and page navigation
  • Capturing page or element screenshots
  • Investigating network requests and console errors
humanlayer/humanlayer12.1KUpdated Oct 23, 2026

See all skills by humanlayer

Report a problem with this skill