Skip to content

Commit

Permalink
Merge pull request #183 from samchon/features/hostnames
Browse files Browse the repository at this point in the history
용어 변경 리팩토링.
  • Loading branch information
samchon authored Dec 6, 2023
2 parents 840bbf6 + faca296 commit 576112b
Show file tree
Hide file tree
Showing 82 changed files with 307 additions and 307 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export async function test_api_toss_vbank_payment(
* {@link IPaymentHistory} 등록에 사용하도록 하자.
*/
const payment: ITossPayment =
await toss.functional.v1.virtual_accounts.store(
await TossAsset.connection("test-toss-payments-store-id"),
await toss.functional.v1.virtual_accounts.create(
await TossAsset.connection("test-toss-payments-create-id"),
{
// 가상 계좌 정보
method: "virtual-account",
Expand Down Expand Up @@ -106,10 +106,10 @@ export async function test_api_toss_vbank_payment(
* 조회할 때 필요하니, 이를 반드시 귀하의 백엔드 서버에 저장해두도록 한다.
*/
const history: IPaymentHistory =
await api.functional.payments.histories.store(connection, {
await api.functional.payments.histories.create(connection, {
vendor: {
code: "toss.payments",
store_id: "test-toss-payments-store-id",
store_id: "test-toss-payments-create-id",
uid: payment.paymentKey,
},
source: {
Expand All @@ -132,7 +132,7 @@ export async function test_api_toss_vbank_payment(
* 고객이 자신 앞을 발급된 계좌에, 결제 금액을 입금하는 상황 시뮬레이션.
*/
await toss.functional.internal.deposit(
await TossAsset.connection("test-toss-payments-store-id"),
await TossAsset.connection("test-toss-payments-create-id"),
payment.paymentKey,
);

Expand Down
2 changes: 1 addition & 1 deletion packages/fake-iamport-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export async function test_fake_subscription_payment_again(): Promise<IIamportCa
);

// 간편 결제 카드 등록하기
await imp.functional.subscribe.customers.store(
await imp.functional.subscribe.customers.create(
await connector.get(),
customer_uid,
{
Expand Down
12 changes: 6 additions & 6 deletions packages/fake-iamport-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fake-iamport-server",
"version": "5.1.5",
"version": "6.0.0",
"description": "Fake iamport server for testing",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -38,7 +38,7 @@
},
"homepage": "https://github.com/samchon/fake-iamport-server",
"devDependencies": {
"@nestia/sdk": "^2.4.1",
"@nestia/sdk": "^2.4.2",
"@types/atob": "^2.1.2",
"@types/btoa": "^1.2.3",
"@types/cli": "^0.11.19",
Expand All @@ -53,13 +53,13 @@
"rimraf": "^3.0.2",
"sloc": "^0.2.1",
"ts-node": "^10.9.1",
"ts-patch": "^3.0.2",
"ts-patch": "^3.1.1",
"typescript": "^5.3.2"
},
"dependencies": {
"@nestia/core": "^2.4.1",
"@nestia/core": "^2.4.2",
"@nestia/e2e": "^0.4.0",
"@nestia/fetcher": "^2.4.1",
"@nestia/fetcher": "^2.4.2",
"@nestjs/common": "^10.2.8",
"@nestjs/core": "^10.2.8",
"@nestjs/platform-fastify": "^10.2.8",
Expand All @@ -68,7 +68,7 @@
"source-map-support": "^0.5.19",
"tstl": "^2.5.13",
"typescript-transform-paths": "^3.4.6",
"typia": "^5.3.1",
"typia": "^5.3.4",
"uuid": "^9.0.0"
},
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function request(
);
}
export namespace request {
export type Input = Primitive<IIamportCertification.IStore>;
export type Input = Primitive<IIamportCertification.ICreate>;
export type Output = Primitive<IIamportResponse<IIamportCertification.IAccessor>>;

export const METADATA = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export async function cancel(
);
}
export namespace cancel {
export type Input = Primitive<IIamportPaymentCancel.IStore>;
export type Input = Primitive<IIamportPaymentCancel.ICreate>;
export type Output = Primitive<IIamportResponse<IIamportPayment>>;

export const METADATA = {
Expand Down
20 changes: 10 additions & 10 deletions packages/fake-iamport-server/src/api/functional/receipts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ export namespace at {
* @security bearer
* @author Samchon
*
* @controller FakeIamportReceiptsController.store
* @controller FakeIamportReceiptsController.create
* @path POST /receipts/:imp_uid
* @nestia Generated by Nestia - https://github.com/samchon/nestia
*/
export async function store(
export async function create(
connection: IConnection,
imp_uid: string,
input: store.Input,
): Promise<store.Output> {
input: create.Input,
): Promise<create.Output> {
return !!connection.simulate
? store.simulate(
? create.simulate(
connection,
imp_uid,
input,
Expand All @@ -113,14 +113,14 @@ export async function store(
},
},
{
...store.METADATA,
path: store.path(imp_uid),
...create.METADATA,
path: create.path(imp_uid),
} as const,
input,
);
}
export namespace store {
export type Input = Primitive<IIamportReceipt.IStore>;
export namespace create {
export type Input = Primitive<IIamportReceipt.ICreate>;
export type Output = Primitive<IIamportResponse<IIamportReceipt>>;

export const METADATA = {
Expand All @@ -145,7 +145,7 @@ export namespace store {
export const simulate = async (
connection: IConnection,
imp_uid: string,
input: store.Input,
input: create.Input,
): Promise<Output> => {
const assert = NestiaSimulator.assert({
method: METADATA.method,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NestiaSimulator } from "../../../utils/NestiaSimulator";
/**
* 간편 결제 카드 정보 조회하기.
*
* `subscribe.customers.at` 은 고객이 {@link store } 나 혹은 아임포트가 제공하는
* `subscribe.customers.at` 은 고객이 {@link create } 나 혹은 아임포트가 제공하는
* 간편 결제 카드 등록 창을 이용하여 저장한 간편 결제 카드 정보를 조회하는 API
* 함수이다.
*
Expand Down Expand Up @@ -91,7 +91,7 @@ export namespace at {
* 필요할 때마다 카드 정보를 반복 입력하는 일 없이, 간편하게 결제를 진행하고자 할 때
* 사용하는 API 함수이다.
*
* 참고로 `subscribe.customers.store` 는 클라이언트 어플리케이션이 아임포트가 제공하는
* 참고로 `subscribe.customers.create` 는 클라이언트 어플리케이션이 아임포트가 제공하는
* 간편 결제 카드 등록 창을 사용하는 경우, 귀하의 백엔드 서버가 이를 실 서비스에서 호출하는
* 일은 없을 것이다. 다만, 고객이 간편 결제 카드를 등록하는 상황을 시뮬레이션하기 위하여,
* 테스트 자동화 프로그램 수준에서 사용될 수는 있다.
Expand All @@ -102,17 +102,17 @@ export namespace at {
* @security bearer
* @author Samchon
*
* @controller FakeIamportSubscribeCustomersController.store
* @controller FakeIamportSubscribeCustomersController.create
* @path POST /subscribe/customers/:customer_uid
* @nestia Generated by Nestia - https://github.com/samchon/nestia
*/
export async function store(
export async function create(
connection: IConnection,
customer_uid: string,
input: store.Input,
): Promise<store.Output> {
input: create.Input,
): Promise<create.Output> {
return !!connection.simulate
? store.simulate(
? create.simulate(
connection,
customer_uid,
input,
Expand All @@ -126,14 +126,14 @@ export async function store(
},
},
{
...store.METADATA,
path: store.path(customer_uid),
...create.METADATA,
path: create.path(customer_uid),
} as const,
input,
);
}
export namespace store {
export type Input = Primitive<IIamportSubscription.IStore>;
export namespace create {
export type Input = Primitive<IIamportSubscription.ICreate>;
export type Output = Primitive<IIamportResponse<IIamportSubscription>>;

export const METADATA = {
Expand All @@ -158,7 +158,7 @@ export namespace store {
export const simulate = async (
connection: IConnection,
customer_uid: string,
input: store.Input,
input: create.Input,
): Promise<Output> => {
const assert = NestiaSimulator.assert({
method: METADATA.method,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { NestiaSimulator } from "../../../utils/NestiaSimulator";
*
* 다만, 정히 간편 카드 등록과 결제를 동시에 하고 싶다면,
* `subscribe.payments.onetime` 에 {@link IIamportSubscription.IOnetime.customer_uid }
* 를 더하기보다, {@link subscribe.customers.store } 와 {@link subscribe.payments.again }
* 를 더하기보다, {@link subscribe.customers.create } 와 {@link subscribe.payments.again }
* 을 각각 호출하는 것을 권장한다. 그것이 예외적인 상황에 보다 안전하게 대처할 수 있기
* 때문이다.
*
Expand Down
20 changes: 10 additions & 10 deletions packages/fake-iamport-server/src/api/functional/vbanks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ import { NestiaSimulator } from "../../utils/NestiaSimulator";
* @security bearer
* @author Samchon
*
* @controller FakeIamportVbanksController.store
* @controller FakeIamportVbanksController.create
* @path POST /vbanks
* @nestia Generated by Nestia - https://github.com/samchon/nestia
*/
export async function store(
export async function create(
connection: IConnection,
input: store.Input,
): Promise<store.Output> {
input: create.Input,
): Promise<create.Output> {
return !!connection.simulate
? store.simulate(
? create.simulate(
connection,
input,
)
Expand All @@ -42,14 +42,14 @@ export async function store(
},
},
{
...store.METADATA,
path: store.path(),
...create.METADATA,
path: create.path(),
} as const,
input,
);
}
export namespace store {
export type Input = Primitive<IIamportVBankPayment.IStore>;
export namespace create {
export type Input = Primitive<IIamportVBankPayment.ICreate>;
export type Output = Primitive<IIamportResponse<IIamportVBankPayment>>;

export const METADATA = {
Expand All @@ -73,7 +73,7 @@ export namespace store {
typia.random<Primitive<IIamportResponse<IIamportVBankPayment>>>(g);
export const simulate = async (
connection: IConnection,
input: store.Input,
input: create.Input,
): Promise<Output> => {
const assert = NestiaSimulator.assert({
method: METADATA.method,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export namespace IIamportCertification {
/**
* 본인 인증 입력 정보.
*/
export interface IStore {
export interface ICreate {
/**
* 본인인증대상자 성명.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export namespace IIamportPaymentCancel {
/**
* 결제 취소 입력 정보.
*/
export interface IStore {
export interface ICreate {
/**
* 결제 정보 {@link IIamportPayment} 의 식별자 키.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export namespace IIamportReceipt {
/**
* 현금영수증 입력 정보.
*/
export interface IStore {
export interface ICreate {
/**
* 귀속 결제의 {@link IIamportPayment.imp_uid}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export namespace IIamportSubscription {
/**
* 간편 결제 카드 입력 정보.
*/
export interface IStore extends IAccessor {
export interface ICreate extends IAccessor {
/**
* 카드 번호.
*
Expand Down Expand Up @@ -82,7 +82,7 @@ export namespace IIamportSubscription {
* 결제 신청 입력 정보.
*/
export interface IOnetime
extends Omit<IStore, "customer_uid">,
extends Omit<ICreate, "customer_uid">,
Omit<IAgain, "customer_uid"> {
/**
* 고객 식별자 키.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export namespace IIamportVBankPayment {
* - 나이스페이먼츠
* - KG이니시스
*/
export interface IStore {
export interface ICreate {
/**
* 주문 식별자 키.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class FakeIamportCertificationsController {
@core.TypedRoute.Post("otp/request")
public request(
@FakeIamportUserAuth() _user: IIamportUser.IAccessor,
@core.TypedBody() input: IIamportCertification.IStore,
@core.TypedBody() input: IIamportCertification.ICreate,
): IIamportResponse<IIamportCertification.IAccessor> {
const birth: Date = new Date(
`${input.birth.substr(0, 4)}-${input.birth.substr(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class FakeIamportPaymentsController {
@core.TypedRoute.Post("cancel")
public cancel(
@FakeIamportUserAuth() _user: IIamportUser.IAccessor,
@core.TypedBody() input: IIamportPaymentCancel.IStore,
@core.TypedBody() input: IIamportPaymentCancel.ICreate,
): IIamportResponse<IIamportPayment> {
const payment: IIamportPayment = FakeIamportStorage.payments.get(
input.imp_uid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export class FakeIamportReceiptsController {
* @author Samchon
*/
@core.TypedRoute.Post()
public store(
public create(
@FakeIamportUserAuth() _user: IIamportUser.IAccessor,
@core.TypedParam("imp_uid") imp_uid: string,
@core.TypedBody() input: IIamportReceipt.IStore,
@core.TypedBody() input: IIamportReceipt.ICreate,
): IIamportResponse<IIamportReceipt> {
const payment: IIamportPayment = FakeIamportStorage.payments.get(imp_uid);
if (!payment.paid_at)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export class FakeIamportVbanksController {
* @author Samchon
*/
@core.TypedRoute.Post()
public store(
public create(
@FakeIamportUserAuth() _user: IIamportUser.IAccessor,
@core.TypedBody() input: IIamportVBankPayment.IStore,
@core.TypedBody() input: IIamportVBankPayment.ICreate,
): IIamportResponse<IIamportVBankPayment> {
// CONSTRUCTION
const pg_id: string = v4();
Expand Down Expand Up @@ -83,7 +83,7 @@ export class FakeIamportVbanksController {
// HIDDEN
notice_url: input.notice_url,
};
FakeIamportPaymentProvider.store(payment);
FakeIamportPaymentProvider.create(payment);

// RETURNS
return FakeIamportResponseProvider.success(payment);
Expand Down
Loading

0 comments on commit 576112b

Please sign in to comment.