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

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.
- 01Introduction
- 02Book overview and reading paths
- 03Terminology and glossary
- 04How payments actually work
- 05Payment lifecycles
- 06International payments and multi-currency
- 07Subscriptions and recurring billing
- 08VAT and digital sales tax
- 09Stripe integration
- 10PayPal integration
- 11Paddle integration
- 12Circle integration
- 132Checkout integration
- 14Escrow payments
- 15Cryptocurrency and Web3
- 16In-app purchases
- 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.
- 18Payment orchestration
- 19Fraud prevention and risk
- 20Financial reconciliation
- 21Performance and scale
- 22Alternative payment methods
- 23Marketplace and multi-party payments
- 24Advanced subscription management
- 25Payment analytics and BI
- 26Global compliance
- 27Payment UX and conversion
- 28Security operations
- 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.
- 30NFC and contactless payments
- 31QR code payments
- 32B2B payment workflows
- 33Open banking and PSD2
- 34Regional payment networks
- 35AI in payments
- 36CBDCs and digital currencies
- 37Gaming and digital goods
- 38Payment SDKs and libraries
- 39Webhooks deep dive
- 40Asian payment ecosystems
- 41Emerging market payment systems
- 42Advanced payment data analytics
# 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 chapterIs 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.
Charge a card, anyone can. Survive the webhook that twice arrives, this book teaches. Fulfil twice, you must not. Read it, you will.
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.
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.
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.
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.
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.
I've had it with these unsigned webhooks in this unsigned production flow. Chapter 9. Read it. Then we can all go home.
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.
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.
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.
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.
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.
We made payments insanely simple. Then the webhooks arrived. One more thing: read this. Boom.
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.
The line must be drawn here. This far, no further: no fulfilment without a verified signature. Make it so. Engage.
Obviously not real, but we'd love to include yours
Send us yoursPricing
One purchase. Lifetime access.
No subscription, no upsell, no pro edition six months later.
Order summary · Payments Playbook
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
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

