fake-iamport-server
Version:
Fake iamport server for testing
78 lines (77 loc) • 3.13 kB
TypeScript
/**
* @packageDocumentation
* @module api.functional.internal
* @nestia Generated by Nestia - https://github.com/samchon/nestia
*/
import type { IConnection } from "@nestia/fetcher";
import type { IIamportPayment } from "../../structures/IIamportPayment";
/**
* 웹훅 이벤트 더미 리스너.
*
* `internal.webhook` 은 실제 아임포트의 서버에는 존재하지 않는 API 로써,
* `fake-impoart-server` 의 {@link Configuration.WEBHOOK_URL} 에 아무런 URL 을 설정하지
* 않으면, `fake-iamport-server` 로부터 발생하는 모든 종류의 웹훅 이벤트는 이 곳으로 전달되어
* 무의미하게 사라진다.
*
* 따라서 `fake-iamport-server` 를 사용하여 아임포트 서버와의 연동을 미리 검증코자 할 때는,
* 반드시 {@link Configuration.WEBHOOK_URL} 를 설정하여 웹훅 이벤트가 귀하의 백엔드 서버로
* 제대로 전달되도록 하자.
*
* @param input 웹훅 이벤트 정보
* @author Samchon
*
* @controller FakeIamportInternalController.webhook
* @path POST /internal/webhook
* @nestia Generated by Nestia - https://github.com/samchon/nestia
*/
export declare function webhook(connection: IConnection, input: IIamportPayment.IWebhook): Promise<void>;
export declare namespace webhook {
type Input = IIamportPayment.IWebhook;
const METADATA: {
readonly method: "POST";
readonly path: "/internal/webhook";
readonly request: {
readonly type: "application/json";
readonly encrypted: false;
};
readonly response: {
readonly type: "application/json";
readonly encrypted: false;
};
readonly status: 201;
};
const path: () => string;
}
/**
* 가상 계좌에 입금하기.
*
* `internal.deposit` 은 실제 아임포트 결제 서버에는 존재하지 않는 API 로써, 가상 계좌
* 결제를 신청한 고객이, 이후 가상 계좌에 목표 금액을 입금하는 상황을 시뮬레이션 할 수 있는
* 함수이다.
*
* 즉, `internal.deposit` 는 고객이 스스로에게 가상으로 발급된 계좌에 입금을 하고, 그에 따라
* 아임포트 서버에서 webhook 이벤트가 발생, 이를 귀하의 백엔드 서버로 전송하는 일련의 상황을
* 시뮬레이션하기 위하여 설계된 테스트 함수다.
*
* @param imp_uid 대상 결제의 {@link IIamportVBankPayment.imp_uid }
* @security bearer
* @author Samchon
*
* @controller FakeIamportInternalController.deposit
* @path PUT /internal/deposit/:imp_uid
* @nestia Generated by Nestia - https://github.com/samchon/nestia
*/
export declare function deposit(connection: IConnection, imp_uid: string): Promise<void>;
export declare namespace deposit {
const METADATA: {
readonly method: "PUT";
readonly path: "/internal/deposit/:imp_uid";
readonly request: null;
readonly response: {
readonly type: "application/json";
readonly encrypted: false;
};
readonly status: 200;
};
const path: (imp_uid: string) => string;
}