콘텐츠로 이동

CancelOutcome — @gj-kit/toss-payments

@gj-kit/toss-payments/server에서 공개하는 interface입니다. package version 0.6.1의 release declaration을 그대로 표시합니다.

import { CancelOutcome } from '@gj-kit/toss-payments/server';
interface CancelOutcome {
/** 전액 취소여도 status 'CANCELED' 단정 금지 — 부분취소 이력이 있으면 PARTIAL_CANCELED 유지(실측). */
readonly payment: Payment & {
readonly status: 'CANCELED' | 'PARTIAL_CANCELED';
};
/** 이번 취소 건. ABORTED는 CancelError로 분리되므로 성공 outcome에는 들어오지 않는다. */
readonly cancel: CancelTransaction & {
readonly cancelStatus: 'DONE' | 'IN_PROGRESS';
};
/** 완전 취소 판정의 유일한 기준: balanceAmount === 0. status로 판정하지 않는다. */
readonly fullyCanceled: boolean;
/** cancelStatus === 'IN_PROGRESS' (PayPal 등 해외 비동기) → CANCEL_STATUS_CHANGED 웹훅 대기. */
readonly pending: boolean;
/** 실제 사용된 키 (자동 생성분 포함). */
readonly idempotencyKey: IdempotencyKey;
}

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

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