payments-handbook
Installation
SKILL.md
Instructions
Plan payments integration with strict PCI boundaries and Next.js. Read payments-pci.md before proposing checkout or webhook fulfillment.
When to Use
- Use when designing checkout, PaymentIntents, refunds, or order fulfillment from payment events.
- Prefer
webhook-receiversfor signature verify + idempotency handler details. - Prefer
api-handbookfor idempotent order APIs that webhooks call. - Prefer
env-config-agentwhen live vs test keys or secret leakage is the issue.
- Never store PAN, CVV, or mag stripe data. Use PSP-hosted fields (card Element / Payment Element) so card data touches PSP JS only.
- Server: create PaymentIntent / session server-side with idempotency key; return client secret to UI; verify amounts and currency server-side on success.
- Webhooks: implement with
webhook-receivers- verify signature, idempotent event processing, handle capture vs metadata order (see payments-pci.md). - PCI scope: prefer SAQ A-style architecture (redirect or iframe/Element hosted by PSP); documenting “we never touch raw card” is required in reviews.
- Refunds / disputes: outline state machine (pending → succeeded → refunded); no destructive scripts without approval.
- Testing: PSP test cards only; no live keys in repo;
.env.examplekey names only. - Fulfillment: pair with
api-handbookfor idempotent order creation from webhook handlers. - Logging red lines: never log
client_secret, PAN, or full unredacted webhook bodies.