@sayren/storefront-sdk 0.10.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.mjs +2 -2
- package/dist/checkout-BeZKjYJz.mjs +310 -0
- package/dist/{client-DEMo7UZc.mjs → client-Do4cw2Ez.mjs} +42 -8
- package/dist/{index-UeHUNywG.d.mts → index-OqvbJ6Xi.d.mts} +273 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/payments/index.d.mts +5 -1
- package/dist/payments/index.mjs +11 -9
- package/package.json +1 -1
- package/src/auth/index.ts +1 -1
- package/src/client.ts +16 -0
- package/src/payments/index.ts +18 -8
- package/src/schemas/checkout.ts +200 -9
- package/src/schemas/claim.ts +23 -0
- package/src/schemas/order.ts +41 -8
- package/src/schemas/review.ts +1 -1
- package/dist/checkout-JFk3b8RG.mjs +0 -189
|
@@ -255,6 +255,37 @@ declare const createCheckoutRequestSchema: z.ZodObject<{
|
|
|
255
255
|
}, z.core.$strip>>;
|
|
256
256
|
}, z.core.$strip>;
|
|
257
257
|
type CreateCheckoutRequest = z.infer<typeof createCheckoutRequestSchema>;
|
|
258
|
+
/** 지역 추가 배송비 구분 — 우편번호로 판정한다 */
|
|
259
|
+
declare const remoteAreaSchema: z.ZodEnum<{
|
|
260
|
+
NONE: "NONE";
|
|
261
|
+
JEJU: "JEJU";
|
|
262
|
+
ISOLATED: "ISOLATED";
|
|
263
|
+
}>;
|
|
264
|
+
type RemoteArea = z.infer<typeof remoteAreaSchema>;
|
|
265
|
+
/**
|
|
266
|
+
* 배송비 내역 (이슈 #29) — 배송비를 **몇 번, 왜** 부과했는지다.
|
|
267
|
+
*
|
|
268
|
+
* 배송비는 **배송 묶음**마다 붙는다. 같은 출고지 + 같은 배송 정책인 상품은 한 묶음이고 한 번만 낸다.
|
|
269
|
+
* 제주·도서산간 추가 배송비는 묶음마다 더하고, 무료배송이어도 붙는다.
|
|
270
|
+
*
|
|
271
|
+
* 주문서를 만들 때는 배송지를 모르므로 `zipCode`가 null이고 `remoteSurcharge`가 0이다.
|
|
272
|
+
* 배송지를 입력하면 `POST /storefront/v1/checkout/{checkoutId}/delivery-quote`로 다시 받고,
|
|
273
|
+
* **결제 시작이 보낸 배송지로 최종 확정한다** — 그래서 주문서 조회 금액과 실제 결제 금액이 다를 수 있다.
|
|
274
|
+
*/
|
|
275
|
+
declare const checkoutDeliverySchema: z.ZodObject<{
|
|
276
|
+
baseFee: z.ZodNumber;
|
|
277
|
+
remoteSurcharge: z.ZodNumber;
|
|
278
|
+
remoteArea: z.ZodEnum<{
|
|
279
|
+
NONE: "NONE";
|
|
280
|
+
JEJU: "JEJU";
|
|
281
|
+
ISOLATED: "ISOLATED";
|
|
282
|
+
}>;
|
|
283
|
+
remoteAreaLabel: z.ZodNullable<z.ZodString>;
|
|
284
|
+
bundleCount: z.ZodNumber;
|
|
285
|
+
freeByThreshold: z.ZodBoolean;
|
|
286
|
+
zipCode: z.ZodNullable<z.ZodString>;
|
|
287
|
+
}, z.core.$strip>;
|
|
288
|
+
type CheckoutDelivery = z.infer<typeof checkoutDeliverySchema>;
|
|
258
289
|
declare const checkoutSessionSchema: z.ZodObject<{
|
|
259
290
|
checkoutId: z.ZodString;
|
|
260
291
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -271,6 +302,19 @@ declare const checkoutSessionSchema: z.ZodObject<{
|
|
|
271
302
|
deliveryFee: z.ZodNumber;
|
|
272
303
|
totalAmount: z.ZodNumber;
|
|
273
304
|
}, z.core.$strip>;
|
|
305
|
+
delivery: z.ZodObject<{
|
|
306
|
+
baseFee: z.ZodNumber;
|
|
307
|
+
remoteSurcharge: z.ZodNumber;
|
|
308
|
+
remoteArea: z.ZodEnum<{
|
|
309
|
+
NONE: "NONE";
|
|
310
|
+
JEJU: "JEJU";
|
|
311
|
+
ISOLATED: "ISOLATED";
|
|
312
|
+
}>;
|
|
313
|
+
remoteAreaLabel: z.ZodNullable<z.ZodString>;
|
|
314
|
+
bundleCount: z.ZodNumber;
|
|
315
|
+
freeByThreshold: z.ZodBoolean;
|
|
316
|
+
zipCode: z.ZodNullable<z.ZodString>;
|
|
317
|
+
}, z.core.$strip>;
|
|
274
318
|
expiresAt: z.ZodString;
|
|
275
319
|
paymentOptions: z.ZodLazy<z.ZodPreprocess<z.ZodArray<z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
276
320
|
pg: z.ZodEnum<{
|
|
@@ -315,6 +359,37 @@ declare const checkoutSessionSchema: z.ZodObject<{
|
|
|
315
359
|
testPayment: z.ZodBoolean;
|
|
316
360
|
}, z.core.$strip>;
|
|
317
361
|
type CheckoutSession = z.infer<typeof checkoutSessionSchema>;
|
|
362
|
+
/**
|
|
363
|
+
* 배송비 미리보기 요청 — 배송지 우편번호로 배송비를 다시 계산한다. 주문서를 바꾸지 않는다(읽기 계산이다).
|
|
364
|
+
*
|
|
365
|
+
* 구매자가 배송지를 입력하거나 고칠 때 부르면 제주·도서산간 추가 배송비가 반영된 금액을 미리 보여 줄 수 있다.
|
|
366
|
+
*/
|
|
367
|
+
declare const deliveryQuoteRequestSchema: z.ZodObject<{
|
|
368
|
+
zipCode: z.ZodString;
|
|
369
|
+
}, z.core.$strip>;
|
|
370
|
+
type DeliveryQuoteRequest = z.infer<typeof deliveryQuoteRequestSchema>;
|
|
371
|
+
/** 배송비 미리보기 응답 — 이 배송지로 결제하면 나갈 금액이다 */
|
|
372
|
+
declare const deliveryQuoteSchema: z.ZodObject<{
|
|
373
|
+
amounts: z.ZodObject<{
|
|
374
|
+
productAmount: z.ZodNumber;
|
|
375
|
+
deliveryFee: z.ZodNumber;
|
|
376
|
+
totalAmount: z.ZodNumber;
|
|
377
|
+
}, z.core.$strip>;
|
|
378
|
+
delivery: z.ZodObject<{
|
|
379
|
+
baseFee: z.ZodNumber;
|
|
380
|
+
remoteSurcharge: z.ZodNumber;
|
|
381
|
+
remoteArea: z.ZodEnum<{
|
|
382
|
+
NONE: "NONE";
|
|
383
|
+
JEJU: "JEJU";
|
|
384
|
+
ISOLATED: "ISOLATED";
|
|
385
|
+
}>;
|
|
386
|
+
remoteAreaLabel: z.ZodNullable<z.ZodString>;
|
|
387
|
+
bundleCount: z.ZodNumber;
|
|
388
|
+
freeByThreshold: z.ZodBoolean;
|
|
389
|
+
zipCode: z.ZodNullable<z.ZodString>;
|
|
390
|
+
}, z.core.$strip>;
|
|
391
|
+
}, z.core.$strip>;
|
|
392
|
+
type DeliveryQuoteResult = z.infer<typeof deliveryQuoteSchema>;
|
|
318
393
|
declare const paymentMethodSchema: z.ZodEnum<{
|
|
319
394
|
CARD: "CARD";
|
|
320
395
|
EASY_PAY: "EASY_PAY";
|
|
@@ -493,6 +568,61 @@ declare const guestInfoSchema: z.ZodObject<{
|
|
|
493
568
|
orderPassword: z.ZodString;
|
|
494
569
|
}, z.core.$strip>;
|
|
495
570
|
type GuestInfo = z.infer<typeof guestInfoSchema>;
|
|
571
|
+
/** 현금영수증을 신청할 수 있는 결제수단 — 계좌이체·가상계좌 */
|
|
572
|
+
declare const CASH_RECEIPT_METHODS: readonly ["BANK_TRANSFER", "VIRTUAL_ACCOUNT"];
|
|
573
|
+
/** 이 결제수단으로 현금영수증을 신청할 수 있는가 */
|
|
574
|
+
declare function cashReceiptAvailable(method: string): boolean;
|
|
575
|
+
/** 현금영수증 용도 — `INCOME_DEDUCTION` 소득공제(개인) · `EXPENSE_PROOF` 지출증빙(사업자) */
|
|
576
|
+
declare const cashReceiptTypeSchema: z.ZodEnum<{
|
|
577
|
+
INCOME_DEDUCTION: "INCOME_DEDUCTION";
|
|
578
|
+
EXPENSE_PROOF: "EXPENSE_PROOF";
|
|
579
|
+
}>;
|
|
580
|
+
type CashReceiptType = z.infer<typeof cashReceiptTypeSchema>;
|
|
581
|
+
/** 현금영수증 식별 번호 종류 — 휴대폰 번호 · 현금영수증카드 번호 · 사업자등록번호 */
|
|
582
|
+
type CashReceiptIdentityType = "PHONE" | "CARD" | "BUSINESS";
|
|
583
|
+
/**
|
|
584
|
+
* 주민등록번호·외국인등록번호 형식인가 — 현금영수증 식별 번호로는 받지 않는다.
|
|
585
|
+
*
|
|
586
|
+
* 현금영수증카드 번호의 아래 끝(13자리)이 주민등록번호 길이와 겹친다. 개인 식별 번호는 최소로 받는다는 원칙이라
|
|
587
|
+
* 주민등록번호로 읽히는 값은 카드 번호 자리로도 받지 않는다.
|
|
588
|
+
*
|
|
589
|
+
* **13자리 숫자 전부를 막지 않는다.** 13자리 현금영수증카드를 쓰는 구매자가 신청할 수 없게 되기 때문이다.
|
|
590
|
+
* 대신 주민등록번호 형식 — 생년월일 6자리(월 01~12, 일 01~31) + 성별·세기 코드(1~8, 5~8은 외국인등록번호) — 으로
|
|
591
|
+
* 판정해 오탐을 줄인다(13자리 숫자 중 이 형식에 걸리는 비율은 약 3%다).
|
|
592
|
+
*
|
|
593
|
+
* 검증번호(뒤 1자리 mod 11)까지는 보지 않는다. 한 자리 오타가 난 주민등록번호도 생년월일을 담고 있어 막아야 하고,
|
|
594
|
+
* 2020년 10월 이후 발급된 외국인등록번호에는 검증번호 규칙이 없다.
|
|
595
|
+
*
|
|
596
|
+
* `cashReceiptIdentityTypeOf`와 같이 하이픈·공백은 빼고 판정한다.
|
|
597
|
+
*/
|
|
598
|
+
declare function residentNumberLike(identityNumber: string): boolean;
|
|
599
|
+
/**
|
|
600
|
+
* 식별 번호 → 종류. 하이픈·공백은 빼고 판정한다. 용도에 맞지 않는 번호면 null이다.
|
|
601
|
+
* - 소득공제: 휴대폰 번호(01로 시작하는 10~11자리) 또는 현금영수증카드 번호(13~19자리)
|
|
602
|
+
* - 지출증빙: 사업자등록번호(10자리) 또는 현금영수증카드 번호(13~19자리)
|
|
603
|
+
*
|
|
604
|
+
* 자릿수 근거. PG 문서는 식별 번호의 최대 길이만 정하고 종류별 자릿수는 정하지 않는다
|
|
605
|
+
* (토스페이먼츠 `customerIdentityNumber` "최대 길이는 30자", 소득공제는 휴대폰 번호·현금영수증카드 번호,
|
|
606
|
+
* 지출증빙은 사업자등록번호: https://docs.tosspayments.com/common/apis/cash-receipt /
|
|
607
|
+
* 포트원 V2는 종류만 PHONE·CARD·BUSINESS로 나눈다: https://developers.portone.io/api/rest-v2/payment.cashReceipt).
|
|
608
|
+
* 그래서 자릿수는 국세청이 정하는 발급수단 규격을 따른다 — 홈택스 소비자 발급수단 등록의 카드 번호는
|
|
609
|
+
* 13~19자리 숫자이고(https://thisthatbase.com/cash-receipts-card-registration/ 가 옮긴 홈택스 안내,
|
|
610
|
+
* 원본은 https://www.hometax.go.kr/ 소비자 발급수단 관리), 사업자등록번호는 10자리, 휴대폰 번호는 01X + 7~8자리다.
|
|
611
|
+
* 국세청 자진발급 번호(010-000-1234)도 휴대폰 형식으로 통과한다.
|
|
612
|
+
*/
|
|
613
|
+
declare function cashReceiptIdentityTypeOf(type: CashReceiptType, identityNumber: string): CashReceiptIdentityType | null;
|
|
614
|
+
/**
|
|
615
|
+
* 현금영수증 신청 — 계좌이체·가상계좌 결제에서만 보낼 수 있다. 결제가 승인되면 sayren이 결제한 PG로 발급하고,
|
|
616
|
+
* 환불하면 그만큼 취소한다. 식별 번호는 암호화해 저장하고 응답에는 가린 값만 나간다.
|
|
617
|
+
*/
|
|
618
|
+
declare const cashReceiptRequestSchema: z.ZodObject<{
|
|
619
|
+
type: z.ZodEnum<{
|
|
620
|
+
INCOME_DEDUCTION: "INCOME_DEDUCTION";
|
|
621
|
+
EXPENSE_PROOF: "EXPENSE_PROOF";
|
|
622
|
+
}>;
|
|
623
|
+
identityNumber: z.ZodString;
|
|
624
|
+
}, z.core.$strip>;
|
|
625
|
+
type CashReceiptRequest = z.infer<typeof cashReceiptRequestSchema>;
|
|
496
626
|
/**
|
|
497
627
|
* 결제 시작 — 배송지를 확정하고 고른 결제 옵션으로 결제 시도를 연다. 응답의 `payUrl`(결제 서비스)을 팝업(`mode=popup`)이나
|
|
498
628
|
* 전체 페이지로 열면 결제 서비스가 PG 결제창을 띄우고 승인까지 한다. 리다이렉트 결제가 끝나면 구매자는 `returnUrl`로 돌아온다.
|
|
@@ -553,9 +683,20 @@ declare const startPaymentRequestSchema: z.ZodObject<{
|
|
|
553
683
|
email: z.ZodEmail;
|
|
554
684
|
orderPassword: z.ZodString;
|
|
555
685
|
}, z.core.$strip>>;
|
|
686
|
+
cashReceipt: z.ZodOptional<z.ZodObject<{
|
|
687
|
+
type: z.ZodEnum<{
|
|
688
|
+
INCOME_DEDUCTION: "INCOME_DEDUCTION";
|
|
689
|
+
EXPENSE_PROOF: "EXPENSE_PROOF";
|
|
690
|
+
}>;
|
|
691
|
+
identityNumber: z.ZodString;
|
|
692
|
+
}, z.core.$strip>>;
|
|
556
693
|
}, z.core.$strip>;
|
|
557
694
|
type StartPaymentRequest = z.infer<typeof startPaymentRequestSchema>;
|
|
558
|
-
/**
|
|
695
|
+
/**
|
|
696
|
+
* 같은 결제에서 다른 결제 옵션으로 다시 시도. `returnUrl`을 생략하면 결제 시작 때의 복귀 주소를 쓴다.
|
|
697
|
+
* `cashReceipt`를 보내면 현금영수증 신청을 이 값으로 바꾸고, 생략하면 결제 시작 때의 신청을 그대로 둔다
|
|
698
|
+
* (승인된 결제수단이 계좌이체·가상계좌가 아니면 발급하지 않는다)
|
|
699
|
+
*/
|
|
559
700
|
declare const retryPaymentRequestSchema: z.ZodObject<{
|
|
560
701
|
option: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
561
702
|
pg: z.ZodEnum<{
|
|
@@ -595,6 +736,13 @@ declare const retryPaymentRequestSchema: z.ZodObject<{
|
|
|
595
736
|
method: z.ZodLiteral<"MOBILE">;
|
|
596
737
|
}, z.core.$strip>], "method">;
|
|
597
738
|
returnUrl: z.ZodOptional<z.ZodURL>;
|
|
739
|
+
cashReceipt: z.ZodOptional<z.ZodObject<{
|
|
740
|
+
type: z.ZodEnum<{
|
|
741
|
+
INCOME_DEDUCTION: "INCOME_DEDUCTION";
|
|
742
|
+
EXPENSE_PROOF: "EXPENSE_PROOF";
|
|
743
|
+
}>;
|
|
744
|
+
identityNumber: z.ZodString;
|
|
745
|
+
}, z.core.$strip>>;
|
|
598
746
|
}, z.core.$strip>;
|
|
599
747
|
type RetryPaymentRequest = z.infer<typeof retryPaymentRequestSchema>;
|
|
600
748
|
declare const paymentStartSchema: z.ZodObject<{
|
|
@@ -640,6 +788,24 @@ declare const paymentStartSchema: z.ZodObject<{
|
|
|
640
788
|
payUrl: z.ZodString;
|
|
641
789
|
expiresAt: z.ZodString;
|
|
642
790
|
testPayment: z.ZodBoolean;
|
|
791
|
+
amounts: z.ZodObject<{
|
|
792
|
+
productAmount: z.ZodNumber;
|
|
793
|
+
deliveryFee: z.ZodNumber;
|
|
794
|
+
totalAmount: z.ZodNumber;
|
|
795
|
+
}, z.core.$strip>;
|
|
796
|
+
delivery: z.ZodObject<{
|
|
797
|
+
baseFee: z.ZodNumber;
|
|
798
|
+
remoteSurcharge: z.ZodNumber;
|
|
799
|
+
remoteArea: z.ZodEnum<{
|
|
800
|
+
NONE: "NONE";
|
|
801
|
+
JEJU: "JEJU";
|
|
802
|
+
ISOLATED: "ISOLATED";
|
|
803
|
+
}>;
|
|
804
|
+
remoteAreaLabel: z.ZodNullable<z.ZodString>;
|
|
805
|
+
bundleCount: z.ZodNumber;
|
|
806
|
+
freeByThreshold: z.ZodBoolean;
|
|
807
|
+
zipCode: z.ZodNullable<z.ZodString>;
|
|
808
|
+
}, z.core.$strip>;
|
|
643
809
|
}, z.core.$strip>;
|
|
644
810
|
type PaymentStart = z.infer<typeof paymentStartSchema>;
|
|
645
811
|
/** 결제창에서 결제하지 못한 이유 */
|
|
@@ -730,6 +896,22 @@ declare const createClaimResultSchema: z.ZodObject<{
|
|
|
730
896
|
deliveryFeeRefundAmount: z.ZodNumber;
|
|
731
897
|
}, z.core.$strip>;
|
|
732
898
|
type CreateClaimResult = z.infer<typeof createClaimResultSchema>;
|
|
899
|
+
/**
|
|
900
|
+
* 반품지 (이슈 #30) — 반품·교환 수거가 안내하는 주소다. 스토어 주소록의 기본 반품지이거나,
|
|
901
|
+
* 상품이 반품지를 따로 지정했으면 그 주소다.
|
|
902
|
+
*
|
|
903
|
+
* 취소 클레임은 보낼 물건이 없어 null이고, 반품지를 등록하지 않은 스토어도 null이다.
|
|
904
|
+
* 구매자가 직접 보내는 수거(`BUYER_SEND`)에 이 주소가 필요하다.
|
|
905
|
+
*/
|
|
906
|
+
declare const claimReturnAddressSchema: z.ZodObject<{
|
|
907
|
+
name: z.ZodString;
|
|
908
|
+
contactName: z.ZodString;
|
|
909
|
+
phone: z.ZodString;
|
|
910
|
+
zipCode: z.ZodString;
|
|
911
|
+
address1: z.ZodString;
|
|
912
|
+
address2: z.ZodNullable<z.ZodString>;
|
|
913
|
+
}, z.core.$strip>;
|
|
914
|
+
type ClaimReturnAddress = z.infer<typeof claimReturnAddressSchema>;
|
|
733
915
|
declare const myClaimSchema: z.ZodObject<{
|
|
734
916
|
claimId: z.ZodString;
|
|
735
917
|
type: z.ZodEnum<{
|
|
@@ -755,6 +937,14 @@ declare const myClaimSchema: z.ZodObject<{
|
|
|
755
937
|
expectedRefundAmount: z.ZodNullable<z.ZodNumber>;
|
|
756
938
|
expectedDeliveryFeeRefundAmount: z.ZodNullable<z.ZodNumber>;
|
|
757
939
|
rejectReason: z.ZodNullable<z.ZodString>;
|
|
940
|
+
returnAddress: z.ZodNullable<z.ZodObject<{
|
|
941
|
+
name: z.ZodString;
|
|
942
|
+
contactName: z.ZodString;
|
|
943
|
+
phone: z.ZodString;
|
|
944
|
+
zipCode: z.ZodString;
|
|
945
|
+
address1: z.ZodString;
|
|
946
|
+
address2: z.ZodNullable<z.ZodString>;
|
|
947
|
+
}, z.core.$strip>>;
|
|
758
948
|
requestedAt: z.ZodString;
|
|
759
949
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
760
950
|
}, z.core.$strip>;
|
|
@@ -1448,6 +1638,15 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
1448
1638
|
deliveryFee: number;
|
|
1449
1639
|
totalAmount: number;
|
|
1450
1640
|
};
|
|
1641
|
+
delivery: {
|
|
1642
|
+
baseFee: number;
|
|
1643
|
+
remoteSurcharge: number;
|
|
1644
|
+
remoteArea: "NONE" | "JEJU" | "ISOLATED";
|
|
1645
|
+
remoteAreaLabel: string | null;
|
|
1646
|
+
bundleCount: number;
|
|
1647
|
+
freeByThreshold: boolean;
|
|
1648
|
+
zipCode: string | null;
|
|
1649
|
+
};
|
|
1451
1650
|
expiresAt: string;
|
|
1452
1651
|
paymentOptions: (({
|
|
1453
1652
|
pg: "tosspayments" | "portone";
|
|
@@ -1471,6 +1670,31 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
1471
1670
|
})[];
|
|
1472
1671
|
testPayment: boolean;
|
|
1473
1672
|
}>;
|
|
1673
|
+
/**
|
|
1674
|
+
* `POST /checkout/{checkoutId}/delivery-quote` — 배송비 미리보기. 배송지 우편번호로 배송비를 다시 계산한다.
|
|
1675
|
+
*
|
|
1676
|
+
* 주문서를 만들 때는 배송지를 모르므로 제주·도서산간 추가 배송비가 빠져 있다. 구매자가 배송지를 입력하거나
|
|
1677
|
+
* 고칠 때 이 메서드로 금액을 갱신하면 결제 직전에 금액이 바뀌는 일을 피할 수 있다. 주문서를 바꾸지 않는
|
|
1678
|
+
* 읽기 계산이고, **최종 금액은 결제 시작 응답의 `amounts`다.**
|
|
1679
|
+
*
|
|
1680
|
+
* 에러(`ApiError.code`): 404 `CHECKOUT_NOT_FOUND`, 409 `CHECKOUT_EXPIRED`, 409 `ALREADY_PAID`
|
|
1681
|
+
*/
|
|
1682
|
+
quoteDelivery: (checkoutId: string, body: DeliveryQuoteRequest) => Promise<{
|
|
1683
|
+
amounts: {
|
|
1684
|
+
productAmount: number;
|
|
1685
|
+
deliveryFee: number;
|
|
1686
|
+
totalAmount: number;
|
|
1687
|
+
};
|
|
1688
|
+
delivery: {
|
|
1689
|
+
baseFee: number;
|
|
1690
|
+
remoteSurcharge: number;
|
|
1691
|
+
remoteArea: "NONE" | "JEJU" | "ISOLATED";
|
|
1692
|
+
remoteAreaLabel: string | null;
|
|
1693
|
+
bundleCount: number;
|
|
1694
|
+
freeByThreshold: boolean;
|
|
1695
|
+
zipCode: string | null;
|
|
1696
|
+
};
|
|
1697
|
+
}>;
|
|
1474
1698
|
/**
|
|
1475
1699
|
* `POST /checkout/{checkoutId}/payment` — 결제 시작. 배송지와 결제 옵션(`paymentOptions` 항목 또는 직접 쓴 옵션)으로
|
|
1476
1700
|
* 결제 세션·첫 시도를 만들고 결제 서비스 주소(`payUrl`)를 돌려준다. 그 주소를 열어 결제를 진행하는 것은
|
|
@@ -1506,6 +1730,20 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
1506
1730
|
payUrl: string;
|
|
1507
1731
|
expiresAt: string;
|
|
1508
1732
|
testPayment: boolean;
|
|
1733
|
+
amounts: {
|
|
1734
|
+
productAmount: number;
|
|
1735
|
+
deliveryFee: number;
|
|
1736
|
+
totalAmount: number;
|
|
1737
|
+
};
|
|
1738
|
+
delivery: {
|
|
1739
|
+
baseFee: number;
|
|
1740
|
+
remoteSurcharge: number;
|
|
1741
|
+
remoteArea: "NONE" | "JEJU" | "ISOLATED";
|
|
1742
|
+
remoteAreaLabel: string | null;
|
|
1743
|
+
bundleCount: number;
|
|
1744
|
+
freeByThreshold: boolean;
|
|
1745
|
+
zipCode: string | null;
|
|
1746
|
+
};
|
|
1509
1747
|
}>;
|
|
1510
1748
|
};
|
|
1511
1749
|
payments: {
|
|
@@ -1557,6 +1795,20 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
1557
1795
|
payUrl: string;
|
|
1558
1796
|
expiresAt: string;
|
|
1559
1797
|
testPayment: boolean;
|
|
1798
|
+
amounts: {
|
|
1799
|
+
productAmount: number;
|
|
1800
|
+
deliveryFee: number;
|
|
1801
|
+
totalAmount: number;
|
|
1802
|
+
};
|
|
1803
|
+
delivery: {
|
|
1804
|
+
baseFee: number;
|
|
1805
|
+
remoteSurcharge: number;
|
|
1806
|
+
remoteArea: "NONE" | "JEJU" | "ISOLATED";
|
|
1807
|
+
remoteAreaLabel: string | null;
|
|
1808
|
+
bundleCount: number;
|
|
1809
|
+
freeByThreshold: boolean;
|
|
1810
|
+
zipCode: string | null;
|
|
1811
|
+
};
|
|
1560
1812
|
}>;
|
|
1561
1813
|
};
|
|
1562
1814
|
myOrders: {
|
|
@@ -1689,7 +1941,10 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
1689
1941
|
status: string;
|
|
1690
1942
|
location: string;
|
|
1691
1943
|
occurredAt: string;
|
|
1944
|
+
stage: string | null;
|
|
1692
1945
|
}[];
|
|
1946
|
+
trackingStage: string | null;
|
|
1947
|
+
trackingCheckedAt: string | null;
|
|
1693
1948
|
}>;
|
|
1694
1949
|
decidePurchase: (orderItemId: string) => Promise<void>;
|
|
1695
1950
|
};
|
|
@@ -1720,6 +1975,14 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
1720
1975
|
expectedRefundAmount: number | null;
|
|
1721
1976
|
expectedDeliveryFeeRefundAmount: number | null;
|
|
1722
1977
|
rejectReason: string | null;
|
|
1978
|
+
returnAddress: {
|
|
1979
|
+
name: string;
|
|
1980
|
+
contactName: string;
|
|
1981
|
+
phone: string;
|
|
1982
|
+
zipCode: string;
|
|
1983
|
+
address1: string;
|
|
1984
|
+
address2: string | null;
|
|
1985
|
+
} | null;
|
|
1723
1986
|
requestedAt: string;
|
|
1724
1987
|
completedAt: string | null;
|
|
1725
1988
|
}[];
|
|
@@ -2136,6 +2399,11 @@ declare const myOrderSchema: z.ZodObject<{
|
|
|
2136
2399
|
testPayment: z.ZodBoolean;
|
|
2137
2400
|
}, z.core.$strip>;
|
|
2138
2401
|
type MyOrder = z.infer<typeof myOrderSchema>;
|
|
2402
|
+
/**
|
|
2403
|
+
* 택배 추적 단계. 응답에서는 문자열로 받는다(값이 추가될 수 있다) — 현재 값은 `ACCEPTED`(접수)·`IN_TRANSIT`(이동 중)·
|
|
2404
|
+
* `OUT_FOR_DELIVERY`(배송 출발)·`DELIVERED`(배송완료)다.
|
|
2405
|
+
*/
|
|
2406
|
+
declare const trackingStageResponseSchema: z.ZodString;
|
|
2139
2407
|
declare const deliveryTrackingSchema: z.ZodObject<{
|
|
2140
2408
|
carrierName: z.ZodString;
|
|
2141
2409
|
trackingNumber: z.ZodString;
|
|
@@ -2149,7 +2417,10 @@ declare const deliveryTrackingSchema: z.ZodObject<{
|
|
|
2149
2417
|
status: z.ZodString;
|
|
2150
2418
|
location: z.ZodString;
|
|
2151
2419
|
occurredAt: z.ZodString;
|
|
2420
|
+
stage: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2152
2421
|
}, z.core.$strip>>;
|
|
2422
|
+
trackingStage: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2423
|
+
trackingCheckedAt: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2153
2424
|
}, z.core.$strip>;
|
|
2154
2425
|
type DeliveryTracking = z.infer<typeof deliveryTrackingSchema>;
|
|
2155
2426
|
/** `POST /me/order-items/{orderItemId}/purchase-decision` 응답 */
|
|
@@ -2180,4 +2451,4 @@ declare const storefrontStoreSchema: z.ZodObject<{
|
|
|
2180
2451
|
}, z.core.$strip>;
|
|
2181
2452
|
type StorefrontStore = z.infer<typeof storefrontStoreSchema>;
|
|
2182
2453
|
//#endregion
|
|
2183
|
-
export {
|
|
2454
|
+
export { Member as $, productCardSchema as $n, DeliveryQuoteRequest as $t, StorefrontClientOptions as A, guestInfoSchema as An, consentStateSchema as At, ReviewPage as B, remoteAreaSchema as Bn, claimReturnAddressSchema as Bt, AnalyticsServerEventName as C, checkoutDeliverySchema as Cn, ConsentSource as Ct, analyticsIdSchema as D, deliveryQuoteSchema as Dn, consentActionSchema as Dt, analyticsClientEventSchema as E, deliveryQuoteRequestSchema as En, MemberConsents as Et, StorefrontSessionOptions as F, paymentOptionListSchema as Fn, ClaimType as Ft, createReviewRequestSchema as G, CategoryNode as Gn, AvailablePaymentOption as Gt, UpdateReviewRequest as H, retryPaymentRequestSchema as Hn, createClaimRequestSchema as Ht, createStorefrontSession as I, paymentOptionSchema as In, CreateClaimRequest as It, reviewPageSchema as J, ProductFacets as Jn, CashReceiptRequest as Jt, createReviewResultSchema as K, ProductCard as Kn, CASH_RECEIPT_METHODS as Kt, CreateReviewRequest as L, paymentStartSchema as Ln, CreateClaimResult as Lt, STOREFRONT_SESSION_KEYS as M, paymentMessageSchema as Mn, memberConsentsSchema as Mt, SessionStorage as N, paymentMethodSchema as Nn, ClaimReason as Nt, analyticsServerEventNameSchema as O, easyPayProviderResponseSchema as On, consentKindSchema as Ot, StorefrontSession as P, paymentOptionKey as Pn, ClaimReturnAddress as Pt, writableReviewSchema as Q, categoryNodeSchema as Qn, CreateCheckoutRequest as Qt, CreateReviewResult as R, paymentStatusSchema as Rn, MyClaim as Rt, AnalyticsEventName as S, cashReceiptTypeSchema as Sn, ConsentKind as St, analyticsClientEventNameSchema as T, createCheckoutRequestSchema as Tn, ConsentUpdateRequest as Tt, UpdateReviewResult as U, shippingAddressInputSchema as Un, createClaimResultSchema as Ut, ReviewSummary as V, residentNumberLike as Vn, claimTypeSchema as Vt, WritableReview as W, startPaymentRequestSchema as Wn, myClaimSchema as Wt, updateReviewRequestSchema as X, ProductSearchParams as Xn, CheckoutDelivery as Xt, reviewSummarySchema as Y, ProductPage as Yn, CashReceiptType as Yt, updateReviewResultSchema as Z, ProductSort as Zn, CheckoutSession as Zt, ANALYTICS_VISITOR_COOKIE as _, StartPaymentRequest as _n, cartItemSchema as _r, CustomerInquiryCategory as _t, MyOrderItem as a, PAYMENT_RESULT_VALUES as an, OrderItemStatus as ar, memberAddressSchema as at, AnalyticsClientEvent as b, cashReceiptIdentityTypeOf as bn, analyticsIdsFromCookie as br, customerInquirySchema as bt, deliveryTrackingSchema as c, PaymentMessage as cn, claimStatusSchema as cr, wishlistAddResultSchema as ct, orderShippingAddressSchema as d, PaymentStart as dn, pageSchema as dr, PublicInquiry as dt, DeliveryQuoteResult as en, productDetailSchema as er, MemberAddress as et, purchaseDecisionResultSchema as f, PaymentStatus as fn, AddCartItemRequest as fr, createInquiryRequestSchema as ft, ANALYTICS_SESSION_HEADER as g, ShippingAddressInput as gn, addCartItemRequestSchema as gr, CustomerInquiry as gt, ANALYTICS_SESSION_COOKIE as h, RetryPaymentRequest as hn, UpdateCartItemRequest as hr, CreateCustomerInquiryRequest as ht, MyOrder as i, KnownPaymentStatus as in, ClaimStatus as ir, memberAddressRequestSchema as it, createStorefrontClient as j, paymentFailureCategorySchema as jn, consentUpdateRequestSchema as jt, StorefrontClient as k, easyPayProviderSchema as kn, consentSourceSchema as kt, myOrderItemSchema as l, PaymentMethod as ln, orderItemStatusSchema as lr, CreateInquiryRequest as lt, ANALYTICS_MAX_BATCH_BYTES as m, RemoteArea as mn, CartItem as mr, publicInquirySchema as mt, storefrontStoreSchema as n, GuestInfo as nn, productPageSchema as nr, UpdateProfileRequest as nt, OrderShippingAddress as o, PAYMENT_STATUS_VALUES as on, PageInfo as or, memberSchema as ot, trackingStageResponseSchema as p, PgProvider as pn, Cart as pr, createInquiryResultSchema as pt, publicReviewSchema as q, ProductDetail as qn, CashReceiptIdentityType as qt, DeliveryTracking as r, KnownPaymentResult as rn, productSortSchema as rr, WishlistAddResult as rt, PurchaseDecisionResult as s, PaymentFailureCategory as sn, PageParams as sr, updateProfileRequestSchema as st, StorefrontStore as t, EasyPayProvider as tn, productFacetsSchema as tr, MemberAddressRequest as tt, myOrderSchema as u, PaymentOption as un, pageInfoSchema as ur, CreateInquiryResult as ut, ANALYTICS_VISITOR_HEADER as v, availablePaymentOptionSchema as vn, cartSchema as vr, createCustomerInquiryRequestSchema as vt, analyticsBatchSchema as w, checkoutSessionSchema as wn, ConsentState as wt, AnalyticsClientEventName as x, cashReceiptRequestSchema as xn, ConsentAction as xt, AnalyticsBatch as y, cashReceiptAvailable as yn, updateCartItemRequestSchema as yr, customerInquiryCategorySchema as yt, PublicReview as z, pgProviderSchema as zn, claimReasonSchema as zt };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { C as loginRequestSchema, D as tokenPairSchema, E as socialProviderSchema, O as withdrawRequestSchema, S as linkIdentityRequestSchema, T as signupRequestSchema, _ as anonymousSessionSchema, a as AnonymousSession, b as idpAuthorizeResponseSchema, c as IdpTokenRequest, d as MemberIdentities, f as SignupRequest, g as WithdrawalBlockedDetails, h as WithdrawRequest, i as buildQuery, k as withdrawalBlockedDetailsSchema, l as LinkIdentityRequest, m as TokenPair, n as Query, o as IdpAgreements, p as SocialProvider, r as TokenSource, s as IdpAuthorizeRequest, t as ApiError, u as LoginRequest, v as idpAgreementsSchema, w as memberIdentitiesSchema, x as idpTokenRequestSchema, y as idpAuthorizeRequestSchema } from "./http-CeRVoUGu.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, AddCartItemRequest, AnalyticsBatch, AnalyticsClientEvent, AnalyticsClientEventName, AnalyticsEventName, AnalyticsServerEventName, AnonymousSession, ApiError, AvailablePaymentOption, Cart, CartItem, CategoryNode, CheckoutSession, ClaimReason, ClaimStatus, ClaimType, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomerInquiry, CustomerInquiryCategory, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStatus, LinkIdentityRequest, LoginRequest, Member, MemberAddress, MemberAddressRequest, MemberConsents, MemberIdentities, MyClaim, MyOrder, MyOrderItem, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, ProductCard, ProductDetail, ProductFacets, ProductPage, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RetryPaymentRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, type StorefrontClient, type StorefrontClientOptions, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, categoryNodeSchema, checkoutSessionSchema, claimReasonSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
|
2
|
+
import { $ as Member, $n as productCardSchema, $t as DeliveryQuoteRequest, A as StorefrontClientOptions, An as guestInfoSchema, At as consentStateSchema, B as ReviewPage, Bn as remoteAreaSchema, Bt as claimReturnAddressSchema, C as AnalyticsServerEventName, Cn as checkoutDeliverySchema, Ct as ConsentSource, D as analyticsIdSchema, Dn as deliveryQuoteSchema, Dt as consentActionSchema, E as analyticsClientEventSchema, En as deliveryQuoteRequestSchema, Et as MemberConsents, F as StorefrontSessionOptions, Fn as paymentOptionListSchema, Ft as ClaimType, G as createReviewRequestSchema, Gn as CategoryNode, Gt as AvailablePaymentOption, H as UpdateReviewRequest, Hn as retryPaymentRequestSchema, Ht as createClaimRequestSchema, I as createStorefrontSession, In as paymentOptionSchema, It as CreateClaimRequest, J as reviewPageSchema, Jn as ProductFacets, Jt as CashReceiptRequest, K as createReviewResultSchema, Kn as ProductCard, Kt as CASH_RECEIPT_METHODS, L as CreateReviewRequest, Ln as paymentStartSchema, Lt as CreateClaimResult, M as STOREFRONT_SESSION_KEYS, Mn as paymentMessageSchema, Mt as memberConsentsSchema, N as SessionStorage, Nn as paymentMethodSchema, Nt as ClaimReason, O as analyticsServerEventNameSchema, On as easyPayProviderResponseSchema, Ot as consentKindSchema, P as StorefrontSession, Pn as paymentOptionKey, Pt as ClaimReturnAddress, Q as writableReviewSchema, Qn as categoryNodeSchema, Qt as CreateCheckoutRequest, R as CreateReviewResult, Rn as paymentStatusSchema, Rt as MyClaim, S as AnalyticsEventName, Sn as cashReceiptTypeSchema, St as ConsentKind, T as analyticsClientEventNameSchema, Tn as createCheckoutRequestSchema, Tt as ConsentUpdateRequest, U as UpdateReviewResult, Un as shippingAddressInputSchema, Ut as createClaimResultSchema, V as ReviewSummary, Vn as residentNumberLike, Vt as claimTypeSchema, W as WritableReview, Wn as startPaymentRequestSchema, Wt as myClaimSchema, X as updateReviewRequestSchema, Xn as ProductSearchParams, Xt as CheckoutDelivery, Y as reviewSummarySchema, Yn as ProductPage, Yt as CashReceiptType, Z as updateReviewResultSchema, Zn as ProductSort, Zt as CheckoutSession, _ as ANALYTICS_VISITOR_COOKIE, _n as StartPaymentRequest, _r as cartItemSchema, _t as CustomerInquiryCategory, a as MyOrderItem, an as PAYMENT_RESULT_VALUES, ar as OrderItemStatus, at as memberAddressSchema, b as AnalyticsClientEvent, bn as cashReceiptIdentityTypeOf, br as analyticsIdsFromCookie, bt as customerInquirySchema, c as deliveryTrackingSchema, cn as PaymentMessage, cr as claimStatusSchema, ct as wishlistAddResultSchema, d as orderShippingAddressSchema, dn as PaymentStart, dr as pageSchema, dt as PublicInquiry, en as DeliveryQuoteResult, er as productDetailSchema, et as MemberAddress, f as purchaseDecisionResultSchema, fn as PaymentStatus, fr as AddCartItemRequest, ft as createInquiryRequestSchema, g as ANALYTICS_SESSION_HEADER, gn as ShippingAddressInput, gr as addCartItemRequestSchema, gt as CustomerInquiry, h as ANALYTICS_SESSION_COOKIE, hn as RetryPaymentRequest, hr as UpdateCartItemRequest, ht as CreateCustomerInquiryRequest, i as MyOrder, in as KnownPaymentStatus, ir as ClaimStatus, it as memberAddressRequestSchema, j as createStorefrontClient, jn as paymentFailureCategorySchema, jt as consentUpdateRequestSchema, k as StorefrontClient, kn as easyPayProviderSchema, kt as consentSourceSchema, l as myOrderItemSchema, ln as PaymentMethod, lr as orderItemStatusSchema, lt as CreateInquiryRequest, m as ANALYTICS_MAX_BATCH_BYTES, mn as RemoteArea, mr as CartItem, mt as publicInquirySchema, n as storefrontStoreSchema, nn as GuestInfo, nr as productPageSchema, nt as UpdateProfileRequest, o as OrderShippingAddress, on as PAYMENT_STATUS_VALUES, or as PageInfo, ot as memberSchema, p as trackingStageResponseSchema, pn as PgProvider, pr as Cart, pt as createInquiryResultSchema, q as publicReviewSchema, qn as ProductDetail, qt as CashReceiptIdentityType, r as DeliveryTracking, rn as KnownPaymentResult, rr as productSortSchema, rt as WishlistAddResult, s as PurchaseDecisionResult, sn as PaymentFailureCategory, sr as PageParams, st as updateProfileRequestSchema, t as StorefrontStore, tn as EasyPayProvider, tr as productFacetsSchema, tt as MemberAddressRequest, u as myOrderSchema, un as PaymentOption, ur as pageInfoSchema, ut as CreateInquiryResult, v as ANALYTICS_VISITOR_HEADER, vn as availablePaymentOptionSchema, vr as cartSchema, vt as createCustomerInquiryRequestSchema, w as analyticsBatchSchema, wn as checkoutSessionSchema, wt as ConsentState, x as AnalyticsClientEventName, xn as cashReceiptRequestSchema, xt as ConsentAction, y as AnalyticsBatch, yn as cashReceiptAvailable, yr as updateCartItemRequestSchema, yt as customerInquiryCategorySchema, z as PublicReview, zn as pgProviderSchema, zt as claimReasonSchema } from "./index-OqvbJ6Xi.mjs";
|
|
3
|
+
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, AddCartItemRequest, AnalyticsBatch, AnalyticsClientEvent, AnalyticsClientEventName, AnalyticsEventName, AnalyticsServerEventName, AnonymousSession, ApiError, AvailablePaymentOption, CASH_RECEIPT_METHODS, Cart, CartItem, CashReceiptIdentityType, CashReceiptRequest, CashReceiptType, CategoryNode, CheckoutDelivery, CheckoutSession, ClaimReason, ClaimReturnAddress, ClaimStatus, ClaimType, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStatus, LinkIdentityRequest, LoginRequest, Member, MemberAddress, MemberAddressRequest, MemberConsents, MemberIdentities, MyClaim, MyOrder, MyOrderItem, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, ProductCard, ProductDetail, ProductFacets, ProductPage, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RemoteArea, RetryPaymentRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, type StorefrontClient, type StorefrontClientOptions, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as ANALYTICS_VISITOR_HEADER, c as analyticsClientEventSchema, i as ANALYTICS_VISITOR_COOKIE, l as analyticsIdSchema, n as ANALYTICS_SESSION_COOKIE, o as analyticsBatchSchema, r as ANALYTICS_SESSION_HEADER, s as analyticsClientEventNameSchema, t as ANALYTICS_MAX_BATCH_BYTES, u as analyticsServerEventNameSchema } from "./analytics-CgD70OqH.mjs";
|
|
2
2
|
import { t as analyticsIdsFromCookie } from "./analytics-ids-COElZiI3.mjs";
|
|
3
|
-
import { $ as
|
|
4
|
-
import {
|
|
3
|
+
import { $ as updateCartItemRequestSchema, A as consentSourceSchema, B as categoryNodeSchema, C as createInquiryResultSchema, D as customerInquirySchema, E as customerInquiryCategorySchema, F as claimReturnAddressSchema, G as productSortSchema, H as productDetailSchema, I as claimTypeSchema, J as pageInfoSchema, K as claimStatusSchema, L as createClaimRequestSchema, M as consentUpdateRequestSchema, N as memberConsentsSchema, O as consentActionSchema, P as claimReasonSchema, Q as cartSchema, R as createClaimResultSchema, S as createInquiryRequestSchema, T as createCustomerInquiryRequestSchema, U as productFacetsSchema, V as productCardSchema, W as productPageSchema, X as addCartItemRequestSchema, Y as pageSchema, Z as cartItemSchema, _ as memberAddressRequestSchema, a as publicReviewSchema, at as linkIdentityRequestSchema, b as updateProfileRequestSchema, c as updateReviewRequestSchema, ct as signupRequestSchema, d as deliveryTrackingSchema, dt as withdrawRequestSchema, et as anonymousSessionSchema, f as myOrderItemSchema, ft as withdrawalBlockedDetailsSchema, g as trackingStageResponseSchema, gt as unwrapData, h as purchaseDecisionResultSchema, ht as toApiError, i as createReviewResultSchema, it as idpTokenRequestSchema, j as consentStateSchema, k as consentKindSchema, l as updateReviewResultSchema, lt as socialProviderSchema, m as orderShippingAddressSchema, mt as buildQuery, n as storefrontStoreSchema, nt as idpAuthorizeRequestSchema, o as reviewPageSchema, ot as loginRequestSchema, p as myOrderSchema, pt as ApiError, q as orderItemStatusSchema, r as createReviewRequestSchema, rt as idpAuthorizeResponseSchema, s as reviewSummarySchema, st as memberIdentitiesSchema, t as createStorefrontClient, tt as idpAgreementsSchema, u as writableReviewSchema, ut as tokenPairSchema, v as memberAddressSchema, w as publicInquirySchema, x as wishlistAddResultSchema, y as memberSchema, z as myClaimSchema } from "./client-Do4cw2Ez.mjs";
|
|
4
|
+
import { A as startPaymentRequestSchema, C as paymentStartSchema, D as residentNumberLike, E as remoteAreaSchema, O as retryPaymentRequestSchema, S as paymentOptionSchema, T as pgProviderSchema, _ as paymentFailureCategorySchema, a as cashReceiptAvailable, b as paymentOptionKey, c as cashReceiptTypeSchema, d as createCheckoutRequestSchema, f as deliveryQuoteRequestSchema, g as guestInfoSchema, h as easyPayProviderSchema, i as availablePaymentOptionSchema, k as shippingAddressInputSchema, l as checkoutDeliverySchema, m as easyPayProviderResponseSchema, n as PAYMENT_RESULT_VALUES, o as cashReceiptIdentityTypeOf, p as deliveryQuoteSchema, r as PAYMENT_STATUS_VALUES, s as cashReceiptRequestSchema, t as CASH_RECEIPT_METHODS, u as checkoutSessionSchema, v as paymentMessageSchema, w as paymentStatusSchema, x as paymentOptionListSchema, y as paymentMethodSchema } from "./checkout-BeZKjYJz.mjs";
|
|
5
5
|
//#region src/session.ts
|
|
6
6
|
/** 세션 키 상수 — SDK가 소유한다. store-sdk와 겹치지 않는 별도 네임스페이스. */
|
|
7
7
|
const STOREFRONT_SESSION_KEYS = {
|
|
@@ -125,4 +125,4 @@ function createStorefrontSession(options) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
//#endregion
|
|
128
|
-
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, ApiError, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, categoryNodeSchema, checkoutSessionSchema, claimReasonSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
|
128
|
+
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, ApiError, CASH_RECEIPT_METHODS, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Jt as CashReceiptRequest, dn as PaymentStart, fn as PaymentStatus, gn as ShippingAddressInput, j as createStorefrontClient, nn as GuestInfo, un as PaymentOption } from "../index-OqvbJ6Xi.mjs";
|
|
2
2
|
//#region src/payments/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* 스토어프론트 결제 — 브라우저 전용(`@sayren/storefront-sdk/payments`).
|
|
@@ -109,6 +109,8 @@ export interface StartOptions {
|
|
|
109
109
|
option: PaymentOption;
|
|
110
110
|
shippingAddress: ShippingAddressInput;
|
|
111
111
|
guest?: GuestInfo;
|
|
112
|
+
/** 현금영수증 신청 — 계좌이체·가상계좌 옵션에서만 보낸다 */
|
|
113
|
+
cashReceipt?: CashReceiptRequest;
|
|
112
114
|
returnUrl?: string;
|
|
113
115
|
mode?: PaymentMode;
|
|
114
116
|
/** 클릭 시점에 {@link Payments.prepareWindow}로 미리 연 창. 폼 검증이 비동기라 클릭 태스크를 넘길 때 쓴다 */
|
|
@@ -118,6 +120,8 @@ export interface RetryOptions {
|
|
|
118
120
|
option: PaymentOption;
|
|
119
121
|
/** 생략하면 결제 시작 때의 복귀 주소를 쓴다 */
|
|
120
122
|
returnUrl?: string;
|
|
123
|
+
/** 현금영수증 신청을 바꾼다. 생략하면 결제 시작 때의 신청을 그대로 둔다 */
|
|
124
|
+
cashReceipt?: CashReceiptRequest;
|
|
121
125
|
mode?: PaymentMode;
|
|
122
126
|
/** 클릭 시점에 {@link Payments.prepareWindow}로 미리 연 창 */
|
|
123
127
|
window?: PreparedPaymentWindow;
|
package/dist/payments/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v as paymentMessageSchema } from "../checkout-BeZKjYJz.mjs";
|
|
2
2
|
//#region src/payments/index.ts
|
|
3
3
|
/** 복귀 주소에 결제 서비스가 붙이는 쿼리 */
|
|
4
4
|
const RETURN_PAYMENT_ID = "sayrenPaymentId";
|
|
@@ -51,19 +51,19 @@ function paymentResultOf(status, options = {}) {
|
|
|
51
51
|
status: "CANCELED",
|
|
52
52
|
paymentId,
|
|
53
53
|
code: lastFailure?.code ?? "USER_CANCELED",
|
|
54
|
-
message: lastFailure?.message ?? "결제를
|
|
54
|
+
message: lastFailure?.message ?? "결제를 취소했습니다"
|
|
55
55
|
};
|
|
56
56
|
if (result === "FAILED" || result === "EXPIRED") return {
|
|
57
57
|
status: "FAILED",
|
|
58
58
|
paymentId,
|
|
59
59
|
code: lastFailure?.code ?? result,
|
|
60
|
-
message: lastFailure?.message ?? (result === "EXPIRED" ? "결제 요청이
|
|
60
|
+
message: lastFailure?.message ?? (result === "EXPIRED" ? "결제 요청이 만료됐습니다" : "결제에 실패했습니다")
|
|
61
61
|
};
|
|
62
62
|
if (result === "PENDING") return options.popupClosed ? {
|
|
63
63
|
status: "CANCELED",
|
|
64
64
|
paymentId,
|
|
65
65
|
code: "POPUP_CLOSED",
|
|
66
|
-
message: "결제창을
|
|
66
|
+
message: "결제창을 닫았습니다"
|
|
67
67
|
} : {
|
|
68
68
|
status: "PROCESSING",
|
|
69
69
|
paymentId
|
|
@@ -147,7 +147,7 @@ function createPayments(options) {
|
|
|
147
147
|
} catch {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
console.warn(`[sayren] returnUrl(${returnUrl})의 origin이 지금 페이지와
|
|
150
|
+
console.warn(`[sayren] returnUrl(${returnUrl})의 origin이 지금 페이지와 다릅니다 — 결제 서비스는 그 origin으로 결과 메시지를 보내므로 팝업 결과가 도달하지 않고 결제 상태 조회로만 끝납니다`);
|
|
151
151
|
}
|
|
152
152
|
function prepareWindow(prepareOptions = {}) {
|
|
153
153
|
stopWatch();
|
|
@@ -165,7 +165,7 @@ function createPayments(options) {
|
|
|
165
165
|
*/
|
|
166
166
|
function resolvePrepared(given, mode) {
|
|
167
167
|
if (!given) return prepareWindow({ mode });
|
|
168
|
-
if (given[PREPARED_WINDOW] !== brand) throw new TypeError("window는 같은 createPayments의 prepareWindow()가 돌려준 핸들이어야
|
|
168
|
+
if (given[PREPARED_WINDOW] !== brand) throw new TypeError("window는 같은 createPayments의 prepareWindow()가 돌려준 핸들이어야 합니다");
|
|
169
169
|
return given;
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
@@ -281,13 +281,14 @@ function createPayments(options) {
|
|
|
281
281
|
const returnUrl = startOptions.returnUrl ?? options.returnUrl;
|
|
282
282
|
if (!returnUrl) {
|
|
283
283
|
prepared.close();
|
|
284
|
-
return Promise.reject(/* @__PURE__ */ new Error("returnUrl이
|
|
284
|
+
return Promise.reject(/* @__PURE__ */ new Error("returnUrl이 필요합니다 — createPayments 또는 start에 넘겨 주십시오"));
|
|
285
285
|
}
|
|
286
286
|
warnReturnOrigin(returnUrl, prepared.mode);
|
|
287
287
|
return startWith(prepared, () => client.checkout.startPayment(checkoutId, {
|
|
288
288
|
option: startOptions.option,
|
|
289
289
|
shippingAddress: startOptions.shippingAddress,
|
|
290
290
|
guest: startOptions.guest,
|
|
291
|
+
...startOptions.cashReceipt ? { cashReceipt: startOptions.cashReceipt } : {},
|
|
291
292
|
returnUrl
|
|
292
293
|
}));
|
|
293
294
|
},
|
|
@@ -297,7 +298,8 @@ function createPayments(options) {
|
|
|
297
298
|
warnReturnOrigin(returnUrl, prepared.mode);
|
|
298
299
|
return startWith(prepared, () => client.payments.retry(paymentId, {
|
|
299
300
|
option: retryOptions.option,
|
|
300
|
-
returnUrl
|
|
301
|
+
returnUrl,
|
|
302
|
+
...retryOptions.cashReceipt ? { cashReceipt: retryOptions.cashReceipt } : {}
|
|
301
303
|
}));
|
|
302
304
|
},
|
|
303
305
|
getStatus: (paymentId) => client.payments.getStatus(paymentId),
|
|
@@ -310,7 +312,7 @@ function createPayments(options) {
|
|
|
310
312
|
}
|
|
311
313
|
if (!paymentId) return {
|
|
312
314
|
status: "INVALID",
|
|
313
|
-
message: "결제 정보가 없는
|
|
315
|
+
message: "결제 정보가 없는 주소입니다"
|
|
314
316
|
};
|
|
315
317
|
return paymentResultOf(await client.payments.getStatus(paymentId));
|
|
316
318
|
}
|
package/package.json
CHANGED
package/src/auth/index.ts
CHANGED
|
@@ -48,7 +48,7 @@ export class IdpCallbackError extends Error {
|
|
|
48
48
|
constructor(
|
|
49
49
|
public readonly reason: "access_denied" | "state_mismatch" | "missing_code" | string,
|
|
50
50
|
) {
|
|
51
|
-
super(`소셜 로그인을 마치지
|
|
51
|
+
super(`소셜 로그인을 마치지 못했습니다 (${reason})`);
|
|
52
52
|
this.name = "IdpCallbackError";
|
|
53
53
|
}
|
|
54
54
|
}
|