# Illustrative diagnostic — payment confirmed, credit missing
**Fictional system and synthetic records. Not a client engagement, real production incident, commercial outcome or proof of a deployed fix.**

## Agreed question
Can a confirmed payment lose its matching internal credit when a write fails and the provider retries?

Scope: one confirmation path across a fictional provider, callback handler and internal ledger. This example assumes the provider retries after a non-2xx response. The receipt marker commits separately from the ledger write. Those are explicit fictional conditions, not assertions about a particular payment integration.

## Synthetic timeline
| Time | Record | Observation |
|---|---|---|
| 10:00:00 | P-104 | Provider marks payment succeeded. |
| 10:00:01.000 | E-104 | Callback with event key evt-104 reaches the handler. |
| 10:00:01.020 | H-104 | Handler commits a receipt marker for evt-104. It has not yet committed a credit. |
| 10:00:01.040 | L-104 | The ledger write fails; no matching credit exists. |
| 10:00:01.050 | H-104-RESPONSE | Handler returns HTTP 500. The provider records failed delivery. |
| 10:05:00.000 | R-104 | Provider retries the same event after the failed delivery. |
| 10:05:00.020 | R-104-RESPONSE | Defective duplicate check sees the receipt marker, skips the credit and returns HTTP 200. |
| 10:10:00 | C-104 | Synthetic comparison shows provider succeeded, receipt present, internal credit absent. |

## F-01 — receipt is being treated as completion
**Observed within this constructed record set:** the first delivery failed after receipt; the second returned success without a credit. The duplicate check distinguishes seen/not-seen, not complete/incomplete.

**Inference to investigate in a real system:** the deduplication marker and recoverable business outcome are not aligned. A retry can suppress the very work that failed.

**Unknowns a real engagement must resolve:** actual transaction boundaries, queue guarantees, database isolation, processing state, crash recovery, concurrent delivery and reconciliation policy. These records alone do not select a universal implementation.

**Recommendation:** define a durable processing state and a recovery path. Preserve exactly-one business credit as an invariant while permitting retries of incomplete work. Choose atomic writes, a recoverable inbox/worker pattern or another design only after inspecting actual guarantees. Do not equate delivery acknowledgement with completed business effect.

## Verification checks to design and run with authorisation
1. Fail the ledger write after the receipt marker is stored. On retry, require one eventual credit or a visible unresolved exception—never a silent missing credit.
2. Deliver the callback repeatedly and concurrently. Require one business credit, not one per delivery.
3. Restart at each relevant commit boundary. Prove recovery from persisted state.
4. Reconcile provider success against the ledger; surface the unmatched event with its evidence reference.

No checks above are represented as executed client tests. The sample demonstrates the proposed deliverable’s clarity and reasoning. It does not prove commercial results.

Technical context checked 14 November 2026: Stripe’s webhook documentation covers automatic retries following unsuccessful delivery and possible duplicate events. It does not justify the universal statement that redelivery can never follow an apparent success. https://docs.stripe.com/webhooks
