PayFanout API reference
    Preparing search index...

    Interface CircuitBreakerOptions

    Outage memory. Without it, a dead PSP gets retried first on EVERY checkout — each customer pays the failed attempt's latency for the whole outage. The breaker skips a PSP after failureThreshold consecutive transient failures, lets one probe through after cooldownMs (half-open), and closes again on any response that proves the PSP alive (success OR business rejection).

    interface CircuitBreakerOptions {
        cooldownMs?: number;
        failureThreshold?: number;
        now?: () => number;
    }
    Index
    cooldownMs?: number

    How long an open circuit skips its PSP before allowing a probe. Default 30_000ms.

    failureThreshold?: number

    Consecutive transient failures before the circuit opens. Default 5.

    now?: () => number

    Injected clock for tests.