Skip to content

RefundCalculation — @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 { RefundCalculation } from '@gj-kit/toss-payments/server';
type RefundCalculation = {
readonly kind: "full";
} | {
readonly kind: "percentage";
readonly rateBps: number;
} | {
readonly kind: "elapsed-time-rate";
readonly elapsedMs: number;
/** fallback이면 null. */
readonly bracketIndex: number | null;
readonly rateBps: number;
} | {
readonly kind: "remaining-units";
readonly totalUnits: number;
readonly remainingUnits: number;
readonly rateBps: number;
} | {
readonly kind: "custom";
readonly entitlementKind: "rate" | "amount";
readonly details: Readonly<Record<string, RefundCalculationDetail>>;
};

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