@tosspayments/tosspayments-sdk 2.2.1 → 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 +22 -0
- package/package.json +3 -3
- package/types/index.d.ts +57 -56
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.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
|
+
|
|
6
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)
|
|
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.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": "2.0.
|
|
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
|
/**
|
|
@@ -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
|
*
|
|
@@ -268,7 +268,7 @@ interface WidgetPaymentRequest {
|
|
|
268
268
|
*/
|
|
269
269
|
line1?: string;
|
|
270
270
|
/**
|
|
271
|
-
* 상세 주소입니다. 번지 및
|
|
271
|
+
* 상세 주소입니다. 번지 및 동호수 정보를 입력하세요.
|
|
272
272
|
*/
|
|
273
273
|
line2?: string;
|
|
274
274
|
/**
|
|
@@ -409,7 +409,7 @@ type RenderAgreement = (params: {
|
|
|
409
409
|
*/
|
|
410
410
|
selector: string;
|
|
411
411
|
/**
|
|
412
|
-
* 렌더링하고 싶은
|
|
412
|
+
* 렌더링하고 싶은 약관 UI의 `variantKey`입니다. 상점관리자의 결제위젯 어드민에서 확인할 수 있어요.
|
|
413
413
|
*/
|
|
414
414
|
variantKey?: string;
|
|
415
415
|
}) => Promise<WidgetAgreementWidget>;
|
|
@@ -435,6 +435,7 @@ type RenderAgreement = (params: {
|
|
|
435
435
|
* @throws {@link PublicError.Widgets.IncorrectFailUrlFormatError} failUrl이 유효하지 않은 경우
|
|
436
436
|
* @throws {@link PublicError.Widgets.PaymentRequestFailError} 결제 요청에 실패한 경우
|
|
437
437
|
* @throws {@link PublicError.Widgets.NotSupportedPromiseError} promise 방식을 지원하지 않는 환경인 경우
|
|
438
|
+
* @throws {@link PublicError.Widgets.CustomPaymentMethodUnableToPayError} 커스텀 결제수단이 선택된 상태에서 결제요청을 한 경우
|
|
438
439
|
* @throws {@link PublicError.Widgets.InvalidMethodTransactionError} 이미 다른 명령을 수행 중인 경우
|
|
439
440
|
* @throws {@link PublicError.Widgets.InvalidParametersError} 파라미터가 올바르지 않은 경우
|
|
440
441
|
* @throws {@link PublicError.Widgets.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
@@ -491,7 +492,7 @@ type RequestPaymentWithRedirection$1 = (paymentRequest: WithRedirection<WidgetPa
|
|
|
491
492
|
/**
|
|
492
493
|
* 결제 금액을 변경합니다
|
|
493
494
|
*
|
|
494
|
-
* @param {Amount} amount
|
|
495
|
+
* @param {Amount} amount 결제 금액 정보입니다.
|
|
495
496
|
*
|
|
496
497
|
* @example
|
|
497
498
|
* ```javascript
|
|
@@ -850,19 +851,19 @@ interface CardPaymentRequest extends PaymentRequest {
|
|
|
850
851
|
*/
|
|
851
852
|
easyPay?: string;
|
|
852
853
|
/**
|
|
853
|
-
*
|
|
854
|
+
* 신용카드 결제에 적용되는 할부 개월 수입니다.
|
|
854
855
|
* 예를 들어, `6`으로 설정하면 할부 개월 수가 6개월로 고정돼요. 자체창에서는 구매자가 할부 개월 수를 볼 수 없으니 사전에 충분히 안내를 해주세요.
|
|
855
|
-
* 0(일시불), 2~12 값으로 설정할 수 있고 `maxCardInstallmentPlan` 파라미터와 함께 사용할 수 없어요.
|
|
856
|
+
* 0(일시불), 2~12 값으로 설정할 수 있고 `maxCardInstallmentPlan` 파라미터와 함께 사용할 수 없어요. 카드사 별로 할부결제가 가능한 [최소 금액](https://pgweb.tosspayments.com/tosspayments/MainPopUp.do)을 확인하세요.
|
|
856
857
|
*/
|
|
857
858
|
cardInstallmentPlan?: number;
|
|
858
859
|
/**
|
|
859
|
-
*
|
|
860
|
-
* 예를 들어, `6`으로 설정하면 구매자는 일시불부터 6개월 할부를 선택할 수 있어요. 0(일시불), 2~12 값으로 설정할 수 있고 `cardInstallmentPlan` 파라미터와 함께 사용할 수 없어요.
|
|
860
|
+
* 신용카드 결제에 적용할 수 있는 최대 할부 개월 수입니다.
|
|
861
|
+
* 예를 들어, `6`으로 설정하면 구매자는 일시불부터 6개월 할부를 선택할 수 있어요. 0(일시불), 2~12 값으로 설정할 수 있고 `cardInstallmentPlan` 파라미터와 함께 사용할 수 없어요. 카드사 별로 할부결제가 가능한 [최소 금액](https://pgweb.tosspayments.com/tosspayments/MainPopUp.do)을 확인하세요.
|
|
861
862
|
*/
|
|
862
863
|
maxCardInstallmentPlan?: number;
|
|
863
864
|
/**
|
|
864
|
-
*
|
|
865
|
-
* 구매자가 선택한 카드, 할부 개월 수가 배열에 등록한 정보와 같다면 무이자가 할부가 자동으로 적용돼요.
|
|
865
|
+
* 신용카드 결제에 적용할 수 있는 **상점 부담 무이자** 할부 정보입니다.
|
|
866
|
+
* 구매자가 선택한 카드, 할부 개월 수가 배열에 등록한 정보와 같다면 무이자가 할부가 자동으로 적용돼요. 카드사 별로 할부결제가 가능한 [최소 금액](https://pgweb.tosspayments.com/tosspayments/MainPopUp.do)을 확인하세요.
|
|
866
867
|
*/
|
|
867
868
|
freeInstallmentPlans?: Array<{
|
|
868
869
|
/**
|
|
@@ -881,7 +882,7 @@ interface CardPaymentRequest extends PaymentRequest {
|
|
|
881
882
|
*/
|
|
882
883
|
useCardPoint?: boolean;
|
|
883
884
|
/**
|
|
884
|
-
* 앱카드 단독 사용 여부입니다.
|
|
885
|
+
* 앱카드 단독 사용 여부입니다. `true`로 설정하면 카드사의 앱카드만 열려요. 국민, 농협, 롯데, 삼성, 신한, 우리, 현대 카드 결제에 적용할 수 있어요.
|
|
885
886
|
*/
|
|
886
887
|
useAppCardOnly?: boolean;
|
|
887
888
|
/**
|
|
@@ -889,12 +890,12 @@ interface CardPaymentRequest extends PaymentRequest {
|
|
|
889
890
|
*/
|
|
890
891
|
discountCode?: string;
|
|
891
892
|
/**
|
|
892
|
-
* 시간으로 설정하는
|
|
893
|
+
* 시간으로 설정하는 결제 기한입니다. 설정할 수 있는 최대 값은 2160시간(90일)입니다.
|
|
893
894
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `24`로 설정하면, 결제 요청 시점으로부터 24시간 동안 결제할 수 있어요.
|
|
894
895
|
*/
|
|
895
896
|
validHours?: number;
|
|
896
897
|
/**
|
|
897
|
-
*
|
|
898
|
+
* 특정 날짜로 설정하는 결제 기한입니다. `yyyy-MM-dd'T'HH:mm:ss` ISO 8601 형식입니다.
|
|
898
899
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `2025-01-01T00:00:00`으로 설정하면, 2024년 12월 31일 23:59까지 결제할 수 있어요.
|
|
899
900
|
*/
|
|
900
901
|
dueDate?: string;
|
|
@@ -969,12 +970,12 @@ interface VirtualAccountPaymentRequest extends PaymentRequest {
|
|
|
969
970
|
quantity?: number;
|
|
970
971
|
}>;
|
|
971
972
|
/**
|
|
972
|
-
* 시간으로 설정하는
|
|
973
|
+
* 시간으로 설정하는 결제 기한입니다. 설정할 수 있는 최대 값은 2160시간(90일)입니다.
|
|
973
974
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `24`로 설정하면, 결제 요청 시점으로부터 24시간 동안 결제할 수 있어요.
|
|
974
975
|
*/
|
|
975
976
|
validHours?: number;
|
|
976
977
|
/**
|
|
977
|
-
*
|
|
978
|
+
* 특정 날짜로 설정하는 결제 기한입니다. `yyyy-MM-dd'T'HH:mm:ss` ISO 8601 형식입니다.
|
|
978
979
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `2025-01-01T00:00:00`으로 설정하면, 2024년 12월 31일 23:59까지 결제할 수 있어요.
|
|
979
980
|
*/
|
|
980
981
|
dueDate?: string;
|
|
@@ -1035,12 +1036,12 @@ interface TransferPaymentRequest extends PaymentRequest {
|
|
|
1035
1036
|
quantity?: number;
|
|
1036
1037
|
}>;
|
|
1037
1038
|
/**
|
|
1038
|
-
* 시간으로 설정하는
|
|
1039
|
+
* 시간으로 설정하는 결제 기한입니다. 설정할 수 있는 최대 값은 2160시간(90일)입니다.
|
|
1039
1040
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `24`로 설정하면, 결제 요청 시점으로부터 24시간 동안 결제할 수 있어요.
|
|
1040
1041
|
*/
|
|
1041
1042
|
validHours?: number;
|
|
1042
1043
|
/**
|
|
1043
|
-
*
|
|
1044
|
+
* 특정 날짜로 설정하는 결제 기한입니다. `yyyy-MM-dd'T'HH:mm:ss` ISO 8601 형식입니다.
|
|
1044
1045
|
* 기한이 지나고 시도하는 결제는 실패해요. 예를 들어 `2025-01-01T00:00:00`으로 설정하면, 2024년 12월 31일 23:59까지 결제할 수 있어요.
|
|
1045
1046
|
*/
|
|
1046
1047
|
dueDate?: string;
|
|
@@ -1126,7 +1127,7 @@ interface ForeignEasyPayPaymentRequest extends PaymentRequest {
|
|
|
1126
1127
|
*/
|
|
1127
1128
|
line1?: string;
|
|
1128
1129
|
/**
|
|
1129
|
-
* 상세 주소입니다. 번지 및
|
|
1130
|
+
* 상세 주소입니다. 번지 및 동호수 정보를 입력하세요.
|
|
1130
1131
|
*/
|
|
1131
1132
|
line2?: string;
|
|
1132
1133
|
/**
|
|
@@ -1179,7 +1180,7 @@ interface RequestPaymentResult {
|
|
|
1179
1180
|
|
|
1180
1181
|
interface BillingAuthRequest {
|
|
1181
1182
|
/**
|
|
1182
|
-
* 자동결제(빌링)에 등록할 결제수단입니다.
|
|
1183
|
+
* 자동결제(빌링)에 등록할 결제수단입니다. 토스페이먼츠 자동결제는 현재 신용·체크카드만 지원해요.
|
|
1183
1184
|
*
|
|
1184
1185
|
*/
|
|
1185
1186
|
method: 'CARD';
|
|
@@ -1215,18 +1216,18 @@ interface BillingAuthRequest {
|
|
|
1215
1216
|
|
|
1216
1217
|
/**
|
|
1217
1218
|
*
|
|
1218
|
-
* @throws {@link PublicError.
|
|
1219
|
-
* @throws {@link PublicError.
|
|
1220
|
-
* @throws {@link PublicError.
|
|
1221
|
-
* @throws {@link PublicError.
|
|
1222
|
-
* @throws {@link PublicError.
|
|
1223
|
-
* @throws {@link PublicError.
|
|
1224
|
-
* @throws {@link PublicError.
|
|
1225
|
-
* @throws {@link PublicError.
|
|
1226
|
-
* @throws {@link PublicError.
|
|
1227
|
-
* @throws {@link PublicError.
|
|
1228
|
-
* @throws {@link PublicError.
|
|
1229
|
-
* @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} 알 수 없는 오류가 발생한 경우
|
|
1230
1231
|
*/
|
|
1231
1232
|
type RequestPayment = RequestCardPaymentWithRedirection & RequestCardPaymentWithPromise & RequestVirtualAccountPaymentWithRedirection & RequestVirtualAccountPaymentWithPromise & RequestTransferPaymentWithRedirection & RequestTransferPaymentWithPromise & RequestMobilePhonePaymentWithRedirection & RequestMobilePhonePaymentWithPromise & RequestGiftCertificatePaymentWithRedirection & RequestGiftCertificatePaymentWithPromise & RequestForeignEasyPayPaymentWithRedirection & RequestForeignEasyPayPaymentWithPromise;
|
|
1232
1233
|
/**
|
|
@@ -1629,17 +1630,17 @@ type RequestForeignEasyPayPaymentWithRedirection = (paymentRequest: WithRedirect
|
|
|
1629
1630
|
* });
|
|
1630
1631
|
* ```
|
|
1631
1632
|
*
|
|
1632
|
-
* @throws {@link PublicError.
|
|
1633
|
-
* @throws {@link PublicError.
|
|
1634
|
-
* @throws {@link PublicError.
|
|
1635
|
-
* @throws {@link PublicError.
|
|
1636
|
-
* @throws {@link PublicError.
|
|
1637
|
-
* @throws {@link PublicError.
|
|
1638
|
-
* @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} 알 수 없는 오류가 발생한 경우
|
|
1639
1640
|
*/
|
|
1640
1641
|
type RequestBillingAuth = (billingAuthRequest: BillingAuthRequest) => Promise<void>;
|
|
1641
1642
|
|
|
1642
|
-
interface
|
|
1643
|
+
interface TossPaymentsPayment {
|
|
1643
1644
|
/**
|
|
1644
1645
|
* 결제창을 띄웁니다. [자세히 >](#paymentrequestpayment)
|
|
1645
1646
|
*/
|
|
@@ -1649,7 +1650,7 @@ interface TossPaymentsPaymentGateway {
|
|
|
1649
1650
|
*/
|
|
1650
1651
|
requestBillingAuth: RequestBillingAuth;
|
|
1651
1652
|
}
|
|
1652
|
-
interface
|
|
1653
|
+
interface TossPaymentsSDK {
|
|
1653
1654
|
/**
|
|
1654
1655
|
*
|
|
1655
1656
|
* 결제위젯을 초기화합니다. [자세히 >](#결제위젯)
|
|
@@ -1671,10 +1672,10 @@ interface TossPaymentsInstance {
|
|
|
1671
1672
|
* import { ANONYMOUS } from "@tosspayments/tosspayments-sdk";
|
|
1672
1673
|
* const widgets = tossPayments.widgets({ customerKey: ANONYMOUS });
|
|
1673
1674
|
* ```
|
|
1674
|
-
* @param {
|
|
1675
|
+
* @param {WidgetInitParams} params 결제위젯 초기화 정보입니다.
|
|
1675
1676
|
*
|
|
1676
1677
|
*/
|
|
1677
|
-
widgets: (params:
|
|
1678
|
+
widgets: (params: WidgetInitParams) => TossPaymentsWidgets;
|
|
1678
1679
|
/**
|
|
1679
1680
|
* 브랜드페이를 초기화합니다. [자세히 >](#브랜드페이)
|
|
1680
1681
|
*
|
|
@@ -1690,10 +1691,10 @@ interface TossPaymentsInstance {
|
|
|
1690
1691
|
* });
|
|
1691
1692
|
* ```
|
|
1692
1693
|
* @returns 아래 메서드를 호출할 수 있는 브랜드페이 객체를 반환합니다.
|
|
1693
|
-
* @param {
|
|
1694
|
+
* @param {BrandpayInitParams} params 브랜드페이 초기화 정보입니다.
|
|
1694
1695
|
*
|
|
1695
1696
|
*/
|
|
1696
|
-
brandpay: (params:
|
|
1697
|
+
brandpay: (params: BrandpayInitParams) => TossPaymentsBrandpay;
|
|
1697
1698
|
/**
|
|
1698
1699
|
* 결제창을 초기화합니다. [자세히 >](#결제창)
|
|
1699
1700
|
*
|
|
@@ -1705,11 +1706,11 @@ interface TossPaymentsInstance {
|
|
|
1705
1706
|
* ```javascript
|
|
1706
1707
|
* const payment = tossPayments.payment({ customerKey });
|
|
1707
1708
|
* ```
|
|
1708
|
-
* @param {
|
|
1709
|
+
* @param {PaymentInitParams} params 결제창 초기화 정보입니다.
|
|
1709
1710
|
* @returns 아래 메서드를 호출할 수 있는 결제창 객체를 반환합니다.
|
|
1710
1711
|
*
|
|
1711
1712
|
*/
|
|
1712
|
-
payment: (params:
|
|
1713
|
+
payment: (params: PaymentInitParams) => TossPaymentsPayment;
|
|
1713
1714
|
}
|
|
1714
1715
|
/**
|
|
1715
1716
|
* @example
|
|
@@ -1729,8 +1730,8 @@ interface TossPaymentsInstance {
|
|
|
1729
1730
|
* @returns
|
|
1730
1731
|
* 아래 메서드를 호출할 수 있는 토스페이먼츠 객체를 반환합니다.
|
|
1731
1732
|
*/
|
|
1732
|
-
type TossPayments = (clientKey: string) =>
|
|
1733
|
-
interface
|
|
1733
|
+
type TossPayments = (clientKey: string) => TossPaymentsSDK;
|
|
1734
|
+
interface BrandpayInitParams {
|
|
1734
1735
|
/**
|
|
1735
1736
|
* 구매자를 식별하는 고유 아이디입니다.
|
|
1736
1737
|
* 이메일・전화번호나 자동 증가하는 숫자와 같이 유추가 가능한 값은 안전하지 않아요. UUID와 같이 충분히 무작위적인 고유 값으로 생성해주세요.
|
|
@@ -1747,7 +1748,7 @@ interface BrandpaySDKInitParams {
|
|
|
1747
1748
|
/**
|
|
1748
1749
|
* @returns 아래 메서드를 호출할 수 있는 토스페이먼츠 객체를 반환합니다.
|
|
1749
1750
|
*/
|
|
1750
|
-
interface
|
|
1751
|
+
interface WidgetInitParams {
|
|
1751
1752
|
/**
|
|
1752
1753
|
* 구매자를 식별하는 고유 아이디입니다.
|
|
1753
1754
|
* 이메일・전화번호나 자동 증가하는 숫자와 같이 유추가 가능한 값은 안전하지 않아요. UUID와 같이 충분히 무작위적인 고유 값으로 생성해주세요.
|
|
@@ -1766,7 +1767,7 @@ interface WidgetSDKInitParams {
|
|
|
1766
1767
|
redirectUrl?: string;
|
|
1767
1768
|
};
|
|
1768
1769
|
}
|
|
1769
|
-
interface
|
|
1770
|
+
interface PaymentInitParams {
|
|
1770
1771
|
/**
|
|
1771
1772
|
* 구매자를 식별하는 고유 아이디입니다.
|
|
1772
1773
|
* 이메일・전화번호나 자동 증가하는 숫자와 같이 유추가 가능한 값은 안전하지 않아요. UUID와 같이 충분히 무작위적인 고유 값으로 생성해주세요.
|
|
@@ -1778,8 +1779,8 @@ interface PaymentGatewaySDKInitParams {
|
|
|
1778
1779
|
type TosspaymentsParams = Parameters<TossPayments>;
|
|
1779
1780
|
declare function loadTossPayments(clientKey: TosspaymentsParams[0], loadOptions?: {
|
|
1780
1781
|
src?: string;
|
|
1781
|
-
}): Promise<
|
|
1782
|
+
}): Promise<TossPaymentsSDK>;
|
|
1782
1783
|
|
|
1783
1784
|
declare const ANONYMOUS = "@@ANONYMOUS";
|
|
1784
1785
|
|
|
1785
|
-
export { ANONYMOUS, type WidgetAgreementStatus, type WidgetAgreementWidget, type WidgetPaymentMethodWidget, type WidgetSelectedPaymentMethod, clearTossPayments, loadTossPayments };
|
|
1786
|
+
export { ANONYMOUS, type TossPaymentsBrandpay, type TossPaymentsPayment, type TossPaymentsSDK, type TossPaymentsWidgets, type WidgetAgreementStatus, type WidgetAgreementWidget, type WidgetPaymentMethodWidget, type WidgetSelectedPaymentMethod, clearTossPayments, loadTossPayments };
|