- Problem
- A payment notification can be missed, repeated, late or out of order, so trusting its arrival or its content can decide the wrong outcome.
- Context
- A seat is held while a customer pays through a payment provider. The provider sends a notification, but a notification can be lost, repeated, late or out of order.
- Decision
- One function records a payment. The notification handler and a reconciliation poller both end in it. It asks the provider for the payment status instead of trusting the notification, and it returns the same result however often it runs.
- Alternatives
- Acting on the notification itself. It is the simplest, and it lets the number, order and content of notifications decide the outcome.
- Consequences
- Every recording costs one status query. The poller has to cover holds that already expired, or a lost notification for one would never be found.
- Verification
- A seeded simulation of 250 random sequences of 60 steps asserts after every step that a seat is never confirmed twice and that every confirmed reservation has exactly one recorded payment.
- Why this matters
- The outcome depends on what the provider says happened, not on how many messages arrived or in which order.