@tosspayments/tosspayments-sdk 2.3.2 → 2.3.3

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.3.3](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.3.2...@tosspayments/tosspayments-sdk@2.3.3) (2024-12-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **tosspayments-sdk:** @tosspayments/standard-public-interfaces 버전업 ([#129](https://github.com/tosspayments/browser-sdk/issues/129)) ([4f7ec3b](https://github.com/tosspayments/browser-sdk/commit/4f7ec3becddc35187a8584c6454d4fe64828f888))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.3.2](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.3.1...@tosspayments/tosspayments-sdk@2.3.2) (2024-09-23)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tosspayments/tosspayments-sdk",
3
3
  "description": "TossPayments.js Tosspayments SDK.",
4
- "version": "2.3.2",
4
+ "version": "2.3.3",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "types/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "@rollup/plugin-commonjs": "^21.0.1",
22
22
  "@rollup/plugin-typescript": "^8.3.0",
23
23
  "@tosspayments/sdk-loader": "2.0.1",
24
- "@tosspayments/standard-public-interfaces": "2.0.22",
24
+ "@tosspayments/standard-public-interfaces": "2.0.38",
25
25
  "happy-dom": "^14.12.3",
26
26
  "prettier": "^2.0.2",
27
27
  "rollup": "^2.60.0",
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "54049b225d20dc37905dc955d4a04d476efd54cd"
41
+ "gitHead": "f2fa79e499251c03f5886981b8ed8e8fa46f383a"
42
42
  }
package/types/index.d.ts CHANGED
@@ -118,23 +118,31 @@ interface WidgetPaymentRequest {
118
118
  /**
119
119
  * 구매자 이메일입니다. 결제 상태가 바뀌면 이메일 주소로 결제내역이 전송됩니다. 최대 길이는 100자입니다.
120
120
  */
121
- customerEmail?: string;
121
+ customerEmail?: string | null;
122
122
  /**
123
123
  * 구매자명입니다. 최대 길이는 100자입니다.
124
124
  */
125
- customerName?: string;
125
+ customerName?: string | null;
126
126
  /**
127
- * 구매자의 휴대폰 번호입니다. 가상계좌 안내, 퀵계좌이체 휴대폰 번호 자동 완성에 사용되고 있어요.
127
+ * 구매자의 휴대폰 번호입니다. 가상계좌 안내, 퀵계좌이체 휴대폰 번호 자동 완성에 사용되고 있어요. `-` 없이 숫자로만 구성된 최소 8자, 최대 15자의 문자열입니다.
128
128
  */
129
- customerMobilePhone?: string;
129
+ customerMobilePhone?: string | null;
130
130
  /**
131
131
  * 결제 금액 중 면세 금액입니다. 면세 상점 혹은 복합 과세 상점으로 계약된 상점만 사용하세요. 자세한 내용은 세금 처리 가이드에서 확인하세요.
132
132
  */
133
- taxFreeAmount?: number;
133
+ taxFreeAmount?: number | null;
134
134
  /**
135
- * 중국 및 동남아 간편결제(비동기)의 결제 요청이 완료되면 리다이렉트되는 URL입니다. 반드시 오리진을 포함해야 합니다.
135
+ * 브라우저에서 결제창이 열리는 프레임입니다. `self`, `iframe` 중 하나입니다.
136
+ *
137
+ * \- `self`는 현재 브라우저를 결제창으로 이동시켜요. 모바일 환경에서 기본 값입니다.
138
+ *
139
+ * \- `iframe`은 iframe에서 결제창이 열려요. PC 환경에서 기본 값입니다. **모바일 환경에서는 `iframe`을 사용할 수 없습니다.**
140
+ */
141
+ windowTarget?: 'iframe' | 'self' | null;
142
+ /**
143
+ * @ignore
136
144
  */
137
- pendingUrl?: string;
145
+ pendingUrl?: string | null;
138
146
  /**
139
147
  * 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
140
148
  */
@@ -147,8 +155,12 @@ interface WidgetPaymentRequest {
147
155
  * 과세를 제외한 결제 금액(컵 보증금 등)입니다. 값을 넣지 않으면 기본값인 0으로 설정됩니다.
148
156
  * 과세 제외 금액이 있는 카드 결제는 부분 취소가 안 됩니다.
149
157
  */
150
- taxExemptionAmount?: number;
151
- };
158
+ taxExemptionAmount?: number | null;
159
+ /**
160
+ * 페이북/ISP 앱에서 상점 앱으로 돌아올 때 사용됩니다. 상점의 앱 스킴을 지정하면 됩니다. 예를 들면 testapp://같은 형태입니다.
161
+ */
162
+ appScheme?: string | null;
163
+ } | null;
152
164
  /**
153
165
  * 구매자가 계좌이체를 선택하면 결제에 적용되는 옵션입니다.
154
166
  */
@@ -157,7 +169,7 @@ interface WidgetPaymentRequest {
157
169
  * 에스크로 적용 여부입니다. `true`로 설정하면 구매자가 반드시 에스크로 적용에 동의해야 결제가 완료돼요.
158
170
  * `false`로 설정하거나 파라미터를 설정하지 않으면 에스크로 적용을 구매자 선택에 맡겨요.
159
171
  */
160
- useEscrow?: boolean;
172
+ useEscrow?: boolean | null;
161
173
  /**
162
174
  * 각 상품의 상세 정보 객체를 담는 배열입니다. 에스크로를 사용하는 상점이라면 필수 파라미터입니다.
163
175
  * 예를 들어 사용자가 세 가지 종류의 상품을 구매했다면 길이가 3인 배열이어야 합니다.
@@ -166,25 +178,25 @@ interface WidgetPaymentRequest {
166
178
  /**
167
179
  * 각 상품의 고유 ID입니다.
168
180
  */
169
- id?: string;
181
+ id?: string | null;
170
182
  /**
171
183
  * 상품명입니다.
172
184
  */
173
- name?: string;
185
+ name?: string | null;
174
186
  /**
175
187
  * 내 상점에서 사용하는 상품 관리 코드입니다.
176
188
  */
177
- code?: string;
189
+ code?: string | null;
178
190
  /**
179
191
  * 상품의 1개의 개별 가격입니다.
180
192
  */
181
- unitPrice?: number;
193
+ unitPrice?: number | null;
182
194
  /**
183
195
  * 상품 구매 수량입니다.
184
196
  */
185
- quantity?: number;
186
- }>;
187
- };
197
+ quantity?: number | null;
198
+ }> | null;
199
+ } | null;
188
200
  /**
189
201
  * 구매자가 가상계좌를 선택하면 결제에 적용되는 옵션입니다.
190
202
  */
