Sep 2026
Model payments as state machines
A payment is not paid or unpaid. It is created, pending, authorized, captured, failed, refunded, disputed.
Make the allowed transitions explicit and reject everything else. Bugs become loud instead of silent.
Log every transition with its cause. Your future self, and your support team, will thank you.