satim-module - v1.0.0
    Preparing search index...

    Class HttpClientService

    HTTP transport. One instance per Satim client by default; can be shared across multiple Satim instances for connection-pool reuse. Concurrent requests against one instance share the embedded breaker; its counter updates are benign under racing onFailure() calls (may transiently overshoot the threshold but the breaker still opens).

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Send a request and translate gateway error codes into typed exceptions.

      Preconditions: endpoint begins with / (concatenated with base URL). data carries the form fields to encode.

      Postcondition on success: returns the parsed JSON response object (always an object, never null or primitive).

      Retry: defaults to true for callers that omit options.retryable. Mutating endpoints (register, confirm, refund, reverseOrder) pass false explicitly unless an idempotency key is set.

      Complexity: O(R × T) where R is maxRetries + 1 and T is the per-attempt round-trip time. Backoff between attempts is included.

      Type Parameters

      • T = unknown

      Parameters

      • endpoint: string
      • data: Record<string, unknown>
      • Optionaloptions: { retryable?: boolean }

      Returns Promise<T>

      SatimInvalidCredentialsError on ErrorCode: "5".

      SatimInvalidArgumentError on ErrorCode: "6".

      SatimGatewayError on ErrorCode in {"1","3","4","7"}.

      SatimUnexpectedResponseError on any other error (network, timeout, parse, non-object response, other non-zero ErrorCode, circuit open).