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

    Class ConfirmResponse

    Immutable wrapper around an order-management response.

    Invariants:

    • _raw is a deep clone validated and normalised at construction.
    • No mutator methods are exposed; the wrapper cannot affect SDK state.
    Index

    Constructors

    Methods

    • Returns string | undefined

      Cardholder IP address as reported by the gateway, or undefined.

    • Returns string | undefined

      Cardholder name as printed on the card, or undefined.

    • Returns string | undefined

      Card expiry in YYYYMM format, or undefined.

    • Returns string | undefined

      Masked PAN (e.g. 4111**1111) as redacted by the gateway, or undefined.

    • Returns string | undefined

      Issuer-generated approval code, or undefined for non-success responses.

    • Returns string | undefined

      The order number as echoed by the gateway, or undefined.

    • Captured amount in major units (e.g. DA). Returns undefined when the gateway value is absent, non-satim-module, fractional, or exceeds Number.MAX_SAFE_INTEGER — these cases indicate a malformed response that should not be silently coerced. Callers needing strictness should also call verifyAmount.

      Returns number | undefined

    • Actually-debited amount in major units.

      For standard captures, equals getAmount. For partial captures (pre-auth flows), may be less than the original hold.

      Same null-vs-malformed semantics as getAmount.

      Returns number | undefined

    • Session timed out (actionCode === "-2007"), only when no terminal OrderStatus is present.

      Returns boolean

    • Customer cancelled (actionCode === "10" or message matches "payment is cancelled").

      Returns boolean

    • Bank declined (actionCode ∈ {"2003","111"}, or respCode outside {"", "00"}, or message matches "payment is declined").

      Returns boolean

    • Catch-all failure predicate — true iff every other predicate is false. Mutual-exclusivity contract enforcement point: any response that does not fit a narrower predicate lands here.

      Returns boolean

    • Localised success/info message. Falls back to getErrorMessage for non-success terminal states.

      Source order on success: params.respCode_desc, then actionCodeDescription, then a fixed English fallback.

      Returns string

    • Localised failure message keyed to the active predicate.

      For declined payments, the message is the SDK's generic "Your transaction was rejected" rather than the gateway's specific respCode_desc (e.g. "Do not honor"). Callers needing the raw gateway reason should read it from getRawResponse.

      Returns string

    • Assert captured amount equals expectedAmount. Compares minor-unit integers via the same IEEE-754-safe toMinorUnits pipeline used at registration.

      Sole defence against partial-capture manipulation. Satim.confirm() calls this automatically on isSuccessful() responses — bypassing requires constructing ConfirmResponse directly, which also bypasses the gateway call entirely.

      Parameters

      • expectedAmount: number

      Returns boolean

      SatimUnexpectedResponseError when the gateway amount is absent, non-satim-module, fractional, or mismatches.

    • Shallow copy of the raw gateway response with cardholder PII redacted.

      Redacted fields: Ip, Pan, cardholderName, expiration.

      Use for debugging, logging, error reporting. Mutating the returned object does not affect this wrapper. For PII access, call the dedicated getCardPan / getCardHolderName / getCardExpiry / getIpAddress methods.

      Returns Record<string, unknown>