Transaction processing
Card network messaging, authorization, reversal and clearing. Every financial event carries one lasting reference, so a repeated request does not create a second hold and a late reversal finds the right transaction.
A small working model that runs in your browser, on sample data. It shows the rule we build to. It is not a client’s system.
With one lasting reference
5,000.00available · 0 holdsWithout it: matching on amount
5,000.00available · 0 holds- Every request carries a reference.
- A reference seen before gets its first answer again.
- A reversal releases only the hold with its reference.
- A reversal with no matching hold changes nothing.
Read the model
This is the code running above. It leaves out storage, restarts, timers and two messages arriving at once. A real engine has to keep the rule through all of them.