OptionalbaseOptionalfetchInjected for tests.
Optionalinit: RequestInitOptionalinit: RequestInitOptionalmaxAutomatic retries for transport-level trouble only (network failure, timeout, HTTP 5xx, 429) with exponential backoff. Default 2. Safe because merchantRefNum makes every mutating call idempotent. Business errors (declines, 3406 unbatched-settlement, validation) are NEVER retried here.
Paysafe selects a merchant account per currency/country — a single
hardcoded id is wrong. This is also why CreatePaymentSessionInput
carries country. Return undefined for single-account API keys: Paysafe
then routes by key + currency without an explicit accountId.
OptionalnowInjected clock (ms since epoch) for session-TTL tests.
OptionalpaymentAccount capabilities vary by merchant account/currency/country — override instead of trusting defaults. Defaults are conservative.
OptionalrequestAbort a hung Paysafe connection after this many milliseconds (default 30000). The timer covers the whole exchange including the response body read. Every mutating call carries an idempotent merchantRefNum, so a timed-out request is safe to retry. Timeouts surface as retryable psp_unavailable errors.
HMAC key for the stateless signed session context (see session-context.ts).
OptionalsessionHow 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/verifyPaymentMethod/updatePaymentSession.
OptionalsleepInjected backoff sleep for retry tests; defaults to real setTimeout.
Basic-auth API credentials (server-side only).
HMAC key Paysafe uses to sign webhook payloads. Accepts several keys at once so a rotation needs no cutover — any active key verifying wins.
Explicit, never inferred. sandbox -> api.test.paysafe.com, live -> api.paysafe.com.