ENGINEERING NOTE 27 / 50 · CARD
Represent card authorization holds without double counting
An authorization reserves spending capacity; settlement records the completed charge. Reporting both as separate expenses double counts the same purchase.
Published by OPEN RAMBO. The engineering patterns and pseudocode illustrate designs, not a documented product API. Numerical examples are illustrative.
Link the lifecycle
Store an authorization reference and link later settlement, reversal or expiry events to it where references are available. Keep raw events for reconciliation, but derive spending reports from the appropriate financial stage.
Distinguish balances
A visible card balance can differ from available spending capacity because of holds. Explain pending reservations rather than showing an unexplained subtraction. Partial settlement or incremental authorization requires more than a simple one-to-one event assumption.
Reconcile unresolved holds
Age open holds using product-specific rules and investigate those beyond the expected window. Do not manually release them solely because a customer says the merchant cancelled. Obtain authoritative reversal or settlement evidence before adjusting financial state.
Illustrative implementation
purchase = {"authorized":100, "settled":80, "reversed":20}
reported_spend = purchase["settled"] # illustrative lifecycleAcceptance check
Feed authorization, settlement and reversal in different orders. Report one settled purchase, not the sum of every event amount.