@tosspayments/tosspayments-sdk 2.2.0 → 2.2.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 +33 -0
- package/package.json +3 -3
- package/types/index.d.ts +103 -84
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
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.2.3](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.2.2...@tosspayments/tosspayments-sdk@2.2.3) (2024-07-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **tosspayments-sdk:** loadTossPayments 반환 타입 변경 ([#118](https://github.com/tosspayments/browser-sdk/issues/118)) ([4b16012](https://github.com/tosspayments/browser-sdk/commit/4b1601206ba77856a1fe0c811f01a4a8700a9f53))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.2.2](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.2.1...@tosspayments/tosspayments-sdk@2.2.2) (2024-07-17)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **tosspayments-sdk:** PI 버전 업 ([#117](https://github.com/tosspayments/browser-sdk/issues/117)) ([bd416a0](https://github.com/tosspayments/browser-sdk/commit/bd416a0b0407e4a3bdc4bec6379ba99f5120c13a))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [2.2.1](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.2.0...@tosspayments/tosspayments-sdk@2.2.1) (2024-07-08)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **tosspayments-sdk:** 위젯 연동시 필요한 type export ([#116](https://github.com/tosspayments/browser-sdk/issues/116)) ([724501c](https://github.com/tosspayments/browser-sdk/commit/724501c8ad79e395d29b0b11191d6e296d0f8134))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
# [2.2.0](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.1.0...@tosspayments/tosspayments-sdk@2.2.0) (2024-07-03)
|
|
7
40
|
|
|
8
41
|
|
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.2.
|
|
4
|
+
"version": "2.2.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": "
|
|
24
|
+
"@tosspayments/standard-public-interfaces": "2.0.6",
|
|
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": "
|
|
41
|
+
"gitHead": "3033873ff3952ec13030ac054ad91626b0da5a59"
|
|
42
42
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
declare function clearTossPayments(): void;
|
|
2
2
|
|
|
3
|
-
interface WidgetSelectedPaymentMethod
|
|
3
|
+
interface WidgetSelectedPaymentMethod {
|
|
4
4
|
/**
|
|
5
5
|
* 구매자가 결제 UI에서 선택한 결제수단입니다. 예를 들어, 신용・체크카드를 선택하면 `CARD` 코드가 응답됩니다. [ENUM 코드](/codes/enum-codes) 및 [기관 코드](/codes/org-codes)를 참고하세요.
|
|
6
6
|
*/
|
|
7
|
-
code: WidgetsPaymentMethodCode
|
|
7
|
+
code: WidgetsPaymentMethodCode;
|
|
8
8
|
}
|
|
9
|
-
type WidgetsPaymentMethodCode = 'CARD' | 'VIRTUAL_ACCOUNT' | 'MOBILE_PHONE' | 'TRANSFER' | 'CULTURE_GIFT_CERTIFICATE' | 'GAME_GIFT_CERTIFICATE' | 'BOOK_GIFT_CERTIFICATE' | 'TOSSPAY' | 'NAVERPAY' | 'SAMSUNGPAY' | 'LPAY' | 'KAKAOPAY' | 'PAYCO' | 'SSG' | 'APPLEPAY' | 'PINPAY' | 'KBPAY' | 'PAYPAL' | 'GCASH' | 'TOUCHNGO' | 'BOOST' | 'BPI' | 'BILLEASE' | 'DANA' | 'ALIPAYHK' | 'TRUEMONEY' | 'RABBIT_LINE_PAY' | 'ALIPAY' | 'SHINHAN' | 'HYUNDAI' | 'SAMSUNG' | 'WOORI' | 'KOOKMIN' | 'LOTTE' | 'NONGHYEOP' | 'HANA' | 'BC' | 'KDBBANK' | 'TOSSBANK' | 'KAKAOBANK' | 'SUHYEOP' | 'JEONBUKBANK' | 'KBANK' | 'POST' | 'SAEMAUL' | 'CITI' | 'SAVINGBANK' | 'JEJUBANK' | 'GWANGJUBANK' | 'SHINHYEOP' | 'JCB' | 'UNIONPAY' | 'MASTER' | 'VISA' | 'DINERS' | 'DISCOVER' | 'IBK_BC' | 'AMEX' | 'TOSS_PAYMENTS' | 'BANKPAY' | 'BRANDPAY' | 'KEYIN';
|
|
9
|
+
type WidgetsPaymentMethodCode = 'CARD' | 'VIRTUAL_ACCOUNT' | 'MOBILE_PHONE' | 'TRANSFER' | 'CULTURE_GIFT_CERTIFICATE' | 'GAME_GIFT_CERTIFICATE' | 'BOOK_GIFT_CERTIFICATE' | 'TOSSPAY' | 'NAVERPAY' | 'SAMSUNGPAY' | 'LPAY' | 'KAKAOPAY' | 'PAYCO' | 'SSG' | 'APPLEPAY' | 'PINPAY' | 'KBPAY' | 'PAYPAL' | 'GCASH' | 'TOUCHNGO' | 'BOOST' | 'BPI' | 'BILLEASE' | 'DANA' | 'ALIPAYHK' | 'TRUEMONEY' | 'RABBIT_LINE_PAY' | 'ALIPAY' | 'SHINHAN' | 'HYUNDAI' | 'SAMSUNG' | 'WOORI' | 'KOOKMIN' | 'LOTTE' | 'NONGHYEOP' | 'HANA' | 'BC' | 'KDBBANK' | 'TOSSBANK' | 'KAKAOBANK' | 'SUHYEOP' | 'JEONBUKBANK' | 'KBANK' | 'POST' | 'SAEMAUL' | 'CITI' | 'SAVINGBANK' | 'JEJUBANK' | 'GWANGJUBANK' | 'SHINHYEOP' | 'JCB' | 'UNIONPAY' | 'MASTER' | 'VISA' | 'DINERS' | 'DISCOVER' | 'IBK_BC' | 'AMEX' | 'TOSS_PAYMENTS' | 'BANKPAY' | 'BRANDPAY' | 'KEYIN' | (NonNullable<unknown> & string);
|
|
10
10
|
|
|
11
11
|
interface WidgetPaymentMethodWidget {
|
|
12
12
|
/**
|
|
@@ -14,18 +14,18 @@ interface WidgetPaymentMethodWidget {
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```javascript
|
|
17
|
-
*
|
|
18
|
-
if (
|
|
19
|
-
// 문화바우처 안내사항 노출
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (paymentMethodSelected.code === '카드') {
|
|
17
|
+
* paymentMethodWidget.on('paymentMethodSelect', selectedPaymentMethod => {
|
|
18
|
+
if (selectedPaymentMethod.code === '카드') {
|
|
23
19
|
// 카드 안내사항 노출
|
|
24
20
|
}
|
|
21
|
+
if (selectedPaymentMethod.code === '문화바우처') {
|
|
22
|
+
// 커스텀 결제수단 (결제위젯 Pro 플랜 기능)
|
|
23
|
+
// 문화바우처 안내사항 노출
|
|
24
|
+
}
|
|
25
25
|
});
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
28
|
-
* @param {'paymentMethodSelect'} eventName 구독할 이벤트입니다. `paymentMethodSelect` 이벤트로 구매자가 선택한 결제수단
|
|
28
|
+
* @param {'paymentMethodSelect'} eventName 구독할 이벤트입니다. `paymentMethodSelect` 이벤트로 구매자가 선택한 결제수단 코드를 확인하세요. 일반결제는 [결제수단 ENUM 코드](/codes/enum-codes#결제수단-타입)가 응답돼요. 결제위젯 Pro 플랜으로 [커스텀 결제수단](/guides/v2/payment-widget/pro/integration-custom)을 연동했다면 결제위젯 어드민에서 설정한 `key` 값이 응답돼요.
|
|
29
29
|
* @param {function} callback 이벤트가 일어나면 호출되는 콜백 함수입니다.
|
|
30
30
|
*
|
|
31
31
|
* @throws {@link PublicError.Widgets.InvalidEventParameterError} eventName이 유효하지 않은 경우
|
|
@@ -33,7 +33,7 @@ interface WidgetPaymentMethodWidget {
|
|
|
33
33
|
* @throws {@link PublicError.Widgets.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
34
34
|
*/
|
|
35
35
|
on: {
|
|
36
|
-
(eventName: 'paymentMethodSelect', callback:
|
|
36
|
+
(eventName: 'paymentMethodSelect', callback: (paymentMethod: WidgetSelectedPaymentMethod) => void): void;
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* 구매자가 선택한 결제수단을 불러옵니다. [자세히 >](#paymentmethodwidgetgetselectedpaymentmethod)
|
|
@@ -45,7 +45,7 @@ interface WidgetPaymentMethodWidget {
|
|
|
45
45
|
*
|
|
46
46
|
* @throws {@link PublicError.Widgets.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
47
47
|
*/
|
|
48
|
-
getSelectedPaymentMethod:
|
|
48
|
+
getSelectedPaymentMethod: () => Promise<WidgetSelectedPaymentMethod>;
|
|
49
49
|
/**
|
|
50
50
|
* 결제 UI 객체를 제거합니다. [자세히 >](#paymentmethodwidgetdestroy)
|
|
51
51
|
*
|
|
@@ -216,6 +216,9 @@ interface WidgetPaymentRequest {
|
|
|
216
216
|
* 구매자가 해외간편결제를 선택하면 결제에 적용되는 옵션입니다.
|
|
217
217
|
*/
|
|
218
218
|
foreignEasyPay?: {
|
|
219
|
+
/**
|
|
220
|
+
* 구매자가 위치한 국가입니다. ISO-3166의 두 자리 국가 코드를 입력하세요.
|
|
221
|
+
*/
|
|
219
222
|
country: string;
|
|
220
223
|
/**
|
|
221
224
|
* 구매 상품 정보입니다. 여러 가지의 상품을 결제했다면 각 상품의 정보를 입력하세요. 예를 들어, 구매자가 세 가지 종류의 상품을 구매했다면 배열의 길이는 3이어야 합니다.
|
|
@@ -265,7 +268,7 @@ interface WidgetPaymentRequest {
|
|
|
265
268
|
*/
|
|
266
269
|
line1?: string;
|
|
267
270
|
/**
|
|
268
|
-
* 상세 주소입니다. 번지 및
|
|
271
|
+
* 상세 주소입니다. 번지 및 동호수 정보를 입력하세요.
|
|
269
272
|
*/
|
|
270
273
|
line2?: string;
|
|
271
274
|
/**
|
|
@@ -307,7 +310,7 @@ interface Amount {
|
|
|
307
310
|
*/
|
|
308
311
|
value: number;
|
|
309
312
|
/**
|
|
310
|
-
* 결제 통화입니다.
|
|
313
|
+
* 결제 통화입니다. 일반결제는 `KRW`만 지원합니다. 해외 간편결제(PayPal)는 `USD`만 지원합니다.
|
|
311
314
|
*/
|
|
312
315
|
currency: string;
|
|
313
316
|
}
|
|
@@ -406,7 +409,7 @@ type RenderAgreement = (params: {
|
|
|
406
409
|
*/
|
|
407
410
|
selector: string;
|
|
408
411
|
/**
|
|
409
|
-
* 렌더링하고 싶은
|
|
412
|
+
* 렌더링하고 싶은 약관 UI의 `variantKey`입니다. 상점관리자의 결제위젯 어드민에서 확인할 수 있어요.
|
|
410
413
|
*/
|
|
411
414
|
variantKey?: string;
|
|
412
415
|
}) => Promise<WidgetAgreementWidget>;
|
|
@@ -432,6 +435,7 @@ type RenderAgreement = (params: {
|
|
|
432
435
|
* @throws {@link PublicError.Widgets.IncorrectFailUrlFormatError} failUrl이 유효하지 않은 경우
|
|
433
436
|
* @throws {@link PublicError.Widgets.PaymentRequestFailError} 결제 요청에 실패한 경우
|
|
434
437
|
* @throws {@link PublicError.Widgets.NotSupportedPromiseError} promise 방식을 지원하지 않는 환경인 경우
|
|
438
|
+
* @throws {@link PublicError.Widgets.CustomPaymentMethodUnableToPayError} 커스텀 결제수단이 선택된 상태에서 결제요청을 한 경우
|
|
435
439
|
* @throws {@link PublicError.Widgets.InvalidMethodTransactionError} 이미 다른 명령을 수행 중인 경우
|
|
436
440
|
* @throws {@link PublicError.Widgets.InvalidParametersError} 파라미터가 올바르지 않은 경우
|
|
437
441
|
* @throws {@link PublicError.Widgets.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
@@ -458,9 +462,9 @@ type RequestPaymentWithPromise$1 = (paymentRequest: WidgetPaymentRequest) => Pro
|
|
|
458
462
|
/**
|
|
459
463
|
* @docsAlias Redirect 방식
|
|
460
464
|
*
|
|
461
|
-
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
465
|
+
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 메서드 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
462
466
|
* ```plain theme="grey" copyable="false"
|
|
463
|
-
* {successUrl}?amount={AMOUNT}&orderId={ORDER_ID}&paymentKey={PAYMENT_KEY}
|
|
467
|
+
* {successUrl}?paymentType={PAYMENT_TYPE}&amount={AMOUNT}&orderId={ORDER_ID}&paymentKey={PAYMENT_KEY}
|
|
464
468
|
* ```
|
|
465
469
|
* 결제 요청이 실패하면 파라미터로 설정한 `failUrl`로 이동해요. 쿼리 파라미터로 에러 코드와 메시지를 확인하세요.
|
|
466
470
|
* ```plain theme="grey" copyable="false"
|
|
@@ -488,7 +492,7 @@ type RequestPaymentWithRedirection$1 = (paymentRequest: WithRedirection<WidgetPa
|
|
|
488
492
|
/**
|
|
489
493
|
* 결제 금액을 변경합니다
|
|
490
494
|
*
|
|
491
|
-
* @param {Amount} amount
|
|
495
|
+
* @param {Amount} amount 결제 금액 정보입니다.
|
|
492
496
|
*
|
|
493
497
|
* @example
|
|
494
498
|
* ```javascript
|
|
@@ -526,6 +530,9 @@ interface TossPaymentsWidgets {
|
|
|
526
530
|
}
|
|
527
531
|
|
|
528
532
|
interface BrandpayAmount extends Amount {
|
|
533
|
+
/**
|
|
534
|
+
* 결제 통화입니다. 브랜드페이는 `KRW` 결제만 지원합니다.
|
|
535
|
+
*/
|
|
529
536
|
currency: 'KRW';
|
|
530
537
|
}
|
|
531
538
|
|
|
@@ -565,6 +572,9 @@ interface BrandpayRequestPaymentResult {
|
|
|
565
572
|
* 주문번호입니다. 결제를 요청할 때 호출한 `requestPayment()` 메서드로 넘긴 `orderId` 값과 같은지 확인하세요.
|
|
566
573
|
*/
|
|
567
574
|
orderId: string;
|
|
575
|
+
/**
|
|
576
|
+
* 결제 금액 정보입니다. `requestPayment()` 메서드로 넘긴 `amount` 값과 같은지 확인하세요.
|
|
577
|
+
*/
|
|
568
578
|
amount: BrandpayAmount;
|
|
569
579
|
}
|
|
570
580
|
|
|
@@ -588,7 +598,7 @@ interface BrandpayRequestPaymentResult {
|
|
|
588
598
|
type RequestPayment$1 = RequestPaymentWithRedirection & RequestPaymentWithPromise;
|
|
589
599
|
/**
|
|
590
600
|
* @docsAlias Redirect 방식
|
|
591
|
-
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [브랜드페이 결제 승인 API](/reference/brandpay#결제-승인)를 호출해서 결제를 완료하세요.
|
|
601
|
+
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 메서드 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [브랜드페이 결제 승인 API](/reference/brandpay#결제-승인)를 호출해서 결제를 완료하세요.
|
|
592
602
|
* ```plain theme="grey" copyable="false"
|
|
593
603
|
* {successUrl}?amount={AMOUNT}&orderId={ORDER_ID}&paymentKey={PAYMENT_KEY}
|
|
594
604
|
* ```
|
|
@@ -799,7 +809,8 @@ interface PaymentRequest {
|
|
|
799
809
|
taxFreeAmount?: number;
|
|
800
810
|
/**
|
|
801
811
|
* 결제창이 열리는 프레임입니다.
|
|
802
|
-
* `iframe` 또는 현재 브라우저 화면(`self`)에서
|
|
812
|
+
* `iframe` 또는 현재 브라우저 화면(`self`)에서 결제창을 열 수 있어요. 기본 값은 `iframe`입니다.
|
|
813
|
+
* 모바일 웹에서는 `windowTarget` 값이 작동하지 않고 화면이 이동합니다.
|
|
803
814
|
*/
|
|
804
815
|
windowTarget?: 'iframe' | 'self';
|
|
805
816
|
}
|
|
@@ -840,19 +851,19 @@ interface CardPaymentRequest extends PaymentRequest {
|
|
|
840
851
|
*/
|
|
841
852
|
easyPay?: string;
|
|
842
853
|
/**
|
|
843
|
-
*
|
|
854
|
+
* 신용카드 결제에 적용되는 할부 개월 수입니다.
|
|
844
855
|
* 예를 들어, `6`으로 설정하면 할부 개월 수가 6개월로 고정돼요. 자체창에서는 구매자가 할부 개월 수를 볼 수 없으니 사전에 충분히 안내를 해주세요.
|
|
845
|
-
* 0(일시불), 2~12 값으로 설정할 수 있고 `maxCardInstallmentPlan` 파라미터와 함께 사용할 수 없어요.
|
|
856
|
+
* 0(일시불), 2~12 값으로 설정할 수 있고 `maxCardInstallmentPlan` 파라미터와 함께 사용할 수 없어요. 카드사 별로 할부결제가 가능한 [최소 금액](https://pgweb.tosspayments.com/tosspayments/MainPopUp.do)을 확인하세요.
|
|
846
857
|
*/
|
|
847
858
|
cardInstallmentPlan?: number;
|
|
848
859
|
/**
|
|
849
|
-
*
|
|
850
|
-
* 예를 들어, `6`으로 설정하면 구매자는 일시불부터 6개월 할부를 선택할 수 있어요. 0(일시불), 2~12 값으로 설정할 수 있고 `cardInstallmentPlan` 파라미터와 함께 사용할 수 없어요.
|
|
860
|
+
* 신용카드 결제에 적용할 수 있는 최대 할부 개월 수입니다.
|
|
861
|
+
* 예를 들어, `6`으로 설정하면 구매자는 일시불부터 6개월 할부를 선택할 수 있어요. 0(일시불), 2~12 값으로 설정할 수 있고 `cardInstallmentPlan` 파라미터와 함께 사용할 수 없어요. 카드사 별로 할부결제가 가능한 [최소 금액](https://pgweb.tosspayments.com/tosspayments/MainPopUp.do)을 확인하세요.
|
|
851
862
|
*/
|
|
852
863
|
maxCardInstallmentPlan?: number;
|
|
853
864
|
/**
|
|
854
|
-
*
|
|
855
|
-
* 구매자가 선택한 카드, 할부 개월 수가 배열에 등록한 정보와 같다면 무이자가 할부가 자동으로 적용돼요.
|
|
865
|
+
* 신용카드 결제에 적용할 수 있는 **상점 부담 무이자** 할부 정보입니다.
|
|
866
|
+
* 구매자가 선택한 카드, 할부 개월 수가 배열에 등록한 정보와 같다면 무이자가 할부가 자동으로 적용돼요. 카드사 별로 할부결제가 가능한 [최소 금액](https://pgweb.tosspayments.com/tosspayments/MainPopUp.do)을 확인하세요.
|
|
856
867
|
*/
|
|
857
868
|
freeInstallmentPlans?: Array<{
|
|
858
869
|
/**
|
|
@@ -871,7 +882,7 @@ interface CardPaymentRequest extends PaymentRequest {
|
|
|
871
882
|
*/
|
|
872
883
|
useCardPoint?: boolean;
|
|
873
884
|
/**
|
|
874
|
-
* 앱카드 단독 사용 여부입니다.
|
|
885
|
+
* 앱카드 단독 사용 여부입니다. `true`로 설정하면 카드사의 앱카드만 열려요. 국민, 농협, 롯데, 삼성, 신한, 우리, 현대 카드 결제에 적용할 수 있어요.
|
|
875
886
|
*/
|
|
876
887
|
useAppCardOnly?: boolean;
|
|
877
888
|
/**
|
|
@@ -879,12 +890,12 @@ interface CardPaymentRequest extends PaymentRequest {
|
|
|
879
890
|
*/
|
|
880
891
|
discountCode?: string;
|
|
881
892
|
/**
|
|
882
|
-
* 시간으로 설정하는
|
|
893
|
+
* 시간으로 설정하는 결제 기한입니다. 설정할 수 있는 최대 값은 2160시간(90일)입니다.
|
|
883
894
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `24`로 설정하면, 결제 요청 시점으로부터 24시간 동안 결제할 수 있어요.
|
|
884
895
|
*/
|
|
885
896
|
validHours?: number;
|
|
886
897
|
/**
|
|
887
|
-
*
|
|
898
|
+
* 특정 날짜로 설정하는 결제 기한입니다. `yyyy-MM-dd'T'HH:mm:ss` ISO 8601 형식입니다.
|
|
888
899
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `2025-01-01T00:00:00`으로 설정하면, 2024년 12월 31일 23:59까지 결제할 수 있어요.
|
|
889
900
|
*/
|
|
890
901
|
dueDate?: string;
|
|
@@ -959,12 +970,12 @@ interface VirtualAccountPaymentRequest extends PaymentRequest {
|
|
|
959
970
|
quantity?: number;
|
|
960
971
|
}>;
|
|
961
972
|
/**
|
|
962
|
-
* 시간으로 설정하는
|
|
973
|
+
* 시간으로 설정하는 결제 기한입니다. 설정할 수 있는 최대 값은 2160시간(90일)입니다.
|
|
963
974
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `24`로 설정하면, 결제 요청 시점으로부터 24시간 동안 결제할 수 있어요.
|
|
964
975
|
*/
|
|
965
976
|
validHours?: number;
|
|
966
977
|
/**
|
|
967
|
-
*
|
|
978
|
+
* 특정 날짜로 설정하는 결제 기한입니다. `yyyy-MM-dd'T'HH:mm:ss` ISO 8601 형식입니다.
|
|
968
979
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `2025-01-01T00:00:00`으로 설정하면, 2024년 12월 31일 23:59까지 결제할 수 있어요.
|
|
969
980
|
*/
|
|
970
981
|
dueDate?: string;
|
|
@@ -1025,12 +1036,12 @@ interface TransferPaymentRequest extends PaymentRequest {
|
|
|
1025
1036
|
quantity?: number;
|
|
1026
1037
|
}>;
|
|
1027
1038
|
/**
|
|
1028
|
-
* 시간으로 설정하는
|
|
1039
|
+
* 시간으로 설정하는 결제 기한입니다. 설정할 수 있는 최대 값은 2160시간(90일)입니다.
|
|
1029
1040
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `24`로 설정하면, 결제 요청 시점으로부터 24시간 동안 결제할 수 있어요.
|
|
1030
1041
|
*/
|
|
1031
1042
|
validHours?: number;
|
|
1032
1043
|
/**
|
|
1033
|
-
*
|
|
1044
|
+
* 특정 날짜로 설정하는 결제 기한입니다. `yyyy-MM-dd'T'HH:mm:ss` ISO 8601 형식입니다.
|
|
1034
1045
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `2025-01-01T00:00:00`으로 설정하면, 2024년 12월 31일 23:59까지 결제할 수 있어요.
|
|
1035
1046
|
*/
|
|
1036
1047
|
dueDate?: string;
|
|
@@ -1065,7 +1076,7 @@ interface ForeignEasyPayPaymentRequest extends PaymentRequest {
|
|
|
1065
1076
|
*/
|
|
1066
1077
|
provider: string;
|
|
1067
1078
|
/**
|
|
1068
|
-
* 구매자가
|
|
1079
|
+
* 구매자가 위치한 국가입니다. ISO-3166의 두 자리 국가 코드를 입력하세요.
|
|
1069
1080
|
*/
|
|
1070
1081
|
country: string;
|
|
1071
1082
|
/**
|
|
@@ -1116,7 +1127,7 @@ interface ForeignEasyPayPaymentRequest extends PaymentRequest {
|
|
|
1116
1127
|
*/
|
|
1117
1128
|
line1?: string;
|
|
1118
1129
|
/**
|
|
1119
|
-
* 상세 주소입니다. 번지 및
|
|
1130
|
+
* 상세 주소입니다. 번지 및 동호수 정보를 입력하세요.
|
|
1120
1131
|
*/
|
|
1121
1132
|
line2?: string;
|
|
1122
1133
|
/**
|
|
@@ -1169,7 +1180,7 @@ interface RequestPaymentResult {
|
|
|
1169
1180
|
|
|
1170
1181
|
interface BillingAuthRequest {
|
|
1171
1182
|
/**
|
|
1172
|
-
* 자동결제(빌링)에 등록할 결제수단입니다.
|
|
1183
|
+
* 자동결제(빌링)에 등록할 결제수단입니다. 토스페이먼츠 자동결제는 현재 신용·체크카드만 지원해요.
|
|
1173
1184
|
*
|
|
1174
1185
|
*/
|
|
1175
1186
|
method: 'CARD';
|
|
@@ -1194,8 +1205,9 @@ interface BillingAuthRequest {
|
|
|
1194
1205
|
*/
|
|
1195
1206
|
customerEmail?: string;
|
|
1196
1207
|
/**
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1208
|
+
* 결제창이 열리는 프레임입니다.
|
|
1209
|
+
* `iframe` 또는 현재 브라우저 화면(`self`)에서 등록창을 열 수 있어요. 기본 값은 `iframe`입니다.
|
|
1210
|
+
* 모바일 웹에서는 `windowTarget` 값이 작동하지 않고 화면이 이동합니다.
|
|
1199
1211
|
*
|
|
1200
1212
|
* @default 'iframe'
|
|
1201
1213
|
*/
|
|
@@ -1204,18 +1216,18 @@ interface BillingAuthRequest {
|
|
|
1204
1216
|
|
|
1205
1217
|
/**
|
|
1206
1218
|
*
|
|
1207
|
-
* @throws {@link PublicError.
|
|
1208
|
-
* @throws {@link PublicError.
|
|
1209
|
-
* @throws {@link PublicError.
|
|
1210
|
-
* @throws {@link PublicError.
|
|
1211
|
-
* @throws {@link PublicError.
|
|
1212
|
-
* @throws {@link PublicError.
|
|
1213
|
-
* @throws {@link PublicError.
|
|
1214
|
-
* @throws {@link PublicError.
|
|
1215
|
-
* @throws {@link PublicError.
|
|
1216
|
-
* @throws {@link PublicError.
|
|
1217
|
-
* @throws {@link PublicError.
|
|
1218
|
-
* @throws {@link PublicError.
|
|
1219
|
+
* @throws {@link PublicError.Payment.UserCancelError} 사용자가 결제창을 닫은 경우
|
|
1220
|
+
* @throws {@link PublicError.Payment.InvalidAmountValueError} 결제 금액이 유효하지 않은 경우
|
|
1221
|
+
* @throws {@link PublicError.Payment.InvalidAmountCurrencyError} 결제 금액의 통화가 유효하지 않은 경우
|
|
1222
|
+
* @throws {@link PublicError.Payment.BelowZeroAmountError} 결제 금액이 0 미만인 경우
|
|
1223
|
+
* @throws {@link PublicError.Payment.NotSupportedPromiseError} promise 방식을 지원하지 않는 환경인 경우
|
|
1224
|
+
* @throws {@link PublicError.Payment.NotSupportedMethodError} 가맹점에서 정의되지 않은 method를 넘겨준 경우
|
|
1225
|
+
* @throws {@link PublicError.Payment.IncorrectSuccessUrlFormatError} 가맹점에서 유효하지 않은 successUrl을 넘겨준 경우
|
|
1226
|
+
* @throws {@link PublicError.Payment.IncorrectFailUrlFormatError} 가맹점에서 유효하지 않은 failUrl을 넘겨준 경우
|
|
1227
|
+
* @throws {@link PublicError.Payment.PaymentRequestFailError} 결제에 실패한 경우
|
|
1228
|
+
* @throws {@link PublicError.Payment.InvalidMethodTransactionError} 이미 다른 명령을 수행 중인 경우
|
|
1229
|
+
* @throws {@link PublicError.Payment.InvalidParametersError} 파라미터가 올바르지 않은 경우
|
|
1230
|
+
* @throws {@link PublicError.Payment.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
1219
1231
|
*/
|
|
1220
1232
|
type RequestPayment = RequestCardPaymentWithRedirection & RequestCardPaymentWithPromise & RequestVirtualAccountPaymentWithRedirection & RequestVirtualAccountPaymentWithPromise & RequestTransferPaymentWithRedirection & RequestTransferPaymentWithPromise & RequestMobilePhonePaymentWithRedirection & RequestMobilePhonePaymentWithPromise & RequestGiftCertificatePaymentWithRedirection & RequestGiftCertificatePaymentWithPromise & RequestForeignEasyPayPaymentWithRedirection & RequestForeignEasyPayPaymentWithPromise;
|
|
1221
1233
|
/**
|
|
@@ -1249,7 +1261,7 @@ type RequestPayment = RequestCardPaymentWithRedirection & RequestCardPaymentWith
|
|
|
1249
1261
|
type RequestCardPaymentWithPromise = (paymentRequest: CardPaymentRequest) => Promise<RequestPaymentResult>;
|
|
1250
1262
|
/**
|
|
1251
1263
|
* @docsAlias 카드(Redirect 방식)
|
|
1252
|
-
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1264
|
+
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 메서드 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1253
1265
|
* ```plain theme="grey" copyable="false"
|
|
1254
1266
|
* {successUrl}?amount={AMOUNT}&orderId={ORDER_ID}&paymentKey={PAYMENT_KEY}
|
|
1255
1267
|
* ```
|
|
@@ -1318,7 +1330,7 @@ type RequestCardPaymentWithRedirection = (paymentRequest: WithRedirection<CardPa
|
|
|
1318
1330
|
type RequestVirtualAccountPaymentWithPromise = (paymentRequest: VirtualAccountPaymentRequest) => Promise<RequestPaymentResult>;
|
|
1319
1331
|
/**
|
|
1320
1332
|
* @docsAlias 가상계좌(Redirect 방식)
|
|
1321
|
-
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1333
|
+
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 메서드 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1322
1334
|
* ```plain theme="grey" copyable="false"
|
|
1323
1335
|
* {successUrl}?amount={AMOUNT}&orderId={ORDER_ID}&paymentKey={PAYMENT_KEY}
|
|
1324
1336
|
* ```
|
|
@@ -1386,7 +1398,7 @@ type RequestVirtualAccountPaymentWithRedirection = (paymentRequest: WithRedirect
|
|
|
1386
1398
|
type RequestTransferPaymentWithPromise = (paymentRequest: TransferPaymentRequest) => Promise<RequestPaymentResult>;
|
|
1387
1399
|
/**
|
|
1388
1400
|
* @docsAlias 계좌이체(Redirect 방식)
|
|
1389
|
-
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1401
|
+
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 메서드 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1390
1402
|
* ```plain theme="grey" copyable="false"
|
|
1391
1403
|
* {successUrl}?amount={AMOUNT}&orderId={ORDER_ID}&paymentKey={PAYMENT_KEY}
|
|
1392
1404
|
* ```
|
|
@@ -1447,7 +1459,7 @@ type RequestTransferPaymentWithRedirection = (paymentRequest: WithRedirection<Tr
|
|
|
1447
1459
|
type RequestMobilePhonePaymentWithPromise = (paymentRequest: MobilePhonePaymentRequest) => Promise<RequestPaymentResult>;
|
|
1448
1460
|
/**
|
|
1449
1461
|
* @docsAlias 휴대폰 결제(Redirect 방식)
|
|
1450
|
-
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1462
|
+
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 메서드 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1451
1463
|
* ```plain theme="grey" copyable="false"
|
|
1452
1464
|
* {successUrl}?amount={AMOUNT}&orderId={ORDER_ID}&paymentKey={PAYMENT_KEY}
|
|
1453
1465
|
* ```
|
|
@@ -1502,7 +1514,7 @@ type RequestMobilePhonePaymentWithRedirection = (paymentRequest: WithRedirection
|
|
|
1502
1514
|
type RequestGiftCertificatePaymentWithPromise = (paymentRequest: GiftCertificatePaymentRequest) => Promise<RequestPaymentResult>;
|
|
1503
1515
|
/**
|
|
1504
1516
|
* @docsAlias 상품권(Redirect 방식)
|
|
1505
|
-
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1517
|
+
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 메서드 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1506
1518
|
* ```plain theme="grey" copyable="false"
|
|
1507
1519
|
* {successUrl}?amount={AMOUNT}&orderId={ORDER_ID}&paymentKey={PAYMENT_KEY}
|
|
1508
1520
|
* ```
|
|
@@ -1561,7 +1573,7 @@ type RequestGiftCertificatePaymentWithRedirection = (paymentRequest: WithRedirec
|
|
|
1561
1573
|
type RequestForeignEasyPayPaymentWithPromise = (paymentRequest: ForeignEasyPayPaymentRequest) => Promise<RequestPaymentResult>;
|
|
1562
1574
|
/**
|
|
1563
1575
|
* @docsAlias 해외 간편결제(Redirect 방식)
|
|
1564
|
-
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1576
|
+
* @returns 결제 요청이 성공하면 파라미터로 설정한 `successUrl`로 이동해요. 쿼리 파라미터의 `amount` 값이 메서드 파라미터로 설정한 `amount`와 같은지 반드시 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해서 결제를 완료하세요.
|
|
1565
1577
|
* ```plain theme="grey" copyable="false"
|
|
1566
1578
|
* {successUrl}?amount={AMOUNT}&orderId={ORDER_ID}&paymentKey={PAYMENT_KEY}
|
|
1567
1579
|
* ```
|
|
@@ -1618,17 +1630,17 @@ type RequestForeignEasyPayPaymentWithRedirection = (paymentRequest: WithRedirect
|
|
|
1618
1630
|
* });
|
|
1619
1631
|
* ```
|
|
1620
1632
|
*
|
|
1621
|
-
* @throws {@link PublicError.
|
|
1622
|
-
* @throws {@link PublicError.
|
|
1623
|
-
* @throws {@link PublicError.
|
|
1624
|
-
* @throws {@link PublicError.
|
|
1625
|
-
* @throws {@link PublicError.
|
|
1626
|
-
* @throws {@link PublicError.
|
|
1627
|
-
* @throws {@link PublicError.
|
|
1633
|
+
* @throws {@link PublicError.Payment.UserCancelError} 사용자가 자동결제 인증창을 닫은 경우
|
|
1634
|
+
* @throws {@link PublicError.Payment.NotSupportedMethodError} 가맹점에서 정의되지 않은 method를 넘겨준 경우
|
|
1635
|
+
* @throws {@link PublicError.Payment.IncorrectSuccessUrlFormatError} 가맹점에서 유효하지 않은 successUrl을 넘겨준 경우
|
|
1636
|
+
* @throws {@link PublicError.Payment.IncorrectFailUrlFormatError} 가맹점에서 유효하지 않은 failUrl을 넘겨준 경우
|
|
1637
|
+
* @throws {@link PublicError.Payment.InvalidMethodTransactionError} 이미 다른 명령을 수행 중인 경우
|
|
1638
|
+
* @throws {@link PublicError.Payment.InvalidParametersError} 파라미터가 올바르지 않은 경우
|
|
1639
|
+
* @throws {@link PublicError.Payment.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
1628
1640
|
*/
|
|
1629
1641
|
type RequestBillingAuth = (billingAuthRequest: BillingAuthRequest) => Promise<void>;
|
|
1630
1642
|
|
|
1631
|
-
interface
|
|
1643
|
+
interface TossPaymentsPayment {
|
|
1632
1644
|
/**
|
|
1633
1645
|
* 결제창을 띄웁니다. [자세히 >](#paymentrequestpayment)
|
|
1634
1646
|
*/
|
|
@@ -1638,7 +1650,7 @@ interface TossPaymentsPaymentGateway {
|
|
|
1638
1650
|
*/
|
|
1639
1651
|
requestBillingAuth: RequestBillingAuth;
|
|
1640
1652
|
}
|
|
1641
|
-
interface
|
|
1653
|
+
interface TossPaymentsSDK {
|
|
1642
1654
|
/**
|
|
1643
1655
|
*
|
|
1644
1656
|
* 결제위젯을 초기화합니다. [자세히 >](#결제위젯)
|
|
@@ -1652,13 +1664,18 @@ interface TossPaymentsInstance {
|
|
|
1652
1664
|
* ```javascript
|
|
1653
1665
|
* // 회원 결제
|
|
1654
1666
|
* const widgets = tossPayments.widgets({ customerKey });
|
|
1667
|
+
*
|
|
1655
1668
|
* // 비회원 결제
|
|
1656
|
-
* //
|
|
1669
|
+
* // 스크립트 태그 연동방식
|
|
1670
|
+
* const widgets = tossPayments.widgets({ customerKey: TossPayments.ANONYMOUS });
|
|
1671
|
+
* // 모듈 임포트 연동방식
|
|
1672
|
+
* import { ANONYMOUS } from "@tosspayments/tosspayments-sdk";
|
|
1673
|
+
* const widgets = tossPayments.widgets({ customerKey: ANONYMOUS });
|
|
1657
1674
|
* ```
|
|
1658
|
-
* @param {
|
|
1675
|
+
* @param {WidgetInitParams} params 결제위젯 초기화 정보입니다.
|
|
1659
1676
|
*
|
|
1660
1677
|
*/
|
|
1661
|
-
widgets: (params:
|
|
1678
|
+
widgets: (params: WidgetInitParams) => TossPaymentsWidgets;
|
|
1662
1679
|
/**
|
|
1663
1680
|
* 브랜드페이를 초기화합니다. [자세히 >](#브랜드페이)
|
|
1664
1681
|
*
|
|
@@ -1674,10 +1691,10 @@ interface TossPaymentsInstance {
|
|
|
1674
1691
|
* });
|
|
1675
1692
|
* ```
|
|
1676
1693
|
* @returns 아래 메서드를 호출할 수 있는 브랜드페이 객체를 반환합니다.
|
|
1677
|
-
* @param {
|
|
1694
|
+
* @param {BrandpayInitParams} params 브랜드페이 초기화 정보입니다.
|
|
1678
1695
|
*
|
|
1679
1696
|
*/
|
|
1680
|
-
brandpay: (params:
|
|
1697
|
+
brandpay: (params: BrandpayInitParams) => TossPaymentsBrandpay;
|
|
1681
1698
|
/**
|
|
1682
1699
|
* 결제창을 초기화합니다. [자세히 >](#결제창)
|
|
1683
1700
|
*
|
|
@@ -1687,23 +1704,25 @@ interface TossPaymentsInstance {
|
|
|
1687
1704
|
* @throw {@link PublicError.Brandpay.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
1688
1705
|
* @example
|
|
1689
1706
|
* ```javascript
|
|
1690
|
-
* // 회원 결제
|
|
1691
1707
|
* const payment = tossPayments.payment({ customerKey });
|
|
1692
|
-
*
|
|
1693
|
-
* //비회원 결제
|
|
1694
|
-
* // const payment = tossPayments.payment({ customerKey: TossPayments.ANONYMOUS });
|
|
1695
1708
|
* ```
|
|
1709
|
+
* @param {PaymentInitParams} params 결제창 초기화 정보입니다.
|
|
1696
1710
|
* @returns 아래 메서드를 호출할 수 있는 결제창 객체를 반환합니다.
|
|
1697
|
-
* @param {PaymentGatewaySDKInitParams} 결제창 초기화 정보입니다.
|
|
1698
1711
|
*
|
|
1699
1712
|
*/
|
|
1700
|
-
payment: (params:
|
|
1713
|
+
payment: (params: PaymentInitParams) => TossPaymentsPayment;
|
|
1701
1714
|
}
|
|
1702
1715
|
/**
|
|
1703
1716
|
* @example
|
|
1704
1717
|
* ```javascript
|
|
1718
|
+
* // 스크립트 태그 연동방식
|
|
1705
1719
|
* const tossPayments = TossPayments("<WidgetClientKey />");
|
|
1720
|
+
*
|
|
1721
|
+
* // 모듈 임포트 연동방식
|
|
1722
|
+
* import { loadTossPayments } from "@tosspayments/tosspayments-sdk"
|
|
1723
|
+
* const tossPayments = await loadTossPayments("<WidgetClientKey />");
|
|
1706
1724
|
* ```
|
|
1725
|
+
*
|
|
1707
1726
|
* @param {string} clientKey 토스페이먼츠 발급하는 클라이언트 키입니다. 개발자센터의 [API 키 메뉴](https://developers.tosspayments.com/my/api-keys)에서 확인할 수 있어요.
|
|
1708
1727
|
*
|
|
1709
1728
|
* 결제위젯을 연동한다면 [결제위젯 연동 키](/reference/using-api/api-keys#결제위젯-연동-키)를 사용하세요. 결제창, 자동결제(빌링)을 연동한다면 [API 개별 연동 키](/reference/using-api/api-keys#api-개별-연동-키)를 사용하세요.
|
|
@@ -1711,8 +1730,8 @@ interface TossPaymentsInstance {
|
|
|
1711
1730
|
* @returns
|
|
1712
1731
|
* 아래 메서드를 호출할 수 있는 토스페이먼츠 객체를 반환합니다.
|
|
1713
1732
|
*/
|
|
1714
|
-
type TossPayments = (clientKey: string) =>
|
|
1715
|
-
interface
|
|
1733
|
+
type TossPayments = (clientKey: string) => TossPaymentsSDK;
|
|
1734
|
+
interface BrandpayInitParams {
|
|
1716
1735
|
/**
|
|
1717
1736
|
* 구매자를 식별하는 고유 아이디입니다.
|
|
1718
1737
|
* 이메일・전화번호나 자동 증가하는 숫자와 같이 유추가 가능한 값은 안전하지 않아요. UUID와 같이 충분히 무작위적인 고유 값으로 생성해주세요.
|
|
@@ -1722,14 +1741,14 @@ interface BrandpaySDKInitParams {
|
|
|
1722
1741
|
/**
|
|
1723
1742
|
* 브랜드페이 결제 과정에서 [Access Token 발급](/guides/v2/brandpay/auth)을 위해 필요한 URL입니다. Access Token은 브랜드페이 고객을 식별하고 고객의 결제 권한을 증명합니다. 값을 넣지 않으면 개발자센터의 브랜드페이 메뉴에 최초로 등록한 리다이렉트 URL이 기본값으로 들어갑니다.
|
|
1724
1743
|
*
|
|
1725
|
-
* \* 브랜드페이 메뉴에 두 개 이상의 리다이렉트 URL을 등록한 상점은 각 도메인에 맞는 redirectUrl 값을 필수로 추가하세요.
|
|
1744
|
+
* \* 브랜드페이 메뉴에 두 개 이상의 리다이렉트 URL을 등록한 상점은 각 도메인에 맞는 `redirectUrl` 값을 필수로 추가하세요.
|
|
1726
1745
|
*/
|
|
1727
1746
|
redirectUrl?: string;
|
|
1728
1747
|
}
|
|
1729
1748
|
/**
|
|
1730
1749
|
* @returns 아래 메서드를 호출할 수 있는 토스페이먼츠 객체를 반환합니다.
|
|
1731
1750
|
*/
|
|
1732
|
-
interface
|
|
1751
|
+
interface WidgetInitParams {
|
|
1733
1752
|
/**
|
|
1734
1753
|
* 구매자를 식별하는 고유 아이디입니다.
|
|
1735
1754
|
* 이메일・전화번호나 자동 증가하는 숫자와 같이 유추가 가능한 값은 안전하지 않아요. UUID와 같이 충분히 무작위적인 고유 값으로 생성해주세요.
|
|
@@ -1743,12 +1762,12 @@ interface WidgetSDKInitParams {
|
|
|
1743
1762
|
/**
|
|
1744
1763
|
* 브랜드페이 결제 과정에서 [Access Token 발급](/guides/v2/brandpay/auth)을 위해 필요한 URL입니다. Access Token은 브랜드페이 고객을 식별하고 고객의 결제 권한을 증명합니다. 값을 넣지 않으면 개발자센터의 브랜드페이 메뉴에 최초로 등록한 리다이렉트 URL이 기본값으로 들어갑니다.
|
|
1745
1764
|
*
|
|
1746
|
-
* \* 브랜드페이 메뉴에 두 개 이상의 리다이렉트 URL을 등록한 상점은 각 도메인에 맞는 redirectUrl 값을 필수로 추가하세요.
|
|
1765
|
+
* \* 브랜드페이 메뉴에 두 개 이상의 리다이렉트 URL을 등록한 상점은 각 도메인에 맞는 `redirectUrl` 값을 필수로 추가하세요.
|
|
1747
1766
|
*/
|
|
1748
1767
|
redirectUrl?: string;
|
|
1749
1768
|
};
|
|
1750
1769
|
}
|
|
1751
|
-
interface
|
|
1770
|
+
interface PaymentInitParams {
|
|
1752
1771
|
/**
|
|
1753
1772
|
* 구매자를 식별하는 고유 아이디입니다.
|
|
1754
1773
|
* 이메일・전화번호나 자동 증가하는 숫자와 같이 유추가 가능한 값은 안전하지 않아요. UUID와 같이 충분히 무작위적인 고유 값으로 생성해주세요.
|
|
@@ -1760,8 +1779,8 @@ interface PaymentGatewaySDKInitParams {
|
|
|
1760
1779
|
type TosspaymentsParams = Parameters<TossPayments>;
|
|
1761
1780
|
declare function loadTossPayments(clientKey: TosspaymentsParams[0], loadOptions?: {
|
|
1762
1781
|
src?: string;
|
|
1763
|
-
}): Promise<
|
|
1782
|
+
}): Promise<TossPaymentsSDK>;
|
|
1764
1783
|
|
|
1765
1784
|
declare const ANONYMOUS = "@@ANONYMOUS";
|
|
1766
1785
|
|
|
1767
|
-
export { ANONYMOUS, clearTossPayments, loadTossPayments };
|
|
1786
|
+
export { ANONYMOUS, type TossPaymentsBrandpay, type TossPaymentsPayment, type TossPaymentsSDK, type TossPaymentsWidgets, type WidgetAgreementStatus, type WidgetAgreementWidget, type WidgetPaymentMethodWidget, type WidgetSelectedPaymentMethod, clearTossPayments, loadTossPayments };
|