본문으로 건너뛰기
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(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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 / 1,000자

이 양식은 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월 24일 업데이트

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월 24일 업데이트

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월 24일 업데이트

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월 24일 업데이트

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월 24일 업데이트

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월 24일 업데이트

humanlayer의 스킬 모두 보기

이 스킬의 문제 신고