Saving a payment and then publishing "PaymentSucceeded" is two writes to two systems. One of them will eventually fail. The outbox pattern turns it into one write, with runnable EF Core code.
A decimal doesn't know its currency, its precision or how to split itself. A small Money type does, and it turns a whole class of silent bugs into loud ones. Runnable C# 14 and EF Core code.
A balance column tells you a number. A ledger tells you why. How to make recorded transactions the single source of truth for a wallet, with runnable EF Core code.
An idempotency key turns "the client retried" from a duplicate payment into a harmless replay. Here is a small, runnable ASP.NET Core implementation and the trade-offs behind it.
Every night, compare what your ledger says happened with what the payment gateway says happened. A small, testable reconciler plus a BackgroundService turns days of manual checks into one log line.