Validates and deep-clones the gateway payload.
SatimUnexpectedResponseError on schema violations.
The gateway-assigned order identifier. Always present after construction.
The hosted payment form URL.
SatimMissingDataError when no URL is present.
(In practice unreachable because validateRegisterSchema
enforces a non-empty formUrl at construction.)
Build a Web API 302 redirect to the hosted payment form. Returns a
standard Response usable in any Web-API runtime (Cloudflare Workers,
Deno, Bun, Node 18+).
Enforces HTTPS and the TRUSTED_SATIM_HOSTNAMES allowlist —
the only barrier against a gateway returning a formUrl on an
attacker-controlled domain.
SatimInvalidArgumentError when formUrl is not
HTTPS, not on a trusted host, or fails URL parsing.
A shallow copy of the raw gateway response. Suitable for debugging; prefer typed accessors for business logic. Mutating the returned object does not affect this wrapper.
Immutable wrapper around a registration response.
Invariants:
_rawis a deep clone of the gateway payload, made at construction time.