OptionalbaseOptionalfetchInjected for tests.
Optionalinit: RequestInitOptionalinit: RequestInitOptionalmaxHow many times a call may be repeated after transport-level trouble, with exponential backoff. Default 2. A GET is re-sent after a network failure, timeout, HTTP 5xx or 429 (Paysafe's own SDKs retry GETs only). A write is never re-sent blindly, because Paysafe rejects a reused merchantRefNum (409/5031 under dupCheck) instead of answering with the original. A 429 is re-sent after backoff: Paysafe refused it unprocessed. After a timeout, network failure or 5xx the write is looked up by its merchantRefNum and the original returned when Paysafe has it. When it does not, a payment, capture or refund is not re-sent — the call fails with a non-retryable processing_error, to retry later with the same key — while a payment handle, verification or void, which move no money, are. Business errors (declines, 3406 unbatched settlement, validation) never repeat 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 exchange after this many milliseconds (default 60000, the response timeout of Paysafe's own SDKs, which warn that "some requests may take longer to process"). The timer covers the whole exchange including the response body read. A read that times out surfaces as a retryable psp_unavailable; a write that times out may still have been processed, so it is looked up by its merchantRefNum instead (see maxNetworkRetries).
The bound is per exchange, and one call can make several: a read takes up to 1 + maxNetworkRetries attempts, a write up to 1 + maxNetworkRetries attempts with up to three lookups after an unanswered or duplicate one, and many calls read before they write (a card completion looks its key up, a refund reads the payment and its settlements, a full capture the payment and its settlement references). If Paysafe hangs on every exchange, a write can therefore take about (1 + maxNetworkRetries) × 4 × requestTimeoutMs, plus (1 + maxNetworkRetries) × requestTimeoutMs for each read before it: minutes at the defaults. On a platform that ends requests after 25-30 seconds, lower this and maxNetworkRetries until a call fits, and replay a call the platform ended with the same idempotencyKey: the replay reads back what the ended call did.
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.