@tosspayments/tosspayments-sdk 2.3.3 → 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 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.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
+
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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **tosspayments-sdk:** @tosspayments/standard-public-interfaces 버전업 ([#130](https://github.com/tosspayments/browser-sdk/issues/130)) ([62069d3](https://github.com/tosspayments/browser-sdk/commit/62069d34a798ef8324fe032f59c59933d5dba0d1))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [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
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.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.38",
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": "f2fa79e499251c03f5886981b8ed8e8fa46f383a"
41
+ "gitHead": "eb5f441be087a2116a2be35b2ec322ffe956e9ac"
42
42
  }
package/types/index.d.ts CHANGED
@@ -1,11 +1,17 @@
1
1
  declare function clearTossPayments(): void;
2
2
 
3
- interface WidgetSelectedPaymentMethod {
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
  */
@@ -231,6 +244,15 @@ interface WidgetPaymentRequest {
231
244
  */
232
245
  quantity?: number | null;
233
246
  }> | null;
247
+ /**
248
+ * 현금영수증 정보입니다.
249
+ */
250
+ cashReceipt?: {
251
+ /**
252
+ * 현금영수증 발급 용도입니다. '소득공제', '지출증빙', '미발행' 중 하나입니다.
253
+ */
254
+ type: '소득공제' | '지출증빙' | '미발행';
255
+ } | null;
234
256
  } | null;
235
257
  /**
236
258
  * 구매자가 해외간편결제를 선택하면 결제에 적용되는 옵션입니다.
@@ -581,6 +603,10 @@ interface BrandpayPaymentRequest {
581
603
  * 결제 금액 중 면세 금액입니다. 면세 상점 혹은 복합 과세 상점으로 계약된 상점만 사용하세요. 자세한 내용은 세금 처리 가이드에서 확인하세요.
582
604
  */
583
605
  taxFreeAmount?: number | null;
606
+ /**
607
+ * 결제수단의 ID입니다. 결제수단 ID 입니다. 등록되어 있는 결제수단 중 하나를 지정해서 바로 결제하고 싶을 때 사용합니다.
608
+ */
609
+ methodId?: string | null;
584
610
  /**
585
611
  * 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
586
612
  */
@@ -847,6 +873,15 @@ interface PaymentRequest {
847
873
  * 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
848
874
  */
849
875
  metadata?: Record<string | symbol | number, unknown> | null;
876
+ /**
877
+ * @ignore
878
+ */
879
+ sandbox?: {
880
+ /**
881
+ * @ignore
882
+ */
883
+ paymentResult: 'SUCCESS' | 'FAIL';
884
+ };
850
885
  }
851
886
 
852
887
  interface CardPaymentRequest extends PaymentRequest {
@@ -1045,11 +1080,11 @@ interface TransferPaymentRequest extends PaymentRequest {
1045
1080
  */
1046
1081
  taxExemptionAmount?: number | null;
1047
1082
  /**
1048
- * 현금영수증 정보입니다.
1083
+ * @ignore
1049
1084
  */
1050
1085
  cashReceipt?: {
1051
1086
  /**
1052
- * 현금영수증 발급 용도입니다. '소득공제', '지출증빙', '미발행' 중 하나입니다.
1087
+ * @ignore
1053
1088
  */
1054
1089
  type: '소득공제' | '지출증빙' | '미발행';
1055
1090
  } | null;
@@ -1232,7 +1267,7 @@ interface BillingAuthRequest {
1232
1267
  * 자동결제(빌링)에 등록할 결제수단입니다. 토스페이먼츠 자동결제는 현재 신용·체크카드만 지원해요.
1233
1268
  *
1234
1269
  */
1235
- method: 'CARD' | 'TRANSFER';
1270
+ method: 'CARD';
1236
1271
  /**
1237
1272
  * 카드 등록이 성공하면 리다이렉트되는 URL입니다. 리다이렉트되면 URL의 쿼리 파라미터로 `authKey`, `customerKey`가 추가돼요. 값을 검증하고 [빌링키 발급 API](/reference#authkey로-카드-빌링키-발급)를 호출하세요.
1238
1273
  * 반드시 오리진을 포함해야 합니다.
@@ -1284,7 +1319,7 @@ interface BillingAuthRequest {
1284
1319
  type RequestPayment = RequestCardPaymentWithRedirection & RequestCardPaymentWithPromise & RequestVirtualAccountPaymentWithRedirection & RequestVirtualAccountPaymentWithPromise & RequestTransferPaymentWithRedirection & RequestTransferPaymentWithPromise & RequestMobilePhonePaymentWithRedirection & RequestMobilePhonePaymentWithPromise & RequestGiftCertificatePaymentWithRedirection & RequestGiftCertificatePaymentWithPromise & RequestForeignEasyPayPaymentWithRedirection;
1285
1320
  /**
1286
1321
  * @docsAlias 카드(Promise 방식)
1287
- * @returns `WidgetPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1322
+ * @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1288
1323
  * @param {RequestCardPaymentWithPromise} paymentRequest 결제 요청 정보입니다.
1289
1324
  *
1290
1325
  * @example
@@ -1350,7 +1385,7 @@ type RequestCardPaymentWithPromise = (paymentRequest: CardPaymentRequest) => Pro
1350
1385
  type RequestCardPaymentWithRedirection = (paymentRequest: WithRedirection<CardPaymentRequest>) => Promise<void>;
1351
1386
  /**
1352
1387
  * @docsAlias 가상계좌(Promise 방식)
1353
- * @returns `WidgetPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1388
+ * @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1354
1389
  * @param {VirtualAccountPaymentRequest} paymentRequest 결제 요청 정보입니다.
1355
1390
  *
1356
1391
  * @example
@@ -1418,7 +1453,7 @@ type RequestVirtualAccountPaymentWithPromise = (paymentRequest: VirtualAccountPa
1418
1453
  type RequestVirtualAccountPaymentWithRedirection = (paymentRequest: WithRedirection<VirtualAccountPaymentRequest>) => Promise<void>;
1419
1454
  /**
1420
1455
  * @docsAlias 계좌이체(Promise 방식)
1421
- * @returns `WidgetPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1456
+ * @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1422
1457
  * @param {RequestTransferPaymentWithPromise} paymentRequest 결제 요청 정보입니다.
1423
1458
  *
1424
1459
  * @example
@@ -1483,7 +1518,7 @@ type RequestTransferPaymentWithPromise = (paymentRequest: TransferPaymentRequest
1483
1518
  type RequestTransferPaymentWithRedirection = (paymentRequest: WithRedirection<TransferPaymentRequest>) => Promise<void>;
1484
1519
  /**
1485
1520
  * @docsAlias 휴대폰 결제(Promise 방식)
1486
- * @returns `WidgetPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1521
+ * @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1487
1522
  * @param {RequestMobilePhonePaymentWithPromise} paymentRequest 결제 요청 정보입니다.
1488
1523
  *
1489
1524
  * @example
@@ -1536,7 +1571,7 @@ type RequestMobilePhonePaymentWithPromise = (paymentRequest: MobilePhonePaymentR
1536
1571
  type RequestMobilePhonePaymentWithRedirection = (paymentRequest: WithRedirection<MobilePhonePaymentRequest>) => Promise<void>;
1537
1572
  /**
1538
1573
  * @docsAlias 상품권(Promise 방식)
1539
- * @returns `WidgetPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1574
+ * @returns `RequestPaymentResult` 객체가 응답됩니다. 객체 필드를 확인하고 [결제 승인 API](/reference#결제-승인)를 호출해야 결제가 최종적으로 완료돼요.
1540
1575
  * @param {RequestGiftCertificatePaymentWithPromise} paymentRequest 결제 요청 정보입니다.
1541
1576
  *
1542
1577
  * @example