跳到正文
cccskills
免费在 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.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Run Stripe webhook smoke tests and billing lifecycle simulations for stripe

集成工具Stripe

实测评分 未实测

查看安装方法

适用场景

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

包含的文件(2)

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

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

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/humanlayer1.2万2026年10月23日 更新

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/humanlayer1.2万2026年10月23日 更新

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/humanlayer1.2万2026年10月23日 更新

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/humanlayer1.2万2026年10月23日 更新

calldiff

免费

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/humanlayer1.2万2026年10月23日 更新

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/humanlayer1.2万2026年10月23日 更新

查看 humanlayer 的全部技能

报告此技能的问题