Field Manual PHP / Laravel reference
← Financial-system patterns

Failure handling

Financial failure handling distinguishes rejected, failed, and unknown outcomes.

What it is

Financial failure handling distinguishes rejected, failed, and unknown outcomes.

When to use it

Avoid incorrect retries after network or partial external failures.

Syntax

known rejected -> fail
confirmed success -> settle
unknown -> investigate/reconcile

Example

// If provider times out after receiving request:
// Persist unknown outcome with a stable external reference.
// Query/reconcile before initiating a second operation.
// Retry only with the provider’s idempotency contract.

Common mistakes

Timeout is not evidence that no money moved; do not invent success or blindly repeat a charge.

Related topics

Null handlingSecure error handlingError handling