@payfurl/react-plugin 1.0.10 → 1.1.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/dist/{CxPayThreeDsProvider-DfJyYDV8-BtwTH6Vv.js → CxPayThreeDsProvider-7yh00m_f-BSAj-Zut.js} +1 -1
- package/dist/{DefaultThreeDsProvider-DvV6zVzO-DDYac6nh.js → DefaultThreeDsProvider-Bs-1jjDE-BR4j-f3Q.js} +33 -33
- package/dist/{EcentricThreeDsProvider-DC4tQCJ4-43cDaJIh.js → EcentricThreeDsProvider-BjVGZlb9-BVFegP5X.js} +31 -31
- package/dist/{EpnaThreeDsProvider-D9tTUWnr-EX6HQmg0.js → EpnaThreeDsProvider-D-jEeUhd-CjqDQ6sC.js} +1 -1
- package/dist/{FlashBancThreeDsProvider-Dc_WgWyQ-D2rZd6ti.js → FlashBancThreeDsProvider-Cov5ey75-D0PVygYS.js} +1 -1
- package/dist/{GPaymentsThreeDsProvider-BAJmTSdj-BmLQFvQr.js → GPaymentsThreeDsProvider-DC48F4-s-CeTTM1oZ.js} +23 -22
- package/dist/MetricsGlobalThreeDsProvider-D1adNHH6-59d0yjP1.js +146 -0
- package/dist/{NmiThreeDsProvider-X5Wb78Qq-D6zRtIK-.js → NmiThreeDsProvider-UdLXXANS-BJ_uuNCG.js} +1 -1
- package/dist/{NuveiThreeDsProvider-C7kP4S9V-CKRUbO6O.js → NuveiThreeDsProvider-Da4x--0n-2TdKYejN.js} +45 -45
- package/dist/{PayGLocalThreeDsProvider-pa38V_3c-BYX0XJ0I.js → PayGLocalThreeDsProvider-BnHoCS8k-DBBnV_0h.js} +28 -28
- package/dist/{PayWayAppleButton-DGBgHxM1--mVa2z-I.js → PayWayAppleButton-BnfVXscK-s3xK_XOH.js} +1 -1
- package/dist/{PayabliThreeDsProvider-CMCehiRL-Dsv7XOl0.js → PayabliThreeDsProvider-DputC3bO-NOKVgrTF.js} +1 -1
- package/dist/{SkyBankThreeDsProvider-BJXZbNSS-DjLydBX-.js → SkyBankThreeDsProvider-Dv1Vr_P5-BfAcbM_v.js} +1 -1
- package/dist/{cxpay-CmCXB_3H-CFTLoWfG.js → cxpay-DvznoDgN-7uW13wnL.js} +1 -1
- package/dist/{default-DwmL369u-CFn9gU9h.js → default-C5N621sA-vMshBhxy.js} +1 -1
- package/dist/{ecentric-CkX8jlMS-CIF3TL3n.js → ecentric-CAuUEG5b-BIT7b2FE.js} +1 -1
- package/dist/{epna-CQuWi-kj-Bp3oLoVZ.js → epna-diKGQ91--D_6ns_Yg.js} +1 -1
- package/dist/{flashbanc-ROJhNrEr-CkfPZX3E.js → flashbanc-D8UHX81f-DP7Mfbms.js} +1 -1
- package/dist/{gpayments-CMf-VGx8-woOHZ2Uf.js → gpayments-C4CSZg2r-CiQQN4E2.js} +1 -1
- package/dist/{index-DjmLClKy.js → index-CgZDGZz7.js} +5202 -5062
- package/dist/{metrics_global-DCnzJ8W3-owheVXbs.js → metrics_global-BawXVoSi-BbuxD9JD.js} +1 -1
- package/dist/nmi-LmUsZTYy-ByY_sPgd.js +7 -0
- package/dist/{nuvei-DY1eIaaI-CH37Pkov.js → nuvei-DXKVuVRr-BU6CdMvt.js} +1 -1
- package/dist/{payabli-DD1ZuFv1-GPn71phq.js → payabli-7PdId67j-C1ny_G1X.js} +1 -1
- package/dist/payfurl-react.es.js +1 -1
- package/dist/payfurl-react.umd.js +26 -26
- package/dist/{payglocal-CC7Mmvkg-B93wBeJX.js → payglocal-vL14oF4n-tNH_zCze.js} +1 -1
- package/dist/{payway_rest-C2bgT2mt-DZYerbzI.js → payway_rest-Ca-gqNG3-Dlq4bSLu.js} +1 -1
- package/dist/{skybank-DLUEQlDI-CALhFzpW.js → skybank-B8zqMe9Y-CvU0qUrH.js} +1 -1
- package/package.json +2 -2
- package/dist/MetricsGlobalThreeDsProvider-DiPpCK4e-CRZ470ug.js +0 -146
- package/dist/nmi-BAQHxhKe-DtWC05bC.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d,
|
|
2
|
-
var
|
|
3
|
-
const
|
|
1
|
+
import { M as d, y as S, d as g, z as p, a as m, I as T, e as v, J as I, x as u, $ as f, b as y, O as A, n as C, B as E, Y as R } from "./index-CgZDGZz7.js";
|
|
2
|
+
var P = Object.defineProperty, b = (l, e, s) => e in l ? P(l, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : l[e] = s, a = (l, e, s) => b(l, typeof e != "symbol" ? e + "" : e, s);
|
|
3
|
+
const U = { class: "mask" }, $ = { class: "wrapper" }, M = { class: "container" }, L = ["action"], _ = ["value"], w = /* @__PURE__ */ m({
|
|
4
4
|
__name: "ThreeDsChallenge",
|
|
5
5
|
props: {
|
|
6
6
|
threeDSServerTransID: {},
|
|
@@ -9,43 +9,43 @@ const P = { class: "mask" }, U = { class: "wrapper" }, b = { class: "container"
|
|
|
9
9
|
},
|
|
10
10
|
emits: ["close", "submit"],
|
|
11
11
|
setup(l, { emit: e }) {
|
|
12
|
-
const s = l, n = e, o = T(
|
|
12
|
+
const s = l, n = e, o = T(() => E(s.formAction) ? s.formAction : ""), i = C(null), r = JSON.stringify({
|
|
13
13
|
threeDSServerTransID: s.threeDSServerTransID,
|
|
14
14
|
acsTransID: s.acsTransID,
|
|
15
15
|
messageVersion: "2.2.0",
|
|
16
16
|
messageType: "CReq",
|
|
17
17
|
challengeWindowSize: "01"
|
|
18
|
-
}),
|
|
19
|
-
return
|
|
20
|
-
var
|
|
21
|
-
(
|
|
22
|
-
}), (
|
|
23
|
-
u("div",
|
|
24
|
-
u("div",
|
|
25
|
-
|
|
26
|
-
onClick:
|
|
18
|
+
}), t = encodeURI(window.btoa(r).replace(/=*$/, ""));
|
|
19
|
+
return v(() => {
|
|
20
|
+
var h;
|
|
21
|
+
o.value && ((h = i.value) == null || h.submit());
|
|
22
|
+
}), (h, c) => (R(), I("div", U, [
|
|
23
|
+
u("div", $, [
|
|
24
|
+
u("div", M, [
|
|
25
|
+
f(y, {
|
|
26
|
+
onClick: c[0] || (c[0] = (H) => n("close")),
|
|
27
27
|
id: "3ds-challenge-close"
|
|
28
28
|
}),
|
|
29
|
-
|
|
29
|
+
c[1] || (c[1] = u("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)),
|
|
30
30
|
u("form", {
|
|
31
|
-
action:
|
|
31
|
+
action: o.value,
|
|
32
32
|
target: "ThreeDsChallengeIFrame",
|
|
33
33
|
method: "post",
|
|
34
34
|
ref_key: "form",
|
|
35
|
-
ref:
|
|
35
|
+
ref: i
|
|
36
36
|
}, [
|
|
37
37
|
u("input", {
|
|
38
38
|
type: "hidden",
|
|
39
39
|
name: "creq",
|
|
40
|
-
value: A(
|
|
41
|
-
}, null, 8,
|
|
42
|
-
], 8,
|
|
40
|
+
value: A(t)
|
|
41
|
+
}, null, 8, _)
|
|
42
|
+
], 8, L)
|
|
43
43
|
])
|
|
44
44
|
])
|
|
45
45
|
]));
|
|
46
46
|
}
|
|
47
|
-
}),
|
|
48
|
-
class
|
|
47
|
+
}), O = /* @__PURE__ */ p(w, [["__scopeId", "data-v-07081e85"]]);
|
|
48
|
+
class k {
|
|
49
49
|
constructor() {
|
|
50
50
|
a(this, "iframeId", "threeDsIframeMethod"), a(this, "containerId", "payfurlContainerFormInvoker"), a(this, "iframe", null), a(this, "container", null);
|
|
51
51
|
}
|
|
@@ -64,8 +64,8 @@ class w {
|
|
|
64
64
|
t.submit();
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
const { hideSpinner: D, showSpinner:
|
|
68
|
-
class
|
|
67
|
+
const { hideSpinner: D, showSpinner: N } = g(), q = "3ds_method_invocation_complete", V = "3ds_challenge_complete";
|
|
68
|
+
class J {
|
|
69
69
|
constructor(e, s, n) {
|
|
70
70
|
a(this, "log"), a(this, "container"), a(this, "options"), a(this, "threeDsProcessor", null), a(this, "threeDSDestroy", () => {
|
|
71
71
|
}), a(this, "threeDSServerTransID", ""), a(this, "threeDSAuthURL", ""), a(this, "threeDSRequestorTransID", ""), a(this, "threeDSMonitorURL", ""), a(this, "internalMessageHandler", this.messageHandler.bind(this)), a(this, "onError", (o, i) => {
|
|
@@ -141,7 +141,7 @@ class q {
|
|
|
141
141
|
return "";
|
|
142
142
|
}
|
|
143
143
|
onPreAuth() {
|
|
144
|
-
this.log(`[${this.getType()}][onPreAuth]`), this.threeDsProcessor && (
|
|
144
|
+
this.log(`[${this.getType()}][onPreAuth]`), this.threeDsProcessor && (N(), this.threeDsProcessor.onPreAuth(this.onInitAuthSuccess, this.onError), window.addEventListener("message", this.internalMessageHandler));
|
|
145
145
|
}
|
|
146
146
|
onAuth(e, s) {
|
|
147
147
|
var n;
|
|
@@ -165,12 +165,12 @@ class q {
|
|
|
165
165
|
}
|
|
166
166
|
messageHandler(e) {
|
|
167
167
|
var s, n;
|
|
168
|
-
if (!(!((s = e == null ? void 0 : e.data) != null && s.status) || ((n = e == null ? void 0 : e.data) == null ? void 0 : n.status) ===
|
|
169
|
-
if (e.data.status ===
|
|
168
|
+
if (!(!((s = e == null ? void 0 : e.data) != null && s.status) || ((n = e == null ? void 0 : e.data) == null ? void 0 : n.status) === d)) {
|
|
169
|
+
if (e.data.status === q) {
|
|
170
170
|
e.stopPropagation(), this.invocationComplete(e);
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
e.data.status ===
|
|
173
|
+
e.data.status === V && (e.stopPropagation(), this.challengeComplete(e));
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
invocationComplete(e) {
|
|
@@ -183,9 +183,9 @@ class q {
|
|
|
183
183
|
}
|
|
184
184
|
doChallenge(e, s, n) {
|
|
185
185
|
this.log(`[${this.getType()}][doChallenge]`), D();
|
|
186
|
-
const { destroy: o } =
|
|
186
|
+
const { destroy: o } = S({
|
|
187
187
|
el: document.body,
|
|
188
|
-
component:
|
|
188
|
+
component: O,
|
|
189
189
|
props: {
|
|
190
190
|
threeDSServerTransID: this.threeDSServerTransID,
|
|
191
191
|
acsTransID: s,
|
|
@@ -212,13 +212,13 @@ class q {
|
|
|
212
212
|
threeDSServerTransID: e,
|
|
213
213
|
threeDSMethodNotificationURL: this.options.apiUrl + "/3ds/method_invocation"
|
|
214
214
|
}, o = encodeURI(window.btoa(JSON.stringify(n)).replace(/=*$/, ""));
|
|
215
|
-
new
|
|
215
|
+
new k().invoke(s, "POST", {
|
|
216
216
|
threeDSMethodData: o
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
export {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
J as DefaultThreeDsProvider,
|
|
222
|
+
V as THREE_DS_CHALLENGE_COMPLETE,
|
|
223
|
+
q as THREE_DS_METHOD_INVOCATION_COMPLETE
|
|
224
224
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DefaultThreeDsProvider as
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { DefaultThreeDsProvider as i } from "./DefaultThreeDsProvider-Bs-1jjDE-BR4j-f3Q.js";
|
|
2
|
+
import { y as h, z as c, a as u, I as D, e as d, Y as p, J as m, x as s, $ as v, b as g, O as y, n as S, B as T } from "./index-CgZDGZz7.js";
|
|
3
|
+
var f = Object.defineProperty, I = (a, e, t) => e in a ? f(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t, P = (a, e, t) => I(a, e + "", t);
|
|
4
|
+
const C = { class: "mask" }, A = { class: "wrapper" }, $ = { class: "container" }, b = ["action"], E = ["value"], V = /* @__PURE__ */ u({
|
|
5
5
|
__name: "ecentric",
|
|
6
6
|
props: {
|
|
7
7
|
threeDSServerTransID: {},
|
|
@@ -9,39 +9,39 @@ const P = { class: "mask" }, f = { class: "wrapper" }, I = { class: "container"
|
|
|
9
9
|
formAction: {},
|
|
10
10
|
authenticationValue: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const e =
|
|
12
|
+
setup(a) {
|
|
13
|
+
const e = a, t = D(() => T(e.formAction) ? e.formAction : ""), o = S(null), n = e.authenticationValue;
|
|
14
14
|
return d(() => {
|
|
15
|
-
var
|
|
16
|
-
(
|
|
17
|
-
}), (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onClick:
|
|
15
|
+
var r;
|
|
16
|
+
t.value && ((r = o.value) == null || r.submit());
|
|
17
|
+
}), (r, l) => (p(), m("div", C, [
|
|
18
|
+
s("div", A, [
|
|
19
|
+
s("div", $, [
|
|
20
|
+
v(g, {
|
|
21
|
+
onClick: l[0] || (l[0] = (F) => r.emit("close"))
|
|
22
22
|
}),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
action:
|
|
23
|
+
l[1] || (l[1] = s("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)),
|
|
24
|
+
s("form", {
|
|
25
|
+
action: t.value,
|
|
26
26
|
target: "ThreeDsChallengeIFrame",
|
|
27
27
|
method: "post",
|
|
28
28
|
ref_key: "form",
|
|
29
|
-
ref:
|
|
29
|
+
ref: o
|
|
30
30
|
}, [
|
|
31
|
-
|
|
31
|
+
s("input", {
|
|
32
32
|
type: "hidden",
|
|
33
33
|
name: "PaReq",
|
|
34
|
-
value:
|
|
35
|
-
}, null, 8,
|
|
36
|
-
], 8,
|
|
34
|
+
value: y(n)
|
|
35
|
+
}, null, 8, E)
|
|
36
|
+
], 8, b)
|
|
37
37
|
])
|
|
38
38
|
])
|
|
39
39
|
]));
|
|
40
40
|
}
|
|
41
|
-
}),
|
|
42
|
-
class
|
|
41
|
+
}), x = /* @__PURE__ */ c(V, [["__scopeId", "data-v-d0f7984c"]]);
|
|
42
|
+
class k extends i {
|
|
43
43
|
constructor() {
|
|
44
|
-
super(...arguments),
|
|
44
|
+
super(...arguments), P(this, "paResPayload", "");
|
|
45
45
|
}
|
|
46
46
|
getType() {
|
|
47
47
|
return "Ecentric";
|
|
@@ -58,9 +58,9 @@ class R extends l {
|
|
|
58
58
|
}
|
|
59
59
|
doChallenge(e, t, o) {
|
|
60
60
|
this.log(`[${this.getType()}][doChallenge]`);
|
|
61
|
-
const { destroy:
|
|
61
|
+
const { destroy: n } = h({
|
|
62
62
|
el: document.body,
|
|
63
|
-
component:
|
|
63
|
+
component: x,
|
|
64
64
|
props: {
|
|
65
65
|
threeDSServerTransID: this.threeDSServerTransID,
|
|
66
66
|
acsTransID: t,
|
|
@@ -69,18 +69,18 @@ class R extends l {
|
|
|
69
69
|
},
|
|
70
70
|
on: {
|
|
71
71
|
close: () => {
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
}, (
|
|
72
|
+
var r;
|
|
73
|
+
n(), this.threeDSDestroy = () => {
|
|
74
|
+
}, (r = this.threeDsProcessor) == null || r.onError({ error: "Challenge cancelled" });
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
this.threeDSDestroy =
|
|
78
|
+
this.threeDSDestroy = n;
|
|
79
79
|
}
|
|
80
80
|
challengeComplete(e) {
|
|
81
81
|
this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge(), this.log(`[${this.getType()}]: cresData`, e.data.cres), e.data.cres ? (this.paResPayload = e.data.cres, this.onPostAuth()) : (this.log(`[${this.getType()}]: Failed 3DS Challenge`, e.data), this.onError(400, "Failed 3DS Challenge"));
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
export {
|
|
85
|
-
|
|
85
|
+
k as EcentricThreeDsProvider
|
|
86
86
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DefaultThreeDsProvider as
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { DefaultThreeDsProvider as o } from "./DefaultThreeDsProvider-Bs-1jjDE-BR4j-f3Q.js";
|
|
2
|
+
import { y as l, B as n, z as u, a as c, I as p, Y as d, J as g, x as a, C as h } from "./index-CgZDGZz7.js";
|
|
3
|
+
var D = Object.defineProperty, S = (r, e, t) => e in r ? D(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, i = (r, e, t) => S(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const y = { class: "mask" }, m = { class: "wrapper" }, f = ["src"], v = /* @__PURE__ */ c({
|
|
5
5
|
__name: "GPayments",
|
|
6
6
|
props: {
|
|
7
7
|
url: {},
|
|
@@ -9,31 +9,31 @@ const S = { class: "mask" }, D = { class: "wrapper" }, m = ["src"], y = /* @__PU
|
|
|
9
9
|
height: {}
|
|
10
10
|
},
|
|
11
11
|
setup(r) {
|
|
12
|
-
const e = r;
|
|
13
|
-
function
|
|
12
|
+
const e = r, t = p(() => n(e.url) ? e.url : "");
|
|
13
|
+
function s() {
|
|
14
14
|
return {
|
|
15
15
|
width: `${e.width || 650}px`,
|
|
16
16
|
height: `${e.height || 400}px`
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
return (
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
return (T, U) => (d(), g("div", y, [
|
|
20
|
+
a("div", m, [
|
|
21
|
+
a("div", {
|
|
22
22
|
class: "container",
|
|
23
|
-
style:
|
|
23
|
+
style: h([s(), { padding: "0", margin: "0" }])
|
|
24
24
|
}, [
|
|
25
|
-
|
|
26
|
-
src:
|
|
27
|
-
style:
|
|
28
|
-
}, null, 12,
|
|
25
|
+
a("iframe", {
|
|
26
|
+
src: t.value,
|
|
27
|
+
style: h(s())
|
|
28
|
+
}, null, 12, f)
|
|
29
29
|
], 4)
|
|
30
30
|
])
|
|
31
31
|
]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
34
|
-
class
|
|
33
|
+
}), C = /* @__PURE__ */ u(v, [["__scopeId", "data-v-cf5aa816"]]);
|
|
34
|
+
class $ extends o {
|
|
35
35
|
constructor() {
|
|
36
|
-
super(...arguments),
|
|
36
|
+
super(...arguments), i(this, "onDoAuthSuccess", (e, t) => {
|
|
37
37
|
const s = JSON.parse(t);
|
|
38
38
|
if (this.log(`[${this.getType()}][onDoAuthSuccess]`, s), !s.transStatus) {
|
|
39
39
|
this.onError(e, "No transStatus specified");
|
|
@@ -51,7 +51,7 @@ class U extends n {
|
|
|
51
51
|
this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${s.transStatus}`), this.onPostAuth();
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), i(this, "onInitAuthSuccess", (e, t) => {
|
|
55
55
|
const s = JSON.parse(t);
|
|
56
56
|
if (this.log(`[${this.getType()}][onInitAuthSuccess]`, s), !s.threeDSAuthURL) {
|
|
57
57
|
this.onError(e, "No AuthUrl specified");
|
|
@@ -69,9 +69,9 @@ class U extends n {
|
|
|
69
69
|
}
|
|
70
70
|
doChallenge(e) {
|
|
71
71
|
this.log(`[${this.getType()}][doChallenge]`);
|
|
72
|
-
const { destroy: t } =
|
|
72
|
+
const { destroy: t } = l({
|
|
73
73
|
el: document.body,
|
|
74
|
-
component:
|
|
74
|
+
component: C,
|
|
75
75
|
props: {
|
|
76
76
|
url: e,
|
|
77
77
|
width: 390,
|
|
@@ -90,11 +90,12 @@ class U extends n {
|
|
|
90
90
|
this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge(), this.onPostAuth();
|
|
91
91
|
}
|
|
92
92
|
initFrame(e) {
|
|
93
|
-
this.log(`[${this.getType()}][init3DSFrame]`, e)
|
|
93
|
+
if (this.log(`[${this.getType()}][init3DSFrame]`, e), !n(e))
|
|
94
|
+
return;
|
|
94
95
|
const t = document.createElement("iframe");
|
|
95
96
|
t.src = e, t.style.width = "1px", t.style.height = "1px", t.style.border = "0", document.body.appendChild(t);
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
export {
|
|
99
|
-
|
|
100
|
+
$ as GPaymentsThreeDsProvider
|
|
100
101
|
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { DefaultThreeDsProvider as w } from "./DefaultThreeDsProvider-Bs-1jjDE-BR4j-f3Q.js";
|
|
2
|
+
import { c as g, y as E, d as A, z as b, a as f, e as T, h as L, T as x, l as _, Y as G, J as N, x as m, $, b as I, n as H } from "./index-CgZDGZz7.js";
|
|
3
|
+
var O = Object.defineProperty, M = (h, e, t) => e in h ? O(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t, p = (h, e, t) => M(h, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const U = { class: "mask" }, j = { class: "wrapper" }, F = { class: "container" }, k = /* @__PURE__ */ f({
|
|
5
|
+
__name: "MetricsGlobalThreeDsChallenge",
|
|
6
|
+
emits: ["close", "submit"],
|
|
7
|
+
setup(h, { emit: e }) {
|
|
8
|
+
const t = e, r = H(!1);
|
|
9
|
+
function a(c) {
|
|
10
|
+
var o;
|
|
11
|
+
["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes((o = c.data) == null ? void 0 : o.message) && (r.value = c.data.message === "3DS_CHALLENGE_SHOW");
|
|
12
|
+
}
|
|
13
|
+
return T(() => {
|
|
14
|
+
window.addEventListener("message", a);
|
|
15
|
+
}), L(() => {
|
|
16
|
+
window.removeEventListener("message", a);
|
|
17
|
+
}), (c, o) => x((G(), N("div", U, [
|
|
18
|
+
m("div", j, [
|
|
19
|
+
m("div", F, [
|
|
20
|
+
$(I, {
|
|
21
|
+
onClick: o[0] || (o[0] = (i) => t("close")),
|
|
22
|
+
id: "3ds-challenge-close"
|
|
23
|
+
}),
|
|
24
|
+
o[1] || (o[1] = m("div", { id: "ThreeDsChallengeIFrame" }, null, -1))
|
|
25
|
+
])
|
|
26
|
+
])
|
|
27
|
+
], 512)), [
|
|
28
|
+
[_, r.value]
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
}), W = /* @__PURE__ */ b(k, [["__scopeId", "data-v-8a0b6dcb"]]), { hideSpinner: d, showSpinner: R } = A(), D = 5;
|
|
32
|
+
class q extends w {
|
|
33
|
+
constructor(e, t, r) {
|
|
34
|
+
var a;
|
|
35
|
+
super(e, t, r), p(this, "gateway"), p(this, "threeDS"), p(this, "numAttempts", 0), this.initScript(((a = r.clientParameters) == null ? void 0 : a.PublicKey) || "");
|
|
36
|
+
}
|
|
37
|
+
getType() {
|
|
38
|
+
return "MetricsGlobal";
|
|
39
|
+
}
|
|
40
|
+
getDomain() {
|
|
41
|
+
return "secure.metricsglobalgateway.com";
|
|
42
|
+
}
|
|
43
|
+
onPreAuth() {
|
|
44
|
+
var e, t;
|
|
45
|
+
if (this.log(`[${this.getType()}]: onPreAuth`), !this.threeDS && this.numAttempts >= D) {
|
|
46
|
+
d(), g(this.container, "Error loading 3D Secure");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (!this.threeDS && this.numAttempts < D) {
|
|
50
|
+
this.numAttempts++, this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`), setTimeout(() => this.onPreAuth(), 1e3);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
(e = this.threeDsProcessor) != null && e.getTokenId() ? (t = this.threeDsProcessor) == null || t.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (r) => {
|
|
54
|
+
var a;
|
|
55
|
+
(a = this.threeDsProcessor) == null || a.setPaymentInfo(r), this.startAuth();
|
|
56
|
+
}, () => {
|
|
57
|
+
g(this.container, "Unable to get card information");
|
|
58
|
+
}) : this.startAuth();
|
|
59
|
+
}
|
|
60
|
+
onAuth(e, t) {
|
|
61
|
+
}
|
|
62
|
+
onPostAuth() {
|
|
63
|
+
}
|
|
64
|
+
startAuth() {
|
|
65
|
+
var e, t, r, a, c, o;
|
|
66
|
+
this.log(`[${this.getType()}]: startAuth`);
|
|
67
|
+
const i = (e = this.threeDsProcessor) == null ? void 0 : e.getPaymentInfo();
|
|
68
|
+
if (!i) {
|
|
69
|
+
d(), g(this.container, "Payment information is missing");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
R();
|
|
73
|
+
const s = (t = this.threeDsProcessor) == null ? void 0 : t.getAddressInfo(), y = i.expiryDate.length === 4 ? i.expiryDate[2] + i.expiryDate[3] : "", v = i.expiryDate.length === 4 ? i.expiryDate[0] + i.expiryDate[1] : "", [C = "", P = ""] = ((r = i.cardholder) == null ? void 0 : r.split(/\s+/)) || [], S = {
|
|
74
|
+
cardNumber: i.cardNumber,
|
|
75
|
+
cardExpMonth: y,
|
|
76
|
+
cardExpYear: parseInt(v) + 2e3,
|
|
77
|
+
currency: (a = this.threeDsProcessor) == null ? void 0 : a.getCurrency(),
|
|
78
|
+
amount: (c = this.threeDsProcessor) == null ? void 0 : c.getAmount(),
|
|
79
|
+
email: (o = this.threeDsProcessor) == null ? void 0 : o.getEmail(),
|
|
80
|
+
phone: s == null ? void 0 : s.phoneNumber,
|
|
81
|
+
city: s == null ? void 0 : s.city,
|
|
82
|
+
state: s == null ? void 0 : s.state,
|
|
83
|
+
address1: s == null ? void 0 : s.streetAddress,
|
|
84
|
+
country: s == null ? void 0 : s.country,
|
|
85
|
+
firstName: (s == null ? void 0 : s.firstName) || C || "payFURL",
|
|
86
|
+
lastName: (s == null ? void 0 : s.lastName) || P || "payFURL",
|
|
87
|
+
postalCode: s == null ? void 0 : s.postalCode
|
|
88
|
+
}, u = this.threeDS.createUI(S);
|
|
89
|
+
u.start("#ThreeDsChallengeIFrame"), u.on("challenge", (n) => {
|
|
90
|
+
this.log(`[${this.getType()}][onChallenge]`, n), d(), this.showChallenge();
|
|
91
|
+
}), u.on("complete", (n) => {
|
|
92
|
+
var l;
|
|
93
|
+
this.log(`[${this.getType()}][onComplete]`, n), this.removeChallenge(), (l = this.threeDsProcessor) == null || l.onSuccess({
|
|
94
|
+
externalThreeDsData: n
|
|
95
|
+
});
|
|
96
|
+
}), u.on("failure", (n) => {
|
|
97
|
+
var l;
|
|
98
|
+
this.log(`[${this.getType()}][onFailure]`, n), d(), this.closeChallenge(), (l = this.threeDsProcessor) == null || l.onError({ error: n.message });
|
|
99
|
+
}), u.on("error", (n) => {
|
|
100
|
+
var l;
|
|
101
|
+
this.log(`[${this.getType()}][error]`, n), d(), this.closeChallenge(), (l = this.threeDsProcessor) == null || l.onError({ error: n.message });
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
initScript(e) {
|
|
105
|
+
const t = document.createElement("script");
|
|
106
|
+
t.type = "text/javascript", t.src = `https://${this.getDomain()}/js/v1/Gateway.js`, t.onload = () => {
|
|
107
|
+
this.initGateway(e), this.initChallenge();
|
|
108
|
+
}, document.head.appendChild(t);
|
|
109
|
+
}
|
|
110
|
+
initGateway(e) {
|
|
111
|
+
this.gateway = window.Gateway.create(e), this.threeDS = this.gateway.get3DSecure(), this.gateway.on("error", (t) => {
|
|
112
|
+
var r;
|
|
113
|
+
this.log(`[${this.getType()}]: gateway error`, t), (r = this.threeDsProcessor) == null || r.onError({ error: t.message }), this.threeDS = null, this.numAttempts = D;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
initChallenge() {
|
|
117
|
+
const { destroy: e } = E({
|
|
118
|
+
el: document.body,
|
|
119
|
+
component: W,
|
|
120
|
+
on: {
|
|
121
|
+
close: () => {
|
|
122
|
+
var t;
|
|
123
|
+
this.closeChallenge(), (t = this.threeDsProcessor) == null || t.onError({ error: "Challenge cancelled" });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
this.threeDSDestroy = e;
|
|
128
|
+
}
|
|
129
|
+
showChallenge() {
|
|
130
|
+
window.postMessage({
|
|
131
|
+
message: "3DS_CHALLENGE_SHOW"
|
|
132
|
+
}, "*");
|
|
133
|
+
}
|
|
134
|
+
closeChallenge() {
|
|
135
|
+
window.postMessage({
|
|
136
|
+
message: "3DS_CHALLENGE_CLOSE"
|
|
137
|
+
}, "*");
|
|
138
|
+
}
|
|
139
|
+
removeChallenge() {
|
|
140
|
+
var e;
|
|
141
|
+
(e = this.threeDSDestroy) == null || e.call(this);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export {
|
|
145
|
+
q as MetricsGlobalThreeDsProvider
|
|
146
|
+
};
|