@portone/browser-sdk 0.0.1 → 0.0.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/README.md +25 -4
- package/dist/utils.d.ts +18 -0
- package/dist/v2/entity/Address.d.ts +8 -0
- package/dist/v2/entity/Bank.d.ts +78 -0
- package/dist/v2/entity/BillingKeyMethod.d.ts +7 -0
- package/dist/v2/entity/CardCompany.d.ts +25 -0
- package/dist/v2/entity/Carrier.d.ts +18 -0
- package/dist/v2/entity/CashReceiptType.d.ts +6 -0
- package/dist/v2/entity/Country.d.ts +252 -0
- package/dist/v2/entity/Currency.d.ts +184 -0
- package/dist/v2/entity/Customer.d.ts +15 -0
- package/dist/v2/entity/EasyPayProvider.d.ts +21 -0
- package/dist/v2/entity/FreeInstallmentPlan.d.ts +19 -0
- package/dist/v2/entity/Gender.d.ts +6 -0
- package/dist/v2/entity/GiftCertificateType.d.ts +7 -0
- package/dist/v2/entity/Installment.d.ts +24 -0
- package/dist/v2/entity/Locale.d.ts +6 -0
- package/dist/v2/entity/OfferPeriod.d.ts +27 -0
- package/dist/v2/entity/PayMethod.d.ts +1 -0
- package/dist/v2/entity/PgProvider.d.ts +44 -0
- package/dist/v2/entity/Product.d.ts +8 -0
- package/dist/v2/entity/ProductType.d.ts +10 -0
- package/dist/v2/entity/StoreDetails.d.ts +14 -0
- package/dist/v2/entity/TransactionType.d.ts +12 -0
- package/dist/v2/entity/WindowType.d.ts +15 -0
- package/dist/v2/entity/bypass/identityVerification/Danal.d.ts +23 -0
- package/dist/v2/entity/bypass/identityVerification/index.d.ts +4 -0
- package/dist/v2/entity/bypass/issueBillingKey/Naverpay.d.ts +8 -0
- package/dist/v2/entity/bypass/issueBillingKey/PaypalV2.d.ts +24 -0
- package/dist/v2/entity/bypass/issueBillingKey/SmartroV2.d.ts +8 -0
- package/dist/v2/entity/bypass/issueBillingKey/index.d.ts +10 -0
- package/dist/v2/entity/bypass/payment/Kakaopay.d.ts +3 -0
- package/dist/v2/entity/bypass/payment/Ksnet.d.ts +7 -0
- package/dist/v2/entity/bypass/payment/Naverpay.d.ts +31 -0
- package/dist/v2/entity/bypass/payment/NiceV2.d.ts +39 -0
- package/dist/v2/entity/bypass/payment/PaypalV2.d.ts +44 -0
- package/dist/v2/entity/bypass/payment/SmartroV2.d.ts +9 -0
- package/dist/v2/entity/bypass/payment/TossBrandpay.d.ts +46 -0
- package/dist/v2/entity/bypass/payment/Tosspayments.d.ts +8 -0
- package/dist/v2/entity/bypass/payment/index.d.ts +18 -0
- package/dist/v2/entity/index.d.ts +27 -0
- package/dist/v2/exception/CheckoutServiceErrorCode.d.ts +1 -0
- package/dist/v2/exception/GrpcErrorCode.d.ts +1 -0
- package/dist/v2/exception/IdentityVerificationError.d.ts +20 -0
- package/dist/v2/exception/IssueBillingKeyError.d.ts +19 -0
- package/dist/v2/exception/ModuleError.d.ts +14 -0
- package/dist/v2/exception/PaymentError.d.ts +20 -0
- package/dist/v2/exception/TxServiceIdentityVerificationErrorCode.d.ts +1 -0
- package/dist/v2/exception/TxServiceIssueErrorCode.d.ts +1 -0
- package/dist/v2/exception/TxServicePayErrorCode.d.ts +1 -0
- package/dist/v2/exception/index.d.ts +8 -0
- package/dist/v2/index.d.ts +15 -0
- package/dist/v2/loader.d.ts +16 -0
- package/dist/v2/requestIdentityVerification.d.ts +25 -0
- package/dist/v2/requestIssueBillingKey.d.ts +49 -0
- package/dist/v2/requestPayment.d.ts +91 -0
- package/dist/v2.cjs +851 -0
- package/dist/v2.js +833 -0
- package/package.json +42 -9
- package/v2/index.d.ts +0 -1120
- package/v2/index.js +0 -84
package/v2/index.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
__INTERNAL__setPortOneSdkUrl: () => setPortOneJsSdkUrl,
|
|
24
|
-
requestIssueBillingKey: () => requestIssueBillingKey,
|
|
25
|
-
requestPayment: () => requestPayment
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(src_exports);
|
|
28
|
-
|
|
29
|
-
// src/loader.ts
|
|
30
|
-
var promise = null;
|
|
31
|
-
var portone = {
|
|
32
|
-
jsSdkUrl: "https://cdn.portone.io/v2/browser-sdk.js"
|
|
33
|
-
};
|
|
34
|
-
function findScript() {
|
|
35
|
-
return document.querySelector(
|
|
36
|
-
`script[src="${portone.jsSdkUrl}"]`
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
function injectScript() {
|
|
40
|
-
const script = document.createElement("script");
|
|
41
|
-
script.src = portone.jsSdkUrl;
|
|
42
|
-
const headOrBody = document.head || document.body;
|
|
43
|
-
if (!headOrBody)
|
|
44
|
-
throw new Error("[PortOne] Expected document.body not to be null");
|
|
45
|
-
return headOrBody.appendChild(script);
|
|
46
|
-
}
|
|
47
|
-
function loadScript() {
|
|
48
|
-
if (promise != null)
|
|
49
|
-
return promise;
|
|
50
|
-
return promise = new Promise((resolve, reject) => {
|
|
51
|
-
if (window.PortOne)
|
|
52
|
-
return resolve(window.PortOne);
|
|
53
|
-
try {
|
|
54
|
-
const script = findScript() || injectScript();
|
|
55
|
-
script.addEventListener("load", () => {
|
|
56
|
-
if (window.PortOne)
|
|
57
|
-
return resolve(window.PortOne);
|
|
58
|
-
reject(new Error("[PortOne] Failed to load window.PortOne"));
|
|
59
|
-
});
|
|
60
|
-
script.addEventListener("error", () => {
|
|
61
|
-
reject(new Error("[PortOne] Failed to load window.PortOne"));
|
|
62
|
-
});
|
|
63
|
-
} catch (error) {
|
|
64
|
-
return reject(error);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function setPortOneJsSdkUrl(url) {
|
|
69
|
-
return portone.jsSdkUrl = url;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// src/index.ts
|
|
73
|
-
function requestPayment(request) {
|
|
74
|
-
return loadScript().then((sdk) => sdk.requestPayment(request));
|
|
75
|
-
}
|
|
76
|
-
function requestIssueBillingKey(request) {
|
|
77
|
-
return loadScript().then((sdk) => sdk.requestIssueBillingKey(request));
|
|
78
|
-
}
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
__INTERNAL__setPortOneSdkUrl,
|
|
82
|
-
requestIssueBillingKey,
|
|
83
|
-
requestPayment
|
|
84
|
-
});
|