SuperAPI AI 工具集

stripe-local-dev

编程与开发

查看项目

更新于 10-16 03:41

技能介绍

用途:解决本地开发时 Stripe webhook 返回 400、提示 signature verification failed 或 No signatures found matching the expected signature for payload 的问题。根因是 stripe listen 每次启动都会生成新的 webhook 密钥,而应用仍使用旧密钥。

主要能力:提供 dev-stripe.sh 脚本模式,先通过 stripe listen --print-secret 提取密钥,再同步到环境(Convex env 或 .env.local),最后启动转发,实现自动启动与自动同步。同时覆盖 checkout 成功但访问仍被锁、出现 stripe_webhook_missing_convex_token 或 Webhook token is not configured 的情况,提示 CONVEX_WEBHOOK_TOKEN 在 Next 运行时与 Convex 之间缺失或不匹配。

使用方式:推荐 Convex HTTP webhook(convex/http.ts),密钥同步用 bunx convex env set,无需重启;复制脚本 cp ~/.claude/skills/stripe-local-dev/scripts/dev-stripe-convex.sh scripts/dev-stripe.sh 并 chmod +x,然后在 package.json 中设置 "stripe:listen": "./scripts/dev-stripe.sh"。Next.js API Route 方案复制 dev-stripe-nextjs.sh,同步到 .env.local,但需重启才能读取环境变更,脚本会给出警告。验证:运行 bun run dev 或 pnpm dev,另开终端执行 stripe trigger checkout.session.completed,检查日志返回 200 而非 400。

适用场景:本地开发中 Stripe webhook 调试、Convex 或 Next.js 项目集成 Stripe 时的密钥同步。

限制:资料未提供脚本内部实现细节、支持版本、平台要求及收费信息;Next.js 方案需手动重启,Convex 方案为推荐做法。相关技能包括 /check-stripe、/stripe-health、/stripe-audit。