← projectsPayment Processing Engine
Idempotent charge API backed by a double-entry ledger, with HMAC-signed async webhook delivery.
status in-progress
stack TypeScript, Node.js, PostgreSQL, Redis, Docker
A payment processing engine designed around an idempotent charge API backed by a double-entry ledger rather than a mutable balance field, so financial correctness holds under retries and concurrent requests.
problem
A balance column plus a retryable endpoint is how you end up double-charging customers. Correctness has to be structural, not defensive.
solution
A double-entry ledger as the source of truth and an idempotency key on every charge, so retries and concurrent requests converge on the same state.
architecture
- Idempotent charge API keyed on client-supplied idempotency keys
- Double-entry ledger in PostgreSQL as source of truth
- Async webhook delivery via a Redis-backed job queue
- HMAC-signed webhook payloads with exponential-backoff retries
results
In progress.