Moving money safely: ledgers, idempotency and reconciliation
A club treasurer keeps the money in a book written in ink. Every movement takes two lines that cancel out, $20 out of a member's account and $20 into the club's, so the whole book always adds up to zero. She never rubs anything out; a mistake gets a new line that reverses it. Each paying-in slip has a number she looks up first, so no payment goes in twice. And every month she ticks each line against the bank statement, and anything on one but not the other goes on a list to chase.
The book is a ledger table whose entries are only ever added, the two lines are double entry, and the reversing line is a correcting entry. The slip number is an idempotency key, the bank is the payment provider, and the monthly tick is reconciliation, with the list to chase as its breaks. Interviewers in any payments, wallet or marketplace question listen for three things: nothing moves twice, money can't appear or vanish, and you'd find out if it did. The move: record every movement as balanced entries that are never edited, make every call that moves money idempotent, and reconcile against the provider every day.