Exploring the architecture behind modern payment systems.

Payment infrastructure is fragmented, underdocumented, and harder to build correctly than almost any other domain in software. These articles document the structural problems — and what better architecture could look like.

Farnaz Bagheri · Software Engineer · Payment Infrastructure

01

POS System Integrations

How payment terminals communicate with backend services, EMV certification constraints, and the gap between SDK documentation and production behavior.

02

Processor Interoperability

Why payment processors expose inconsistent APIs for identical operations, and what a normalized abstraction layer would need to handle.

03

Transaction State Architecture

Modeling payment lifecycle as a state machine — from authorization to capture, void, and refund — across distributed, sometimes-offline systems.

All articles →
01

A State Machine Approach to Reliable Payment Processing in POS Systems

A research-style treatment of transaction state modeling for POS payment systems, defining an explicit lifecycle, transition constraints, idempotency discipline, and recovery behavior under the failure modes that dominate production — timeouts, duplicate responses, post-capture declines, and partial persistence failures.

·16 min readPayment ProcessingState Machines
02

What I'd Build Differently: Lessons from Years of Payment Infrastructure

Twenty-seven articles into this series, and the pattern is clear: payment systems fail in predictable ways, and most of those failures trace back to architectural decisions made early. If I could start over with what I know now, here's what I'd do differently — and what I'd keep the same.

·13 min readPayment InfrastructureArchitecture
03

Real-Time Settlement vs. Batch Processing: Choosing the Right Model

Every vendor selling real-time payments will tell you batch is dead. It isn't. The choice between real-time and batch settlement is one of the most consequential payment architecture decisions, and it's almost always made for the wrong reasons.

·13 min readPayment InfrastructureSettlement
04

Embedded Payments: Why Every SaaS Platform Wants to Be a Payments Company

Look at any vertical SaaS company's earnings call lately and you'll hear the same word: payments. Toast, Mindbody, Square, ServiceTitan — they all want to be payments companies now. Some are right to want it. Most underestimate what it actually takes.

·13 min readPayment InfrastructureEmbedded Payments

Software engineer focused on payment infrastructure — the backend architecture, device protocols, and integration patterns that underlie POS systems and fintech platforms. Writing toward a more coherent understanding of how payment systems should be designed.

More about me →
Stack
Node.js · TypeScript · React · MongoDB
Domain
Payment Infrastructure · POS Systems
Protocols
EMV · ISO 8583 · REST