<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Nick Zykov</title>
    <description>The latest articles on Forem by Nick Zykov (@zykovn).</description>
    <link>https://forem.com/zykovn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3647665%2F82e356c2-7179-447a-9486-f17b052ebb39.png</url>
      <title>Forem: Nick Zykov</title>
      <link>https://forem.com/zykovn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/zykovn"/>
    <language>en</language>
    <item>
      <title>Your payment model is probably lying to you</title>
      <dc:creator>Nick Zykov</dc:creator>
      <pubDate>Wed, 15 Apr 2026 15:31:11 +0000</pubDate>
      <link>https://forem.com/zykovn/your-payment-model-is-probably-lying-to-52if</link>
      <guid>https://forem.com/zykovn/your-payment-model-is-probably-lying-to-52if</guid>
      <description>&lt;p&gt;Every payment system starts the same way: one table, one provider, ship it.&lt;/p&gt;

&lt;p&gt;Then the second provider arrives. Then retry logic. Then partial refunds. Then you realize the model you built on day one is lying to you.                             &lt;/p&gt;

&lt;p&gt;I went through this — and instead of patching it, I started over with one question: what is a payment as a business concept?                                           &lt;/p&gt;

&lt;p&gt;The result is a domain model built around DDD and hexagonal architecture: Payment as intent, PaymentAttempt as action, channels (Card, Crypto, P2P, Cash) each with their own state machine, and provider ports that keep the domain clean.&lt;/p&gt;

&lt;p&gt;Full writeup with code, diagrams, and the reasoning behind every decision:&lt;br&gt;&lt;br&gt;
  👉 &lt;a href="https://corner4.dev/reinventing-payment-how-i-evolved-a-domain-model-from-one-table-to-ddd" rel="noopener noreferrer"&gt;https://corner4.dev/reinventing-payment-how-i-evolved-a-domain-model-from-one-table-to-ddd&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code is open source: &lt;a href="https://github.com/payroad/payroad-core" rel="noopener noreferrer"&gt;https://github.com/payroad/payroad-core&lt;/a&gt;                                                                                                                   &lt;/p&gt;

</description>
      <category>php</category>
      <category>ddd</category>
      <category>architecture</category>
      <category>fintech</category>
    </item>
  </channel>
</rss>
