Skip to content

PaymentStatusChangedEvent — @gj-kit/toss-payments

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

import { PaymentStatusChangedEvent } from '@gj-kit/toss-payments/webhook';
/**
* 웹훅 이벤트 타입 + 신뢰 3등급 + 전방 호환 UNKNOWN 래퍼.
*
* '검증됨' 단일 타입은 의도적으로 없다 — 토스가 전 이벤트에 서명을 제공하지 않는다:
* 서명(HMAC)은 payout.changed/seller.changed에만, secret 대조는 DEPOSIT_CALLBACK에만
* 존재하고 나머지는 암호학적 진위 검증 수단이 없다.
* 출처: docs/research/toss-payments-v2.md "웹훅과 보안".
*/
interface PaymentStatusChangedEvent {
readonly envelope: 'legacy';
readonly eventType: 'PAYMENT_STATUS_CHANGED';
/** 마이크로초 6자리 무오프셋 형식(yyyy-MM-dd'T'HH:mm:ss.SSSSSS) — {@link import('./envelope').parseTossTimestamp} 권장. */
readonly createdAt: string;
/**
* core Payment 재사용(웹훅 전용 타입의 이중 관리 회피) + 종결 status 협착 —
* 문서: EXPIRED/DONE/ABORTED/CANCELED/PARTIAL_CANCELED로의 전이 시에만 발송된다.
*/
readonly data: Payment & {
readonly status: 'DONE' | 'CANCELED' | 'PARTIAL_CANCELED' | 'ABORTED' | 'EXPIRED';
};
}

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