paystream: async payment service with outbox and idempotency by Maxim Popelnitskiypaystream: async payment service with outbox and idempotency by Maxim Popelnitskiy

paystream: async payment service with outbox and idempotency

Portfolio project
Maxim Popelnitskiy
Open-source reference implementation of an asynchronous payment service: github.com/Gegirhasut/paystream. FastAPI accepts a payment request, background workers process it through a simulated gateway and notify the merchant with a signed webhook. No real payment processor is connected; the point is the reliability patterns.
Transactional outbox: payment and outbox records commit together, so the database and the broker never drift apart. Idempotency-Key with a request fingerprint replays the original result or rejects a conflicting reuse. Retry queues and a dead-letter queue, plus recovery of stalled payments. Exact money values (decimal, NUMERIC). HMAC-signed webhooks with SSRF protection on the sender side.
195 tests run in CI against real PostgreSQL and RabbitMQ.
Stack: Python, FastAPI, Pydantic v2, SQLAlchemy 2 async, PostgreSQL, RabbitMQ / FastStream, Alembic, Docker Compose, pytest.

0 likes · 0 views · Nov 11, 2026

Open-source async payment service: transactional outbox, idempotency keys, retries with DLQ, HMAC-signed webhooks; 195 tests on real PostgreSQL and RabbitMQ.

Tags