charanjit-singh/lovable-skills/payment-webhook-idempotency
- community
Checking that the SKILL.md file is still in the repository.
Use when Stripe or payment webhooks fire twice, need duplicate event handling, stripe_webhook_events table, ordering, or safe retries. Not for first-time webhook setup without idempotency concerns (use stripe-payment-webhooks).
Install
npx vskill@latest install charanjit-singh/lovable-skills/payment-webhook-idempotencySKILL.md
Payment webhook idempotency
Stripe retries webhooks on non-2xx, slow responses, or network blips. Handlers must be safe to run multiple times for the same event.id.
Rules
- Insert `event.id` first (or check existence) before side effects.
- On duplicate
event.id, return 200 immediately — do not re-grant credits or extend subscription twice. - Side effects (DB upsert, emails, credits) must be upserts keyed by stable IDs (
subscription_id,payment_intent_id), not blind inserts.
Table
Handler flow
If work fails after partial writes, prefer:
- Transaction where possible, or
- Compensating upsert on retry, or
- Insert event id only after success (accept rare double-work on crash — mitigate with unique constraints on business keys)
Unique constraints (business layer)
Ordering
Events may arrive out of order (subscription.updated before checkout.session.completed). Upsert from latest Stripe object via API retrieve when unsure, or handle both paths to the same upsert function.
Avoid
insert into credits (amount) values (100)without idempotency key per event.- Returning 500 after successfully granting access (causes retry + duplicate grant).
- Deleting webhook event rows in production.
Checklist
- [ ] Primary key = Stripe
event.id - [ ] Duplicate returns 200
- [ ] Business tables have unique Stripe IDs
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/payment-webhook-idempotency/SKILL.md
Popularity
- Repository stars
- 10
- Repository forks
- 9
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/charanjit-singh/lovable-skills/payment-webhook-idempotency)