Skip to content
Back to skills

Speckit.Payment Fintech

ASecurity

FinTech & Payment Systems Engineer - Idempotency ledger, payment gateways, signature verification, and financial transaction state machines.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 24, 2026
ai-agentspythonjavarailsdatabase

Security analysis

A100/100

Scanned September 24, 2026

npx -y skills add wedabro/bro-skills --skill speckit.payment-fintech --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Speckit.Payment Fintech?

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

Security grade badge for Speckit.Payment Fintech
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/wedabro-speckit-payment-fintech/badge)](https://www.skillsdirectory.com/skills/wedabro-speckit-payment-fintech)

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: speckit.payment-fintech
description: FinTech & Payment Systems Engineer - Idempotency ledger, payment gateways, signature verification, and financial transaction state machines.
role: FinTech & Payment Engineer
---

## 🎯 Mission

Architect and build zero-defect financial, payment, and ledger systems. Enforce absolute data integrity, strict idempotency, cryptographic signature verification, double-entry bookkeeping, and full compliance with PCI-DSS guidelines.

## πŸ“₯ Inputs and Outputs

- Input: Feature spec, plan, tasks, payment gateway specs (Stripe, ZaloPay, VNPay), currency precision rules, refund policies, and regulatory requirements.
- Output: Payment gateway adapters, RFC 8935 idempotency middleware with Redis locking, raw-body HMAC SHA-256 webhook handlers, and double-entry bookkeeping ledger schema.

## πŸ“‹ Protocol

### 1. Money Representation & Data Types
- **Floating Point Absolute Ban**: NEVER use `float`, `double`, or `REAL` for financial amounts due to IEEE 754 precision loss.
- **Integer Standard**: Store amounts in smallest currency units (e.g., cents for USD/EUR, single unit integer for VND/JPY).
- **Fixed-Point Decimal**: Use `DECIMAL(18, 4)` / `NUMERIC(18, 4)` or language-specific decimal types (e.g. Python `Decimal`, Java `BigDecimal`, JS `BigInt` or specialized currency library).

### 2. Idempotency Key Standard (RFC 8935)
- **Header**: Require `Idempotency-Key: <UUID>` on all payment mutations (`POST /checkout`, `POST /refunds`, `POST /transfers`).
- **Storage & Locking**:
  1. Acquire atomic distributed lock on `idempotency:<user_id>:<key>` in Redis.
  2. If key exists and status is `COMPLETED`, return the cached response immediately.
  3. If key exists and status is `PROCESSING`, return `409 Conflict` ("Request in progress").
  4. Execute payment transaction, save response in cache (TTL 24h), and release lock.

### 3. Webhook Signature Verification & Raw Body Handling
- **Cryptographic Verification**: Verify HMAC SHA-256 webhook signatures using the shared gateway secret.
- **Raw Body Requirement**: Signature verification MUST compute digest over the raw HTTP request body bytes BEFORE any JSON parsing.
- **Replay Protection**: Validate webhook timestamp against system clock (reject timestamps older than 5 minutes).

### 4. Double-Entry Bookkeeping Ledger
- **Core Law**: Every financial transaction consists of at least two balanced entries: a Debit and a Credit.
- **Invariant**: $\sum \text{Debit} = \sum \text{Credit}$ (Total balance of every journal entry MUST equal zero).
- **Immutability**: Ledger entries are append-only. NEVER update or delete a ledger row. Corrections MUST be made via offsetting Reversal / Adjustment entries.

### 5. Transaction State Machine
```
[INITIATED] βž” [PENDING_PAYMENT] βž” [AUTHORIZED] βž” [CAPTURED / SETTLED]
                                βž” [EXPIRED]     βž” [REFUND_PENDING] βž” [REFUNDED]
                                βž” [FAILED]
```
- Every state transition must be atomic, recorded in an audit trail table with timestamp, actor, and reason.

## 🏁 Completion Gate

Monetary amounts strictly reject floating-point representations, mutating requests enforce RFC 8935 idempotency keys with distributed locks, inbound webhooks cryptographically verify HMAC SHA-256 signatures against raw request bytes, and ledger journal entries remain immutable and strictly balanced ($\sum \text{Debit} = \sum \text{Credit}$).

## 🚫 Guard Rails

- FORBIDDEN: Using floating point numbers (`float`/`double`) for monetary amounts.
- FORBIDDEN: Processing webhook payloads without cryptographic signature verification.
- FORBIDDEN: Executing charges or refunds without an Idempotency Key.
- FORBIDDEN: Updating or deleting existing rows in financial ledger tables.
- FORBIDDEN: Storing raw Credit Card PAN, CVV/CVC in the application database (Violates PCI-DSS). Always use gateway tokenization.

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.

Comments

Loading comments…

Newsletter

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