本文へ移動
cccskills
無料GitHub で公開日本語紹介

stripe-billing-verification

Stripeの決済・購読イベントをローカル環境へ送り、署名検証や受信処理を確かめるスキル。テスト用の時刻を進め、継続課金の流れも検証します。

原文原文の説明を見る

Run Stripe webhook smoke tests and billing lifecycle simulations for stripe

連携ツールStripe

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 決済・購読イベントのローカル受信確認
  • Webhookの署名エラーを調べたいとき
  • Test Clocksで購読更新を再現したいとき
  • 転送ログやAPIエラーを確認したいとき

日本語での紹介

できること

StripeのWebhook(イベント通知)をローカル環境へ転送し、決済や購読イベントの受信処理を検証します。署名なしの通知が400、正しい署名付きの通知が2xxを返すことや、ログのイベントID・種別を確認します。Test Clocksでテスト用の時刻を進め、課金のライフサイクルも調べます。

こんなときに便利

Webhookの基本動作を確認したいときや、署名エラーの原因を調べたいときに向いています。購読更新など、時間の経過に伴う処理の検証にも使えます。

使い方の例

  • 「決済成功と購読作成のイベントを送り、応答とログを確認して」
  • 「新しい顧客とTest Clockで購読更新を検証して」

注意点

Stripe CLIと、http://localhost:8700で動くriptide-apiを前提とします。STRIPE_WEBHOOK_SECRETは通知経路に対応する値が必要で、CLI転送用とDashboardの値は交換できません。Test Clocksはテストモードで使い、readyになるまで待ちます。Dashboardの設定や実環境の接続先選択は手動または利用者確認の対象です。ngrokは公開HTTPSの接続先が必要な場合に使います。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(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 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

agent-browser

無料概要あり

Webページの移動やフォーム入力、クリックをエージェントに任せ、情報抽出や画面保存、操作前後の比較まで行います。ブラウザ作業の自動化やWebアプリの確認に使えるスキル。

  • フォーム入力やクリックを自動化したいとき
  • Webページのテキスト抽出
  • ページのスクリーンショット・PDF保存
humanlayer/humanlayer1.2万2026年10月23日 更新

asd-ste100

無料概要あり

曖昧で読みにくい英文を、語の意味をそろえた短い能動態の文へ書き直すスキル。指示文やツール説明を見直し、修正理由と変更前後を表で確認できます。

  • 別のエージェントへの英文指示の明確化
  • 英語のツール説明やエラー文の簡素化
  • 英語を母語としない読者向けの文章整理
humanlayer/humanlayer1.2万2026年10月23日 更新

better-github-skill

無料概要あり

GitHubのPRの状態、レビューの会話、CI失敗のログを専用スクリプトで収集し、変更の確認状況や未解決の指摘、失敗したジョブとステップを調べるスキル。

  • PRの状態をまとめて確認したいとき
  • 未解決のレビューの会話の確認
  • CIの失敗ジョブとステップの調査
humanlayer/humanlayer1.2万2026年10月23日 更新

bump-version

無料概要あり

リリース時に対象パッケージの基準バージョンを更新し、関連ファイルの同期と生成結果を検証して、コミットからPRブランチへのプッシュまで進めるスキル。

  • リリース用のバージョンを更新したいとき
  • 関連ファイルのバージョン表記の同期
  • プッシュ前の生成バージョン検証
humanlayer/humanlayer1.2万2026年10月23日 更新

calldiff

無料概要あり

Git のコミット間や作業中のコードで、関数の呼び出し構造の違いを確認します。呼び出しツリーの表示や、指定した関数へ至る経路の調査にも使えます。

  • 変更前後の関数呼び出しを比較したいとき
  • ブランチ間の呼び出し構造レビュー
  • 起点から目的の関数への経路調査
humanlayer/humanlayer1.2万2026年10月23日 更新

chrome-devtools-cli

無料概要あり

ターミナルからブラウザのクリックや入力、ページ移動を自動化し、通信やエラー、表示速度も調べられる、Chrome DevToolsのCLI操作を支援するスキル。

  • フォーム入力やページ移動の自動化
  • ページや要素の画面撮影
  • 通信内容やコンソールエラーの調査
humanlayer/humanlayer1.2万2026年10月23日 更新

humanlayer のスキルをすべて見る

このスキルの問題を報告する