Skip to main content

webhook-implementation

Implements or fixes Stripe webhook handlers -- signature verification, event routing, idempotency, and retry-safe processing. Use when the user wants to "add a webhook handler", "handle stripe events", "fix webhook", or process specific events. For delivery health audit, see webhook-reliability.

跳到安装

来源信息

仓库
appeeky/stripe-skills
最近来源活动
2026年7月19日 10:10
检测到的 SKILL.md 语言
英语
星标
5
分支
1

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
webhook-implementation
description
Implements or fixes Stripe webhook handlers -- signature verification, event routing, idempotency, and retry-safe processing. Use when the user wants to "add a webhook handler", "handle stripe events", "fix webhook", or process specific events. For delivery health audit, see webhook-reliability.
metadata
{"version":"1.0.0"}
# Webhook Implementation Builds robust Stripe webhook handlers. Match the project's stack or ask users (Next.js route, Express, Supabase edge function). ## Must-haves 1. **Raw body** for signature verification (no JSON pre-parse) 2. `stripe.webhooks.constructEvent(body, sig, secret)` 3. **Idempotency** -- dedupe by `event.id` (store processed IDs) 4. Return `200` fast; heavy work async 5. Handle only subscribed events; ignore rest gracefully ## Core events (subscription SaaS) | Event | Handler action | |-------|----------------| | `checkout.session.completed` | Provision access, save customer/sub IDs | | `customer.subscription.updated` | Sync plan + status | | `customer.subscription.deleted` | Revoke access | | `invoice.payment_failed` | Trigger dunning email/banner | | `invoice.paid` | Confirm renewal | ## Pattern (pseudocode) ``` event = constructEvent(rawBody, sig, secret) if alreadyProcessed(event.id): return 200 switch event.type: ...handle... markProcessed(event.id) return 200 ``` ## Verify Use Stripe CLI `stripe listen` / `stripe trigger`, or check `webhook-reliability` after deploy.
在 GitHub 查看