@portone/browser-sdk 0.0.1 → 0.0.2
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/README.md +25 -4
- package/dist/chunk-4ed6f045.js +66 -0
- package/dist/chunk-ced8f127.js +13 -0
- package/dist/chunk-f7332846.js +690 -0
- package/dist/loader.d.ts +14 -0
- package/dist/types/utils.d.ts +18 -0
- package/dist/types/v2/entity/Address.d.ts +8 -0
- package/dist/types/v2/entity/Bank.d.ts +78 -0
- package/dist/types/v2/entity/BillingKeyMethod.d.ts +7 -0
- package/dist/types/v2/entity/CardCompany.d.ts +25 -0
- package/dist/types/v2/entity/Carrier.d.ts +18 -0
- package/dist/types/v2/entity/CashReceiptType.d.ts +6 -0
- package/dist/types/v2/entity/Country.d.ts +252 -0
- package/dist/types/v2/entity/Currency.d.ts +184 -0
- package/dist/types/v2/entity/Customer.d.ts +15 -0
- package/dist/types/v2/entity/EasyPayProvider.d.ts +20 -0
- package/dist/types/v2/entity/FreeInstallmentPlan.d.ts +19 -0
- package/dist/types/v2/entity/Gender.d.ts +6 -0
- package/dist/types/v2/entity/GiftCertificateType.d.ts +7 -0
- package/dist/types/v2/entity/Installment.d.ts +24 -0
- package/dist/types/v2/entity/Locale.d.ts +6 -0
- package/dist/types/v2/entity/OfferPeriod.d.ts +27 -0
- package/dist/types/v2/entity/PayMethod.d.ts +1 -0
- package/dist/types/v2/entity/PgProvider.d.ts +44 -0
- package/dist/types/v2/entity/Product.d.ts +8 -0
- package/dist/types/v2/entity/ProductType.d.ts +10 -0
- package/dist/types/v2/entity/StoreDetails.d.ts +14 -0
- package/dist/types/v2/entity/TransactionType.d.ts +12 -0
- package/dist/types/v2/entity/WindowType.d.ts +15 -0
- package/dist/types/v2/entity/bypass/identityVerification/Danal.d.ts +23 -0
- package/dist/types/v2/entity/bypass/identityVerification/index.d.ts +4 -0
- package/dist/types/v2/entity/bypass/issueBillingKey/Naverpay.d.ts +8 -0
- package/dist/types/v2/entity/bypass/issueBillingKey/PaypalV2.d.ts +24 -0
- package/dist/types/v2/entity/bypass/issueBillingKey/SmartroV2.d.ts +8 -0
- package/dist/types/v2/entity/bypass/issueBillingKey/index.d.ts +10 -0
- package/dist/types/v2/entity/bypass/payment/Kakaopay.d.ts +3 -0
- package/dist/types/v2/entity/bypass/payment/Ksnet.d.ts +7 -0
- package/dist/types/v2/entity/bypass/payment/Naverpay.d.ts +31 -0
- package/dist/types/v2/entity/bypass/payment/NiceV2.d.ts +39 -0
- package/dist/types/v2/entity/bypass/payment/PaypalV2.d.ts +44 -0
- package/dist/types/v2/entity/bypass/payment/SmartroV2.d.ts +9 -0
- package/dist/types/v2/entity/bypass/payment/Tosspayments.d.ts +8 -0
- package/dist/types/v2/entity/bypass/payment/TosspaymentsBrandpay.d.ts +27 -0
- package/dist/types/v2/entity/bypass/payment/index.d.ts +18 -0
- package/dist/types/v2/entity/index.d.ts +27 -0
- package/dist/types/v2/entity/index.js +2 -0
- package/dist/types/v2/exception/CheckoutServiceErrorCode.d.ts +1 -0
- package/dist/types/v2/exception/GrpcErrorCode.d.ts +1 -0
- package/dist/types/v2/exception/IdentityVerificationError.d.ts +20 -0
- package/dist/types/v2/exception/IssueBillingKeyError.d.ts +19 -0
- package/dist/types/v2/exception/PaymentError.d.ts +20 -0
- package/dist/types/v2/exception/TxServiceIdentityVerificationErrorCode.d.ts +1 -0
- package/dist/types/v2/exception/TxServiceIssueErrorCode.d.ts +1 -0
- package/dist/types/v2/exception/TxServicePayErrorCode.d.ts +1 -0
- package/dist/types/v2/exception/index.d.ts +7 -0
- package/dist/types/v2/exception/index.js +2 -0
- package/dist/types/v2/index.d.ts +5 -0
- package/dist/types/v2/request/IdentityVerification.d.ts +14 -0
- package/dist/types/v2/request/IssueBillingKey.d.ts +38 -0
- package/dist/types/v2/request/Payment.d.ts +79 -0
- package/dist/types/v2/request/index.d.ts +5 -0
- package/dist/types/v2/response/IdentityVerification.d.ts +13 -0
- package/dist/types/v2/response/IssueBillingKey.d.ts +12 -0
- package/dist/types/v2/response/Payment.d.ts +13 -0
- package/dist/types/v2/response/index.d.ts +5 -0
- package/dist/v2-entity.js +2 -0
- package/dist/v2-exception.js +2 -0
- package/dist/v2.d.ts +11 -0
- package/dist/v2.js +75 -0
- package/package.json +60 -9
- package/v2/index.d.ts +0 -1120
- package/v2/index.js +0 -84
package/README.md
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PortOne NPM Browser SDK
|
|
2
|
+
|
|
3
|
+
> **Warning**
|
|
4
|
+
>
|
|
5
|
+
> Browser SDK에서는 포트원 V2 베타 기능만 제공하고 있습니다.\
|
|
6
|
+
> [V2 연동 시작하기 > 사용 가능한 PG사](https://developers.portone.io/docs/ko/v2-payment/v2#%EC%82%AC%EC%9A%A9-%EA%B0%80%EB%8A%A5%ED%95%9C-pg%EC%82%AC)
|
|
7
|
+
> 문서를 참고해주세요.
|
|
8
|
+
|
|
9
|
+
`@portone/browser-sdk` 패키지를 통해 포트원 결제 연동을 빠르게 진행할 수
|
|
10
|
+
있습니다.
|
|
2
11
|
|
|
3
12
|
## Installation
|
|
4
13
|
|
|
5
|
-
|
|
6
|
-
|
|
14
|
+
```sh
|
|
15
|
+
# 원하는 패키지 매니저 사용
|
|
16
|
+
npm i @portone/browser-sdk
|
|
17
|
+
yarn add @portone/browser-sdk
|
|
18
|
+
pnpm i @portone/browser-sdk
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Documentation
|
|
22
|
+
|
|
23
|
+
[V2 연동하기 > 인증결제 연동하기](https://developers.portone.io/docs/ko/v2-payment/v2)
|
|
24
|
+
문서를 참고해주세요.
|
|
25
|
+
|
|
26
|
+
## Support
|
|
7
27
|
|
|
8
|
-
|
|
28
|
+
패키지에 문제가 있거나 결제 연동 시 도움이 필요하신 경우
|
|
29
|
+
[support@portone.io](mailto:support@portone.io)로 메일을 보내주세요.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { T as TransactionType } from './chunk-ced8f127.js';
|
|
2
|
+
|
|
3
|
+
function isIdentityVerificationError(error) {
|
|
4
|
+
return (isPortOneError(error) &&
|
|
5
|
+
error.__portOneErrorType === 'IdentityVerificationError');
|
|
6
|
+
}
|
|
7
|
+
class IdentityVerificationError extends Error {
|
|
8
|
+
constructor({ code, message, identityVerificationId, identityVerificationTxId, }) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.__portOneErrorType = 'IdentityVerificationError';
|
|
11
|
+
this.transactionType = TransactionType.IDENTITY_VERIFICATION;
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.message = message;
|
|
14
|
+
this.identityVerificationId = identityVerificationId;
|
|
15
|
+
this.identityVerificationTxId = identityVerificationTxId;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function isIssueBillingKeyError(error) {
|
|
20
|
+
return (isPortOneError(error) && error.__portOneErrorType === 'IssueBillingKeyError');
|
|
21
|
+
}
|
|
22
|
+
class IssueBillingKeyError extends Error {
|
|
23
|
+
constructor({ code, message, billingKey, }) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.__portOneErrorType = 'IssueBillingKeyError';
|
|
26
|
+
this.transactionType = TransactionType.ISSUE_BILLING_KEY;
|
|
27
|
+
this.code = code;
|
|
28
|
+
this.message = message;
|
|
29
|
+
this.billingKey = billingKey;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function isPaymentError(error) {
|
|
34
|
+
return isPortOneError(error) && error.__portOneErrorType === 'PaymentError';
|
|
35
|
+
}
|
|
36
|
+
class PaymentError extends Error {
|
|
37
|
+
constructor({ code, message, txId, paymentId, }) {
|
|
38
|
+
super(message);
|
|
39
|
+
this.__portOneErrorType = 'PaymentError';
|
|
40
|
+
this.transactionType = TransactionType.PAYMENT;
|
|
41
|
+
this.code = code;
|
|
42
|
+
this.message = message;
|
|
43
|
+
this.txId = txId;
|
|
44
|
+
this.paymentId = paymentId;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function isPortOneError(error) {
|
|
49
|
+
return (error != null &&
|
|
50
|
+
typeof error === 'object' &&
|
|
51
|
+
'__portOneErrorType' in error &&
|
|
52
|
+
typeof error.__portOneErrorType === 'string');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
56
|
+
__proto__: null,
|
|
57
|
+
IdentityVerificationError: IdentityVerificationError,
|
|
58
|
+
IssueBillingKeyError: IssueBillingKeyError,
|
|
59
|
+
PaymentError: PaymentError,
|
|
60
|
+
isIdentityVerificationError: isIdentityVerificationError,
|
|
61
|
+
isIssueBillingKeyError: isIssueBillingKeyError,
|
|
62
|
+
isPaymentError: isPaymentError,
|
|
63
|
+
isPortOneError: isPortOneError
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export { IdentityVerificationError as I, PaymentError as P, isPortOneError as a, isIdentityVerificationError as b, isIssueBillingKeyError as c, IssueBillingKeyError as d, isPaymentError as e, index as i };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 트랜잭션 유형
|
|
3
|
+
* - PAYMENT: 결제
|
|
4
|
+
* - ISSUE_BILLING_KEY: 빌링키 발급
|
|
5
|
+
* - IDENTITY_VERIFICATION: 본인 인증
|
|
6
|
+
*/
|
|
7
|
+
const TransactionType = {
|
|
8
|
+
PAYMENT: 'PAYMENT',
|
|
9
|
+
ISSUE_BILLING_KEY: 'ISSUE_BILLING_KEY',
|
|
10
|
+
IDENTITY_VERIFICATION: 'IDENTITY_VERIFICATION',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { TransactionType as T };
|