PayFanout API reference
    Preparing search index...

    Interface GoCardlessServerAdapterConfig

    interface GoCardlessServerAdapterConfig {
        accessToken: string;
        baseUrl?: string;
        environment: "sandbox" | "live";
        exitUri?: string;
        fallbackEnabled?: boolean;
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        goCardlessVersion?: string;
        maxNetworkRetries?: number;
        paymentMethods?: PaymentMethodCapability[];
        requestTimeoutMs?: number;
        sleep?: (ms: number) => Promise<void>;
        webhookSecret: string | string[];
    }
    Index
    accessToken: string

    Read-write access token from the GoCardless dashboard (server-side only).

    baseUrl?: string
    environment: "sandbox" | "live"

    Explicit, never inferred. sandbox -> api-sandbox.gocardless.com, live -> api.gocardless.com.

    exitUri?: string

    Where the hosted flow sends payers who cannot proceed (e.g. unsupported bank).

    fallbackEnabled?: boolean

    Lets a billing request fall back from instant bank payment to collecting a Direct Debit mandate when the instant rails are unavailable. Off by default: fallback payments confirm on debit timing (days), not seconds.

    fetch?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    }

    Injected for tests.

    Type Declaration

      • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
      • Parameters

        • input: URL | RequestInfo
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: string | URL | Request, init?: RequestInit): Promise<Response>
      • Parameters

        • input: string | URL | Request
        • Optionalinit: RequestInit

        Returns Promise<Response>

    goCardlessVersion?: string

    Pinned GoCardless-Version request header, overridable when GoCardless dates a new one.

    maxNetworkRetries?: number

    Automatic retries for transport-level trouble only (network failure, timeout, HTTP 5xx, 429) with exponential backoff. Default 2. Safe for mutating calls: billing-request/refund creates and cancel actions carry an Idempotency-Key, and a replayed flow create only re-issues an authorisation URL for the same billing request. Business errors (validation, invalid_state, permissions) are NEVER retried here.

    paymentMethods?: PaymentMethodCapability[]

    Scheme enablement varies per account — override the conservative defaults.

    requestTimeoutMs?: number

    Abort a hung GoCardless connection after this many milliseconds (default 30000; GoCardless's own server-side limit is 29s). The timer covers the whole exchange including the response body read. Timed-out requests are safe to retry (see maxNetworkRetries) and surface as retryable psp_unavailable errors.

    sleep?: (ms: number) => Promise<void>

    Injected backoff sleep for retry tests; defaults to real setTimeout.

    webhookSecret: string | string[]

    Webhook endpoint secret(s) from the dashboard. Accepts several at once so a rotation needs no cutover — any active secret verifying wins.