Leanpub Header

Skip to main content

Money Never Lies

Designing Payment Systems That Survive Production

Money Never Lies
This book is 100% completeLast updated on 2026-10-13

Retries, timeouts, webhooks and month-end reconciliation: the parts tutorials skip. A practical book for backend engineers who build or own payment systems, from cards to real-time rails like Pix, UPI and QRIS.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
About

About

About the Book

A customer is charged twice. A webhook arrives before your API call returns. Finance finds money nobody can explain. Every service did its job, and the money is still wrong.

Money Never Lies is a practical book for backend engineers who build or own payment systems. It follows one payment from the moment it is created to the day it matches the bank statement, and shows the design that keeps it correct at every step.

What you will learn

  • Store money without losing a single unit, and round in the right place
  • Model payments as state machines that never move backwards
  • Make every retry safe with idempotency keys, on your API and towards your providers
  • Trust webhooks only after you verify, store and process them idempotently
  • Treat timeouts as UNKNOWN, not failed, and resolve them without double charges
  • Derive balances from a double-entry ledger instead of a column you update
  • Reconcile your records against provider reports and the bank statement, every day
  • Pay out sellers safely, handle refunds and chargebacks, and stop common fraud
  • Answer "design a payment system" in a 45-minute interview

Beyond cards. The book also covers real-time push payments (virtual accounts, QR codes, e-wallets, Pix, UPI, QRIS, FedNow, SEPA Instant), where customers pay late, pay twice and pay the wrong amount.

What is inside: 17 chapters in four parts, 7 appendices, 19 figures, an Interview Corner, production checklist and TL;DR in every chapter, and companion Go code with tests. PDF (231 pages) and EPUB.

Who it is for: backend engineers new to payments or fintech, engineers preparing for system design interviews, and founders or tech leads adding payments to a product.

Who it is not for: beginners learning to program, accountants looking for accounting standards, compliance teams looking for country-by-country regulation.

All incidents in the book are composites. Not legal or financial advice.

Author

About the Author

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub