Skip to content

mustQueryOutcomeBeforeRetry — @gj-kit/toss-payments

A public function from @gj-kit/toss-payments. The signature below is taken directly from the 0.6.1 release declaration.

import { mustQueryOutcomeBeforeRetry } from '@gj-kit/toss-payments';
/**
* `true` when the caller must look the payment/billing outcome up before retrying or failing
* the operation, because the provider may have completed it:
*
* - every `TransportFailure` (`NETWORK_ERROR` / `TIMEOUT`) — the request may have reached Toss
* and the response was lost;
* - every `TossApiFailure` whose `code` is in {@link OUTCOME_QUERY_FIRST_ERROR_CODES}.
*
* Decided by `source` and `code` only — never by HTTP status (`PROVIDER_ERROR` is a 400 that
* belongs here; `REFUND_REJECTED` is a 400 that does not). `false` means the error is a
* definitive refusal as far as the library can tell; unregistered codes return `false`.
*
* The lookup itself stays with the caller: for confirm use `resolveConfirmFailure`, for cancel
* and billing approve re-fetch the payment by orderId and compare against your ledger. Note the
* two CONCURRENCY codes are special among the `true` cases: the *original* request may still be
* running, so a lookup that finds nothing (`NOT_FOUND_PAYMENT`) does **not** prove it never
* happened — replay the same key after a delay instead of minting a new attempt.
*/
declare function mustQueryOutcomeBeforeRetry(failure: TossApiFailure | TransportFailure): boolean;

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/toss-payments
  • Version: 0.6.1
  • Public entry: .
  • Source: GitHub