Mock data
How developers should handle uncertain outcomes
Your application should represent pending, reconciling and reversed positions honestly rather than guessing an outcome.
Why it matters
An application that shows 'Payment successful' on an unresolved event teaches users to distrust every screen you build.
How it works
- 1Treat webhook events as facts about state, not as instructions to celebrate.
- 2Make every money action idempotent using your own reference.
- 3Show the reference, the current state and the last checked time when the position is uncertain.
- 4Never offer a bare 'Try again' on a financial action without saying whether retrying is safe.
A practical example
A Nairobi ticketing app receives no webhook for four minutes on a slow network. Instead of retrying the charge, it shows the reference and 'we are checking with the provider'.
Common misunderstanding
A missing webhook is treated as a failed payment.
What to check before acting
- Verify webhook signatures.
- Reconcile with the recorded state rather than local assumptions.