@@ -192,7 +204,7 @@ interface WidgetPaymentRequest {
192
204
  /**
193
205
  * 에스크로 사용 여부입니다. 값을 주지 않으면 결제창에서 고객이 직접 에스크로 결제 여부를 선택합니다.
194
206
  */
195
- useEscrow?: boolean;
207
+ useEscrow?: boolean | null;
196
208
  /**
197
209
  * 각 상품의 상세 정보 객체를 담는 배열입니다. 에스크로를 사용하는 상점이라면 필수 파라미터입니다.
198
210
  * 예를 들어 사용자가 세 가지 종류의 상품을 구매했다면 길이가 3인 배열이어야 합니다.
@@ -201,25 +213,25 @@ interface WidgetPaymentRequest {
201
213
  /**
202
214
  * 각 상품의 고유 ID입니다.
203
215
  */
204
- id?: string;
216
+ id?: string | null;
205
217
  /**
206
218
  * 상품명입니다.
207
219
  */
208
- name?: string;
220
+ name?: string | null;
209
221
  /**
210
222
  * 내 상점에서 사용하는 상품 관리 코드입니다.
211
223
  */
212
- code?: string;
224
+ code?: string | null;
213
225
  /**
214
226
  * 상품의 1개의 개별 가격입니다.
215
227
  */
216
- unitPrice?: number;
228
+ unitPrice?: number | null;
217
229
  /**
218
230
  * 상품 구매 수량입니다.
219
231
  */
220
- quantity?: number;
221
- }>;
222
- };
232
+ quantity?: number | null;
233
+ }> | null;
234
+ } | null;
223
235
  /**
224
236
  * 구매자가 해외간편결제를 선택하면 결제에 적용되는 옵션입니다.
225
237
  */
@@ -254,7 +266,7 @@ interface WidgetPaymentRequest {
254
266
  * 상품 설명입니다.
255
267
  */
256
268
  description: string;
257
- }>;
269
+ }> | null;
258
270
  /**
259
271
  * 배송 정보입니다.
260
272
  */
@@ -262,27 +274,27 @@ interface WidgetPaymentRequest {
262
274
  /**
263
275
  * 수령인입니다.
264
276
  */
265
- fullName?: string;
277
+ fullName?: string | null;
266
278
  /**
267
279
  * 배송 주소입니다.
268
280
  */
269
281
  address?: {
270
282
  /**
271
- * 국가입니다.
283
+ * 구매자가 위치한 국가입니다. ISO-3166의 두 자리 국가 코드를 입력하세요.
272
284
  */
273
285
  country: string;
274
286
  /**
275
287
  * 주소입니다. 도로명 및 건물(Street, Apt), 번지 정보입니다.
276
288
  */
277
- line1?: string;
289
+ line1?: string | null;
278
290
  /**
279
291
  * 상세 주소입니다. 번지 및 동호수 정보를 입력하세요.
280
292
  */
281
- line2?: string;
293
+ line2?: string | null;
282
294
  /**
283
295
  * 주(State, Province, Region) 정보입니다. 국가의 도시 체계에 따라 없는 경우가 있습니다.
284
296
  */
285
- area1?: string;
297
+ area1?: string | null;
286
298
  /**
287
299
  * 도시입니다.
288
300
  */
@@ -290,9 +302,9 @@ interface WidgetPaymentRequest {
290
302
  /**
291
303
  * 배송지 우편번호입니다. 중국, 일본, 프랑스, 독일 등 [일부 국가](https://developer.paypal.com/api/rest/reference/orders/v2/country-address-requirements/#link-countryandregionaddressrequirements)에서는 필수 파라미터입니다
292
304
  */
293
- postalCode?: string;
294
- };
295
- };
305
+ postalCode?: string | null;
306
+ } | null;
307
+ } | null;
296
308
  /**
297
309
  * 특정 해외간편결제 수단에만 필요한 정보입니다.
298
310
  */
@@ -307,9 +319,9 @@ interface WidgetPaymentRequest {
307
319
  * 문서의 표에 있는 ‘Data Field Name’ 컬럼 값을 객체의 ‘key’로, ‘Description’에 맞는 값을 객체의 ‘value’로 넣어주시면 됩니다.
308
320
  */
309
321
  setTransactionContext?: unknown;
310
- };
311
- };
312
- };
322
+ } | null;
323
+ } | null;
324
+ } | null;
313
325
  }
314
326
 
315
327
  interface Amount {
@@ -328,12 +340,12 @@ type WithRedirection<T> = T & {
328
340
  * 결제 요청이 성공하면 리다이렉트되는 URL입니다. `https://www.example.com/success`와 같이 오리진을 포함한 형태로 설정해주세요.
329
341
  * 리다이렉트되면 URL의 쿼리 파라미터로 `amount`, `orderId`, `paymentKey`가 추가돼요.
330
342
  */
331
- successUrl?: string;
343
+ successUrl?: string | null;
332
344
  /**
333
345
  * 결제 요청이 실패하면 리다이렉트되는 URL입니다. `https://www.example.com/fail`와 같이 오리진을 포함한 형태로 설정해주세요.
334
346
  * 리다이렉트되면 URL의 쿼리 파라미터로 에러 코드와 메시지를 확인할 수 있어요.
335
347
  */
336
- failUrl?: string;
348
+ failUrl?: string | null;
337
349
  };
338
350
 
339
351
  type WidgetPaymentResult = {
@@ -464,7 +476,6 @@ type RequestPayment$2 = RequestPaymentWithPromise$1 & RequestPaymentWithRedirect
464
476
  orderName: "토스 티셔츠 외 2건",
465
477
  customerEmail: "customer123@gmail.com",
466
478
  customerName: "김토스",
467
- customerMobilePhone: "01012341234",
468
479
  });
