콘텐츠로 이동

NotCancelableError — @gj-kit/toss-payments

@gj-kit/toss-payments/server에서 공개하는 type입니다. package version 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[];
};

이 선언은 매개변수, optionality, 제네릭, 반환값, 공개 union/type 계약의 정본입니다. 호출 전 필요한 환경·권한·오류 경계는 패키지 Golden path와 이 subpath의 import 조건을 함께 확인하세요.

  • 패키지: @gj-kit/toss-payments
  • 버전: 0.6.1
  • 공개 entry: ./server
  • 소스: GitHub