Skip to content
Back to skills

Payment Integration Safety

ASecurity

Builds or reviews payment code so amounts are set on the server, webhooks are verified and idempotent, and every charge can be reconciled with the provider.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 15, 2026
ai-agents

Works with

  • cli

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill payment-integration-safety --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Payment Integration Safety?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Payment Integration Safety
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-payment-integration-safety/badge)](https://www.skillsdirectory.com/skills/workspace-templates-payment-integration-safety)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: payment-integration-safety
description: Builds or reviews payment code so amounts are set on the server, webhooks are verified and idempotent, and every charge can be reconciled with the provider.
---

# Payment integration safety

Money code is reviewed line by line. Use test mode and test keys only.

## Steps

1. Map the flow: where the price is set, where the charge is created, what confirms it, what fulfills the order. Draw it as five lines of text before changing anything.
2. Amounts: compute the total on the server from stored prices and quantities. Reject any amount, currency or price id taken from the client. Store money as integer minor units, never floats.
3. Confirmation: fulfill an order only from a verified webhook (or a server-side fetch of the payment status), never from the browser redirect.
4. Webhooks: verify the signature on the raw request body before parsing JSON. Reject old timestamps. Return 2xx quickly and do the heavy work in a job.
5. Idempotency: send an idempotency key on every create-charge call, derived from the order id. In the webhook handler, store the provider event id with a unique constraint and skip events already seen.
6. State: model the order as explicit states (pending, paid, failed, refunded) and allow only valid transitions. Handle out-of-order events.
7. Reconciliation: write or check a job that compares provider payments with local orders daily and lists mismatches.
8. Test the unhappy paths: declined card, duplicate webhook, webhook before redirect, partial refund.

## Rules

- Never log card data, full tokens or webhook secrets. Read keys from environment variables.
- Do not store card numbers. Use the provider's hosted fields or checkout.
- Do not run anything against live mode.

## Report

Findings ranked by money at risk, each with file, line and fix, then the tests added.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.