469
480
  * ```
470
481
 
@@ -494,7 +505,6 @@ type RequestPaymentWithPromise$1 = (paymentRequest: WidgetPaymentRequest) => Pro
494
505
  failUrl: window.location.origin + "/fail.html",
495
506
  customerEmail: "customer123@gmail.com",
496
507
  customerName: "김토스",
497
- customerMobilePhone: "01012341234",
498
508
  });
499
509
  * ```
500
510
  */
@@ -562,15 +572,15 @@ interface BrandpayPaymentRequest {
562
572
  /**
563
573
  * 구매자 이메일입니다. 결제 상태가 바뀌면 이메일 주소로 결제내역이 전송됩니다. 최대 길이는 100자입니다.
564
574
  */
565
- customerEmail?: string;
575
+ customerEmail?: string | null;
566
576
  /**
567
577
  * 구매자명입니다. 최대 길이는 100자입니다.
568
578
  */
569
- customerName?: string;
579
+ customerName?: string | null;
570
580
  /**
571
581
  * 결제 금액 중 면세 금액입니다. 면세 상점 혹은 복합 과세 상점으로 계약된 상점만 사용하세요. 자세한 내용은 세금 처리 가이드에서 확인하세요.
572
582
  */
573
- taxFreeAmount?: number;
583
+ taxFreeAmount?: number | null;
574
584
  /**
575
585
  * 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
576
586
  */
@@ -639,7 +649,6 @@ type RequestPayment$1 = RequestPaymentWithPromise & RequestPaymentWithRedirectio
639
649
  * failUrl: window.location.origin + '/fail.html',
640
650
  * customerEmail: 'customer123@gmail.com',
641
651
  * customerName: '김토스',
642
- * customerMobilePhone: '01012341234',
643
652
  * });
644
653
  * ```
645
654
  */
@@ -660,7 +669,6 @@ type RequestPaymentWithRedirection = (paymentRequest: WithRedirection<BrandpayPa
660
669
  * orderName: '토스 티셔츠 외 2건',
661
670
  * customerEmail: 'customer123@gmail.com',
662
671
  * customerName: '김토스',
663
- * customerMobilePhone: '01012341234',
664
672
  * });
665
673
  * ```
666
674
  */
