@payfurl/client 4.11.1 → 4.11.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/CHANGELOG.md +23 -0
- package/README.md +23 -0
- package/dist/sdk/{CloseIcon-Ejad61tT.js → CloseIcon-Dkap5zUl.js} +15 -15
- package/dist/sdk/{DefaultThreeDsProvider-bLoDSnkd.js → DefaultThreeDsProvider-D0iYIu6R.js} +22 -19
- package/dist/sdk/{MetricsGlobalThreeDsProvider-C93ttqbB.js → MetricsGlobalThreeDsProvider-BiILkcHI.js} +14 -14
- package/dist/sdk/{PayWayAppleButton-B1Ttj4J_.js → PayWayAppleButton-DfgBdc_z.js} +16 -16
- package/dist/sdk/{alerts-1YSRy5iI.js → alerts-CWLXzX6j.js} +7 -7
- package/dist/sdk/{cxpay-DblHb5vN.js → cxpay-CYbHYLG3.js} +1 -1
- package/dist/sdk/{default-C7f86Fx-.js → default-zi2wr9FU.js} +1 -1
- package/dist/sdk/{ecentric-B3UohyO_.js → ecentric-BKZbgUUA.js} +12 -12
- package/dist/sdk/{epna-DwUg2IlB.js → epna-BM5bSJk1.js} +1 -1
- package/dist/sdk/{flashbanc-LXs8bahL.js → flashbanc-CF9FiNJl.js} +1 -1
- package/dist/sdk/{forter-CLFaJUYa.js → forter-DJAURi8-.js} +2 -2
- package/dist/sdk/{gpayments-DoZug3PV.js → gpayments-BI4ClQBQ.js} +13 -13
- package/dist/sdk/{metrics_global-BM-ooge-.js → metrics_global-DuXa4GNp.js} +1 -1
- package/dist/sdk/{nmi-BA3ZTdQa.js → nmi-BtGmIJu6.js} +1 -1
- package/dist/sdk/{nuvei-DIWsLlLz.js → nuvei-DV30sIgG.js} +33 -33
- package/dist/sdk/{payabli-DgrTI1Et.js → payabli-8yAmXU9j.js} +1 -1
- package/dist/sdk/payfurl.es.js +1491 -1528
- package/dist/sdk/payfurl.umd.js +9 -8
- package/dist/sdk/{payglocal-ezp0MsaZ.js → payglocal-4P2oZpaS.js} +17 -17
- package/dist/sdk/{payway_rest-4Pjb1c7k.js → payway_rest-Cmi8SOvm.js} +1 -1
- package/dist/sdk/{skybank-BgDLlFXX.js → skybank-Czn5pUK_.js} +1 -1
- package/dist/sdk/strings-yAlHZQqv.js +322 -0
- package/package.json +1 -1
- package/dist/sdk/strings-DyifLS9r.js +0 -175
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as e } from "./DefaultThreeDsProvider-
|
|
2
|
-
import { t } from "./alerts-
|
|
3
|
-
import {
|
|
1
|
+
import { t as e } from "./DefaultThreeDsProvider-D0iYIu6R.js";
|
|
2
|
+
import { t } from "./alerts-CWLXzX6j.js";
|
|
3
|
+
import { Ct as n, Dt as r, Ht as i, Mt as a, Nt as o, Pt as s, _t as c, h as l, jt as u, mt as d, rt as f, wt as p, zt as m } from "./CloseIcon-Dkap5zUl.js";
|
|
4
4
|
import { t as h } from "./redact-Bn_hfytX.js";
|
|
5
5
|
// src/iframe/setup/log.ts
|
|
6
|
-
var g =
|
|
6
|
+
var g = i(!1);
|
|
7
7
|
function _(e, ...t) {
|
|
8
8
|
g.value && console.log(h(e), h(t));
|
|
9
9
|
}
|
|
@@ -11,9 +11,9 @@ function v(e) {
|
|
|
11
11
|
e?.data?.status && e.data.status === "init-card-form" && (g.value = !!e?.data?.debug);
|
|
12
12
|
}
|
|
13
13
|
function y() {
|
|
14
|
-
return
|
|
14
|
+
return a(() => {
|
|
15
15
|
window.addEventListener("message", v);
|
|
16
|
-
}),
|
|
16
|
+
}), o(() => {
|
|
17
17
|
window.removeEventListener("message", v);
|
|
18
18
|
}), {
|
|
19
19
|
debug: g,
|
|
@@ -21,27 +21,27 @@ function y() {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
// src/sdk/3ds/PayGLocalThreeDsChallenge.vue?vue&type=script&setup=true&lang.ts
|
|
24
|
-
var b = { class: "modal-mask" }, x = { class: "modal-wrapper" }, S = ["src"], C = /*#__PURE__*/
|
|
24
|
+
var b = { class: "modal-mask" }, x = { class: "modal-wrapper" }, S = ["src"], C = /*#__PURE__*/ f(/* @__PURE__ */ u({
|
|
25
25
|
__name: "PayGLocalThreeDsChallenge",
|
|
26
26
|
props: { url: {} },
|
|
27
27
|
emits: ["close"],
|
|
28
28
|
setup(e, { emit: t }) {
|
|
29
|
-
let { logMessage:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}),
|
|
29
|
+
let { logMessage: c } = y(), l = e, u = t, f = i(l.url), h = n(() => d(f.value) ? f.value : "");
|
|
30
|
+
m(() => l.url, (e) => {
|
|
31
|
+
f.value = e;
|
|
32
|
+
}), a(() => {
|
|
33
33
|
window.addEventListener("message", g);
|
|
34
|
-
}),
|
|
34
|
+
}), o(() => {
|
|
35
35
|
window.removeEventListener("message", g);
|
|
36
36
|
});
|
|
37
37
|
function g(e) {
|
|
38
|
-
if (
|
|
38
|
+
if (c("PayGLocalThreeDsChallenge: Message received", e.data), !e?.data?.["payglocal-token"]) return;
|
|
39
39
|
let t = e.data["payglocal-token"];
|
|
40
|
-
|
|
40
|
+
c("Token received", t);
|
|
41
41
|
let n = t.split(".")[1], r = window.atob(n), i = JSON.parse(r);
|
|
42
|
-
|
|
42
|
+
u("close", i);
|
|
43
43
|
}
|
|
44
|
-
return (e, t) => (
|
|
44
|
+
return (e, t) => (s(), r("div", b, [p("div", x, [p("iframe", {
|
|
45
45
|
src: h.value,
|
|
46
46
|
sandbox: "allow-same-origin allow-scripts allow-popups allow-forms"
|
|
47
47
|
}, null, 8, S)])]));
|
|
@@ -65,7 +65,7 @@ var b = { class: "modal-mask" }, x = { class: "modal-wrapper" }, S = ["src"], C
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
this.setChallengeFrameVisible(!0);
|
|
68
|
-
let { destroy: n } =
|
|
68
|
+
let { destroy: n } = c({
|
|
69
69
|
el: document.body,
|
|
70
70
|
component: C,
|
|
71
71
|
props: { url: e },
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { t as e } from "./redact-Bn_hfytX.js";
|
|
2
|
+
import { t } from "./screen-aNRlfrZR.js";
|
|
3
|
+
// src/sdk/config.local.ts
|
|
4
|
+
var n = {
|
|
5
|
+
baseUrl: "",
|
|
6
|
+
cssUrl: "",
|
|
7
|
+
redirectUrl: "",
|
|
8
|
+
url: "",
|
|
9
|
+
secureUrl: "/dist/secure/index.html",
|
|
10
|
+
apiUrl: "",
|
|
11
|
+
errorUrl: "https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"
|
|
12
|
+
}, r = {
|
|
13
|
+
baseUrl: "https://assets.payfurl.com",
|
|
14
|
+
cssUrl: "https://assets.payfurl.com/v4.11.3/js/",
|
|
15
|
+
url: "https://assets.payfurl.com/v4.11.3/iframe/index.html",
|
|
16
|
+
secureUrl: "https://assets.payfurl.com/v4.11.3/secure/index.html",
|
|
17
|
+
redirectUrl: "https://assets.payfurl.com/v4.11.3/checkout/redirect.html",
|
|
18
|
+
apiUrl: "https://develop-api.payfurl.com",
|
|
19
|
+
errorUrl: "https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"
|
|
20
|
+
}, i = {
|
|
21
|
+
baseUrl: "https://assets.payfurl.com",
|
|
22
|
+
cssUrl: "https://assets.payfurl.com/v4.11.3/js/",
|
|
23
|
+
url: "https://assets.payfurl.com/v4.11.3/iframe/index.html",
|
|
24
|
+
secureUrl: "https://assets.payfurl.com/v4.11.3/secure/index.html",
|
|
25
|
+
redirectUrl: "https://assets.payfurl.com/v4.11.3/checkout/redirect.html",
|
|
26
|
+
apiUrl: "https://sandbox-api.payfurl.com",
|
|
27
|
+
errorUrl: "https://gujl7xo5fhpkjaain4swyiymt40loyia.lambda-url.ap-southeast-2.on.aws"
|
|
28
|
+
}, a = {
|
|
29
|
+
baseUrl: "https://assets.payfurl.com",
|
|
30
|
+
cssUrl: "https://assets.payfurl.com/v4.11.3/js/",
|
|
31
|
+
url: "https://assets.payfurl.com/v4.11.3/iframe/index.html",
|
|
32
|
+
secureUrl: "https://assets.payfurl.com/v4.11.3/secure/index.html",
|
|
33
|
+
redirectUrl: "https://assets.payfurl.com/v4.11.3/checkout/redirect.html",
|
|
34
|
+
apiUrl: "https://api.payfurl.com",
|
|
35
|
+
errorUrl: "https://4rvkh6tupgcmqk3b2igkpdi2zi0mveyg.lambda-url.ap-southeast-2.on.aws"
|
|
36
|
+
}, o = {
|
|
37
|
+
name: "@payfurl/client",
|
|
38
|
+
private: !1,
|
|
39
|
+
version: "4.11.3",
|
|
40
|
+
homepage: "https://docs.payfurl.com/client_sdk/overview",
|
|
41
|
+
bugs: { url: "https://docs.payfurl.com/support" },
|
|
42
|
+
files: ["dist/sdk", "CHANGELOG.md"],
|
|
43
|
+
type: "module",
|
|
44
|
+
main: "./dist/sdk/payfurl.umd.js",
|
|
45
|
+
module: "./dist/sdk/payfurl.es.js",
|
|
46
|
+
types: "./dist/sdk/payfurl.d.ts",
|
|
47
|
+
exports: { ".": {
|
|
48
|
+
types: "./dist/sdk/payfurl.d.ts",
|
|
49
|
+
import: "./dist/sdk/payfurl.es.js",
|
|
50
|
+
require: "./dist/sdk/payfurl.umd.js"
|
|
51
|
+
} },
|
|
52
|
+
scripts: {
|
|
53
|
+
dev: "node .build/config-local.mjs && vite -c vite.iframe.config.ts",
|
|
54
|
+
"build-iframe": "node .build/config-local.mjs && vite build -c vite.iframe.config.ts --emptyOutDir",
|
|
55
|
+
"build-secure": "node .build/config-local.mjs && vite build -c vite.secure.config.ts --emptyOutDir",
|
|
56
|
+
"build-sdk": "node .build/config-local.mjs && vite build -c vite.sdk.config.ts",
|
|
57
|
+
build: "npm run build-all",
|
|
58
|
+
"build-all": "npm run build-iframe && npm run build-secure && npm run build-sdk",
|
|
59
|
+
preview: "vite preview",
|
|
60
|
+
server: "python3 -m http.server 3001",
|
|
61
|
+
test: "node .build/config-local.mjs && jest",
|
|
62
|
+
"update-packages": "ncu -u && npm update --save",
|
|
63
|
+
remove_js: "git ls-files -o --exclude-standard | grep '.js' | xargs rm",
|
|
64
|
+
remove_d_ts: "git ls-files -o --exclude-standard | grep '.d.ts' | xargs rm"
|
|
65
|
+
},
|
|
66
|
+
dependencies: {
|
|
67
|
+
dayjs: "^1.11.13",
|
|
68
|
+
vue: "^3.5.10"
|
|
69
|
+
},
|
|
70
|
+
devDependencies: {
|
|
71
|
+
"@babel/preset-env": "^7.25.4",
|
|
72
|
+
"@babel/types": "^7.25.6",
|
|
73
|
+
"@jest/globals": "^29.7.0",
|
|
74
|
+
"@rollup/plugin-typescript": "^12.1.0",
|
|
75
|
+
"@types/applepayjs": "^14.0.8",
|
|
76
|
+
"@types/jest": "^29.5.13",
|
|
77
|
+
"@types/jest-when": "^3.5.5",
|
|
78
|
+
"@types/node": "^22.7.4",
|
|
79
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
80
|
+
"@vue/eslint-config-prettier": "^9.0.0",
|
|
81
|
+
"@vue/eslint-config-typescript": "^13.0.0",
|
|
82
|
+
"@vue/vue3-jest": "^29.2.6",
|
|
83
|
+
"babel-jest": "^29.7.0",
|
|
84
|
+
eslint: "^8.56.0",
|
|
85
|
+
"eslint-plugin-vue": "^9.28.0",
|
|
86
|
+
jest: "^29.7.0",
|
|
87
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
88
|
+
"jest-when": "^3.6.0",
|
|
89
|
+
prettier: "^3.3.3",
|
|
90
|
+
"rollup-plugin-visualizer": "^5.12.0",
|
|
91
|
+
"ts-jest": "^29.2.5",
|
|
92
|
+
"ts-node": "^10.9.2",
|
|
93
|
+
tslib: "^2.8.1",
|
|
94
|
+
typescript: "^5.6.2",
|
|
95
|
+
vite: "^8.0.16",
|
|
96
|
+
"vite-plugin-checker": "^0.8.0",
|
|
97
|
+
"vite-plugin-dts": "^4.5.4",
|
|
98
|
+
"vue-tsc": "^2.1.6"
|
|
99
|
+
}
|
|
100
|
+
}, s;
|
|
101
|
+
(function(e) {
|
|
102
|
+
e.LOCAL = "local", e.DEVELOPMENT = "development", e.SANDBOX = "sandbox", e.PRODUCTION = "production";
|
|
103
|
+
})(s ||= {});
|
|
104
|
+
var c = {
|
|
105
|
+
[s.LOCAL]: n,
|
|
106
|
+
[s.DEVELOPMENT]: r,
|
|
107
|
+
[s.SANDBOX]: i,
|
|
108
|
+
[s.PRODUCTION]: a
|
|
109
|
+
};
|
|
110
|
+
function l(e) {
|
|
111
|
+
let t = c[e];
|
|
112
|
+
return t && Object.fromEntries(Object.entries(t).map(([e, t]) => [e, t.split("{VERSION}").join(o.version)]));
|
|
113
|
+
}
|
|
114
|
+
function u(e) {
|
|
115
|
+
let t = c[e];
|
|
116
|
+
return t ||= c[s.PRODUCTION], t.errorUrl;
|
|
117
|
+
}
|
|
118
|
+
// src/utils/ErrorHandler.ts
|
|
119
|
+
var d = 2e3, f = /(\b(?:https?|blob|file):[^\s?#()]*)[?#][^\s()]*?(?=(?::\d+){1,2}(?:\)|\s|$)|\)|\s|$)/g;
|
|
120
|
+
function p(t) {
|
|
121
|
+
return e(t.replace(f, "$1").slice(0, d));
|
|
122
|
+
}
|
|
123
|
+
function m() {
|
|
124
|
+
try {
|
|
125
|
+
if (typeof crypto < "u" && crypto.randomUUID) return crypto.randomUUID();
|
|
126
|
+
} catch {}
|
|
127
|
+
return Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
128
|
+
}
|
|
129
|
+
function h() {
|
|
130
|
+
try {
|
|
131
|
+
return window.location.origin + window.location.pathname;
|
|
132
|
+
} catch {
|
|
133
|
+
return "";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
var g = class n {
|
|
137
|
+
static environment;
|
|
138
|
+
static publicKey;
|
|
139
|
+
static version = o.version;
|
|
140
|
+
static session = {
|
|
141
|
+
sessionId: m(),
|
|
142
|
+
page: h()
|
|
143
|
+
};
|
|
144
|
+
static sent = /* @__PURE__ */ new Set();
|
|
145
|
+
static init(e, t, r, i) {
|
|
146
|
+
return n.environment = String(e || "").toLowerCase(), n.publicKey = t, n.version = r || o.version, i?.sessionId && (n.session = {
|
|
147
|
+
sessionId: i.sessionId,
|
|
148
|
+
page: i.page || ""
|
|
149
|
+
}), new n();
|
|
150
|
+
}
|
|
151
|
+
static getSession() {
|
|
152
|
+
return { ...n.session };
|
|
153
|
+
}
|
|
154
|
+
static reset() {
|
|
155
|
+
n.sent.clear();
|
|
156
|
+
}
|
|
157
|
+
sendError(r, i, a, o) {
|
|
158
|
+
try {
|
|
159
|
+
let s = r + "\n" + i;
|
|
160
|
+
if (n.sent.has(s)) return;
|
|
161
|
+
n.sent.add(s);
|
|
162
|
+
let c = /* @__PURE__ */ new Date(), l = JSON.stringify({
|
|
163
|
+
method: r,
|
|
164
|
+
message: i,
|
|
165
|
+
context: {
|
|
166
|
+
publicKey: n.publicKey,
|
|
167
|
+
version: n.version,
|
|
168
|
+
environment: n.environment,
|
|
169
|
+
sessionId: e(n.session.sessionId),
|
|
170
|
+
page: e(n.session.page),
|
|
171
|
+
browser: {
|
|
172
|
+
userAgent: navigator.userAgent,
|
|
173
|
+
language: window.navigator.language,
|
|
174
|
+
colorDepth: String(t()),
|
|
175
|
+
screenHeight: screen.height + "",
|
|
176
|
+
screenWidth: screen.width + "",
|
|
177
|
+
timezone: Math.round(c.getTimezoneOffset() / 60) + "",
|
|
178
|
+
referrer: document.referrer
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
arguments: Object.values(a).map((e) => typeof e == "object" ? JSON.stringify(e) : String(e)),
|
|
182
|
+
...o && { stack: p(String(o)) }
|
|
183
|
+
}), d = new XMLHttpRequest();
|
|
184
|
+
d.open("POST", u(n.environment)), d.setRequestHeader("Content-Type", "application/json"), d.send(l);
|
|
185
|
+
} catch (e) {
|
|
186
|
+
console.error("Error sending error", e);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}, _ = /* @__PURE__ */ new WeakSet();
|
|
190
|
+
function v(e, t, n = []) {
|
|
191
|
+
if (t && (typeof t == "object" || typeof t == "function")) {
|
|
192
|
+
if (_.has(t)) return !1;
|
|
193
|
+
_.add(t);
|
|
194
|
+
}
|
|
195
|
+
let r = t instanceof Error || typeof t?.message == "string" ? t.message : String(t);
|
|
196
|
+
return new g().sendError(e, r, w(n), typeof t?.stack == "string" ? t.stack : void 0), !0;
|
|
197
|
+
}
|
|
198
|
+
function y(t, n, r) {
|
|
199
|
+
return n instanceof Promise && n.then(void 0, (n) => {
|
|
200
|
+
v(t, n, r) && console.warn("[ErrorHandled], rejection", {
|
|
201
|
+
error: e(n),
|
|
202
|
+
method: t,
|
|
203
|
+
args: w(r)
|
|
204
|
+
});
|
|
205
|
+
}), n;
|
|
206
|
+
}
|
|
207
|
+
function b(t, n, r) {
|
|
208
|
+
let i = r.value;
|
|
209
|
+
r.value = function(...t) {
|
|
210
|
+
try {
|
|
211
|
+
return y(n, i.apply(this, t), t);
|
|
212
|
+
} catch (r) {
|
|
213
|
+
throw v(n, r, t) && console.warn("[ErrorHandled], exception", {
|
|
214
|
+
error: e(r),
|
|
215
|
+
propertyKey: n,
|
|
216
|
+
arguments: w(t)
|
|
217
|
+
}), r;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function x(t, n, r) {
|
|
222
|
+
return function(...i) {
|
|
223
|
+
try {
|
|
224
|
+
return y(n, r.apply(t, i), i);
|
|
225
|
+
} catch (t) {
|
|
226
|
+
throw v(n, t, i) && console.warn("[ErrorHandledFunction], exception", {
|
|
227
|
+
error: e(t),
|
|
228
|
+
funcName: n,
|
|
229
|
+
args: w(i)
|
|
230
|
+
}), t;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function S(e, t) {
|
|
235
|
+
return typeof t == "function" ? function(...n) {
|
|
236
|
+
try {
|
|
237
|
+
return t.apply(this, n);
|
|
238
|
+
} catch (t) {
|
|
239
|
+
throw v(`[integration] merchant ${e} handler threw`, t), t;
|
|
240
|
+
}
|
|
241
|
+
} : t;
|
|
242
|
+
}
|
|
243
|
+
function C(e, t, n) {
|
|
244
|
+
new g().sendError(e, t, w(n));
|
|
245
|
+
}
|
|
246
|
+
function w(t) {
|
|
247
|
+
return t.map((t) => e(t));
|
|
248
|
+
}
|
|
249
|
+
// src/utils/httpInvoker.ts
|
|
250
|
+
var T = !1;
|
|
251
|
+
typeof window < "u" && (window.addEventListener("pagehide", () => {
|
|
252
|
+
T = !0;
|
|
253
|
+
}), window.addEventListener("pageshow", () => {
|
|
254
|
+
T = !1;
|
|
255
|
+
}));
|
|
256
|
+
function E(e, t, n) {
|
|
257
|
+
if (T || e !== 0 && e < 500) return;
|
|
258
|
+
let r = "";
|
|
259
|
+
try {
|
|
260
|
+
r = new URL(n).pathname;
|
|
261
|
+
} catch {}
|
|
262
|
+
C(e === 0 ? "[shopper][httpInvoker]" : "[httpInvoker]", `API request failed: status ${e}`, [t, r]);
|
|
263
|
+
}
|
|
264
|
+
var D = class {
|
|
265
|
+
publicKey = "";
|
|
266
|
+
version = "";
|
|
267
|
+
regionResolver = null;
|
|
268
|
+
constructor(e, t, n) {
|
|
269
|
+
this.publicKey = e || "", this.version = t || "", this.regionResolver = n || null;
|
|
270
|
+
}
|
|
271
|
+
invoke(e, t, n, r, i, a) {
|
|
272
|
+
let o = new XMLHttpRequest();
|
|
273
|
+
o || i?.(0, ""), o.onreadystatechange = function() {
|
|
274
|
+
o.readyState === 4 && (o.status === 200 || o.status === 201 ? r?.(o.status, o.responseText) : (E(o.status, t, e), i?.(o.status, o.responseText)));
|
|
275
|
+
};
|
|
276
|
+
let s = new URL(e);
|
|
277
|
+
if (this.regionResolver && (s.hostname = new URL(this.regionResolver.getRegionUrl()).hostname), o.open(t, s.toString()), o.setRequestHeader("Content-Type", "application/json"), this.publicKey && o.setRequestHeader("x-publickey", this.publicKey), this.version && o.setRequestHeader("sdk-version", this.version), a) for (let [e, t] of Object.entries(a)) o.setRequestHeader(e, t);
|
|
278
|
+
o.send(String(n));
|
|
279
|
+
}
|
|
280
|
+
}, O = { domain: "payfurl.com" }, k = {
|
|
281
|
+
[s.DEVELOPMENT]: {
|
|
282
|
+
AU: `https://develop-api-au.${O.domain}`,
|
|
283
|
+
DEFAULT: `https://develop-api.${O.domain}`
|
|
284
|
+
},
|
|
285
|
+
[s.SANDBOX]: {
|
|
286
|
+
AU: `https://sandbox-api-au.${O.domain}`,
|
|
287
|
+
DEFAULT: `https://sandbox-api.${O.domain}`
|
|
288
|
+
},
|
|
289
|
+
[s.PRODUCTION]: {
|
|
290
|
+
AU: `https://api-au.${O.domain}`,
|
|
291
|
+
DEFAULT: `https://api.${O.domain}`
|
|
292
|
+
},
|
|
293
|
+
[s.LOCAL]: { DEFAULT: "https://localhost:5001" }
|
|
294
|
+
}, A = class {
|
|
295
|
+
environment;
|
|
296
|
+
location;
|
|
297
|
+
constructor(e, t) {
|
|
298
|
+
this.environment = e.toLowerCase(), this.location = t.toUpperCase();
|
|
299
|
+
}
|
|
300
|
+
getRegionUrl() {
|
|
301
|
+
if (!k[this.environment]) throw Error(`Invalid environment: ${this.environment}`);
|
|
302
|
+
return k[this.environment][this.location] || k[this.environment].DEFAULT;
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
// src/utils/strings.ts
|
|
306
|
+
function j(e) {
|
|
307
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
308
|
+
}
|
|
309
|
+
function M(e) {
|
|
310
|
+
return e.match(/-([a-z]{2})$/)?.[1] || "";
|
|
311
|
+
}
|
|
312
|
+
function N(e) {
|
|
313
|
+
let t = e.match(/\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)(\d{1,14})$/);
|
|
314
|
+
return t ? [t[1], t[2]] : [e];
|
|
315
|
+
}
|
|
316
|
+
function P(e) {
|
|
317
|
+
return e ? e.replace(/(\d{4})\d{8}(\d{4})/, "$1 **** **** $2") : "";
|
|
318
|
+
}
|
|
319
|
+
function F(e) {
|
|
320
|
+
return e.replace(/\s/g, "");
|
|
321
|
+
}
|
|
322
|
+
export { N as a, b as c, C as d, g as f, o as h, P as i, x as l, l as m, j as n, A as o, s as p, M as r, D as s, F as t, S as u };
|
package/package.json
CHANGED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
// src/sdk/config.local.ts
|
|
2
|
-
var e = {
|
|
3
|
-
baseUrl: "",
|
|
4
|
-
cssUrl: "",
|
|
5
|
-
redirectUrl: "",
|
|
6
|
-
url: "",
|
|
7
|
-
secureUrl: "/dist/secure/index.html",
|
|
8
|
-
apiUrl: "",
|
|
9
|
-
errorUrl: "https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"
|
|
10
|
-
}, t = {
|
|
11
|
-
baseUrl: "https://assets.payfurl.com",
|
|
12
|
-
cssUrl: "https://assets.payfurl.com/v4.11.1/js/",
|
|
13
|
-
url: "https://assets.payfurl.com/v4.11.1/iframe/index.html",
|
|
14
|
-
secureUrl: "https://assets.payfurl.com/v4.11.1/secure/index.html",
|
|
15
|
-
redirectUrl: "https://assets.payfurl.com/v4.11.1/checkout/redirect.html",
|
|
16
|
-
apiUrl: "https://develop-api.payfurl.com",
|
|
17
|
-
errorUrl: "https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"
|
|
18
|
-
}, n = {
|
|
19
|
-
baseUrl: "https://assets.payfurl.com",
|
|
20
|
-
cssUrl: "https://assets.payfurl.com/v4.11.1/js/",
|
|
21
|
-
url: "https://assets.payfurl.com/v4.11.1/iframe/index.html",
|
|
22
|
-
secureUrl: "https://assets.payfurl.com/v4.11.1/secure/index.html",
|
|
23
|
-
redirectUrl: "https://assets.payfurl.com/v4.11.1/checkout/redirect.html",
|
|
24
|
-
apiUrl: "https://sandbox-api.payfurl.com",
|
|
25
|
-
errorUrl: "https://gujl7xo5fhpkjaain4swyiymt40loyia.lambda-url.ap-southeast-2.on.aws"
|
|
26
|
-
}, r = {
|
|
27
|
-
baseUrl: "https://assets.payfurl.com",
|
|
28
|
-
cssUrl: "https://assets.payfurl.com/v4.11.1/js/",
|
|
29
|
-
url: "https://assets.payfurl.com/v4.11.1/iframe/index.html",
|
|
30
|
-
secureUrl: "https://assets.payfurl.com/v4.11.1/secure/index.html",
|
|
31
|
-
redirectUrl: "https://assets.payfurl.com/v4.11.1/checkout/redirect.html",
|
|
32
|
-
apiUrl: "https://api.payfurl.com",
|
|
33
|
-
errorUrl: "https://4rvkh6tupgcmqk3b2igkpdi2zi0mveyg.lambda-url.ap-southeast-2.on.aws"
|
|
34
|
-
}, i = {
|
|
35
|
-
name: "@payfurl/client",
|
|
36
|
-
private: !1,
|
|
37
|
-
version: "4.11.1",
|
|
38
|
-
homepage: "https://docs.payfurl.com/client_sdk/overview",
|
|
39
|
-
bugs: { url: "https://docs.payfurl.com/support" },
|
|
40
|
-
files: ["dist/sdk", "CHANGELOG.md"],
|
|
41
|
-
type: "module",
|
|
42
|
-
main: "./dist/sdk/payfurl.umd.js",
|
|
43
|
-
module: "./dist/sdk/payfurl.es.js",
|
|
44
|
-
types: "./dist/sdk/payfurl.d.ts",
|
|
45
|
-
exports: { ".": {
|
|
46
|
-
types: "./dist/sdk/payfurl.d.ts",
|
|
47
|
-
import: "./dist/sdk/payfurl.es.js",
|
|
48
|
-
require: "./dist/sdk/payfurl.umd.js"
|
|
49
|
-
} },
|
|
50
|
-
scripts: {
|
|
51
|
-
dev: "node .build/config-local.mjs && vite -c vite.iframe.config.ts",
|
|
52
|
-
"build-iframe": "node .build/config-local.mjs && vite build -c vite.iframe.config.ts --emptyOutDir",
|
|
53
|
-
"build-secure": "node .build/config-local.mjs && vite build -c vite.secure.config.ts --emptyOutDir",
|
|
54
|
-
"build-sdk": "node .build/config-local.mjs && vite build -c vite.sdk.config.ts",
|
|
55
|
-
build: "npm run build-all",
|
|
56
|
-
"build-all": "npm run build-iframe && npm run build-secure && npm run build-sdk",
|
|
57
|
-
preview: "vite preview",
|
|
58
|
-
server: "python3 -m http.server 3001",
|
|
59
|
-
test: "node .build/config-local.mjs && jest",
|
|
60
|
-
"update-packages": "ncu -u && npm update --save",
|
|
61
|
-
remove_js: "git ls-files -o --exclude-standard | grep '.js' | xargs rm",
|
|
62
|
-
remove_d_ts: "git ls-files -o --exclude-standard | grep '.d.ts' | xargs rm"
|
|
63
|
-
},
|
|
64
|
-
dependencies: {
|
|
65
|
-
dayjs: "^1.11.13",
|
|
66
|
-
vue: "^3.5.10"
|
|
67
|
-
},
|
|
68
|
-
devDependencies: {
|
|
69
|
-
"@babel/preset-env": "^7.25.4",
|
|
70
|
-
"@babel/types": "^7.25.6",
|
|
71
|
-
"@jest/globals": "^29.7.0",
|
|
72
|
-
"@rollup/plugin-typescript": "^12.1.0",
|
|
73
|
-
"@types/applepayjs": "^14.0.8",
|
|
74
|
-
"@types/jest": "^29.5.13",
|
|
75
|
-
"@types/jest-when": "^3.5.5",
|
|
76
|
-
"@types/node": "^22.7.4",
|
|
77
|
-
"@vitejs/plugin-vue": "^6.0.7",
|
|
78
|
-
"@vue/eslint-config-prettier": "^9.0.0",
|
|
79
|
-
"@vue/eslint-config-typescript": "^13.0.0",
|
|
80
|
-
"@vue/vue3-jest": "^29.2.6",
|
|
81
|
-
"babel-jest": "^29.7.0",
|
|
82
|
-
eslint: "^8.56.0",
|
|
83
|
-
"eslint-plugin-vue": "^9.28.0",
|
|
84
|
-
jest: "^29.7.0",
|
|
85
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
86
|
-
"jest-when": "^3.6.0",
|
|
87
|
-
prettier: "^3.3.3",
|
|
88
|
-
"rollup-plugin-visualizer": "^5.12.0",
|
|
89
|
-
"ts-jest": "^29.2.5",
|
|
90
|
-
"ts-node": "^10.9.2",
|
|
91
|
-
tslib: "^2.8.1",
|
|
92
|
-
typescript: "^5.6.2",
|
|
93
|
-
vite: "^8.0.16",
|
|
94
|
-
"vite-plugin-checker": "^0.8.0",
|
|
95
|
-
"vite-plugin-dts": "^4.5.4",
|
|
96
|
-
"vue-tsc": "^2.1.6"
|
|
97
|
-
}
|
|
98
|
-
}, a;
|
|
99
|
-
(function(e) {
|
|
100
|
-
e.LOCAL = "local", e.DEVELOPMENT = "development", e.SANDBOX = "sandbox", e.PRODUCTION = "production";
|
|
101
|
-
})(a ||= {});
|
|
102
|
-
var o = {
|
|
103
|
-
[a.LOCAL]: e,
|
|
104
|
-
[a.DEVELOPMENT]: t,
|
|
105
|
-
[a.SANDBOX]: n,
|
|
106
|
-
[a.PRODUCTION]: r
|
|
107
|
-
};
|
|
108
|
-
function s(e) {
|
|
109
|
-
let t = o[e];
|
|
110
|
-
return t && Object.fromEntries(Object.entries(t).map(([e, t]) => [e, t.split("{VERSION}").join(i.version)]));
|
|
111
|
-
}
|
|
112
|
-
function c(e) {
|
|
113
|
-
let t = o[e];
|
|
114
|
-
return t ||= o[a.PRODUCTION], t.errorUrl;
|
|
115
|
-
}
|
|
116
|
-
// src/utils/httpInvoker.ts
|
|
117
|
-
var l = class {
|
|
118
|
-
publicKey = "";
|
|
119
|
-
version = "";
|
|
120
|
-
regionResolver = null;
|
|
121
|
-
constructor(e, t, n) {
|
|
122
|
-
this.publicKey = e || "", this.version = t || "", this.regionResolver = n || null;
|
|
123
|
-
}
|
|
124
|
-
invoke(e, t, n, r, i, a) {
|
|
125
|
-
let o = new XMLHttpRequest();
|
|
126
|
-
o || i?.(0, ""), o.onreadystatechange = function() {
|
|
127
|
-
o.readyState === 4 && (o.status === 200 || o.status === 201 ? r?.(o.status, o.responseText) : i?.(o.status, o.responseText));
|
|
128
|
-
};
|
|
129
|
-
let s = new URL(e);
|
|
130
|
-
if (this.regionResolver && (s.hostname = new URL(this.regionResolver.getRegionUrl()).hostname), o.open(t, s.toString()), o.setRequestHeader("Content-Type", "application/json"), this.publicKey && o.setRequestHeader("x-publickey", this.publicKey), this.version && o.setRequestHeader("sdk-version", this.version), a) for (let [e, t] of Object.entries(a)) o.setRequestHeader(e, t);
|
|
131
|
-
o.send(String(n));
|
|
132
|
-
}
|
|
133
|
-
}, u = { domain: "payfurl.com" }, d = {
|
|
134
|
-
[a.DEVELOPMENT]: {
|
|
135
|
-
AU: `https://develop-api-au.${u.domain}`,
|
|
136
|
-
DEFAULT: `https://develop-api.${u.domain}`
|
|
137
|
-
},
|
|
138
|
-
[a.SANDBOX]: {
|
|
139
|
-
AU: `https://sandbox-api-au.${u.domain}`,
|
|
140
|
-
DEFAULT: `https://sandbox-api.${u.domain}`
|
|
141
|
-
},
|
|
142
|
-
[a.PRODUCTION]: {
|
|
143
|
-
AU: `https://api-au.${u.domain}`,
|
|
144
|
-
DEFAULT: `https://api.${u.domain}`
|
|
145
|
-
},
|
|
146
|
-
[a.LOCAL]: { DEFAULT: "https://localhost:5001" }
|
|
147
|
-
}, f = class {
|
|
148
|
-
environment;
|
|
149
|
-
location;
|
|
150
|
-
constructor(e, t) {
|
|
151
|
-
this.environment = e.toLowerCase(), this.location = t.toUpperCase();
|
|
152
|
-
}
|
|
153
|
-
getRegionUrl() {
|
|
154
|
-
if (!d[this.environment]) throw Error(`Invalid environment: ${this.environment}`);
|
|
155
|
-
return d[this.environment][this.location] || d[this.environment].DEFAULT;
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
// src/utils/strings.ts
|
|
159
|
-
function p(e) {
|
|
160
|
-
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
161
|
-
}
|
|
162
|
-
function m(e) {
|
|
163
|
-
return e.match(/-([a-z]{2})$/)?.[1] || "";
|
|
164
|
-
}
|
|
165
|
-
function h(e) {
|
|
166
|
-
let t = e.match(/\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)(\d{1,14})$/);
|
|
167
|
-
return t ? [t[1], t[2]] : [e];
|
|
168
|
-
}
|
|
169
|
-
function g(e) {
|
|
170
|
-
return e ? e.replace(/(\d{4})\d{8}(\d{4})/, "$1 **** **** $2") : "";
|
|
171
|
-
}
|
|
172
|
-
function _(e) {
|
|
173
|
-
return e.replace(/\s/g, "");
|
|
174
|
-
}
|
|
175
|
-
export { h as a, a as c, i as d, g as i, s as l, p as n, f as o, m as r, l as s, _ as t, c as u };
|