Failure classification
Every gateway response is normalized into one of three classes:| Class | Examples | Failover? |
|---|---|---|
| Fraud-class (terminal) | stolen card, lost card, fraud suspected, invalid card | Never — surfaced to the customer immediately |
| Hard decline (retryable) | do_not_honor, card_declined, insufficient_funds | Yes, if hardDeclines trigger is on |
| Infrastructure | per-attempt timeout, gateway 5xx, network error | Yes, if timeouts / gatewayErrors triggers are on |
Latency budget
Failover only helps if it is fast enough that the customer never notices:- p95 target: ≤ 2,500 ms for a two-attempt checkout (attempt 1 + failover decision + attempt 2).
- Absolute ceiling: 4,500 ms. The moment total processing time would breach the ceiling, the engine halts all retries — no zombie attempts.
Degradation: when everything is down
If all configured gateways fail with timeouts/5xx in one checkout (a double blackout), SwitchFlow does not show your customer an error page. Instead the widget receives:payment.failed webhook with
reason: "gateway_blackout" so your systems know no capture happened. See
widget reference for configuring the fallback label and
behavior.
What you see afterwards
Every payment carries a full attempt trail — gateway, outcome, normalized decline code, decline class, and latency per attempt — available onGET /payment-sessions/{id}, in the
webhook payload, and in the dashboard’s failover event log.