@@ -810,29 +818,31 @@ interface PaymentRequest {
810
818
  /**
811
819
  * 구매자명입니다. 최대 길이는 100자입니다.
812
820
  */
813
- customerName?: string;
821
+ customerName?: string | null;
814
822
  /**
815
823
  * 구매자 이메일입니다. 결제 상태가 바뀌면 이메일 주소로 결제내역이 전송됩니다. 최대 길이는 100자입니다.
816
824
  */
817
- customerEmail?: string;
825
+ customerEmail?: string | null;
818
826
  /**
819
- * 구매자의 휴대폰 번호입니다. 가상계좌 안내, 퀵계좌이체 휴대폰 번호 자동 완성에 사용되고 있어요.
827
+ * 구매자의 휴대폰 번호입니다. 가상계좌 안내, 퀵계좌이체 휴대폰 번호 자동 완성에 사용되고 있어요. `-` 없이 숫자로만 구성된 최소 8자, 최대 15자의 문자열입니다.
820
828
  */
821
- customerMobilePhone?: string;
829
+ customerMobilePhone?: string | null;
822
830
  /**
823
831
  * 결제 금액 중 면세 금액입니다. 면세 상점 혹은 복합 과세 상점으로 계약된 상점만 사용하세요. 자세한 내용은 세금 처리 가이드에서 확인하세요.
824
832
  */
825
- taxFreeAmount?: number;
833
+ taxFreeAmount?: number | null;
826
834
  /**
827
835
  * 브라우저에서 결제창이 열리는 프레임입니다. `self`, `iframe` 중 하나입니다.
836
+ *
828
837
  * \- `self`는 현재 브라우저를 결제창으로 이동시켜요. 모바일 환경에서 기본 값입니다.
838
+ *
829
839
  * \- `iframe`은 iframe에서 결제창이 열려요. PC 환경에서 기본 값입니다. **모바일 환경에서는 `iframe`을 사용할 수 없습니다.**
830
840
  */
831
- windowTarget?: 'iframe' | 'self';
841
+ windowTarget?: 'iframe' | 'self' | null;
832
842
  /**
833
- * 중국 및 동남아 간편결제(비동기)의 결제 요청이 완료되면 리다이렉트되는 URL입니다. 반드시 오리진을 포함해야 합니다.
843
+ * @ignore
834
844
  */
835
- pendingUrl?: string;
845
+ pendingUrl?: string | null;
836
846
  /**
837
847
  * 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
838
848
  */
@@ -851,105 +861,109 @@ interface CardPaymentRequest extends PaymentRequest {
851
861
  /**
852
862
  * 에스크로 적용 여부입니다. `true`로 설정하면 구매자가 반드시 에스크로 적용에 동의해야 결제가 완료돼요. `false`로 설정하거나 파라미터를 설정하지 않으면 에스크로 적용을 구매자 선택에 맡겨요.
853
863
  */
854
- useEscrow?: boolean;
864
+ useEscrow?: boolean | null;
855
865
  /**
856
866
  * 과세를 제외한 결제 금액(컵 보증금 등)입니다.
857
867
  * 과세 제외 금액이 있는 카드 결제는 부분 취소가 안 됩니다.
858
868
  */
859
- taxExemptionAmount?: number;
869
+ taxExemptionAmount?: number | null;
860
870
  /**
861
871
  * 결제창을 여는 방법입니다. `DEFAULT`는 카드/간편결제 통합결제창을 열고, `DIRECT`는 카드 또는 간편결제의 자체창을 열어요.
862
872
  * 기본 값은 `DEFAULT`입니다.
863
873
  */
864
- flowMode?: 'DIRECT' | 'DEFAULT';
874
+ flowMode?: 'DIRECT' | 'DEFAULT' | null;
865
875
  /**
866
- * 카드사 코드입니다. `flowMode` 값에 따라 아래와 같이 다르게 동작해요.
876
+ * [카드사 코드](/codes/org-codes#카드사-코드)입니다. `flowMode` 값에 따라 아래와 같이 다르게 동작해요.
867
877
  * `flowMode`가 `DIRECT`일 때는 입력한 코드의 카드사 앱이 열려요.
868
878
  * `flowMode`가 `DEFAULT`일 때는 통합결제창에 입력한 코드의 카드사만 보여요.
869
879
  */
870
- cardCompany?: string;
880
+ cardCompany?: string | null;
871
881
  /**
872
- * 간편결제 코드입니다. `flowMode` 값에 따라 아래와 같이 다르게 동작해요.
882
+ * [간편결제 코드](/codes/org-codes#간편결제사-코드)입니다. `flowMode` 값에 따라 아래와 같이 다르게 동작해요.
873
883
  * `flowMode`가 `DIRECT`일 때는 입력한 코드의 간편결제 앱이 열려요.
874
- * `flowMode`가 `DEFAULT`일 때는 통합결제창에 입력한 코드의 간편결제만 보여요.
884
+ * `flowMode`가 `DEFAULT`일 때는 해당 파라미터와 상관 없이 기본 통합결제창이 열려요.
875
885
  */
876
- easyPay?: string;
886
+ easyPay?: string | null;
877
887
  /**
878
888
  * 신용카드 결제에 적용되는 할부 개월 수입니다.
879
889
  * 예를 들어, `6`으로 설정하면 할부 개월 수가 6개월로 고정돼요. 자체창에서는 구매자가 할부 개월 수를 볼 수 없으니 사전에 충분히 안내를 해주세요.
880
890
  * 0(일시불), 2~12 값으로 설정할 수 있고 `maxCardInstallmentPlan` 파라미터와 함께 사용할 수 없어요. 카드사 별로 할부결제가 가능한 [최소 금액](https://pgweb.tosspayments.com/tosspayments/MainPopUp.do)을 확인하세요.
881
891
  */
882
- cardInstallmentPlan?: number;
892
+ cardInstallmentPlan?: number | null;
883
893
  /**
884
894
  * 신용카드 결제에 적용할 수 있는 최대 할부 개월 수입니다.
885
895
  * 예를 들어, `6`으로 설정하면 구매자는 일시불부터 6개월 할부를 선택할 수 있어요. 0(일시불), 2~12 값으로 설정할 수 있고 `cardInstallmentPlan` 파라미터와 함께 사용할 수 없어요. 카드사 별로 할부결제가 가능한 [최소 금액](https://pgweb.tosspayments.com/tosspayments/MainPopUp.do)을 확인하세요.
886
896
  */
887
- maxCardInstallmentPlan?: number;
897
+ maxCardInstallmentPlan?: number | null;
888
898
  /**
889
899
  * 신용카드 결제에 적용할 수 있는 **상점 부담 무이자** 할부 정보입니다.
890
900
  * 구매자가 선택한 카드, 할부 개월 수가 배열에 등록한 정보와 같다면 무이자가 할부가 자동으로 적용돼요. 카드사 별로 할부결제가 가능한 [최소 금액](https://pgweb.tosspayments.com/tosspayments/MainPopUp.do)을 확인하세요.
891
901
  */
892
902
  freeInstallmentPlans?: Array<{
893
903
  /**
894
- * 상점 부담 무이자를 적용할 카드사 코드입니다.
904
+ * 상점 부담 무이자를 적용할 카드사 코드](/codes/org-codes#카드사-코드)입니다.
895
905
  */
896
906
  company: string;
897
907
  /**
898
908
  * 상점 부담 무이자를 적용할 할부 개월입니다.
899
909
  */
900
910
  months: number[];
901
- }>;
911
+ }> | null;
902
912
  /**
903
913
  * 카드사 포인트 사용 여부입니다. `true`로 설정하면 카드사 포인트 사용이 체크된 상태로 결제창이 열려요. `false`로 설정하거나 값을 넣지 않으면 구매자가 직접 카드사 포인트 사용 여부를 선택할 수 있어요.
904
914
  *
905
915
  * \* 추가 계약이 필요한 파라미터입니다. 토스페이먼츠 고객센터(1544-7772, support@tosspayments.com)로 문의해주세요.
906
916
  */
907
- useCardPoint?: boolean;
917
+ useCardPoint?: boolean | null;
908
918
  /**
909
919
  * 앱카드 단독 사용 여부입니다. `true`로 설정하면 카드사의 앱카드만 열려요. 국민, 농협, 롯데, 삼성, 신한, 우리, 현대 카드 결제에 적용할 수 있어요.
910
920
  */
911
- useAppCardOnly?: boolean;
921
+ useAppCardOnly?: boolean | null;
912
922
  /**
913
923
  * 카드사의 프로모션 코드입니다. 프로모션은 `flowMode`가 `DIRECT`로 설정된 자체창 결제에만 사용할 수 있어요. 프로모션 조회 API로 적용할 수 있는 프로모션 코드를 확인하세요.
914
924
  */
915
- discountCode?: string;
925
+ discountCode?: string | null;
916
926
  /**
917
927
  * 시간으로 설정하는 결제 기한입니다. 설정할 수 있는 최대 값은 2160시간(90일)입니다.
918
928
  * 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `24`로 설정하면, 결제 요청 시점으로부터 24시간 동안 결제할 수 있어요.
919
929
  */
920
- validHours?: number;
930
+ validHours?: number | null;
921
931
  /**
922
932
  * 특정 날짜로 설정하는 결제 기한입니다. `yyyy-MM-dd'T'HH:mm:ss` ISO 8601 형식입니다.
923
933
  * 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `2025-01-01T00:00:00`으로 설정하면, 2024년 12월 31일 23:59까지 결제할 수 있어요.
924
934
  */
925
- dueDate?: string;
935
+ dueDate?: string | null;
926
936
  escrowProducts?: Array<{
927
937
  /**
928
938
  * 각 상품의 고유 ID입니다.
929
939
  */
930
- id?: string;
940
+ id?: string | null;
931
941
  /**
932
942
  * 상품명입니다.
933
943
  */
934
- name?: string;
944
+ name?: string | null;
935
945
  /**
936
946
  * 내 상점에서 사용하는 상품 관리 코드입니다.
937
947
  */
938
- code?: string;
948
+ code?: string | null;
939
949
  /**
940
950
  * 상품의 1개의 개별 가격입니다.
941
951
  */
942
- unitPrice?: number;
952
+ unitPrice?: number | null;
943
953
  /**
944
954
  * 상품 구매 수량입니다.
945
955
  */
946
- quantity?: number;
947
- }>;
956
+ quantity?: number | null;
957
+ }> | null;
948
958
  /**
949
959
  * 해외카드(Visa, MasterCard, JCB, UnionPay 등) 결제 여부입니다. `true`로 설정하면 해외카드 결제가 가능한 [다국어 결제창](/resources/glossary/payment-window#다국어-결제창)이 열립니다.
950
960
  */
951
- useInternationalCardOnly?: boolean;
952
- };
961
+ useInternationalCardOnly?: boolean | null;
962
+ /**
963
+ * 페이북/ISP 앱에서 상점 앱으로 돌아올 때 사용됩니다. 상점의 앱 스킴을 지정하면 됩니다. 예를 들면 testapp://같은 형태입니다.
964
+ */
965
+ appScheme?: string | null;
966
+ } | null;
953
967
  }
954
968
 
955
969
  interface VirtualAccountPaymentRequest extends PaymentRequest {
@@ -964,50 +978,57 @@ interface VirtualAccountPaymentRequest extends PaymentRequest {
964
978
  /**
965
979
  * 과세를 제외한 결제 금액(컵 보증금 등)입니다.
966
980
  */
967
- taxExemptionAmount?: number;
981
+ taxExemptionAmount?: number | null;
968
982
  /**
969
- * 현금영수증 발급 용도입니다.
983
+ * 현금영수증 정보입니다.
970
984
  */
971
985
  cashReceipt?: {
986
+ /**
987
+ * 현금영수증 발급 용도입니다. '소득공제', '지출증빙', '미발행' 중 하나입니다.
988
+ */
972
989
  type: '소득공제' | '지출증빙' | '미발행';
973
- };
990
+ } | null;
974
991
  /**
975
992
  * 에스크로 적용 여부입니다.
976
993
  */
977
- useEscrow?: boolean;
994
+ useEscrow?: boolean | null;
995
+ /**
996
+ * 에스크로 상품 정보입니다.
997
+ * 여러 가지의 상품을 결제했다면 각 상품의 정보를 입력하세요. 예를 들어, 구매자가 세 가지 종류의 상품을 구매했다면 배열의 길이는 3이어야 합니다.
998
+ */
978
999
  escrowProducts?: Array<{
979
1000
  /**
980
1001
  * 각 상품의 고유 ID입니다.
981
1002
  */
982
- id?: string;
1003
+ id?: string | null;
983
1004
  /**
984
1005
  * 상품명입니다.
985
1006
  */
986
- name?: string;
1007
+ name?: string | null;
987
1008
  /**
988
1009
  * 내 상점에서 사용하는 상품 관리 코드입니다.
989
1010
  */
990
- code?: string;
1011
+ code?: string | null;
991
1012
  /**
992
1013
  * 상품의 1개의 개별 가격입니다.
993
1014
  */
994
- unitPrice?: number;
1015
+ unitPrice?: number | null;
995
1016
  /**
996
1017
  * 상품 구매 수량입니다.
997
1018
  */
998
- quantity?: number;
999
- }>;
1019
+ quantity?: number | null;
1020
+ }> | null;
1000
1021
  /**
1001
1022
  * 시간으로 설정하는 결제 기한입니다. 설정할 수 있는 최대 값은 2160시간(90일)입니다.
1002
1023
  * 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `24`로 설정하면, 결제 요청 시점으로부터 24시간 동안 결제할 수 있어요.
1003
1024
  */
1004
- validHours?: number;
1025
+ validHours?: number | null;
1005
1026
  /**
1006
1027
  * 특정 날짜로 설정하는 결제 기한입니다. `yyyy-MM-dd'T'HH:mm:ss` ISO 8601 형식입니다.
1007
1028
  * 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `2025-01-01T00:00:00`으로 설정하면, 2024년 12월 31일 23:59까지 결제할 수 있어요.
1008
1029
  */
1009
- dueDate?: string;
1010
- };
1030
+ dueDate?: string | null;
1031
+ } | null;
1011
1032
  }
1012
1033
 
1013
1034
  interface TransferPaymentRequest extends PaymentRequest {
@@ -1022,21 +1043,21 @@ interface TransferPaymentRequest extends PaymentRequest {
1022
1043
  /**
1023
1044
  * 과세를 제외한 결제 금액(컵 보증금 등)입니다.
1024
1045
  */
1025
- taxExemptionAmount?: number;
1046
+ taxExemptionAmount?: number | null;
1026
1047
  /**
1027
1048
  * 현금영수증 정보입니다.
1028
1049
  */
1029
1050
  cashReceipt?: {
1030
1051
  /**
1031
- * 현금영수증 발급 용도입니다.
1052
+ * 현금영수증 발급 용도입니다. '소득공제', '지출증빙', '미발행' 중 하나입니다.
1032
1053
  */
1033
1054
  type: '소득공제' | '지출증빙' | '미발행';
1034
- };
1055
+ } | null;
1035
1056
  /**
1036
1057
  * 에스크로 적용 여부입니다. `true`로 설정하면 구매자가 반드시 에스크로 적용에 동의해야 결제가 완료돼요.
1037
1058
  * `false`로 설정하거나 파라미터를 설정하지 않으면 에스크로 적용을 구매자 선택에 맡겨요.
1038
1059
  */
1039
- useEscrow?: boolean;
1060
+ useEscrow?: boolean | null;
1040
1061
  /**
1041
1062
  * 에스크로 상품 정보입니다.
1042
1063
  * 여러 가지의 상품을 결제했다면 각 상품의 정보를 입력하세요. 예를 들어, 구매자가 세 가지 종류의 상품을 구매했다면 배열의 길이는 3이어야 합니다.
@@ -1045,35 +1066,35 @@ interface TransferPaymentRequest extends PaymentRequest {
1045
1066
  /**
1046
1067
  * 각 상품의 고유 ID입니다.
1047
1068
  */
1048
- id?: string;
1069
+ id?: string | null;
1049
1070
  /**
1050
1071
  * 상품명입니다.
1051
1072
  */
1052
- name?: string;
1073
+ name?: string | null;
1053
1074
  /**
1054
1075
  * 내 상점에서 사용하는 상품 관리 코드입니다.
1055
1076
  */
1056
- code?: string;
1077
+ code?: string | null;
1057
1078
  /**
1058
1079
  * 상품의 1개의 개별 가격입니다.
1059
1080
  */
1060
- unitPrice?: number;
1081
+ unitPrice?: number | null;
1061
1082
  /**
1062
1083
  * 상품 구매 수량입니다.
1063
1084
  */
1064
- quantity?: number;
1065
- }>;
1085
+ quantity?: number | null;
1086
+ }> | null;
1066
1087
  /**
1067
1088
  * 시간으로 설정하는 결제 기한입니다. 설정할 수 있는 최대 값은 2160시간(90일)입니다.
1068
1089
  * 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `24`로 설정하면, 결제 요청 시점으로부터 24시간 동안 결제할 수 있어요.
1069
1090
  */
1070
- validHours?: number;
1091
+ validHours?: number | null;
1071
1092
  /**
1072
1093
  * 특정 날짜로 설정하는 결제 기한입니다. `yyyy-MM-dd'T'HH:mm:ss` ISO 8601 형식입니다.
1073
1094
  * 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `2025-01-01T00:00:00`으로 설정하면, 2024년 12월 31일 23:59까지 결제할 수 있어요.
1074
1095
  */
1075
- dueDate?: string;
1076
- };
1096
+ dueDate?: string | null;
1097
+ } | null;
1077
1098
  }
1078
1099
 
1079
1100
  interface MobilePhonePaymentRequest extends PaymentRequest {
@@ -1102,7 +1123,7 @@ interface ForeignEasyPayPaymentRequest extends PaymentRequest {
1102
1123
  /**
1103
1124
  * 해외간편결제 코드입니다. 현재는 `PAYPAL`만 지원하고 있어요.
1104
1125
  */
1105
- provider: string;
1126
+ provider: 'PAYPAL' | 'GCASH' | 'TOUCHNGO' | 'BOOST' | 'BPI' | 'BILLEASE' | 'DANA' | 'ALIPAYHK' | 'TRUEMONEY' | 'RABBIT_LINE_PAY' | 'ALIPAY';
1106
1127
  /**
1107
1128
  * 구매자가 위치한 국가입니다. ISO-3166의 두 자리 국가 코드를 입력하세요.
1108
1129
  */
@@ -1133,7 +1154,7 @@ interface ForeignEasyPayPaymentRequest extends PaymentRequest {
1133
1154
  * 상품 설명입니다.
1134
1155
  */
1135
1156
  description: string;
1136
- }>;
1157
+ }> | null;
1137
1158
  /**
1138
1159
  * 배송 정보입니다.
1139
1160
  */
@@ -1141,27 +1162,27 @@ interface ForeignEasyPayPaymentRequest extends PaymentRequest {
1141
1162
  /**
1142
1163
  * 수령인입니다.
1143
1164
  */
1144
- fullName?: string;
1165
+ fullName?: string | null;
1145
1166
  /**
1146
1167
  * 배송 주소입니다.
1147
1168
  */
1148
1169
  address?: {
1149
1170
  /**
1150
- * 국가입니다.
1171
+ * 구매자가 위치한 국가입니다. ISO-3166의 두 자리 국가 코드를 입력하세요.
1151
1172
  */
1152
1173
  country: string;
1153
1174
  /**
1154
1175
  * 주소입니다. 도로명 및 건물(Street, Apt), 번지 정보입니다.
1155
1176
  */
1156
- line1?: string;
1177
+ line1?: string | null;
1157
1178
  /**
1158
1179
  * 상세 주소입니다. 번지 및 동호수 정보를 입력하세요.
1159
1180
  */
1160
- line2?: string;
1181
+ line2?: string | null;
1161
1182
  /**
1162
1183
  * 주(State, Province, Region) 정보입니다. 국가의 도시 체계에 따라 없는 경우가 있습니다.
1163
1184
  */
1164
- area1?: string;
1185
+ area1?: string | null;
1165
1186
  /**
1166
1187
  * 도시입니다.
1167
1188
  */
@@ -1169,9 +1190,9 @@ interface ForeignEasyPayPaymentRequest extends PaymentRequest {
1169
1190
  /**
1170
1191
  * 배송지 우편번호입니다. 중국, 일본, 프랑스, 독일 등 [일부 국가](https://developer.paypal.com/api/rest/reference/orders/v2/country-address-requirements/#link-countryandregionaddressrequirements)에서는 필수 파라미터입니다
1171
1192
  */
1172
- postalCode?: string;
1173
- };
1174
- };
1193
+ postalCode?: string | null;
1194
+ } | null;
1195
+ } | null;
1175
1196
  /**
1176
1197
  * 특정 해외간편결제 수단에만 필요한 정보입니다.
1177
1198
  */
