Manny S.

ledger

WIP

Multi-currency ledger API in C# and .NET on Postgres, with top-ups through a payment provider

Why

I work in C# every day but never on money. ledger is a small bank-style backend so I can learn what goes wrong when you move it: users, one account per currency, and top-ups that only credit an account when the payment provider says the charge went through.

How it works

Domain, Application, Infrastructure and Api projects. Handlers return result types instead of throwing, and value types like Amount, Email and Currency can't be built invalid. Raw SQL through Npgsql, no ORM. Auth is a hand-rolled HMAC JWT with PBKDF2 passwords. Top-ups go through a provider interface (a stub for now, with a separate fake provider service in progress). The provider confirms a charge with an HMAC signed callback, and a background job expires top-ups that never got one. Warnings fail the build, and the repository tests run against a real Postgres database.

Next

Next is transfers between accounts, idempotency keys on client requests and storing money as integer pence everywhere.