← All projects

payment-service

RustAxumPostgreSQLSQLxDocker

An API-key authenticated multi-tenant billing service with customer and invoice management, a Draft → Open → Paid state machine enforced at the data layer, and idempotent PSP-backed payments keyed on Idempotency-Key.

The integration tests assert the correctness properties that actually matter under concurrency: 10 concurrent /pay requests yield exactly one success, a replayed idempotency key returns the cached response without a second PSP call, and PSP timeouts and 500s roll the invoice back to Open rather than stranding it in Processing.

Rounded out with signed async webhook delivery, a mock PSP with deterministic failure tokens, and one-command docker compose bring-up with migrations applied on startup.