@@ -1186,8 +1207,8 @@ interface ForeignEasyPayPaymentRequest extends PaymentRequest {
1186
1207
  * 문서의 표에 있는 ‘Data Field Name’ 컬럼 값을 객체의 ‘key’로, ‘Description’에 맞는 값을 객체의 ‘value’로 넣어주시면 됩니다.
1187
1208
  */
1188
1209
  setTransactionContext?: unknown;
1189
- };
1190
- };
1210
+ } | null;
1211
+ } | null;
1191
1212
  };
1192
1213
  }
1193
1214
 
@@ -1211,7 +1232,7 @@ interface BillingAuthRequest {
1211
1232
  * 자동결제(빌링)에 등록할 결제수단입니다. 토스페이먼츠 자동결제는 현재 신용·체크카드만 지원해요.
1212
1233
  *
1213
1234
  */
1214
- method: 'CARD';
1235
+ method: 'CARD' | 'TRANSFER';
1215
1236
  /**
1216
1237
  * 카드 등록이 성공하면 리다이렉트되는 URL입니다. 리다이렉트되면 URL의 쿼리 파라미터로 `authKey`, `customerKey`가 추가돼요. 값을 검증하고 [빌링키 발급 API](/reference#authkey로-카드-빌링키-발급)를 호출하세요.
1217
1238
  * 반드시 오리진을 포함해야 합니다.
@@ -1227,19 +1248,21 @@ interface BillingAuthRequest {
1227
1248
  /**
1228
1249
  * 구매자명입니다. 상점관리자 및 결제내역 이메일에 사용됩니다. 최대 길이는 100자입니다.
1229
1250
  */
1230
- customerName?: string;
1251
+ customerName?: string | null;
1231
1252
  /**
1232
1253
  * 구매자의 이메일 주소입니다. 결제 상태가 바뀌면 이메일 주소로 결제내역이 전송됩니다. 최대 길이는 100자입니다.
1233
1254
  */
1234
- customerEmail?: string;
1255
+ customerEmail?: string | null;
1235
1256
  /**
1236
1257
  * 브라우저에서 결제창이 열리는 프레임입니다. `self`, `iframe` 중 하나입니다.
1258
+ *
1237
1259
  * \- `self`는 현재 브라우저를 결제창으로 이동시켜요. 모바일 환경에서 기본 값입니다.
1260
+ *
1238
1261
  * \- `iframe`은 iframe에서 결제창이 열려요. PC 환경에서 기본 값입니다. **모바일 환경에서는 `iframe`을 사용할 수 없습니다.**
1239
1262
  *
1240
1263
  * @default 'iframe'
1241
1264
  */
1242
- windowTarget?: 'iframe' | 'self';
1265
+ windowTarget?: 'iframe' | 'self' | null;
1243
1266
  }
1244
1267
 
1245
1268
  /**
@@ -1258,7 +1281,7 @@ interface BillingAuthRequest {
1258
1281
  * @throws {@link PublicError.Payment.InvalidParametersError} 파라미터가 올바르지 않은 경우
1259
1282
  * @throws {@link PublicError.Payment.UnknownError} 알 수 없는 오류가 발생한 경우
1260
1283
  */
