@tosspayments/tosspayments-sdk 2.3.4 → 2.3.5
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 +11 -0
- package/package.json +3 -3
- package/types/index.d.ts +38 -12
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.5](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.3.4...@tosspayments/tosspayments-sdk@2.3.5) (2025-05-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **tosspayments-sdk:** @tosspayments/standard-public-interfaces 버전업 ([#131](https://github.com/tosspayments/browser-sdk/issues/131)) ([006451e](https://github.com/tosspayments/browser-sdk/commit/006451e3cb508b851433e11019aa0bc5d2179f16))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.3.4](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.3.3...@tosspayments/tosspayments-sdk@2.3.4) (2024-12-12)
|
|
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.
|
|
4
|
+
"version": "2.3.5",
|
|
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.51",
|
|
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": "eb5f441be087a2116a2be35b2ec322ffe956e9ac"
|
|
42
42
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
declare function clearTossPayments(): void;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type WidgetSelectedPaymentMethod = {
|
|
4
4
|
/**
|
|
5
5
|
* 구매자가 결제 UI에서 선택한 결제수단입니다. 예를 들어, 신용・체크카드를 선택하면 `CARD` 코드가 응답됩니다. [ENUM 코드](/codes/enum-codes) 및 [기관 코드](/codes/org-codes)를 참고하세요.
|
|
6
6
|
*/
|
|
7
|
-
code: WidgetsPaymentMethodCode
|
|
8
|
-
}
|
|
7
|
+
code: Exclude<WidgetsPaymentMethodCode, 'BRANDPAY'>;
|
|
8
|
+
} | {
|
|
9
|
+
code: 'BRANDPAY';
|
|
10
|
+
/**
|
|
11
|
+
* 현재 브랜드페이에서 선택되어 있는 결제수단의 ID입니다.
|
|
12
|
+
*/
|
|
13
|
+
methodId?: string;
|
|
14
|
+
};
|
|
9
15
|
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
16
|
|
|
11
17
|
interface WidgetPaymentMethodWidget {
|
|
@@ -32,9 +38,7 @@ interface WidgetPaymentMethodWidget {
|
|
|
32
38
|
* @throws {@link PublicError.Widgets.InvalidCallbackParameterError} callback이 유효하지 않은 경우
|
|
33
39
|
* @throws {@link PublicError.Widgets.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
34
40
|
*/
|
|
35
|
-
on:
|
|
36
|
-
(eventName: 'paymentMethodSelect', callback: (paymentMethod: WidgetSelectedPaymentMethod) => void): void;
|
|
37
|
-
};
|
|
41
|
+
on: (eventName: 'paymentMethodSelect', callback: (paymentMethod: WidgetSelectedPaymentMethod) => void) => void;
|
|
38
42
|
/**
|
|
39
43
|
* 구매자가 선택한 결제수단을 불러옵니다. [자세히 >](#paymentmethodwidgetgetselectedpaymentmethod)
|
|
40
44
|
*
|
|
@@ -147,6 +151,15 @@ interface WidgetPaymentRequest {
|
|
|
147
151
|
* 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
|
|
148
152
|
*/
|
|
149
153
|
metadata?: Record<string | symbol | number, unknown> | null;
|
|
154
|
+
/**
|
|
155
|
+
* @ignore
|
|
156
|
+
*/
|
|
157
|
+
sandbox?: {
|
|
158
|
+
/**
|
|
159
|
+
* @ignore
|
|
160
|
+
*/
|
|
161
|
+
paymentResult: 'SUCCESS' | 'FAIL';
|
|
162
|
+
};
|
|
150
163
|
/**
|
|
151
164
|
* 구매자가 카드를 선택하면 결제에 적용되는 옵션입니다.
|
|
152
165
|
*/
|
|
@@ -590,6 +603,10 @@ interface BrandpayPaymentRequest {
|
|
|
590
603
|
* 결제 금액 중 면세 금액입니다. 면세 상점 혹은 복합 과세 상점으로 계약된 상점만 사용하세요. 자세한 내용은 세금 처리 가이드에서 확인하세요.
|
|
591
604
|
*/
|
|
592
605
|
taxFreeAmount?: number | null;
|
|
606
|
+
/**
|
|
607
|
+
* 결제수단의 ID입니다. 결제수단 ID 입니다. 등록되어 있는 결제수단 중 하나를 지정해서 바로 결제하고 싶을 때 사용합니다.
|
|
608
|
+
*/
|
|
609
|
+
methodId?: string | null;
|
|
593
610
|
/**
|
|
594
611
|
* 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
|
|
595
612
|
*/
|
|
@@ -856,6 +873,15 @@ interface PaymentRequest {
|
|
|
856
873
|
* 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
|
|
857
874
|
*/
|
|
858
875
|
metadata?: Record<string | symbol | number, unknown> | null;
|
|
876
|
+
/**
|
|
877
|
+
* @ignore
|
|
878
|
+
*/
|
|
879
|
+
sandbox?: {
|
|
880
|
+
/**
|
|
881
|
+
* @ignore
|
|
882
|
+
*/
|
|
883
|
+
paymentResult: 'SUCCESS' | 'FAIL';
|
|
884
|
+
};
|
|
859
885
|
}
|
|
860
886
|
|
|
861
887
|
interface CardPaymentRequest extends PaymentRequest {
|
|
@@ -1241,7 +1267,7 @@ interface BillingAuthRequest {
|
|
|
1241
1267
|
* 자동결제(빌링)에 등록할 결제수단입니다. 토스페이먼츠 자동결제는 현재 신용·체크카드만 지원해요.
|
|
1242
1268
|
*
|
|
1243
1269
|
*/
|
|
1244
|
-
method: 'CARD'
|
|
1270
|
+
method: 'CARD';
|
|
1245
1271
|
/**
|
|
1246
1272
|
* 카드 등록이 성공하면 리다이렉트되는 URL입니다. 리다이렉트되면 URL의 쿼리 파라미터로 `authKey`, `customerKey`가 추가돼요. 값을 검증하고 [빌링키 발급 API](/reference#authkey로-카드-빌링키-발급)를 호출하세요.
|
|
1247
1273
|
* 반드시 오리진을 포함해야 합니다.
|
|
@@ -1293,7 +1319,7 @@ interface BillingAuthRequest {
|
|
|
1293
1319
|
type RequestPayment = RequestCardPaymentWithRedirection & RequestCardPaymentWithPromise & RequestVirtualAccountPaymentWithRedirection & RequestVirtualAccountPaymentWithPromise & RequestTransferPaymentWithRedirection & RequestTransferPaymentWithPromise & RequestMobilePhonePaymentWithRedirection & RequestMobilePhonePaymentWithPromise & RequestGiftCertificatePaymentWithRedirection & RequestGiftCertificatePaymentWithPromise & RequestForeignEasyPayPaymentWithRedirection;
|
|
1294
1320
|
/**
|
|
1295
1321
|
* @docsAlias 카드(Promise 방식)
|
|
1296
|
-
* @returns `
|
|
1322
|
+
* @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
|
|
1297
1323
|
* @param {RequestCardPaymentWithPromise} paymentRequest 결제 요청 정보입니다.
|
|
1298
1324
|
*
|
|
1299
1325
|
* @example
|
|
@@ -1359,7 +1385,7 @@ type RequestCardPaymentWithPromise = (paymentRequest: CardPaymentRequest) => Pro
|
|
|
1359
1385
|
type RequestCardPaymentWithRedirection = (paymentRequest: WithRedirection<CardPaymentRequest>) => Promise<void>;
|
|
1360
1386
|
/**
|
|
1361
1387
|
* @docsAlias 가상계좌(Promise 방식)
|
|
1362
|
-
* @returns `
|
|
1388
|
+
* @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
|
|
1363
1389
|
* @param {VirtualAccountPaymentRequest} paymentRequest 결제 요청 정보입니다.
|
|
1364
1390
|
*
|
|
1365
1391
|
* @example
|
|
@@ -1427,7 +1453,7 @@ type RequestVirtualAccountPaymentWithPromise = (paymentRequest: VirtualAccountPa
|
|
|
1427
1453
|
type RequestVirtualAccountPaymentWithRedirection = (paymentRequest: WithRedirection<VirtualAccountPaymentRequest>) => Promise<void>;
|
|
1428
1454
|
/**
|
|
1429
1455
|
* @docsAlias 계좌이체(Promise 방식)
|
|
1430
|
-
* @returns `
|
|
1456
|
+
* @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
|
|
1431
1457
|
* @param {RequestTransferPaymentWithPromise} paymentRequest 결제 요청 정보입니다.
|
|
1432
1458
|
*
|
|
1433
1459
|
* @example
|
|
@@ -1492,7 +1518,7 @@ type RequestTransferPaymentWithPromise = (paymentRequest: TransferPaymentRequest
|
|
|
1492
1518
|
type RequestTransferPaymentWithRedirection = (paymentRequest: WithRedirection<TransferPaymentRequest>) => Promise<void>;
|
|
1493
1519
|
/**
|
|
1494
1520
|
* @docsAlias 휴대폰 결제(Promise 방식)
|
|
1495
|
-
* @returns `
|
|
1521
|
+
* @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
|
|
1496
1522
|
* @param {RequestMobilePhonePaymentWithPromise} paymentRequest 결제 요청 정보입니다.
|
|
1497
1523
|
*
|
|
1498
1524
|
* @example
|
|
@@ -1545,7 +1571,7 @@ type RequestMobilePhonePaymentWithPromise = (paymentRequest: MobilePhonePaymentR
|
|
|
1545
1571
|
type RequestMobilePhonePaymentWithRedirection = (paymentRequest: WithRedirection<MobilePhonePaymentRequest>) => Promise<void>;
|
|
1546
1572
|
/**
|
|
1547
1573
|
* @docsAlias 상품권(Promise 방식)
|
|
1548
|
-
* @returns `
|
|
1574
|
+
* @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
|
|
1549
1575
|
* @param {RequestGiftCertificatePaymentWithPromise} paymentRequest 결제 요청 정보입니다.
|
|
1550
1576
|
*
|
|
1551
1577
|
* @example
|