Topics / Engineering practice

Verify the transaction, including what happens after a timeout.

Financial workflows need explicit promises about amounts, identity, ordering and recovery. A successful API response is only one observation.

Write down the invariant before the happy path.

For your product, identify the effects that must remain consistent: balances, ledger entries, currency, fees and the relationship between a request and its resulting transaction. Have a domain owner confirm the rules. This guide illustrates engineering checks, not a universal accounting model.

Illustrative example

The response disappeared after the charge.

A provider accepts a payment, but the caller times out. The caller retries while a delayed callback arrives. The check should inspect the final ledger and external effect, not just the retry’s response code. The required handling of an unknown outcome must be explicit.

Build a failure-oriented scenario set.

ConditionObservation to inspect
Same request delivered twiceNumber and identity of durable effects
Callback arrives before the responseFinal state and transition history
Currency has a different precisionRecorded amount and approved rounding behavior
Partial failure between systemsReconciliation state and recoverable evidence
Refund overlaps settlementPermitted ordering and resulting balances

Use these as prompts to select relevant tests. Passing them does not establish the safety of every transaction or satisfy a regulatory assessment.

Keep the rule with the implementation.

Proof connects the approved requirement to code, hazards, checks and prior defects. That context helps an agent changing retries or throughput retrieve the financial promises it must preserve.

For a pilot, choose a single flow with a runnable environment and representative failure injection. Measure the effort to explain and verify that change, including any domain decisions still needed.

Try it on your software

Start with one consequential transaction flow.

Bring a retry, reconciliation or rounding issue and the rule it should obey.