For engineers who ship payments

Build payment systems that survive real customers

The docs show you how to charge a card. This is everything after the first test payment, with Python that runs.

30-day money-backInstant PDF and EPUB

Payments Playbook cover: build, integrate, scale, and optimize payment systems, by Sean Nieuwoudt and Beverley Merriman

42 chapters · 1,000+ pages · 90+ Python examples · 15+ providers

Written after the incident

Every chapter started as a post-incident note: the webhook that arrived twice, the 180-day PayPal hold, the SCA flow that lost 60% of European checkouts. None of it is in the docs.

Code that actually runs

90+ Python examples with the error handling, retries, and signature checks left in. Standard library where possible. Point them at a sandbox and go.

One purchase, every update

Payments don't stand still and neither does the book. Buy it once and every future edition lands in your inbox. You have 30 days to decide it's not for you.

What's inside

42 chapters. Three parts.

Read it front to back, or jump straight to whichever part is on fire.

Part I · Chapters 1 to 17

Core payment integration

Your first checkout, the state machine behind it, and eight providers compared with the fees in the open.

  1. 01Introduction
  2. 02Book overview and reading paths
  3. 03Terminology and glossary
  4. 04How payments actually work
  5. 05Payment lifecycles
  6. 06International payments and multi-currency
  7. 07Subscriptions and recurring billing
  8. 08VAT and digital sales tax
  9. 09Stripe integration
  10. 10PayPal integration
  11. 11Paddle integration
  12. 12Circle integration
  13. 132Checkout integration
  14. 14Escrow payments
  15. 15Cryptocurrency and Web3
  16. 16In-app purchases
  17. 17Compliance and security

Part II · Chapters 18 to 29

Advanced payment operations

Running it for real: routing across providers, fraud, reconciliation, and Black Friday without adding servers.

  1. 18Payment orchestration
  2. 19Fraud prevention and risk
  3. 20Financial reconciliation
  4. 21Performance and scale
  5. 22Alternative payment methods
  6. 23Marketplace and multi-party payments
  7. 24Advanced subscription management
  8. 25Payment analytics and BI
  9. 26Global compliance
  10. 27Payment UX and conversion
  11. 28Security operations
  12. 29Fees and margin optimization

Part III · Chapters 30 to 42

Modern payment systems

Wallets, QR, open banking, regional rails, and the webhook chapter you'll wish you'd read first.

  1. 30NFC and contactless payments
  2. 31QR code payments
  3. 32B2B payment workflows
  4. 33Open banking and PSD2
  5. 34Regional payment networks
  6. 35AI in payments
  7. 36CBDCs and digital currencies
  8. 37Gaming and digital goods
  9. 38Payment SDKs and libraries
  10. 39Webhooks deep dive
  11. 40Asian payment ecosystems
  12. 41Emerging market payment systems
  13. 42Advanced payment data analytics
Free to read
webhooks.py
# Chapter 9 - verify before you fulfil anything
import stripe


def handle_webhook(payload: bytes, sig: str) -> None:
    try:
        event = stripe.Webhook.construct_event(
            payload, sig, WEBHOOK_SECRET
        )
    except stripe.error.SignatureVerificationError:
        raise Unauthorized("Bad signature")

    if already_processed(event.id):
        return  # Stripe retries. That's fine.

    if event.type == "payment_intent.succeeded":
        fulfil_order(event.data.object.id)

    mark_processed(event.id)

Free sample

Chapter 9: Stripe integration

The full chapter, online, no email required. Payment Intents and 3D Secure, webhooks that arrive twice and out of order, subscriptions you can test without waiting a month, and what the bill really comes to once the add-ons land.

Read the whole chapter

Is it for you?

Read it if. Skip it if.

We'd rather you not buy a book you won't use. Thirty days to decide either way.

Read it if

  • You're integrating Stripe, PayPal, Paddle or a regional rail and want the parts the docs skip.
  • You've shipped a checkout and now own the webhooks, dunning, disputes and reconciliation.
  • You're choosing a provider and want the fees and failure modes in one place.
  • You lead a team that touches money and want a reference everyone has read.

Skip it if

  • You want a no-code checkout and never plan to touch the API.
  • You need legal or tax advice for one jurisdiction. Chapters 8 and 26 are a map, not a lawyer.
  • You're after a framework tutorial. The examples are Python and the patterns are language-neutral.

From the book

The voice, before you buy.

Everyone talks about AI for fraud detection. But that's like using a Ferrari to deliver pizza. The real power of AI in payments isn't just stopping fraud; it's optimising every microsecond, every route, every price point.

Chapter 35 · AI in payments

PayPal isn't the cheapest processor, and the dispute system is famously painful. Skip it anyway and you'll lose 10 to 15% of your international conversions, which is why every serious e-commerce stack still includes it.

Chapter 10 · PayPal integration

Stripe's 2.9% + $0.30 is higher than some competitors. If Stripe saves 40 hours of integration work at $100/hour, that's $4,000: the fee difference on $140K of volume against a 2.5% competitor.

Chapter 9 · Stripe integration

What the greats would have said.

Hark! The merchant's scroll did charge me twice, and twice again the knave did knock. This playbook unmasks such villainy. Would I had it ere the refund scene.

William ShakespearePlaywright, Stratford-upon-Avon

Charge a card, anyone can. Survive the webhook that twice arrives, this book teaches. Fulfil twice, you must not. Read it, you will.

