Skip to content

NotCancelableError — @gj-kit/toss-payments

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

import { NotCancelableError } from '@gj-kit/toss-payments/server';
type NotCancelableError = {
readonly source: 'library';
readonly kind: 'not-cancelable-status';
readonly status: Exclude<PaymentStatus, 'DONE' | 'PARTIAL_CANCELED' | 'WAITING_FOR_DEPOSIT'>;
}
/**
* balanceAmount === 0 — Phase 0 실측(2026-08-09): 부분취소 이력이 있으면 잔액 전액
* 취소 후에도 status가 PARTIAL_CANCELED로 남는다. 취소 status의 잔액 0만 완료로 보고,
* 비취소 status의 잔액 0은 상태 불일치로 차단한다.
*/
| {
readonly source: 'library';
readonly kind: 'already-fully-canceled';
readonly paymentKey: PaymentKey;
readonly status: 'CANCELED' | 'PARTIAL_CANCELED';
} | {
/** 타입상 Payment여도 status·balance·취소 이력이 서로 모순이면 실행하지 않는다. */
readonly source: 'library';
readonly kind: 'inconsistent-payment-state';
readonly paymentKey: PaymentKey;
readonly status: PaymentStatus;
readonly balanceAmount: number;
/** summarizePaymentState와 동일한 단일 불변식 판정 결과. */
readonly reason: PaymentStateConsistencyIssue['kind'];
readonly issue: PaymentStateConsistencyIssue;
} | {
/** 해외 결제 등 provider 취소가 확정되기 전에는 추가 취소를 시작하지 않는다. */
readonly source: 'library';
readonly kind: 'pending-cancellation';
readonly paymentKey: PaymentKey;
readonly status: PaymentStatus;
readonly transactionKeys: readonly string[];
};

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: ./server
  • Source: GitHub