@tosspayments/tosspayments-sdk 2.2.4 → 2.3.0
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 +32 -18
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.0](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.2.4...@tosspayments/tosspayments-sdk@2.3.0) (2024-09-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* @tosspayments/standard-public-interfaces 버전업 ([#121](https://github.com/tosspayments/browser-sdk/issues/121)) ([985e51c](https://github.com/tosspayments/browser-sdk/commit/985e51c172248a68803cc28538aa3a609bda85ee))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.2.4](https://github.com/tosspayments/browser-sdk/compare/@tosspayments/tosspayments-sdk@2.2.3...@tosspayments/tosspayments-sdk@2.2.4) (2024-07-23)
|
|
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.
|
|
4
|
+
"version": "2.3.0",
|
|
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.17",
|
|
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": "58f8d7998a1b5d0021a770173dff9b023907e3f8"
|
|
42
42
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -131,6 +131,10 @@ interface WidgetPaymentRequest {
|
|
|
131
131
|
* 결제 금액 중 면세 금액입니다. 면세 상점 혹은 복합 과세 상점으로 계약된 상점만 사용하세요. 자세한 내용은 세금 처리 가이드에서 확인하세요.
|
|
132
132
|
*/
|
|
133
133
|
taxFreeAmount?: number;
|
|
134
|
+
/**
|
|
135
|
+
* 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
|
|
136
|
+
*/
|
|
137
|
+
metadata?: Record<string | symbol | number, unknown> | null;
|
|
134
138
|
/**
|
|
135
139
|
* 구매자가 카드를 선택하면 결제에 적용되는 옵션입니다.
|
|
136
140
|
*/
|
|
@@ -416,6 +420,7 @@ type RenderAgreement = (params: {
|
|
|
416
420
|
|
|
417
421
|
/**
|
|
418
422
|
* 결제를 요청합니다
|
|
423
|
+
* @docsDefaultSignature RequestPaymentWithRedirection
|
|
419
424
|
*
|
|
420
425
|
* @param {WidgetPaymentRequest} paymentRequest - 결제 요청 정보입니다.
|
|
421
426
|
*
|
|
@@ -437,6 +442,7 @@ type RenderAgreement = (params: {
|
|
|
437
442
|
* @throws {@link PublicError.Widgets.NotSupportedPromiseError} promise 방식을 지원하지 않는 환경인 경우
|
|
438
443
|
* @throws {@link PublicError.Widgets.CustomPaymentMethodUnableToPayError} 커스텀 결제수단이 선택된 상태에서 결제요청을 한 경우
|
|
439
444
|
* @throws {@link PublicError.Widgets.InvalidMethodTransactionError} 이미 다른 명령을 수행 중인 경우
|
|
445
|
+
* @throws {@link PublicError.Widgets.InvalidMetadataError} metadata가 올바르지 않은 경우
|
|
440
446
|
* @throws {@link PublicError.Widgets.InvalidParametersError} 파라미터가 올바르지 않은 경우
|
|
441
447
|
* @throws {@link PublicError.Widgets.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
442
448
|
*/
|
|
@@ -561,6 +567,10 @@ interface BrandpayPaymentRequest {
|
|
|
561
567
|
* 결제 금액 중 면세 금액입니다. 면세 상점 혹은 복합 과세 상점으로 계약된 상점만 사용하세요. 자세한 내용은 세금 처리 가이드에서 확인하세요.
|
|
562
568
|
*/
|
|
563
569
|
taxFreeAmount?: number;
|
|
570
|
+
/**
|
|
571
|
+
* 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
|
|
572
|
+
*/
|
|
573
|
+
metadata?: Record<string | symbol | number, unknown> | null;
|
|
564
574
|
}
|
|
565
575
|
|
|
566
576
|
interface BrandpayRequestPaymentResult {
|
|
@@ -580,6 +590,7 @@ interface BrandpayRequestPaymentResult {
|
|
|
580
590
|
|
|
581
591
|
/**
|
|
582
592
|
* 결제를 요청합니다
|
|
593
|
+
* @docsDefaultSignature RequestPaymentWithRedirection
|
|
583
594
|
*
|
|
584
595
|
* @param {WithRedirection<BrandpayPaymentRequest> | BrandpayPaymentRequest} paymentRequest - 결제 요청 정보
|
|
585
596
|
*
|
|
@@ -592,6 +603,7 @@ interface BrandpayRequestPaymentResult {
|
|
|
592
603
|
* @throws {@link PublicError.Brandpay.PaymentRequestFailError} 결제 요청에 실패한 경우
|
|
593
604
|
* @throws {@link PublicError.Brandpay.NotRegisteredRedirectUrlError} redirectUrl이 등록되지 않은 경우
|
|
594
605
|
* @throws {@link PublicError.Brandpay.InvalidMethodTransactionError} 이미 다른 명령을 수행 중인 경우
|
|
606
|
+
* @throws {@link PublicError.Brandpay.InvalidMetadataError} metadata가 올바르지 않은 경우
|
|
595
607
|
* @throws {@link PublicError.Brandpay.InvalidParametersError} 파라미터가 올바르지 않은 경우
|
|
596
608
|
* @throws {@link PublicError.Brandpay.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
597
609
|
*/
|
|
@@ -808,11 +820,15 @@ interface PaymentRequest {
|
|
|
808
820
|
*/
|
|
809
821
|
taxFreeAmount?: number;
|
|
810
822
|
/**
|
|
811
|
-
* 결제창이 열리는 프레임입니다.
|
|
812
|
-
* `
|
|
813
|
-
*
|
|
823
|
+
* 브라우저에서 결제창이 열리는 프레임입니다. `self`, `iframe` 중 하나입니다.
|
|
824
|
+
* \- `self`는 현재 브라우저를 결제창으로 이동시켜요. 모바일 환경에서 기본 값입니다.
|
|
825
|
+
* \- `iframe`은 iframe에서 결제창이 열려요. PC 환경에서 기본 값입니다. **모바일 환경에서는 `iframe`을 사용할 수 없습니다.**
|
|
814
826
|
*/
|
|
815
827
|
windowTarget?: 'iframe' | 'self';
|
|
828
|
+
/**
|
|
829
|
+
* 결제 관련 정보를 추가할 수 있는 객체입니다. 최대 5개의 키-값(key-value) 쌍을 자유롭게 추가해주세요. 키는 `[` , `]` 를 사용하지 않는 최대 40자의 문자열, 값은 최대 500자의 문자열입니다.
|
|
830
|
+
*/
|
|
831
|
+
metadata?: Record<string | symbol | number, unknown> | null;
|
|
816
832
|
}
|
|
817
833
|
|
|
818
834
|
interface CardPaymentRequest extends PaymentRequest {
|
|
@@ -1205,9 +1221,9 @@ interface BillingAuthRequest {
|
|
|
1205
1221
|
*/
|
|
1206
1222
|
customerEmail?: string;
|
|
1207
1223
|
/**
|
|
1208
|
-
* 결제창이 열리는 프레임입니다.
|
|
1209
|
-
* `
|
|
1210
|
-
*
|
|
1224
|
+
* 브라우저에서 결제창이 열리는 프레임입니다. `self`, `iframe` 중 하나입니다.
|
|
1225
|
+
* \- `self`는 현재 브라우저를 결제창으로 이동시켜요. 모바일 환경에서 기본 값입니다.
|
|
1226
|
+
* \- `iframe`은 iframe에서 결제창이 열려요. PC 환경에서 기본 값입니다. **모바일 환경에서는 `iframe`을 사용할 수 없습니다.**
|
|
1211
1227
|
*
|
|
1212
1228
|
* @default 'iframe'
|
|
1213
1229
|
*/
|
|
@@ -1226,6 +1242,7 @@ interface BillingAuthRequest {
|
|
|
1226
1242
|
* @throws {@link PublicError.Payment.IncorrectFailUrlFormatError} 가맹점에서 유효하지 않은 failUrl을 넘겨준 경우
|
|
1227
1243
|
* @throws {@link PublicError.Payment.PaymentRequestFailError} 결제에 실패한 경우
|
|
1228
1244
|
* @throws {@link PublicError.Payment.InvalidMethodTransactionError} 이미 다른 명령을 수행 중인 경우
|
|
1245
|
+
* @throws {@link PublicError.Payment.InvalidMetadataError} metadata가 올바르지 않은 경우
|
|
1229
1246
|
* @throws {@link PublicError.Payment.InvalidParametersError} 파라미터가 올바르지 않은 경우
|
|
1230
1247
|
* @throws {@link PublicError.Payment.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
1231
1248
|
*/
|
|
@@ -1619,12 +1636,8 @@ type RequestForeignEasyPayPaymentWithRedirection = (paymentRequest: WithRedirect
|
|
|
1619
1636
|
* ```javascript
|
|
1620
1637
|
* payment.requestBillingAuth({
|
|
1621
1638
|
* method: 'CARD',
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1624
|
-
* value: 50000,
|
|
1625
|
-
* },
|
|
1626
|
-
* successUrl: window.location.origin + '/payment/billing.html',
|
|
1627
|
-
* failUrl: window.location.origin + '/fail.html',
|
|
1639
|
+
* successUrl: window.location.origin + '/payment/billing',
|
|
1640
|
+
* failUrl: window.location.origin + '/fail',
|
|
1628
1641
|
* customerEmail: 'customer123@gmail.com',
|
|
1629
1642
|
* customerName: '김토스',
|
|
1630
1643
|
* });
|
|
@@ -1657,7 +1670,7 @@ interface TossPaymentsSDK {
|
|
|
1657
1670
|
*
|
|
1658
1671
|
* @throw {@link PublicError.Widgets.InvalidClientKeyError} clientKey가 올바르지 않은 경우
|
|
1659
1672
|
* @throw {@link PublicError.Widgets.InvalidCustomerKeyError} customerKey가 올바르지 않은 경우
|
|
1660
|
-
* @throw {@link PublicError.Widgets.
|
|
1673
|
+
* @throw {@link PublicError.Widgets.InsecureKeyUsageError} customerKey에 시크릿키를 사용한 경우
|
|
1661
1674
|
* @throw {@link PublicError.Widgets.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
1662
1675
|
* @returns 아래 메서드를 호출할 수 있는 결제위젯 객체를 반환합니다.
|
|
1663
1676
|
* @example
|
|
@@ -1681,7 +1694,7 @@ interface TossPaymentsSDK {
|
|
|
1681
1694
|
*
|
|
1682
1695
|
* @throw {@link PublicError.Brandpay.InvalidClientKeyError} clientKey가 올바르지 않은 경우
|
|
1683
1696
|
* @throw {@link PublicError.Brandpay.InvalidCustomerKeyError} customerKey가 올바르지 않은 경우
|
|
1684
|
-
* @throw {@link PublicError.Brandpay.
|
|
1697
|
+
* @throw {@link PublicError.Brandpay.InsecureKeyUsageError} customerKey에 시크릿키를 사용한 경우
|
|
1685
1698
|
* @throw {@link PublicError.Brandpay.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
1686
1699
|
* @example
|
|
1687
1700
|
* ```javascript
|
|
@@ -1700,8 +1713,8 @@ interface TossPaymentsSDK {
|
|
|
1700
1713
|
*
|
|
1701
1714
|
* @throw {@link PublicError.Payment.InvalidClientKeyError} clientKey가 올바르지 않은 경우
|
|
1702
1715
|
* @throw {@link PublicError.Payment.InvalidCustomerKeyError} customerKey가 올바르지 않은 경우
|
|
1703
|
-
* @throw {@link PublicError.Payment.
|
|
1704
|
-
* @throw {@link PublicError.
|
|
1716
|
+
* @throw {@link PublicError.Payment.InsecureKeyUsageError} customerKey에 시크릿키를 사용한 경우
|
|
1717
|
+
* @throw {@link PublicError.Payment.UnknownError} 알 수 없는 오류가 발생한 경우
|
|
1705
1718
|
* @example
|
|
1706
1719
|
* ```javascript
|
|
1707
1720
|
* const payment = tossPayments.payment({ customerKey });
|
|
@@ -1716,7 +1729,8 @@ interface TossPaymentsSDK {
|
|
|
1716
1729
|
* @example
|
|
1717
1730
|
* ```javascript
|
|
1718
1731
|
* // 스크립트 태그 연동방식
|
|
1719
|
-
* const tossPayments = TossPayments("<WidgetClientKey />");
|
|
1732
|
+
* const tossPayments = TossPayments("<WidgetClientKey />"); // 결제위젯 연동 키
|
|
1733
|
+
* const tossPayments = TossPayments("<ClientKey />"); // API 개별 연동 키
|
|
1720
1734
|
*
|
|
1721
1735
|
* // 모듈 임포트 연동방식
|
|
1722
1736
|
* import { loadTossPayments } from "@tosspayments/tosspayments-sdk"
|
|
@@ -1725,7 +1739,7 @@ interface TossPaymentsSDK {
|
|
|
1725
1739
|
*
|
|
1726
1740
|
* @param {string} clientKey 토스페이먼츠 발급하는 클라이언트 키입니다. 개발자센터의 [API 키 메뉴](https://developers.tosspayments.com/my/api-keys)에서 확인할 수 있어요.
|
|
1727
1741
|
*
|
|
1728
|
-
* 결제위젯을 연동한다면 [결제위젯 연동 키](/reference/using-api/api-keys#결제위젯-연동-키)를 사용하세요. 결제창, 자동결제(빌링)
|
|
1742
|
+
* 결제위젯을 연동한다면 [결제위젯 연동 키](/reference/using-api/api-keys#결제위젯-연동-키)를 사용하세요. 브랜드페이, 결제창, 자동결제(빌링)를 연동한다면 [API 개별 연동 키](/reference/using-api/api-keys#api-개별-연동-키)를 사용하세요.
|
|
1729
1743
|
*
|
|
1730
1744
|
* @returns
|
|
1731
1745
|
* 아래 메서드를 호출할 수 있는 토스페이먼츠 객체를 반환합니다.
|