Skip to content

memoryOrderStore — @gj-kit/toss-payments

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

import { memoryOrderStore } from '@gj-kit/toss-payments/testing';
/**
* 인메모리 스토어 4종 + 인메모리 AuditSink — 단위 테스트·프로토타이핑용.
*
* 프로세스 생존 기간만 유지된다 — 프로덕션 사용 금지(특히 빌링키는 토스에 조회
* API가 없어 저장 유실 = 복구 불가).
*
* 스토어 인터페이스는 전부 타입 전용 import다 — "./testing" 엔트리가 server/webhook
* 모듈의 런타임 코드를 번들에 끌고 가지 않는다(격리 규칙 §2 유지).
*/
/**
* orderId 키 인메모리 OrderStore — saveOrder는 같은 orderId를 덮어쓴다.
*
* `orderOf` is a side-effect-free inspection hook for assertions (mirrors the
* `memoryAuditSink().entries` convention): it never creates, claims or mutates an entry, and
* it returns a defensive copy — mutating the returned object cannot corrupt the store.
*/
declare function memoryOrderStore(): OrderStore & {
orderOf(orderId: string): StoredOrder | undefined;
};

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