PayFanout API reference
    Preparing search index...

    Interface AdyenServerAdapterConfig

    interface AdyenServerAdapterConfig {
        apiKey: string;
        apiVersion?: string;
        baseUrl?: string;
        defaultReturnUrl?: string;
        environment: "sandbox" | "live";
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        hmacKeys: string
        | string[];
        liveUrlPrefix?: string;
        maxNetworkRetries?: number;
        merchantAccount: string;
        now?: () => number;
        paymentMethods?: PaymentMethodCapability[];
        requestTimeoutMs?: number;
        sessionSigningKey: string;
        sessionTtlSeconds?: number;
        sleep?: (ms: number) => Promise<void>;
        webhookBasicAuth: AdyenWebhookBasicAuth | AdyenWebhookBasicAuth[];
    }
    Index
    apiKey: string

    Checkout API key, sent as the X-API-Key header. Server-side only.

    apiVersion?: string

    Pinned Checkout API version, e.g. "v72".

    baseUrl?: string
    defaultReturnUrl?: string

    Where Adyen sends the shopper back from a redirect, including the 3-D Secure redirect flow Adyen can choose instead of the native one. returnUrl is one of the required top-level fields on POST /payments, so a session that carries none falls back to this value; with neither, session creation is refused instead of sending Adyen a request it rejects. Absolute with a scheme (https:// on the web, an app scheme such as my-app://), without whitespace, at most 1024 characters once serialized, and without // in the path of a web URL — a value that breaks those rules is refused at construction. It is sent WHATWG-serialized, so non-ASCII characters travel percent-encoded.

    environment: "sandbox" | "live"

    Explicit, never inferred. sandbox -> checkout-test.adyen.com, live -> {liveUrlPrefix}-checkout-live.adyenpayments.com.

    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>

    hmacKeys: string | string[]

    Webhook HMAC keys as generated in the Customer Area (HEX). Pass several to rotate with no cutover — any active key verifying wins.

    liveUrlPrefix?: string

    The account's live URL prefix — REQUIRED when environment is "live".

    maxNetworkRetries?: number

    Automatic retries with exponential backoff, each under the same idempotency-key (default 2): network failures, timeouts, HTTP 408 and 429, errorCode 705 (rate limited), a duplicate racing its in-flight original (errorCode 704), 5xx errors other than 501 unless Adyen types them validation, configuration or security, a 2xx whose body is not a JSON object, and any error Adyen sends with transient-error: true. The 5xx retry needs no transient-error header, deliberately: Adyen does not store a request an internal error stopped, and the retry carries the same key. Every other rejection surfaces on the first attempt, and a refusal is an answer, never retried.

    merchantAccount: string

    The merchant account every request is booked against.

    now?: () => number

    Injected clock (ms since epoch) — drives the session context expiry.

    paymentMethods?: PaymentMethodCapability[]

    Account capabilities vary by contract — override instead of trusting defaults.

    requestTimeoutMs?: number

    Abort a hung Adyen connection after this many milliseconds (default 30000). The timer covers the whole exchange including the response body read. Timeouts surface as retryable psp_unavailable and are retried under the same idempotency-key, so a request that did reach Adyen is answered from its store rather than performed twice.

    sessionSigningKey: string

    HMAC key for the stateless signed session context (see session-context.ts).

    sessionTtlSeconds?: number

    How long a signed session context stays completable, in seconds. Default 3600 (1h). A signed token must not be valid forever — expiry is enforced at completePayment.

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

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

    Basic-auth credentials configured on the Adyen webhook endpoint. Adyen's HMAC authenticates eight field values only, so the rest of a delivery is trusted on the strength of the channel it arrived on — verification requires these. Pass several to rotate with no cutover.