Skip to content

isFullyCanceled — @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 { isFullyCanceled } from '@gj-kit/toss-payments';
/**
* 완전 취소 판정 — ⚠ `status === 'CANCELED'` 검사가 아니다.
*
* Phase 0 실측(2026-08-09): 부분취소 이력이 있으면 잔액 전액 취소 후에도
* status가 `PARTIAL_CANCELED`로 남는다(balanceAmount 0). 따라서 CANCELED 문자열만
* 검사하지 않고, `balanceAmount === 0`과 취소 상태/이력 신호를 함께 본다. 취소 신호가
* 없는 READY의 잔액 0은 완전 취소가 아니다.
*
* The parameter is the structural subset this predicate actually reads (`status`,
* `balanceAmount`, `cancels`), so callers that only hold a reduced payment snapshot
* (see `PaymentStateInput`) can use it too. A full `Payment` is always assignable —
* including a fresh inline object literal: the explicit `| Payment` union member exists
* solely so the excess-property check accepts literals spelling out non-Pick `Payment`
* fields. Existing call sites compile unchanged.
*/
declare function isFullyCanceled(p: Pick<Payment, 'status' | 'balanceAmount' | 'cancels'> | Payment): 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