1261
- type RequestPayment = RequestCardPaymentWithRedirection & RequestCardPaymentWithPromise & RequestVirtualAccountPaymentWithRedirection & RequestVirtualAccountPaymentWithPromise & RequestTransferPaymentWithRedirection & RequestTransferPaymentWithPromise & RequestMobilePhonePaymentWithRedirection & RequestMobilePhonePaymentWithPromise & RequestGiftCertificatePaymentWithRedirection & RequestGiftCertificatePaymentWithPromise & RequestForeignEasyPayPaymentWithRedirection & RequestForeignEasyPayPaymentWithPromise;
1284
+ type RequestPayment = RequestCardPaymentWithRedirection & RequestCardPaymentWithPromise & RequestVirtualAccountPaymentWithRedirection & RequestVirtualAccountPaymentWithPromise & RequestTransferPaymentWithRedirection & RequestTransferPaymentWithPromise & RequestMobilePhonePaymentWithRedirection & RequestMobilePhonePaymentWithPromise & RequestGiftCertificatePaymentWithRedirection & RequestGiftCertificatePaymentWithPromise & RequestForeignEasyPayPaymentWithRedirection;
1262
1285
  /**
1263
1286
  * @docsAlias 카드(Promise 방식)
1264
1287
  * @returns `WidgetPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
@@ -1276,7 +1299,6 @@ type RequestPayment = RequestCardPaymentWithRedirection & RequestCardPaymentWith
1276
1299
  orderName: "토스 티셔츠 외 2건",
1277
1300
  customerEmail: "customer123@gmail.com",
1278
1301
  customerName: "김토스",
1279
- customerMobilePhone: "01012341234",
1280
1302
  windowTarget: "iframe",
1281
1303
  card: {
1282
1304
  useEscrow: false,
@@ -1316,7 +1338,6 @@ type RequestCardPaymentWithPromise = (paymentRequest: CardPaymentRequest) => Pro
1316
1338
  failUrl: window.location.origin + "/fail.html",
1317
1339
  customerEmail: "customer123@gmail.com",
1318
1340
  customerName: "김토스",
1319
- customerMobilePhone: "01012341234",
1320
1341
  card: {
1321
1342
  useEscrow: false,
1322
1343
  flowMode: "DEFAULT",
@@ -1344,7 +1365,6 @@ type RequestCardPaymentWithRedirection = (paymentRequest: WithRedirection<CardPa
1344
1365
  orderName: "토스 티셔츠 외 2건",
1345
1366
  customerEmail: "customer123@gmail.com",
1346
1367
  customerName: "김토스",
1347
- customerMobilePhone: "01012341234",
1348
1368
  windowTarget: "iframe",
1349
1369
  virtualAccount: {
1350
1370
  cashReceipt: {
@@ -1385,7 +1405,6 @@ type RequestVirtualAccountPaymentWithPromise = (paymentRequest: VirtualAccountPa
1385
1405
  failUrl: window.location.origin + "/fail.html",
1386
1406
  customerEmail: "customer123@gmail.com",
1387
1407
  customerName: "김토스",
1388
- customerMobilePhone: "01012341234",
1389
1408
  virtualAccount: {
1390
1409
  cashReceipt: {
1391
1410
  type: "소득공제",
@@ -1414,7 +1433,6 @@ type RequestVirtualAccountPaymentWithRedirection = (paymentRequest: WithRedirect
1414
1433
  orderName: "토스 티셔츠 외 2건",
1415
1434
  customerEmail: "customer123@gmail.com",
1416
1435
  customerName: "김토스",
1417
- customerMobilePhone: "01012341234",
1418
1436
  transfer: {
1419
1437
  cashReceipt: {
1420
1438
  type: "소득공제",
@@ -1453,7 +1471,6 @@ type RequestTransferPaymentWithPromise = (paymentRequest: TransferPaymentRequest
1453
1471
  failUrl: window.location.origin + "/fail.html",
1454
1472
  customerEmail: "customer123@gmail.com",
1455
1473
  customerName: "김토스",
1456
- customerMobilePhone: "01012341234",
1457
1474
  transfer: {
1458
1475
  cashReceipt: {
1459
1476
  type: "소득공제",
@@ -1481,7 +1498,6 @@ type RequestTransferPaymentWithRedirection = (paymentRequest: WithRedirection<Tr
1481
1498
  orderName: "토스 티셔츠 외 2건",
1482
1499
  customerEmail: "customer123@gmail.com",
1483
1500
  customerName: "김토스",
1484
- customerMobilePhone: "01012341234",
1485
1501
  });
1486
1502
  * ```
1487
1503
  */
@@ -1514,7 +1530,6 @@ type RequestMobilePhonePaymentWithPromise = (paymentRequest: MobilePhonePaymentR
1514
1530
  failUrl: window.location.origin + "/fail.html",
1515
1531
  customerEmail: "customer123@gmail.com",
1516
1532
  customerName: "김토스",
1517
- customerMobilePhone: "01012341234",
1518
1533
  });
1519
1534
  * ```
1520
1535
  */
@@ -1536,7 +1551,6 @@ type RequestMobilePhonePaymentWithRedirection = (paymentRequest: WithRedirection
1536
1551
  orderName: "토스 티셔츠 외 2건",
1537
1552
  customerEmail: "customer123@gmail.com",
1538
1553
  customerName: "김토스",
1539
- customerMobilePhone: "01012341234",
1540
1554
  });
1541
1555
  * ```
1542
1556
  */
@@ -1569,37 +1583,10 @@ type RequestGiftCertificatePaymentWithPromise = (paymentRequest: GiftCertificate
1569
1583
  failUrl: window.location.origin + "/fail.html",
1570
1584
  customerEmail: "customer123@gmail.com",
1571
1585
  customerName: "김토스",
1572
- customerMobilePhone: "01012341234",
1573
1586
  });
1574
1587
  * ```
1575
1588
  */
1576
1589
  type RequestGiftCertificatePaymentWithRedirection = (paymentRequest: WithRedirection<GiftCertificatePaymentRequest>) => Promise<void>;
1577
- /**
1578
- * @docsAlias 해외 간편결제(Promise 방식)
1579
- * @returns `WidgetPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1580
- * @param {RequestForeignEasyPayPaymentWithPromise} paymentRequest 결제 요청 정보입니다.
1581
- *
1582
- * @example
1583
- * ```javascript
1584
- * payment.requestPayment({
1585
- method: "FOREIGN_EASY_PAY",
1586
- amount: {
1587
- currency: "USD",
1588
- value: 5000,
1589
- },
1590
- orderId: "<UniqueId name='orderId.paypal' />",
1591
- orderName: "토스 티셔츠 외 2건",
1592
- customerEmail: "customer123@gmail.com",
1593
- customerName: "김토스",
1594
- customerMobilePhone: "01012341234",
1595
- foreignEasyPay: {
1596
- provider: "PAYPAL",
1597
- country: "KR",
1598
- },
1599
- });
1600
- * ```
1601
- */
1602
- type RequestForeignEasyPayPaymentWithPromise = (paymentRequest: ForeignEasyPayPaymentRequest) => Promise<RequestPaymentResult>;
1603
1590
  /**
1604
1591
  * @docsAlias 해외 간편결제(Redirect 방식)
1605
1592
  * @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 메서드 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
@@ -1628,7 +1615,6 @@ type RequestForeignEasyPayPaymentWithPromise = (paymentRequest: ForeignEasyPayPa
1628
1615
  failUrl: window.location.origin + "/fail.html",
1629
1616
  customerEmail: "customer123@gmail.com",
1630
1617
  customerName: "김토스",
1631
- customerMobilePhone: "01012341234",
1632
1618
  foreignEasyPay: {
1633
1619
  provider: "PAYPAL",
1634
1620
  country: "KR",