secure-payment-webhook-access

Audit and implement secure Stripe and Xendit webhook handling with signature verification and access gating.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/raingernx/KRUKRAFT --skill secure-payment-webhook-access
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secure-payment-webhook-access
Source: https://github.com/raingernx/KRUKRAFT/tree/main/.claude/skills/secure-payment-webhook-access
Command: npx skills add https://github.com/raingernx/KRUKRAFT --skill secure-payment-webhook-access

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures that payment webhook events are verified before granting access to purchases, preventing unauthorized access via client-side redirects or unreliable signals.

Core Features & Use Cases

  • Signature verification for Stripe and Xendit webhooks before any body parsing or DB access.
  • Idempotency checks to avoid duplicate grants on repeated webhook deliveries.
  • Atomic transactions for state changes using prisma.$transaction to ensure consistency.
  • Access gating only when Purchase.status is "COMPLETED" or an active subscription exists.
  • Auditing and debugging workflows for common issues like "payment succeeded but user can't access resource".
  • Guidance for implementing and auditing webhook handlers across Stripe and Xendit.

Quick Start

Audit and implement webhook handling to ensure signature verification, idempotency, transactional updates, and secure access gating after a completed purchase.

Frequently Asked Questions about secure-payment-webhook-access

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I securely handle Stripe and Xendit webhooks to grant purchase access?

Securely handling Stripe and Xendit webhooks requires verifying event signatures before body parsing, enforcing idempotency to prevent duplicate grants, and gating access only when Purchase.status is COMPLETED.

Why does payment succeed but the user still cannot access the purchased resource?

Payment succeeding without access usually indicates missing access checks on download routes or non-atomic state updates. You must ensure transitions occur only after a verified webhook event updates the Purchase.status to COMPLETED.

What is the best way to prevent duplicate access grants on repeated webhook deliveries?

Preventing duplicate access grants on repeated webhook deliveries requires implementing idempotency checks within your webhook handler to ensure the same event does not trigger multiple transactional state updates.

How do I ensure payment state changes remain consistent when updating purchase records?

Ensuring consistent payment state changes requires using atomic transactions, such as prisma.$transaction, to update Purchase records securely after a webhook's signature verification succeeds.

Does this webhook security approach work for both one-time purchases and active subscriptions?

Yes, this webhook security approach works for both by enforcing gate logic that validates either a COMPLETED Purchase.status for one-time payments or an active subscription state for recurring access.

When do I need signature verification for webhook handlers?

Signature verification for webhook handlers is needed before any database access or body parsing to prevent unauthorized access via client-side redirects or unreliable client signals.