YodaJedi Master, Dagobah support

Here, in the dim light of a production log, we observe the webhook in its natural habitat: arriving twice, out of order, and slightly apologetic. These engineers wrote it down.

David AttenboroughNaturalist of failing systems

This handler is RAW. No signature check, no idempotency key, and the customer has been charged twice. It's a disaster. Read the book. Don't send it back to the kitchen.

Gordon RamsayChef, very loud

That's a happy little payment intent. If it fails, we don't get mad. We just retry it, right up here in the corner. There are no mistakes, only pending states.

Bob RossPainter of happy trees

I can resist everything except 2.9% plus thirty cents. This book is the only honest thing I have read about money since my last unpaid invoice.

Oscar WildeProfessional wit

One has, over many decades, authorised a great number of payments. One had not, until this volume, understood why they sometimes vanish. One is moderately amused, and rather better informed.

Elizabeth IILate Queen, patient with invoices

I've had it with these unsigned webhooks in this unsigned production flow. Chapter 9. Read it. Then we can all go home.

Samuel L. JacksonProfessional emphasis

They charged us twice, they did, precious. Nasty little Stripe. We reads the book. We keeps the money. We doesn't fulfil it twice. Ours, the refund is.

GollumPrecious, and the finance team

I would not charge them here or there. I would not charge them twice. I would not skip the webhook check. I would not. It is not nice. I read this book. I slept at night.

Dr. SeussChildren's author, adult refunds

He thought a payment was a single API call. It was not. It was a state machine. And in that moment, he opened chapter five, and the 3 AM pages finally stopped.

Morgan FreemanNarrator of everything

Honey, I have written more verses than Stripe has add-on fees. This book is the first thing that explained the bill without making me want to lie down.

Dolly PartonMusician and philosopher

We shall fight them on the invoices. We shall fight them in the dashboard. We shall never surrender to a missing settlement file. This is not the end. It is chapter 20.

Winston ChurchillOccasional orator

We made payments insanely simple. Then the webhooks arrived. One more thing: read this. Boom.

Steve JobsReality distortion field

Me pay for cookie. Cookie not come. Me check webhook. Webhook come twice. Now me have two no-cookies. This book? Om nom nom. Knowledge taste good.

Cookie MonsterSesame Street finance

The line must be drawn here. This far, no further: no fulfilment without a verified signature. Make it so. Engage.

Jean-Luc PicardStarfleet, idle callbacks

Obviously not real, but we'd love to include yours

Send us yours

Authors

Two founders. Ten years of notes.

A shared decade of shipping payments for products that charge real customers, and ten years of evenings turning what broke into chapters. Nobody else was going to write it.

Portrait of Sean Nieuwoudt

Sean Nieuwoudt

@ghstcode

I've been building payment systems since the mid-2010s. SaaS billing, marketplace payouts, multi-currency, the Stripe to PayPal to custom-orchestration progression. I wrote the chapters on integration, scaling, and orchestration because I have the scars.

Portrait of Beverley Merriman

Beverley Merriman

@atomicbev

Subscription billing and dunning are my territory. The chapters on recurring revenue, payment lifecycles, reconciliation, and the unglamorous operational stuff, that's me. If your retention metric is held together by tape and luck, you'll find the kit in the book.

Pricing

One purchase. Lifetime access.

No subscription, no upsell, no pro edition six months later.

30-day refund

Order summary · Payments Playbook

$99

one-time payment

Stripe's 2.9% + $0.30, before the add-ons land. $99 is about what they keep on $3,400 of card volume.

  • 42 chapters, 1,000+ pagesIncluded
  • PDF and EPUBIncluded
  • 90+ Python examples that runIncluded
  • Every future update$0.00
  • SubscriptionNone
  • Pro editionDoesn't exist
Total$99
Get the book · $99

Secure checkout. Instant download. 30-day no-questions-asked refund.

Buying for a team? Email us for a team licence.

FAQ

Questions, answered.

What format is the book in?

PDF (1,000+ pages, print-ready) and EPUB for Kindle, Apple Books, and any modern reader. Both included.

What's the refund policy?

30 days, no questions asked. Email us, we refund. We'd rather you not own a book you don't get value from.

Do I get future updates?

Yes. Every update, free, for as long as the book exists. Payments don't stand still and neither does the book.

Is it for beginners or experienced engineers?

Both. Chapters 1 to 8 cover the fundamentals, 9 to 17 the providers, 18 to 29 production operations, and 30 to 42 modern rails and advanced patterns. Read straight through, or jump to whatever is on fire.

Can I read a sample first?

Yes. The full Stripe chapter is free, online, no email required.

What language are the examples in?

Python, standard library where possible. The patterns translate cleanly to any language.

Can I expense it?

Yes. Checkout emails you a receipt with your details on it, and most engineering budgets cover books. Teams can email us for a licence and one invoice.

I don't use Stripe. Is it still useful?

Yes. Stripe gets one chapter. PayPal, Paddle, Circle, 2Checkout, escrow, crypto, in-app purchases, open banking, and the regional rails each get their own, and the operations chapters apply whatever you run.

Ready when you are

Ten years of notes. One book.

42 chapters, 1,000+ pages, 90+ examples, every future update, and a 30-day refund if it's not for you.

30-day money-backInstant PDF and EPUB

$99 one-time · 30-day refund
Get the book