@payfurl/client 4.10.0 → 4.11.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 +54 -0
- package/README.md +54 -0
- package/dist/sdk/{CloseIcon-B65NDIbM.js → CloseIcon-Ejad61tT.js} +377 -363
- package/dist/sdk/{DefaultThreeDsProvider-CzqbXEws.js → DefaultThreeDsProvider-bLoDSnkd.js} +24 -24
- package/dist/sdk/{MetricsGlobalThreeDsProvider-B-EQQsEV.js → MetricsGlobalThreeDsProvider-C93ttqbB.js} +16 -16
- package/dist/sdk/{PayWayAppleButton-C-XfcgNS.js → PayWayAppleButton-BzAwlGS-.js} +1 -1
- package/dist/sdk/{alerts-BvNnAm_q.js → alerts-1YSRy5iI.js} +9 -9
- package/dist/sdk/{cxpay-VbaQA3_P.js → cxpay-DblHb5vN.js} +1 -1
- package/dist/sdk/{default-Diji0SXY.js → default-C7f86Fx-.js} +1 -1
- package/dist/sdk/{ecentric-BlNDCZo_.js → ecentric-B3UohyO_.js} +11 -11
- package/dist/sdk/{epna-CxmJ_mqR.js → epna-DwUg2IlB.js} +1 -1
- package/dist/sdk/{flashbanc-BAxvqtBB.js → flashbanc-LXs8bahL.js} +1 -1
- package/dist/sdk/forter-CLFaJUYa.js +30 -0
- package/dist/sdk/{gpayments-B5KWQV4S.js → gpayments-DoZug3PV.js} +13 -13
- package/dist/sdk/{metrics_global-HMMDzPlb.js → metrics_global-BM-ooge-.js} +1 -1
- package/dist/sdk/{nmi-Ch7qQ6Av.js → nmi-BA3ZTdQa.js} +1 -1
- package/dist/sdk/{nuvei-DRmlfpTL.js → nuvei-DIWsLlLz.js} +29 -29
- package/dist/sdk/{payabli-CiBJ1-vC.js → payabli-DgrTI1Et.js} +1 -1
- package/dist/sdk/payfurl.d.ts +18 -1
- package/dist/sdk/payfurl.es.js +1117 -830
- package/dist/sdk/payfurl.umd.js +8 -8
- package/dist/sdk/{payglocal-uAPlijwL.js → payglocal-ezp0MsaZ.js} +18 -18
- package/dist/sdk/{payway_rest-CjgIP42z.js → payway_rest-D8-T-ULx.js} +1 -1
- package/dist/sdk/{skybank-D7uRF17E.js → skybank-BgDLlFXX.js} +1 -1
- package/dist/sdk/{strings-BthDdeA6.js → strings-Dp6oE-U1.js} +13 -13
- package/dist/sdk/style.css +1 -1
- package/dist/sdk/whenRendered-jR4Jls4M.js +12 -0
- package/package.json +1 -1
- package/dist/sdk/forter-R2alfHeE.js +0 -26
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as e, Bt as t, Mt as n, Ot as r, St as i, Tt as a, Vt as o, ft as s, h as c, ht as l, j as u, k as d, kt as f, n as p, t as m, tt as h, xt as g } from "./CloseIcon-Ejad61tT.js";
|
|
2
2
|
// src/sdk/3ds/ThreeDsChallenge.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" }, b = ["action"], x = ["value"], S = /*#__PURE__*/
|
|
3
|
+
var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" }, b = ["action"], x = ["value"], S = /*#__PURE__*/ h(/* @__PURE__ */ f({
|
|
4
4
|
__name: "ThreeDsChallenge",
|
|
5
5
|
props: {
|
|
6
6
|
threeDSServerTransID: {},
|
|
@@ -8,32 +8,32 @@ var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" },
|
|
|
8
8
|
formAction: {}
|
|
9
9
|
},
|
|
10
10
|
emits: ["close", "submit"],
|
|
11
|
-
setup(
|
|
12
|
-
let
|
|
13
|
-
threeDSServerTransID:
|
|
14
|
-
acsTransID:
|
|
11
|
+
setup(c, { emit: l }) {
|
|
12
|
+
let u = c, d = l, f = g(() => s(u.formAction) ? u.formAction : ""), p = t(null), h = JSON.stringify({
|
|
13
|
+
threeDSServerTransID: u.threeDSServerTransID,
|
|
14
|
+
acsTransID: u.acsTransID,
|
|
15
15
|
messageVersion: "2.2.0",
|
|
16
16
|
messageType: "CReq",
|
|
17
17
|
challengeWindowSize: "01"
|
|
18
|
-
}), S = encodeURI(window.btoa(
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
}), (e, t) => (
|
|
22
|
-
|
|
23
|
-
onClick: t[0] ||= (e) =>
|
|
18
|
+
}), S = encodeURI(window.btoa(h).replace(/=*$/, ""));
|
|
19
|
+
return e(() => {
|
|
20
|
+
f.value && p.value?.submit();
|
|
21
|
+
}), (e, t) => (n(), a("div", _, [i("div", v, [i("div", y, [
|
|
22
|
+
r(m, {
|
|
23
|
+
onClick: t[0] ||= (e) => d("close"),
|
|
24
24
|
id: "3ds-challenge-close"
|
|
25
25
|
}),
|
|
26
|
-
t[1] ||=
|
|
27
|
-
|
|
28
|
-
action:
|
|
26
|
+
t[1] ||= i("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1),
|
|
27
|
+
i("form", {
|
|
28
|
+
action: f.value,
|
|
29
29
|
target: "ThreeDsChallengeIFrame",
|
|
30
30
|
method: "post",
|
|
31
31
|
ref_key: "form",
|
|
32
|
-
ref:
|
|
33
|
-
}, [
|
|
32
|
+
ref: p
|
|
33
|
+
}, [i("input", {
|
|
34
34
|
type: "hidden",
|
|
35
35
|
name: "creq",
|
|
36
|
-
value:
|
|
36
|
+
value: o(S)
|
|
37
37
|
}, null, 8, x)], 8, b)
|
|
38
38
|
])])]));
|
|
39
39
|
}
|
|
@@ -55,7 +55,7 @@ var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" },
|
|
|
55
55
|
}
|
|
56
56
|
a.submit();
|
|
57
57
|
}
|
|
58
|
-
}, { hideSpinner: w, showSpinner: T } =
|
|
58
|
+
}, { hideSpinner: w, showSpinner: T } = p(), E = "3ds_method_invocation_complete", D = "3ds_challenge_complete", O = class {
|
|
59
59
|
log;
|
|
60
60
|
container;
|
|
61
61
|
options;
|
|
@@ -107,12 +107,12 @@ var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" },
|
|
|
107
107
|
"R"
|
|
108
108
|
].includes(t.transStatus) && (this.log(`[${this.getType()}]: Failed 3DS Challenge`, e.data), this.onError(400, "Failed 3DS Challenge"));
|
|
109
109
|
}
|
|
110
|
-
setChallengeFrameVisible(
|
|
111
|
-
window.self !== window.top && window.parent.postMessage({ status:
|
|
110
|
+
setChallengeFrameVisible(e) {
|
|
111
|
+
e && this.threeDsProcessor?.challengeShown(), window.self !== window.top && window.parent.postMessage({ status: e ? u : d }, "*");
|
|
112
112
|
}
|
|
113
113
|
doChallenge(e, t, n) {
|
|
114
114
|
this.log(`[${this.getType()}][doChallenge]`), w(), this.setChallengeFrameVisible(!0);
|
|
115
|
-
let { destroy: r } =
|
|
115
|
+
let { destroy: r } = l({
|
|
116
116
|
el: document.body,
|
|
117
117
|
component: S,
|
|
118
118
|
props: {
|
|
@@ -132,14 +132,14 @@ var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" },
|
|
|
132
132
|
}
|
|
133
133
|
onError = (e, t) => {
|
|
134
134
|
this.closeChallenge(), w(), e === 404 ? this.threeDsProcessor?.onError({ error: "This feature is only supported by ActiveServer v1.1.2+" }) : this.threeDsProcessor?.onError({
|
|
135
|
-
error:
|
|
135
|
+
error: c,
|
|
136
136
|
body: t
|
|
137
137
|
});
|
|
138
138
|
};
|
|
139
139
|
onSuccess = (e, t) => {
|
|
140
140
|
this.closeChallenge(), w();
|
|
141
141
|
let n = JSON.parse(t);
|
|
142
|
-
["Y", "A"].includes(n.transStatus) ? this.threeDsProcessor?.onSuccess(n) : (this.log(`[${this.getType()}]: ${
|
|
142
|
+
["Y", "A"].includes(n.transStatus) ? this.threeDsProcessor?.onSuccess(n) : (this.log(`[${this.getType()}]: ${c}`, n), this.threeDsProcessor?.onError({ error: c }));
|
|
143
143
|
};
|
|
144
144
|
threeDsMethodInvoke(e, t) {
|
|
145
145
|
this.log(`[${this.getType()}][threeDsMethodInvoke]`, {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { t as e } from "./DefaultThreeDsProvider-
|
|
2
|
-
import {
|
|
3
|
-
import { t as h } from "./alerts-
|
|
1
|
+
import { t as e } from "./DefaultThreeDsProvider-bLoDSnkd.js";
|
|
2
|
+
import { At as t, Bt as n, Mt as r, Ot as i, St as a, Tt as o, ht as s, jt as c, kt as l, n as u, t as d, tt as f, vt as p, zt as m } from "./CloseIcon-Ejad61tT.js";
|
|
3
|
+
import { t as h } from "./alerts-1YSRy5iI.js";
|
|
4
4
|
import { t as g } from "./screen-aNRlfrZR.js";
|
|
5
5
|
// src/sdk/3ds/MetricsGlobalThreeDsChallenge.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" }, b = /*#__PURE__*/
|
|
6
|
+
var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" }, b = /*#__PURE__*/ f(/* @__PURE__ */ l({
|
|
7
7
|
__name: "MetricsGlobalThreeDsChallenge",
|
|
8
8
|
emits: ["close", "submit"],
|
|
9
|
-
setup(e, { emit:
|
|
10
|
-
let
|
|
11
|
-
function
|
|
12
|
-
["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes(e.data?.message) && (
|
|
9
|
+
setup(e, { emit: s }) {
|
|
10
|
+
let l = s, u = n(!1);
|
|
11
|
+
function f(e) {
|
|
12
|
+
["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes(e.data?.message) && (u.value = e.data.message === "3DS_CHALLENGE_SHOW");
|
|
13
13
|
}
|
|
14
|
-
return
|
|
15
|
-
window.addEventListener("message",
|
|
16
|
-
}),
|
|
17
|
-
window.removeEventListener("message",
|
|
18
|
-
}), (e, t) =>
|
|
19
|
-
onClick: t[0] ||= (e) =>
|
|
14
|
+
return t(() => {
|
|
15
|
+
window.addEventListener("message", f);
|
|
16
|
+
}), c(() => {
|
|
17
|
+
window.removeEventListener("message", f);
|
|
18
|
+
}), (e, t) => m((r(), o("div", _, [a("div", v, [a("div", y, [i(d, {
|
|
19
|
+
onClick: t[0] ||= (e) => l("close"),
|
|
20
20
|
id: "3ds-challenge-close"
|
|
21
|
-
}), t[1] ||=
|
|
21
|
+
}), t[1] ||= a("div", { id: "ThreeDsChallengeIFrame" }, null, -1)])])], 512)), [[p, u.value]]);
|
|
22
22
|
}
|
|
23
23
|
}), [["__scopeId", "data-v-8a0b6dcb"]]), { hideSpinner: x, showSpinner: S } = u(), C = 5, w = class extends e {
|
|
24
24
|
gateway;
|
|
@@ -103,7 +103,7 @@ var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" },
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
initChallenge() {
|
|
106
|
-
let { destroy: e } =
|
|
106
|
+
let { destroy: e } = s({
|
|
107
107
|
el: document.body,
|
|
108
108
|
component: b,
|
|
109
109
|
on: { close: () => {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Bt as e,
|
|
1
|
+
import { Bt as e, Mt as t, St as n, Tt as r, Wt as i, bt as a, ht as o, kt as s, tt as c, wt as l } from "./CloseIcon-Ejad61tT.js";
|
|
2
2
|
// src/sdk/components/Error.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var u = { class: "message" }, d = /*#__PURE__*/
|
|
3
|
+
var u = { class: "message" }, d = /*#__PURE__*/ c(/* @__PURE__ */ s({
|
|
4
4
|
__name: "Error",
|
|
5
5
|
props: { error: {} },
|
|
6
|
-
setup(
|
|
7
|
-
let
|
|
8
|
-
return (
|
|
6
|
+
setup(n) {
|
|
7
|
+
let a = e(n.error);
|
|
8
|
+
return (e, n) => (t(), r("div", u, i(a.value), 1));
|
|
9
9
|
}
|
|
10
|
-
}), [["__scopeId", "data-v-ae4be0f9"]]), f = { class: "message" }, p = { key: 0 }, m = /*#__PURE__*/
|
|
10
|
+
}), [["__scopeId", "data-v-ae4be0f9"]]), f = { class: "message" }, p = { key: 0 }, m = /*#__PURE__*/ c(/* @__PURE__ */ s({
|
|
11
11
|
__name: "Success",
|
|
12
12
|
props: {
|
|
13
13
|
message: {},
|
|
14
14
|
token: {}
|
|
15
15
|
},
|
|
16
16
|
emits: ["close"],
|
|
17
|
-
setup(
|
|
18
|
-
let
|
|
19
|
-
return (
|
|
17
|
+
setup(e, { emit: o }) {
|
|
18
|
+
let s = e;
|
|
19
|
+
return (e, o) => (t(), r(a, null, [n("div", f, i(s.message), 1), s.token ? (t(), r("div", p, "TokenId = " + i(s.token), 1)) : l("", !0)], 64));
|
|
20
20
|
}
|
|
21
21
|
}), [["__scopeId", "data-v-6a4e1608"]]);
|
|
22
22
|
// src/sdk/utils/alerts.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./DefaultThreeDsProvider-
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "./DefaultThreeDsProvider-bLoDSnkd.js";
|
|
2
|
+
import { At as t, Bt as n, Mt as r, Ot as i, St as a, Tt as o, Vt as s, ft as c, ht as l, kt as u, t as d, tt as f, xt as p } from "./CloseIcon-Ejad61tT.js";
|
|
3
3
|
// src/sdk/3ds/ecentric.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var m = { class: "mask" }, h = { class: "wrapper" }, g = { class: "container" }, _ = ["action"], v = ["value"], y = /*#__PURE__*/
|
|
4
|
+
var m = { class: "mask" }, h = { class: "wrapper" }, g = { class: "container" }, _ = ["action"], v = ["value"], y = /*#__PURE__*/ f(/* @__PURE__ */ u({
|
|
5
5
|
__name: "ecentric",
|
|
6
6
|
props: {
|
|
7
7
|
threeDSServerTransID: {},
|
|
@@ -10,23 +10,23 @@ var m = { class: "mask" }, h = { class: "wrapper" }, g = { class: "container" },
|
|
|
10
10
|
authenticationValue: {}
|
|
11
11
|
},
|
|
12
12
|
emits: ["close", "submit"],
|
|
13
|
-
setup(e, { emit:
|
|
14
|
-
let
|
|
13
|
+
setup(e, { emit: l }) {
|
|
14
|
+
let u = e, f = l, y = p(() => c(u.formAction) ? u.formAction : ""), b = n(null), x = u.authenticationValue;
|
|
15
15
|
return t(() => {
|
|
16
16
|
y.value && b.value?.submit();
|
|
17
|
-
}), (e, t) => (
|
|
18
|
-
|
|
19
|
-
t[1] ||=
|
|
20
|
-
|
|
17
|
+
}), (e, t) => (r(), o("div", m, [a("div", h, [a("div", g, [
|
|
18
|
+
i(d, { onClick: t[0] ||= (e) => f("close") }),
|
|
19
|
+
t[1] ||= a("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1),
|
|
20
|
+
a("form", {
|
|
21
21
|
action: y.value,
|
|
22
22
|
target: "ThreeDsChallengeIFrame",
|
|
23
23
|
method: "post",
|
|
24
24
|
ref_key: "form",
|
|
25
25
|
ref: b
|
|
26
|
-
}, [
|
|
26
|
+
}, [a("input", {
|
|
27
27
|
type: "hidden",
|
|
28
28
|
name: "PaReq",
|
|
29
|
-
value:
|
|
29
|
+
value: s(x)
|
|
30
30
|
}, null, 8, v)], 8, _)
|
|
31
31
|
])])]));
|
|
32
32
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { t as e } from "./DefaultThreeDsProvider-bLoDSnkd.js";
|
|
2
|
+
import { n as t, r as n, t as r } from "./managedOrders-ojoMZ0Ab.js";
|
|
3
|
+
import { n as i } from "./CloseIcon-Ejad61tT.js";
|
|
4
|
+
import { t as a } from "./whenRendered-jR4Jls4M.js";
|
|
5
|
+
// src/sdk/3ds/ForterThreeDsProvider.ts
|
|
6
|
+
var { hideSpinner: o } = i(), s = class extends e {
|
|
7
|
+
getType() {
|
|
8
|
+
return "Forter";
|
|
9
|
+
}
|
|
10
|
+
onDoAuthSuccess = (e, i) => {
|
|
11
|
+
let s = JSON.parse(i);
|
|
12
|
+
this.log(`[${this.getType()}][onDoAuthSuccess]`, s);
|
|
13
|
+
let c = this.options.clientParameters?.SiteId || "", l = s.managedOrderToken;
|
|
14
|
+
!l || !r.test(c) ? this.onError(e, "3DS could not be started") : t(c).then(() => {
|
|
15
|
+
let e = !1, t = a(this.container, () => {
|
|
16
|
+
e = !0, this.setChallengeFrameVisible(!0), o();
|
|
17
|
+
});
|
|
18
|
+
n(l, this.container, (n) => {
|
|
19
|
+
t(), e && this.setChallengeFrameVisible(!1), n ? (this.log(`[${this.getType()}]: manageOrder failed`, n), this.onError(400, "3DS failed")) : this.onPostAuth();
|
|
20
|
+
});
|
|
21
|
+
}, (e) => {
|
|
22
|
+
this.log(`[${this.getType()}]: managedOrders.js failed to load`, e), this.onError(400, "3DS could not be started");
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
// src/sdk/3ds/forter.ts
|
|
27
|
+
function c(e, t, n) {
|
|
28
|
+
return new s(e, t, n);
|
|
29
|
+
}
|
|
30
|
+
export { c as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./DefaultThreeDsProvider-
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "./DefaultThreeDsProvider-bLoDSnkd.js";
|
|
2
|
+
import { Mt as t, St as n, Tt as r, Ut as i, ft as a, ht as o, kt as s, n as c, tt as l, xt as u } from "./CloseIcon-Ejad61tT.js";
|
|
3
3
|
// src/sdk/3ds/GPayments.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var d = { class: "mask" }, f = { class: "wrapper" }, p = ["src"], m = /*#__PURE__*/
|
|
4
|
+
var d = { class: "mask" }, f = { class: "wrapper" }, p = ["src"], m = /*#__PURE__*/ l(/* @__PURE__ */ s({
|
|
5
5
|
__name: "GPayments",
|
|
6
6
|
props: {
|
|
7
7
|
url: {},
|
|
@@ -9,25 +9,25 @@ var d = { class: "mask" }, f = { class: "wrapper" }, p = ["src"], m = /*#__PURE_
|
|
|
9
9
|
height: {}
|
|
10
10
|
},
|
|
11
11
|
setup(e) {
|
|
12
|
-
let
|
|
13
|
-
function
|
|
12
|
+
let o = e, s = u(() => a(o.url) ? o.url : "");
|
|
13
|
+
function c() {
|
|
14
14
|
return {
|
|
15
|
-
width: `${
|
|
16
|
-
height: `${
|
|
15
|
+
width: `${o.width || 650}px`,
|
|
16
|
+
height: `${o.height || 400}px`
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
return (e,
|
|
19
|
+
return (e, a) => (t(), r("div", d, [n("div", f, [n("div", {
|
|
20
20
|
class: "container",
|
|
21
|
-
style:
|
|
21
|
+
style: i([c(), {
|
|
22
22
|
padding: "0",
|
|
23
23
|
margin: "0"
|
|
24
24
|
}])
|
|
25
|
-
}, [
|
|
26
|
-
src:
|
|
27
|
-
style:
|
|
25
|
+
}, [n("iframe", {
|
|
26
|
+
src: s.value,
|
|
27
|
+
style: i(c())
|
|
28
28
|
}, null, 12, p)], 4)])]));
|
|
29
29
|
}
|
|
30
|
-
}), [["__scopeId", "data-v-cf5aa816"]]), { hideSpinner: h } =
|
|
30
|
+
}), [["__scopeId", "data-v-cf5aa816"]]), { hideSpinner: h } = c(), g = class extends e {
|
|
31
31
|
getType() {
|
|
32
32
|
return "GPayments";
|
|
33
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as l } from "./DefaultThreeDsProvider-
|
|
1
|
+
import { At as e, Mt as t, St as n, Tt as r, h as i, ht as a, kt as o, n as s, tt as c } from "./CloseIcon-Ejad61tT.js";
|
|
2
|
+
import { t as l } from "./DefaultThreeDsProvider-bLoDSnkd.js";
|
|
3
3
|
// src/sdk/3ds/nuvei.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var u = { class: "mask" }, d = /*#__PURE__*/
|
|
4
|
+
var u = { class: "mask" }, d = /*#__PURE__*/ c(/* @__PURE__ */ o({
|
|
5
5
|
__name: "nuvei",
|
|
6
6
|
props: {
|
|
7
7
|
threeDSServerTransID: {},
|
|
@@ -21,47 +21,47 @@ var u = { class: "mask" }, d = /*#__PURE__*/ r(/* @__PURE__ */ n({
|
|
|
21
21
|
email: {},
|
|
22
22
|
country: {}
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
let { hideSpinner:
|
|
24
|
+
setup(i) {
|
|
25
|
+
let { hideSpinner: a, showSpinner: o } = s(), c = i;
|
|
26
26
|
e(() => {
|
|
27
|
-
|
|
27
|
+
o();
|
|
28
28
|
let e = document.createElement("script");
|
|
29
29
|
e.type = "text/javascript", e.src = "https://cdn.safecharge.com/safecharge_resources/v1/websdk/safecharge.js", e.onload = () => {
|
|
30
30
|
let e = new MutationObserver(function() {
|
|
31
|
-
document.getElementsByClassName("sfcModal-dialog")[0] && (
|
|
31
|
+
document.getElementsByClassName("sfcModal-dialog")[0] && (a(), e.disconnect());
|
|
32
32
|
}), t = { childList: !0 }, n = document.querySelector("body");
|
|
33
33
|
e.observe(n, t), l();
|
|
34
34
|
}, document.head.appendChild(e);
|
|
35
35
|
});
|
|
36
36
|
function l() {
|
|
37
37
|
let e = window.SafeCharge({
|
|
38
|
-
env:
|
|
39
|
-
merchantId:
|
|
40
|
-
merchantSiteId:
|
|
38
|
+
env: c.env,
|
|
39
|
+
merchantId: c.merchantId,
|
|
40
|
+
merchantSiteId: c.merchantSiteId
|
|
41
41
|
});
|
|
42
42
|
e.fields({
|
|
43
43
|
fonts: [{ cssUrl: "https://fonts.googleapis.com/css?family=Source+Code+Pro" }],
|
|
44
44
|
locale: "en"
|
|
45
45
|
});
|
|
46
|
-
let t =
|
|
47
|
-
userPaymentOptionId:
|
|
48
|
-
...
|
|
46
|
+
let t = c.userPaymentOptionId ? {
|
|
47
|
+
userPaymentOptionId: c.userPaymentOptionId,
|
|
48
|
+
...c.CVV ? { card: { CVV: c.CVV } } : {}
|
|
49
49
|
} : { card: {
|
|
50
|
-
cardNumber:
|
|
51
|
-
cardHolderName:
|
|
52
|
-
expirationMonth:
|
|
53
|
-
expirationYear:
|
|
54
|
-
CVV:
|
|
50
|
+
cardNumber: c.cardNumber,
|
|
51
|
+
cardHolderName: c.cardHolderName,
|
|
52
|
+
expirationMonth: c.expirationMonth,
|
|
53
|
+
expirationYear: c.expirationYear,
|
|
54
|
+
CVV: c.CVV
|
|
55
55
|
} };
|
|
56
56
|
e.authenticate3d({
|
|
57
|
-
sessionToken:
|
|
58
|
-
...
|
|
57
|
+
sessionToken: c.sessionToken,
|
|
58
|
+
...c.userTokenId ? { userTokenId: c.userTokenId } : {},
|
|
59
59
|
paymentOption: t,
|
|
60
60
|
billingAddress: {
|
|
61
|
-
firstName:
|
|
62
|
-
lastName:
|
|
63
|
-
email:
|
|
64
|
-
country:
|
|
61
|
+
firstName: c.firstName,
|
|
62
|
+
lastName: c.lastName,
|
|
63
|
+
email: c.email,
|
|
64
|
+
country: c.country
|
|
65
65
|
}
|
|
66
66
|
}, function(e) {
|
|
67
67
|
window.postMessage({
|
|
@@ -70,9 +70,9 @@ var u = { class: "mask" }, d = /*#__PURE__*/ r(/* @__PURE__ */ n({
|
|
|
70
70
|
}, "*");
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
return (e,
|
|
73
|
+
return (e, i) => (t(), r("div", u, [...i[0] ||= [n("div", { class: "wrapper" }, [n("div", { class: "container" })], -1)]]));
|
|
74
74
|
}
|
|
75
|
-
}), [["__scopeId", "data-v-299db412"]]), { hideSpinner: f } =
|
|
75
|
+
}), [["__scopeId", "data-v-299db412"]]), { hideSpinner: f } = s(), p = class extends l {
|
|
76
76
|
_paResPayload = null;
|
|
77
77
|
getType() {
|
|
78
78
|
return "Nuvei";
|
|
@@ -90,7 +90,7 @@ var u = { class: "mask" }, d = /*#__PURE__*/ r(/* @__PURE__ */ n({
|
|
|
90
90
|
doNuveiChallenge(e, t, n) {
|
|
91
91
|
let r = JSON.parse(e);
|
|
92
92
|
if (r === null || !r.merchantId || !r.merchantSiteId) {
|
|
93
|
-
this.threeDsProcessor?.onError({ error:
|
|
93
|
+
this.threeDsProcessor?.onError({ error: i });
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
if (this.threeDsProcessor?.getTokenId() && !r?.userPaymentOptionId) {
|
|
@@ -98,7 +98,7 @@ var u = { class: "mask" }, d = /*#__PURE__*/ r(/* @__PURE__ */ n({
|
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
t && (r.firstName = t.firstName, r.lastName = t.lastName, r.email = t.email, r.country = t.country), n && (r.cardNumber = n.cardNumber, r.cardHolderName = n.cardholder || "", r.expirationMonth = n.expiryDate.substring(2, 4), r.expirationYear = n.expiryDate.substring(0, 2), r.CVV = n.ccv), this.setChallengeFrameVisible(!0);
|
|
101
|
-
let { destroy: o } =
|
|
101
|
+
let { destroy: o } = a({
|
|
102
102
|
el: document.body,
|
|
103
103
|
component: d,
|
|
104
104
|
props: r,
|
|
@@ -111,7 +111,7 @@ var u = { class: "mask" }, d = /*#__PURE__*/ r(/* @__PURE__ */ n({
|
|
|
111
111
|
onSuccess = (e, t) => {
|
|
112
112
|
this.closeChallenge(), f();
|
|
113
113
|
let n = JSON.parse(t);
|
|
114
|
-
n.authenticationValue ? this.threeDsProcessor?.onSuccess(n) : (this.log(`[${this.getType()}][_onSuccess] ${
|
|
114
|
+
n.authenticationValue ? this.threeDsProcessor?.onSuccess(n) : (this.log(`[${this.getType()}][_onSuccess] ${i}`, n), this.threeDsProcessor?.onError({ error: i }));
|
|
115
115
|
};
|
|
116
116
|
onDoAuthSuccess = (e, t) => {
|
|
117
117
|
let n = JSON.parse(t);
|
package/dist/sdk/payfurl.d.ts
CHANGED
|
@@ -314,7 +314,8 @@ export declare interface PayfurlInterface {
|
|
|
314
314
|
addPaypal(parentId: string, amount: number, currency: string, providerId?: string, options?: PaypalOptionsType): PayfurlInterface;
|
|
315
315
|
addPayTo(parentId: string, amount: number, providerId?: string, options?: PayToOptionsType): PayfurlInterface;
|
|
316
316
|
addGooglePay(parentId: string, amount: number, currency: string, providerId?: string, options?: GooglePayOptionsType): PayfurlInterface;
|
|
317
|
-
addApplePay(parentId: string, amount: number, currency: string, providerId
|
|
317
|
+
addApplePay(parentId: string, amount: number, currency: string, providerId?: string, options?: ApplePayOptionsType): PayfurlInterface;
|
|
318
|
+
isApplePayAvailable(): Promise<boolean>;
|
|
318
319
|
addCheckout(parentId: string, amount: number, currency: string, providerType: string, providerId: string, options: CheckoutOptionsType, checkoutOptions: {
|
|
319
320
|
[key: string]: string;
|
|
320
321
|
}): PayfurlInterface;
|
|
@@ -325,6 +326,8 @@ export declare interface PayfurlInterface {
|
|
|
325
326
|
onFailure(f: (message: FailureResponseType) => void): PayfurlInterface;
|
|
326
327
|
successMessage(message: string): PayfurlInterface;
|
|
327
328
|
onLoaded(f: () => void): PayfurlInterface;
|
|
329
|
+
onPaymentMethodStatus(f: (status: PaymentMethodStatusType) => void): PayfurlInterface;
|
|
330
|
+
onThreeDsProgress(f: (progress: ThreeDsProgressType) => void): PayfurlInterface;
|
|
328
331
|
onValidationStatusChange(f: (status: string, message: string) => void): PayfurlInterface;
|
|
329
332
|
onValidate(f: () => boolean): PayfurlInterface;
|
|
330
333
|
setBillingAddress(address: AddressInfoType): PayfurlInterface;
|
|
@@ -334,6 +337,14 @@ export declare interface PayfurlInterface {
|
|
|
334
337
|
addSavedPaymentMethods(iframeParentId: string, customerId: string, options?: AddSavedPaymentMethodsOptionsType): PayfurlInterface;
|
|
335
338
|
}
|
|
336
339
|
|
|
340
|
+
export declare type PaymentMethodStatusType = {
|
|
341
|
+
paymentMethod: "googlepay" | "applepay" | "paypal" | "payto" | "checkout" | "upi";
|
|
342
|
+
providerType?: string;
|
|
343
|
+
status: "rendered" | "unavailable";
|
|
344
|
+
reason?: "no_provider" | "unsupported" | "error";
|
|
345
|
+
message?: string;
|
|
346
|
+
};
|
|
347
|
+
|
|
337
348
|
declare enum PaymentType {
|
|
338
349
|
card = "card",
|
|
339
350
|
paypal = "paypal",
|
|
@@ -397,6 +408,12 @@ export declare type SuccessResponseType = {
|
|
|
397
408
|
};
|
|
398
409
|
};
|
|
399
410
|
|
|
411
|
+
export declare type ThreeDsProgressType = {
|
|
412
|
+
step: "started" | "challenge" | "completed";
|
|
413
|
+
success?: boolean;
|
|
414
|
+
error?: string;
|
|
415
|
+
};
|
|
416
|
+
|
|
400
417
|
/**
|
|
401
418
|
* The shape of `errorDetails` that the tokenise flow populates on `onFailure` when
|
|
402
419
|
* `POST /token/card` fails during `tokeniseWith3Ds`, the case PAY-4804 was raised for.
|