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