PayFanout API reference
    Preparing search index...

    Interface StripeClientAdapterConfig

    interface StripeClientAdapterConfig {
        apiVersion: string;
        cspNonce?: string;
        environment: "sandbox" | "live";
        getStripeGlobal?: () => StripeJsFactory | undefined;
        hideTestingAssistant?: boolean;
        loadScript?: (url: string) => Promise<void>;
        locale?: string;
        paymentMethods?: PaymentMethodCapability[];
        publishableKey: string;
        returnUrl?: string;
    }
    Index
    apiVersion: string

    The Stripe API version the server adapter pins, such as "2026-08-26.dahlia" or "2024-06-20", or, while the server is on a release this adapter does not know yet, a version of the newest release it knows. Required: it picks the Stripe.js build, which decides the API version the browser half speaks.

    • A version with a release name loads that release's build, https://js.stripe.com/<release>/stripe.js, for the releases this adapter knows: acacia, basil, clover and dahlia. Stripe pins each build to an API version of its release and lets nothing override it, so the browser speaks the release, not necessarily the date: a field or code a later monthly version of the release added may reach the server and not the browser.
    • A date alone, the form of every version before 2024-09-30.acacia, loads https://js.stripe.com/v3 and passes the version to Stripe() as apiVersion, an option only v3 takes, so the browser speaks exactly it.

    A Stripe.js the page already runs is used instead of loading this build (see loadSdk()). The constructor refuses with invalid_request a missing or malformed version, a date that does not exist, a date alone from 2024-09-30 on and a release name with an earlier date, a release this adapter knows no build for, a preview version and a version carrying beta headers ("…; name=v1"), as no Stripe.js build speaks the last two.

    cspNonce?: string

    A Content-Security-Policy nonce for the Stripe.js <script> the adapter injects, set as its nonce attribute before the tag is inserted, so a script-src that allows scripts by nonce without 'strict-dynamic' runs it. Stripe.js reads no nonce itself: it loads its lazy chunks from https://js.stripe.com without one, which such a policy blocks unless it also lists that host. Pass the value alone, as in the policy's 'nonce-<value>' source; the constructor refuses anything else. The adapter never reads a nonce from the page, and a loadScript seam loads the script without it.

    environment: "sandbox" | "live"

    Explicit, mirrors the server adapter — never inferred from key prefixes.

    getStripeGlobal?: () => StripeJsFactory | undefined
    hideTestingAssistant?: boolean

    Hides the testing assistant Stripe.js shows at the bottom right of a sandbox page with Elements, on by default for the Payment Intents API from the clover build on, by passing developerTools: { assistant: { enabled: false } } to Stripe(). Live mode never shows it. Unset or false leaves Stripe's default.

    loadScript?: (url: string) => Promise<void>

    Test seams: script injection + global lookup. loadScript receives the URL of the build apiVersion names, and is called again by the next loadSdk() after an attempt that rejects or leaves the SDK global missing, so it must be safe to call more than once. What getStripeGlobal returns is used as window.Stripe is.

    locale?: string
    paymentMethods?: PaymentMethodCapability[]

    Override the capability list per account/currency instead of hardcoding.

    publishableKey: string
    returnUrl?: string

    Used for redirect-based methods; card/3DS flows stay inline (redirect: "if_required").