Back to browse
Reinventing Payment – evolving a PHP domain model from one table to DDD

Reinventing Payment – evolving a PHP domain model from one table to DDD

by zykovn·Apr 15, 2026·1 point·0 comments

AI Analysis

●●SolidBig BrainNiche Gem

PHP payment domain model handling state machines and multi-provider abstraction better than Omnipay.

Strengths
  • Separates intent from action with channel-based state machines for complex refund and retry logic.
  • Hexagonal architecture ensures domain model remains independent from specific provider SDK implementations.
  • Twenty-eight minute article provides deep architectural reasoning rather than just code snippets.
Weaknesses
  • PHP ecosystem limits broader adoption as fintech infrastructure increasingly moves to Go or Node.
  • Show HN links to article rather than standalone library documentation or product landing page.
Target Audience

PHP developers building fintech products, backend architects

Similar To

Payum · Omnipay · Laravel Cashier

Post Description

I've been building payment systems for a while and kept running into the same problem — existing libraries normalize provider APIs but nobody asks what a payment domain model should actually look like.

This is my attempt to answer that question. The article walks through the evolution from a single table to channels, state machines, and hexagonal architecture. Still ongoing, feedback welcome.

https://corner4.dev/reinventing-payment-how-i-evolved-a-doma...

Similar Projects

AI/MLMid

A governance pattern for self-evolving AI skills

Claude Code Skill pattern paper—interesting theory, but unclear if it ships as a usable tool today.

Big Brain
tiansenxu
103mo ago