@payfurl/client 4.11.0 → 4.11.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/CHANGELOG.md +32 -0
- package/README.md +32 -0
- package/dist/sdk/{DefaultThreeDsProvider-bLoDSnkd.js → DefaultThreeDsProvider-CJ7D2Irh.js} +4 -1
- package/dist/sdk/{MetricsGlobalThreeDsProvider-C93ttqbB.js → MetricsGlobalThreeDsProvider-c8-Fc5ST.js} +1 -1
- package/dist/sdk/{PayWayAppleButton-BzAwlGS-.js → PayWayAppleButton-u5eH-Gev.js} +1 -1
- package/dist/sdk/{cxpay-DblHb5vN.js → cxpay-Dugz0O74.js} +1 -1
- package/dist/sdk/{default-C7f86Fx-.js → default-DGxERUSN.js} +1 -1
- package/dist/sdk/{ecentric-B3UohyO_.js → ecentric-ByBa3UWI.js} +1 -1
- package/dist/sdk/{epna-DwUg2IlB.js → epna-DQVvimvd.js} +1 -1
- package/dist/sdk/{flashbanc-LXs8bahL.js → flashbanc-CBdnGJ_h.js} +1 -1
- package/dist/sdk/{forter-CLFaJUYa.js → forter-BbB3-cUq.js} +1 -1
- package/dist/sdk/{gpayments-DoZug3PV.js → gpayments-CmUdD9kJ.js} +1 -1
- package/dist/sdk/{metrics_global-BM-ooge-.js → metrics_global-DzTY7GMQ.js} +1 -1
- package/dist/sdk/{nmi-BA3ZTdQa.js → nmi-EgdsSmhg.js} +1 -1
- package/dist/sdk/{nuvei-DIWsLlLz.js → nuvei-DSwwNCnf.js} +1 -1
- package/dist/sdk/{payabli-DgrTI1Et.js → payabli-M87Lxo_m.js} +1 -1
- package/dist/sdk/payfurl.d.ts +17 -2
- package/dist/sdk/payfurl.es.js +858 -846
- package/dist/sdk/payfurl.umd.js +4 -4
- package/dist/sdk/{payglocal-ezp0MsaZ.js → payglocal-HYHj4xrA.js} +1 -1
- package/dist/sdk/{payway_rest-D8-T-ULx.js → payway_rest-DvyvbsDG.js} +1 -1
- package/dist/sdk/{skybank-BgDLlFXX.js → skybank-Divo_TW3.js} +1 -1
- package/dist/sdk/{strings-Dp6oE-U1.js → strings-C2ICfH1P.js} +13 -13
- package/package.json +1 -1
package/dist/sdk/payfurl.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./strings-
|
|
1
|
+
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./strings-C2ICfH1P.js";
|
|
2
2
|
import { t as d } from "./screen-aNRlfrZR.js";
|
|
3
3
|
import { t as f } from "./redact-Bn_hfytX.js";
|
|
4
|
-
import { $ as p, At as m, B as h, Bt as g, C as
|
|
5
|
-
import { n as
|
|
6
|
-
import { t as
|
|
4
|
+
import { $ as p, At as m, B as h, Bt as g, C as _, Ct as v, Dt as y, Et as b, Ft as x, G as S, H as ee, Ht as te, I as C, It as ne, J as re, K as ie, L as ae, Lt as oe, M as se, Mt as w, N as ce, Nt as le, Ot as ue, Pt as de, R as fe, Rt as pe, S as me, St as T, Tt as E, U as he, Ut as ge, V as _e, Vt as D, Wt as O, X as ve, _t as ye, a as be, at as xe, b as Se, bt as Ce, c as we, ct as Te, d as Ee, dt as De, et as Oe, f as ke, ft as Ae, gt as je, ht as Me, it as Ne, j as Pe, jt as Fe, kt as k, lt as Ie, m as Le, mt as A, n as Re, nt as ze, o as Be, ot as Ve, pt as He, q as Ue, r as We, rt as j, st as M, t as Ge, tt as N, ut as Ke, v as qe, vt as Je, w as Ye, wt as P, x as Xe, xt as Ze, y as Qe, yt as $e, z as et, zt as F } from "./CloseIcon-Ejad61tT.js";
|
|
5
|
+
import { n as tt, t as I } from "./alerts-1YSRy5iI.js";
|
|
6
|
+
import { t as nt } from "./whenRendered-jR4Jls4M.js";
|
|
7
7
|
// node_modules/tslib/tslib.es6.mjs
|
|
8
|
-
function
|
|
8
|
+
function L(e, t, n, r) {
|
|
9
9
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
10
10
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
11
11
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
12
12
|
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
13
13
|
}
|
|
14
14
|
// src/utils/ErrorHandler.ts
|
|
15
|
-
var
|
|
15
|
+
var rt = class e {
|
|
16
16
|
static instance;
|
|
17
17
|
static environment;
|
|
18
18
|
static publicKey;
|
|
@@ -53,41 +53,41 @@ var at = class e {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
// src/utils/ErrorHandled.ts
|
|
56
|
-
function
|
|
56
|
+
function R(e, t, n) {
|
|
57
57
|
let r = n.value;
|
|
58
58
|
n.value = function() {
|
|
59
59
|
try {
|
|
60
60
|
return r.apply(this, arguments);
|
|
61
61
|
} catch (e) {
|
|
62
|
-
throw new
|
|
62
|
+
throw new rt().sendError(t, e.message, at(Array.from(arguments))), console.warn("[ErrorHandled], exception", {
|
|
63
63
|
error: e,
|
|
64
64
|
propertyKey: t,
|
|
65
|
-
arguments:
|
|
65
|
+
arguments: at(Array.from(arguments))
|
|
66
66
|
}), e;
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function z(e, t, n) {
|
|
71
71
|
return function(...r) {
|
|
72
72
|
try {
|
|
73
73
|
return n.apply(e, r);
|
|
74
74
|
} catch (e) {
|
|
75
|
-
throw new
|
|
75
|
+
throw new rt().sendError(t, e.message, at(r)), console.warn("[ErrorHandledFunction], exception", {
|
|
76
76
|
error: e,
|
|
77
77
|
funcName: t,
|
|
78
|
-
args:
|
|
78
|
+
args: at(r)
|
|
79
79
|
}), e;
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
new
|
|
83
|
+
function it(e, t, n) {
|
|
84
|
+
new rt().sendError(e, t, at(n));
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function at(e) {
|
|
87
87
|
return e.map((e) => f(e));
|
|
88
88
|
}
|
|
89
89
|
// src/components/PaypalIcon.vue
|
|
90
|
-
var
|
|
90
|
+
var ot = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
91
91
|
__name: "PaypalIcon",
|
|
92
92
|
props: {
|
|
93
93
|
size: {},
|
|
@@ -95,31 +95,31 @@ var ct = /*#__PURE__*/ j(/* @__PURE__ */ D({
|
|
|
95
95
|
},
|
|
96
96
|
setup(e) {
|
|
97
97
|
let t = e, n = t.grayscale ? "#2A2A2B" : "#253b80", r = t.grayscale ? "#555557" : "#179bd7", i = t.grayscale ? "#000000" : "#222d65", a = `--size: ${t.size}px`;
|
|
98
|
-
return (e, t) => (
|
|
98
|
+
return (e, t) => (w(), E("svg", {
|
|
99
99
|
id: "paypal",
|
|
100
100
|
style: a,
|
|
101
101
|
xmlns: "http://www.w3.org/2000/svg",
|
|
102
102
|
viewBox: "0 0 25.576353 30.177"
|
|
103
103
|
}, [
|
|
104
|
-
|
|
104
|
+
T("path", {
|
|
105
105
|
d: "m 7.2659888,29.154 0.523,-3.322 -1.165,-0.027 -5.563,0 3.866,-24.513 c 0.012,-0.074 0.051,-0.143 0.108,-0.192 0.057,-0.049 0.13,-0.076 0.206,-0.076 l 9.3800002,0 c 3.114,0 5.263,0.648 6.385,1.927 0.526,0.6 0.861,1.227 1.023,1.917 0.17,0.724 0.173,1.589 0.007,2.644 l -0.012,0.077 0,0.676 0.526,0.298 c 0.443,0.235 0.795,0.504 1.065,0.812 0.45,0.513 0.741,1.165 0.864,1.938 0.127,0.795 0.085,1.741 -0.123,2.812 -0.24,1.232 -0.628,2.305 -1.152,3.183 -0.482,0.809 -1.096,1.48 -1.825,2 -0.696,0.494 -1.523,0.869 -2.458,1.109 -0.906,0.236 -1.939,0.355 -3.072,0.355 l -0.73,0 c -0.522,0 -1.029,0.188 -1.427,0.525 -0.399,0.344 -0.663,0.814 -0.744,1.328 l -0.055,0.299 -0.924,5.855 -0.042,0.215 c -0.011,0.068 -0.03,0.102 -0.058,0.125 -0.025,0.021 -0.061,0.035 -0.096,0.035 l -4.5070002,0 z",
|
|
106
|
-
style:
|
|
106
|
+
style: ge(`fill: ${D(n)}`)
|
|
107
107
|
}, null, 4),
|
|
108
|
-
|
|
108
|
+
T("path", {
|
|
109
109
|
d: "m 23.047989,7.667 0,0 0,0 c -0.028,0.179 -0.06,0.362 -0.096,0.55 -1.237,6.351 -5.469,8.545 -10.874,8.545 l -2.7520002,0 c -0.661,0 -1.218,0.48 -1.321,1.132 l 0,0 0,0 -1.409,8.936 -0.399,2.533 c -0.067,0.428 0.263,0.814 0.695,0.814 l 4.8810002,0 c 0.578,0 1.069,-0.42 1.16,-0.99 l 0.048,-0.248 0.919,-5.832 0.059,-0.32 c 0.09,-0.572 0.582,-0.992 1.16,-0.992 l 0.73,0 c 4.729,0 8.431,-1.92 9.513,-7.476 0.452,-2.321 0.218,-4.259 -0.978,-5.622 -0.362,-0.411 -0.811,-0.752 -1.336,-1.03 z",
|
|
110
|
-
style:
|
|
110
|
+
style: ge(`fill: ${D(r)}`)
|
|
111
111
|
}, null, 4),
|
|
112
|
-
|
|
112
|
+
T("path", {
|
|
113
113
|
d: "m 21.753989,7.151 c -0.189,-0.055 -0.384,-0.105 -0.584,-0.15 -0.201,-0.044 -0.407,-0.083 -0.619,-0.117 -0.742,-0.12 -1.555,-0.177 -2.426,-0.177 l -7.352,0 c -0.181,0 -0.353,0.041 -0.507,0.115 C 9.9269888,6.985 9.6749888,7.306 9.6139888,7.699 l -1.564,9.906 -0.045,0.289 c 0.103,-0.652 0.66,-1.132 1.321,-1.132 l 2.7520002,0 c 5.405,0 9.637,-2.195 10.874,-8.545 0.037,-0.188 0.068,-0.371 0.096,-0.55 -0.313,-0.166 -0.652,-0.308 -1.017,-0.429 -0.09,-0.03 -0.183,-0.059 -0.277,-0.087 z",
|
|
114
|
-
style:
|
|
114
|
+
style: ge(`fill: ${D(i)}`)
|
|
115
115
|
}, null, 4),
|
|
116
|
-
|
|
116
|
+
T("path", {
|
|
117
117
|
d: "m 9.6139888,7.699 c 0.061,-0.393 0.313,-0.714 0.6520002,-0.876 0.155,-0.074 0.326,-0.115 0.507,-0.115 l 7.352,0 c 0.871,0 1.684,0.057 2.426,0.177 0.212,0.034 0.418,0.073 0.619,0.117 0.2,0.045 0.395,0.095 0.584,0.15 0.094,0.028 0.187,0.057 0.278,0.086 0.365,0.121 0.704,0.264 1.017,0.429 0.368,-2.347 -0.003,-3.945 -1.272,-5.392 C 20.377989,0.682 17.852989,0 14.621989,0 L 5.2419888,0 c -0.66,0 -1.223,0.48 -1.325,1.133 L 0.00998882,25.898 c -0.077,0.49 0.301,0.932 0.795,0.932 l 5.79099998,0 1.454,-9.225 1.564,-9.906 z",
|
|
118
|
-
style:
|
|
118
|
+
style: ge(`fill: ${D(n)}`)
|
|
119
119
|
}, null, 4)
|
|
120
120
|
]));
|
|
121
121
|
}
|
|
122
|
-
}), [["__scopeId", "data-v-2b840669"]]),
|
|
122
|
+
}), [["__scopeId", "data-v-2b840669"]]), st = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
123
123
|
__name: "CreditCardIcon",
|
|
124
124
|
props: {
|
|
125
125
|
size: {},
|
|
@@ -128,22 +128,22 @@ var ct = /*#__PURE__*/ j(/* @__PURE__ */ D({
|
|
|
128
128
|
},
|
|
129
129
|
setup(e) {
|
|
130
130
|
let t = e, n = g(t.color);
|
|
131
|
-
|
|
131
|
+
oe(() => t.color, (e) => {
|
|
132
132
|
n.value = e;
|
|
133
133
|
});
|
|
134
|
-
let r =
|
|
135
|
-
return (e, t) => (
|
|
134
|
+
let r = Ze(() => `--size: ${t.size}px;fill:${n.value}`);
|
|
135
|
+
return (e, t) => (w(), E("svg", {
|
|
136
136
|
xmlns: "http://www.w3.org/2000/svg",
|
|
137
|
-
style:
|
|
137
|
+
style: ge([{
|
|
138
138
|
width: "1.2587890625em",
|
|
139
139
|
height: "1em",
|
|
140
140
|
"vertical-align": "middle",
|
|
141
141
|
overflow: "hidden"
|
|
142
142
|
}, r.value]),
|
|
143
143
|
viewBox: "0 0 1289 1024"
|
|
144
|
-
}, [...t[0] ||= [
|
|
144
|
+
}, [...t[0] ||= [T("path", { d: "M1188.420307 68.911452c16.92562 0 32.642267 14.507674 32.642267 32.642267v822.101535c0 16.92562-14.507674 32.642267-32.642267 32.642267h-1088.075561c-16.92562 0-32.642267-14.507674-32.642267-32.642267v-822.101535c0-16.92562 14.507674-32.642267 32.642267-32.642267h1088.075561m0-68.911452h-1088.075561C44.731995 0 0 45.940968 0 100.344746v822.101535c0 55.612751 44.731995 100.344746 100.344746 100.344746h1088.075561c55.612751 0 100.344746-44.731995 100.344746-100.344746v-822.101535c1.208973-54.403778-44.731995-100.344746-100.344746-100.344746z" }, null, -1), T("path", { d: "M41.105077 252.675325h1221.062574v258.720189H41.105077zM177.719008 778.578512h174.09209v71.329398H177.719008zM432.812279 778.578512h259.929161v71.329398H432.812279z" }, null, -1)]], 4));
|
|
145
145
|
}
|
|
146
|
-
}), [["__scopeId", "data-v-6a1e8b23"]]),
|
|
146
|
+
}), [["__scopeId", "data-v-6a1e8b23"]]), ct = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
147
147
|
__name: "GooglePayIcon",
|
|
148
148
|
props: {
|
|
149
149
|
size: {},
|
|
@@ -151,14 +151,14 @@ var ct = /*#__PURE__*/ j(/* @__PURE__ */ D({
|
|
|
151
151
|
},
|
|
152
152
|
setup(e) {
|
|
153
153
|
let t = `--size: ${Number(e.size || 30) + 10}px`;
|
|
154
|
-
return (e, n) => (
|
|
154
|
+
return (e, n) => (w(), E("svg", {
|
|
155
155
|
xmlns: "http://www.w3.org/2000/svg",
|
|
156
156
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
157
157
|
style: t,
|
|
158
158
|
viewBox: "170.7 170 752 400"
|
|
159
|
-
}, [...n[0] ||= [
|
|
159
|
+
}, [...n[0] ||= [b("<path id=\"Base_1_\" fill=\"#FFFFFF\" d=\"M722.7,170h-352c-110,0-200,90-200,200l0,0c0,110,90,200,200,200h352c110,0,200-90,200-200l0,0 C922.7,260,832.7,170,722.7,170z\" data-v-f87e02ce></path><path id=\"Outline\" fill=\"#3C4043\" d=\"M722.7,186.2c24.7,0,48.7,4.9,71.3,14.5c21.9,9.3,41.5,22.6,58.5,39.5 c16.9,16.9,30.2,36.6,39.5,58.5c9.6,22.6,14.5,46.6,14.5,71.3s-4.9,48.7-14.5,71.3c-9.3,21.9-22.6,41.5-39.5,58.5 c-16.9,16.9-36.6,30.2-58.5,39.5c-22.6,9.6-46.6,14.5-71.3,14.5h-352c-24.7,0-48.7-4.9-71.3-14.5c-21.9-9.3-41.5-22.6-58.5-39.5 c-16.9-16.9-30.2-36.6-39.5-58.5c-9.6-22.6-14.5-46.6-14.5-71.3s4.9-48.7,14.5-71.3c9.3-21.9,22.6-41.5,39.5-58.5 c16.9-16.9,36.6-30.2,58.5-39.5c22.6-9.6,46.6-14.5,71.3-14.5L722.7,186.2 M722.7,170h-352c-110,0-200,90-200,200l0,0 c0,110,90,200,200,200h352c110,0,200-90,200-200l0,0C922.7,260,832.7,170,722.7,170L722.7,170z\" data-v-f87e02ce></path><g id=\"Google_Pay_Lockup_1_\" data-v-f87e02ce><g id=\"Pay_Typeface_3_\" data-v-f87e02ce><path id=\"Letter_p_3_\" fill=\"#3C4043\" d=\"M529.3,384.2v60.5h-19.2V295.3H561c12.9,0,23.9,4.3,32.9,12.9 c9.2,8.6,13.8,19.1,13.8,31.5c0,12.7-4.6,23.2-13.8,31.7c-8.9,8.5-19.9,12.7-32.9,12.7h-31.7V384.2z M529.3,313.7v52.1h32.1 c7.6,0,14-2.6,19-7.7c5.1-5.1,7.7-11.3,7.7-18.3c0-6.9-2.6-13-7.7-18.1c-5-5.3-11.3-7.9-19-7.9h-32.1V313.7z\" data-v-f87e02ce></path><path id=\"Letter_a_3_\" fill=\"#3C4043\" d=\"M657.9,339.1c14.2,0,25.4,3.8,33.6,11.4c8.2,7.6,12.3,18,12.3,31.2v63h-18.3v-14.2h-0.8 c-7.9,11.7-18.5,17.5-31.7,17.5c-11.3,0-20.7-3.3-28.3-10s-11.4-15-11.4-25c0-10.6,4-19,12-25.2c8-6.3,18.7-9.4,32-9.4 c11.4,0,20.8,2.1,28.1,6.3v-4.4c0-6.7-2.6-12.3-7.9-17c-5.3-4.7-11.5-7-18.6-7c-10.7,0-19.2,4.5-25.4,13.6l-16.9-10.6 C625.9,345.8,639.7,339.1,657.9,339.1z M633.1,413.3c0,5,2.1,9.2,6.4,12.5c4.2,3.3,9.2,5,14.9,5c8.1,0,15.3-3,21.6-9 s9.5-13,9.5-21.1c-6-4.7-14.3-7.1-25-7.1c-7.8,0-14.3,1.9-19.5,5.6C635.7,403.1,633.1,407.8,633.1,413.3z\" data-v-f87e02ce></path><path id=\"Letter_y_3_\" fill=\"#3C4043\" d=\"M808.2,342.4l-64,147.2h-19.8l23.8-51.5L706,342.4h20.9l30.4,73.4h0.4l29.6-73.4H808.2z\" data-v-f87e02ce></path></g><g id=\"Google_Mark_1_\" data-v-f87e02ce><path id=\"Blue_500\" fill=\"#4285F4\" d=\"M452.93,372c0-6.26-0.56-12.25-1.6-18.01h-80.48v33L417.2,387 c-1.88,10.98-7.93,20.34-17.2,26.58v21.41h27.59C443.7,420.08,452.93,398.04,452.93,372z\" data-v-f87e02ce></path><path id=\"Green_500_1_\" fill=\"#34A853\" d=\"M400.01,413.58c-7.68,5.18-17.57,8.21-29.14,8.21c-22.35,0-41.31-15.06-48.1-35.36 h-28.46v22.08c14.1,27.98,43.08,47.18,76.56,47.18c23.14,0,42.58-7.61,56.73-20.71L400.01,413.58z\" data-v-f87e02ce></path><path id=\"Yellow_500_1_\" fill=\"#FABB05\" d=\"M320.09,370.05c0-5.7,0.95-11.21,2.68-16.39v-22.08h-28.46 c-5.83,11.57-9.11,24.63-9.11,38.47s3.29,26.9,9.11,38.47l28.46-22.08C321.04,381.26,320.09,375.75,320.09,370.05z\" data-v-f87e02ce></path><path id=\"Red_500\" fill=\"#E94235\" d=\"M370.87,318.3c12.63,0,23.94,4.35,32.87,12.85l24.45-24.43 c-14.85-13.83-34.21-22.32-57.32-22.32c-33.47,0-62.46,19.2-76.56,47.18l28.46,22.08C329.56,333.36,348.52,318.3,370.87,318.3z\" data-v-f87e02ce></path></g></g>", 3)]]));
|
|
160
160
|
}
|
|
161
|
-
}), [["__scopeId", "data-v-f87e02ce"]]),
|
|
161
|
+
}), [["__scopeId", "data-v-f87e02ce"]]), lt = ["fill"], ut = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
162
162
|
__name: "PayToIcon",
|
|
163
163
|
props: {
|
|
164
164
|
size: {},
|
|
@@ -168,27 +168,27 @@ var ct = /*#__PURE__*/ j(/* @__PURE__ */ D({
|
|
|
168
168
|
let t = e;
|
|
169
169
|
t.grayscale;
|
|
170
170
|
let n = `--size: ${t.size}px`;
|
|
171
|
-
return (e, t) => (
|
|
171
|
+
return (e, t) => (w(), E("svg", {
|
|
172
172
|
id: "payto-icon",
|
|
173
173
|
viewBox: "0 0 120 57",
|
|
174
174
|
xmlns: "http://www.w3.org/2000/svg",
|
|
175
175
|
style: n
|
|
176
|
-
}, [
|
|
176
|
+
}, [T("path", {
|
|
177
177
|
d: "m8.285 27.63c.8 0 1.562-.06 2.285-.176a6.262 6.262 0 0 0 1.937-.624 3.529 3.529 0 0 0 1.354-1.227c.335-.52.502-1.194.502-2.025s-.169-1.463-.502-1.97a3.492 3.492 0 0 0 -1.337-1.187c-.555-.287-1.186-.473-1.897-.565a17.32 17.32 0 0 0 -2.188-.136h-3.56v7.91zm-8.285-12.04h8.945c1.573 0 2.994.144 4.258.429 1.265.288 2.349.754 3.254 1.404.902.648 1.599 1.479 2.092 2.493.488 1.012.736 2.235.736 3.663 0 1.533-.283 2.818-.853 3.858a6.956 6.956 0 0 1 -2.303 2.512c-.968.637-2.098 1.097-3.388 1.383-1.29.285-2.66.43-4.103.43h-3.76v11.415h-4.878zm32.679 19.054h-1.043c-.751 0-1.538.034-2.364.098s-1.588.207-2.283.427c-.697.223-1.279.534-1.742.937-.464.403-.696.954-.696 1.655 0 .442.095.812.29 1.11.195.3.446.54.755.721.31.183.659.311 1.045.39a5.94 5.94 0 0 0 1.161.117c1.6 0 2.813-.427 3.639-1.287.826-.857 1.238-2.026 1.238-3.505zm.078 6.156h-.116c-.466.832-1.213 1.516-2.247 2.047-1.034.532-2.206.8-3.523.8-.749 0-1.53-.099-2.343-.293a6.902 6.902 0 0 1 -2.245-.972 5.624 5.624 0 0 1 -1.705-1.793c-.45-.74-.676-1.656-.676-2.745 0-1.404.394-2.52 1.18-3.351.787-.831 1.8-1.468 3.04-1.91 1.24-.44 2.614-.732 4.124-.875a47.58 47.58 0 0 1 4.433-.215v-.47c0-1.168-.42-2.031-1.259-2.589s-1.839-.839-3-.839c-.981 0-1.923.21-2.826.624-.903.417-1.652.924-2.246 1.521l-2.4-2.844a10.478 10.478 0 0 1 3.659-2.222 12.448 12.448 0 0 1 4.203-.74c1.651 0 3.013.233 4.084.7 1.072.468 1.916 1.079 2.536 1.83a6.571 6.571 0 0 1 1.298 2.534c.245.936.369 1.869.369 2.806v11.376h-4.338v-2.377l-.002-.004zm5.719-16.325h5.15l5.189 13.599h.078l4.607-13.6h4.84l-8.791 22.717a16.433 16.433 0 0 1 -1.083 2.278 6.33 6.33 0 0 1 -1.395 1.676 5.56 5.56 0 0 1 -1.916 1.032c-.736.234-1.62.351-2.654.351-.386 0-.78-.019-1.182-.058a8.113 8.113 0 0 1 -1.219-.215l.386-4.052c.31.104.614.175.91.215s.575.058.834.058c.49 0 .902-.058 1.238-.175.337-.117.62-.298.852-.545.232-.248.438-.552.618-.917.181-.364.376-.792.582-1.286l.93-2.376-7.977-18.702zm42.808 14.279c.893 0 2.072-.328 2.536-.49v3.735c-.468.183-1.478.535-2.536.535-3.691 0-6.695-3.064-6.697-6.831v-11.228h-4.225v-3.675h4.225v-4.66h3.665v4.66h10a13.83 13.83 0 0 0 -3.625 3.675h-6.375v11.228c0 1.688 1.39 3.05 3.032 3.05zm15 3.78c-6.038 0-10.801-4.79-10.801-10.866s4.845-10.868 10.8-10.868h12.183l.004-3.376 6.267 5.245-6.278 5.256.004-3.45h-12.337c-3.775 0-6.897 3.396-6.897 7.193s3.11 7.13 7.053 7.13c3.942 0 7.053-3.163 7.053-7.13 0-1.755-.62-3.377-1.386-4.553h4.139c.65 1.402.993 3.006.993 4.553 0 6.076-4.761 10.866-10.801 10.866zm10.909-42.534h-31.031c-7.074 0-12.807 5.77-12.807 12.886v31.226c0 7.117 5.735 12.886 12.807 12.886h31.031c7.074 0 12.806-5.77 12.806-12.886v-31.226c0-7.116-5.734-12.886-12.806-12.886z",
|
|
178
|
-
fill:
|
|
179
|
-
}, null, 8,
|
|
178
|
+
fill: D("#000")
|
|
179
|
+
}, null, 8, lt)]));
|
|
180
180
|
}
|
|
181
|
-
}), [["__scopeId", "data-v-0b2d8aa0"]]),
|
|
182
|
-
function
|
|
181
|
+
}), [["__scopeId", "data-v-0b2d8aa0"]]), dt = "payfurl-combined-container";
|
|
182
|
+
function ft(e, t) {
|
|
183
183
|
if (!e) return null;
|
|
184
184
|
for (; e.parentNode && e.parentNode.nodeName.toLowerCase() !== "body";) if (e = e.parentNode, e.id === t) return e;
|
|
185
185
|
return null;
|
|
186
186
|
}
|
|
187
187
|
// src/sdk/components/Combined.vue?vue&type=script&setup=true&lang.ts
|
|
188
|
-
var
|
|
188
|
+
var pt = ["id"], mt = ["id", "onClick"], ht = ["value", "id"], gt = { class: "combined-tab-title" }, _t = { class: "combined-tab-name" }, vt = {
|
|
189
189
|
key: 0,
|
|
190
190
|
class: "combined-tab-description"
|
|
191
|
-
},
|
|
191
|
+
}, yt = ["src", "alt"], bt = ["id"], xt = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
192
192
|
__name: "Combined",
|
|
193
193
|
props: { elements: {} },
|
|
194
194
|
setup(e) {
|
|
@@ -224,27 +224,27 @@ var ht = ["id"], gt = ["id", "onClick"], _t = ["value", "id"], vt = { class: "co
|
|
|
224
224
|
t.elements.forEach((e, t) => {
|
|
225
225
|
l(t);
|
|
226
226
|
}), a(0);
|
|
227
|
-
}), (e, r) => (
|
|
227
|
+
}), (e, r) => (w(), E("div", {
|
|
228
228
|
class: "payfurl-sdk-combined-container",
|
|
229
|
-
id:
|
|
230
|
-
}, [(
|
|
229
|
+
id: D(dt)
|
|
230
|
+
}, [(w(!0), E(Ce, null, le(t.elements, (e, t) => (w(), E(Ce, { key: `container-component${t}` }, [i.value[t] ? P("", !0) : (w(), E("div", {
|
|
231
231
|
key: 0,
|
|
232
|
-
class:
|
|
232
|
+
class: te(["payfurl-sdk-combined-tab", t === n.value ? "active" : ""]),
|
|
233
233
|
id: e.id || `combined-tab${t}`,
|
|
234
234
|
onClick: (e) => a(t)
|
|
235
235
|
}, [
|
|
236
|
-
|
|
236
|
+
T("input", {
|
|
237
237
|
type: "radio",
|
|
238
238
|
name: "payment-type",
|
|
239
239
|
value: e.title,
|
|
240
240
|
id: `payment-type${t}`
|
|
241
|
-
}, null, 8,
|
|
242
|
-
|
|
243
|
-
o(e) ? (
|
|
241
|
+
}, null, 8, ht),
|
|
242
|
+
T("div", gt, [T("div", _t, O(e.title), 1), e.description ? (w(), E("div", vt, O(e.description), 1)) : P("", !0)]),
|
|
243
|
+
o(e) ? (w(), v(x(e.icon), {
|
|
244
244
|
key: 0,
|
|
245
245
|
size: 30
|
|
246
|
-
})) :
|
|
247
|
-
s(e) ? (
|
|
246
|
+
})) : P("", !0),
|
|
247
|
+
s(e) ? (w(), E("img", {
|
|
248
248
|
key: 1,
|
|
249
249
|
src: e.icon,
|
|
250
250
|
style: {
|
|
@@ -253,13 +253,13 @@ var ht = ["id"], gt = ["id", "onClick"], _t = ["value", "id"], vt = { class: "co
|
|
|
253
253
|
"object-fit": "contain"
|
|
254
254
|
},
|
|
255
255
|
alt: e.title
|
|
256
|
-
}, null, 8,
|
|
257
|
-
], 10,
|
|
256
|
+
}, null, 8, yt)) : P("", !0)
|
|
257
|
+
], 10, mt)), F(T("div", {
|
|
258
258
|
class: "payfurl-sdk-container-component",
|
|
259
259
|
id: `container-component${t}`
|
|
260
|
-
}, null, 8,
|
|
260
|
+
}, null, 8, bt), [[Je, c(t)]])], 64))), 128))], 8, pt));
|
|
261
261
|
}
|
|
262
|
-
}), [["__scopeId", "data-v-240dc514"]]),
|
|
262
|
+
}), [["__scopeId", "data-v-240dc514"]]), St = {
|
|
263
263
|
AED: "784",
|
|
264
264
|
AFN: "971",
|
|
265
265
|
ALL: "008",
|
|
@@ -438,7 +438,7 @@ var ht = ["id"], gt = ["id", "onClick"], _t = ["value", "id"], vt = { class: "co
|
|
|
438
438
|
ZAR: "710",
|
|
439
439
|
ZMW: "967",
|
|
440
440
|
ZWL: "932"
|
|
441
|
-
},
|
|
441
|
+
}, Ct = {
|
|
442
442
|
BHD: 3,
|
|
443
443
|
BIF: 0,
|
|
444
444
|
CLF: 4,
|
|
@@ -466,17 +466,17 @@ var ht = ["id"], gt = ["id", "onClick"], _t = ["value", "id"], vt = { class: "co
|
|
|
466
466
|
XOF: 0,
|
|
467
467
|
XPF: 0
|
|
468
468
|
};
|
|
469
|
-
function
|
|
470
|
-
return !!
|
|
469
|
+
function B(e) {
|
|
470
|
+
return !!St[String(e).toUpperCase()];
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
return
|
|
472
|
+
function wt(e) {
|
|
473
|
+
return St[String(e).toUpperCase()] || "";
|
|
474
474
|
}
|
|
475
|
-
function
|
|
476
|
-
return
|
|
475
|
+
function Tt(e) {
|
|
476
|
+
return Ct[String(e).toUpperCase()] || 2;
|
|
477
477
|
}
|
|
478
478
|
// src/sdk/processors/threeDsProcessor.ts
|
|
479
|
-
var { hideSpinner:
|
|
479
|
+
var { hideSpinner: Et, showSpinner: Dt } = Re(), V = {
|
|
480
480
|
PREAUTH: "PREAUTH",
|
|
481
481
|
AUTH: "AUTH",
|
|
482
482
|
POSTAUTH: "POSTAUTH",
|
|
@@ -484,36 +484,36 @@ var { hideSpinner: Ot, showSpinner: kt } = Be(), z = {
|
|
|
484
484
|
GET_GATEWAY_DATA: "GET_GATEWAY_DATA",
|
|
485
485
|
TOKENISE_CARD: "TOKENISE_CARD",
|
|
486
486
|
PUT_TOKEN_EXTERNAL_3DS_DATA: "PUT_TOKEN_EXTERNAL_3DS_DATA"
|
|
487
|
-
},
|
|
488
|
-
[
|
|
487
|
+
}, H = (e, t) => ({
|
|
488
|
+
[V.PREAUTH]: {
|
|
489
489
|
url: e + (t ? "/3ds/preauth/token/" + t : "/3ds/preauth"),
|
|
490
490
|
method: "POST"
|
|
491
491
|
},
|
|
492
|
-
[
|
|
492
|
+
[V.AUTH]: {
|
|
493
493
|
url: e + (t ? "/3ds/auth/token/" + t : "/3ds/auth"),
|
|
494
494
|
method: "POST"
|
|
495
495
|
},
|
|
496
|
-
[
|
|
496
|
+
[V.POSTAUTH]: {
|
|
497
497
|
url: e + "/3ds/postauth",
|
|
498
498
|
method: "POST"
|
|
499
499
|
},
|
|
500
|
-
[
|
|
500
|
+
[V.AUTH_COMPLETE]: {
|
|
501
501
|
url: e + "/3ds/auth_complete",
|
|
502
502
|
method: "POST"
|
|
503
503
|
},
|
|
504
|
-
[
|
|
504
|
+
[V.GET_GATEWAY_DATA]: {
|
|
505
505
|
url: e + "/token/" + t + "/gateway_data",
|
|
506
506
|
method: "GET"
|
|
507
507
|
},
|
|
508
|
-
[
|
|
508
|
+
[V.TOKENISE_CARD]: {
|
|
509
509
|
url: e + "/token/card",
|
|
510
510
|
method: "POST"
|
|
511
511
|
},
|
|
512
|
-
[
|
|
512
|
+
[V.PUT_TOKEN_EXTERNAL_3DS_DATA]: {
|
|
513
513
|
url: e + "/token/" + t + "/external3dsdata",
|
|
514
514
|
method: "PUT"
|
|
515
515
|
}
|
|
516
|
-
}),
|
|
516
|
+
}), U = class {
|
|
517
517
|
container = null;
|
|
518
518
|
log;
|
|
519
519
|
apiUrl = "";
|
|
@@ -593,14 +593,14 @@ var { hideSpinner: Ot, showSpinner: kt } = Be(), z = {
|
|
|
593
593
|
return { ...this.clientParameters };
|
|
594
594
|
}
|
|
595
595
|
onError(e) {
|
|
596
|
-
this.log("[3ds error]", e),
|
|
596
|
+
this.log("[3ds error]", e), Et(), I(this.container, re), this.complete({
|
|
597
597
|
step: "completed",
|
|
598
598
|
success: !1,
|
|
599
599
|
error: e.error
|
|
600
600
|
}), this.threeDSFailureHandler ? this.threeDSFailureHandler(e) : this.failureCallback?.(e);
|
|
601
601
|
}
|
|
602
602
|
onSuccess(e) {
|
|
603
|
-
|
|
603
|
+
Et(), this.log("[3ds success]", e), this.complete({
|
|
604
604
|
step: "completed",
|
|
605
605
|
success: !0
|
|
606
606
|
}), this.threeDSCompleteHandler ? this.threeDSCompleteHandler?.(e) : this.successCallback?.(e);
|
|
@@ -612,14 +612,14 @@ var { hideSpinner: Ot, showSpinner: kt } = Be(), z = {
|
|
|
612
612
|
ccv: this.paymentInfo?.ccv,
|
|
613
613
|
cardProviderId: this.cardProviderId
|
|
614
614
|
};
|
|
615
|
-
this.log("[onPreAuth]", n), this.httpInvoker?.invoke(
|
|
615
|
+
this.log("[onPreAuth]", n), this.httpInvoker?.invoke(H(this.apiUrl, this.tokenId)[V.PREAUTH].url, H(this.apiUrl, this.tokenId)[V.PREAUTH].method, JSON.stringify(n), e, t);
|
|
616
616
|
}
|
|
617
617
|
onAuth(e, t, n, r, i, a, o) {
|
|
618
618
|
this.log("[onAuth]", {
|
|
619
619
|
threeDSServerTransID: n,
|
|
620
620
|
isMethodPerformed: r
|
|
621
621
|
});
|
|
622
|
-
let s =
|
|
622
|
+
let s = wt(this.currency), c = Tt(this.currency), l = /* @__PURE__ */ new Date(), u = {
|
|
623
623
|
acctNumber: this.paymentInfo?.cardNumber,
|
|
624
624
|
notificationURL: this.apiUrl + "/3ds/auth_complete",
|
|
625
625
|
threeDSAuthURL: e,
|
|
@@ -655,12 +655,12 @@ var { hideSpinner: Ot, showSpinner: kt } = Be(), z = {
|
|
|
655
655
|
ccv: this.paymentInfo?.ccv && String(this.paymentInfo?.ccv) || "",
|
|
656
656
|
threeDSRequestorChallengeInd: this.requireChallenge ? "04" : "01"
|
|
657
657
|
};
|
|
658
|
-
this.httpInvoker?.invoke(
|
|
659
|
-
|
|
658
|
+
this.httpInvoker?.invoke(H(this.apiUrl, this.tokenId)[V.AUTH].url, H(this.apiUrl, this.tokenId)[V.AUTH].method, JSON.stringify(u), (e, t) => {
|
|
659
|
+
Et(), a(e, t);
|
|
660
660
|
}, o);
|
|
661
661
|
}
|
|
662
662
|
onPostAuth(e, t, n) {
|
|
663
|
-
this.log("[onPostAuth]", e),
|
|
663
|
+
this.log("[onPostAuth]", e), Dt(), this.httpInvoker?.invoke(H(this.apiUrl, this.tokenId)[V.POSTAUTH].url, H(this.apiUrl, this.tokenId)[V.POSTAUTH].method, JSON.stringify(e), t, n);
|
|
664
664
|
}
|
|
665
665
|
challengeShown() {
|
|
666
666
|
this.running && !this.challengeReported && (this.challengeReported = !0, this.progressCallback?.({ step: "challenge" }));
|
|
@@ -672,15 +672,15 @@ var { hideSpinner: Ot, showSpinner: kt } = Be(), z = {
|
|
|
672
672
|
this.running = !0, this.challengeReported = !1, this.progressCallback?.({ step: "started" }), this.container = e, this.threeDSCompleteHandler = n || null, this.threeDSFailureHandler = r || null, this.requireChallenge = t, this.threeDsInvoker?.onPreAuth();
|
|
673
673
|
}
|
|
674
674
|
getGatewayData(e, t, n, r) {
|
|
675
|
-
this.httpInvoker?.invoke(
|
|
675
|
+
this.httpInvoker?.invoke(H(this.apiUrl, t)[V.GET_GATEWAY_DATA].url, H(this.apiUrl, t)[V.GET_GATEWAY_DATA].method, null, z(this, "[getGatewayDataSuccessCallback]", (e, t) => {
|
|
676
676
|
this.log("getGatewayDataSuccessCallback", e), n(JSON.parse(t));
|
|
677
|
-
}),
|
|
678
|
-
this.log("getGatewayDataFailureCallback", e, t),
|
|
677
|
+
}), z(this, "[getGatewayDataFailureCallback]", (e, t) => {
|
|
678
|
+
this.log("getGatewayDataFailureCallback", e, t), Et(), r();
|
|
679
679
|
}), { providerId: e });
|
|
680
680
|
}
|
|
681
681
|
tokeniseCard(e, t, n) {
|
|
682
682
|
let r = this.getPaymentInfo();
|
|
683
|
-
!r.cardNumber || !r.expiryDate || !r.cardholder ? n("Card information is missing") : (
|
|
683
|
+
!r.cardNumber || !r.expiryDate || !r.cardholder ? n("Card information is missing") : (Dt(), this.httpInvoker?.invoke(H(this.apiUrl)[V.TOKENISE_CARD].url, H(this.apiUrl)[V.TOKENISE_CARD].method, JSON.stringify({
|
|
684
684
|
paymentInformation: {
|
|
685
685
|
cardNumber: r.cardNumber,
|
|
686
686
|
expiryDate: `${r.expiryDate.slice(2)}/${r.expiryDate.slice(0, 2)}`,
|
|
@@ -689,39 +689,39 @@ var { hideSpinner: Ot, showSpinner: kt } = Be(), z = {
|
|
|
689
689
|
},
|
|
690
690
|
currency: this.getCurrency(),
|
|
691
691
|
amount: this.getAmount()
|
|
692
|
-
}),
|
|
693
|
-
this.log("tokeniseCardSuccessCallback", e, n),
|
|
694
|
-
}),
|
|
695
|
-
this.log("tokeniseCardFailureCallback", e, t),
|
|
692
|
+
}), z(this, "[tokeniseCardSuccessCallback]", (e, n) => {
|
|
693
|
+
this.log("tokeniseCardSuccessCallback", e, n), Et(), t(JSON.parse(n));
|
|
694
|
+
}), z(this, "[tokeniseCardFailureCallback]", (e, t) => {
|
|
695
|
+
this.log("tokeniseCardFailureCallback", e, t), Et(), n("Unable to tokenise payment information");
|
|
696
696
|
}), { providerId: e }));
|
|
697
697
|
}
|
|
698
698
|
updateTokenExternal3dsData(e) {
|
|
699
|
-
this.tokenId && e && Object.keys(e).length !== 0 && this.httpInvoker?.invoke(
|
|
699
|
+
this.tokenId && e && Object.keys(e).length !== 0 && this.httpInvoker?.invoke(H(this.apiUrl, this.tokenId)[V.PUT_TOKEN_EXTERNAL_3DS_DATA].url, H(this.apiUrl, this.tokenId)[V.PUT_TOKEN_EXTERNAL_3DS_DATA].method, JSON.stringify(e), (e, t) => {
|
|
700
700
|
this.log("updateTokenExternal3dsDataSuccessCallback", e, t);
|
|
701
701
|
}, (e, t) => {
|
|
702
|
-
this.log("updateTokenExternal3dsDataFailureCallback", e, t),
|
|
702
|
+
this.log("updateTokenExternal3dsDataFailureCallback", e, t), Et();
|
|
703
703
|
}, {});
|
|
704
704
|
}
|
|
705
705
|
};
|
|
706
|
-
|
|
706
|
+
L([R], U.prototype, "setPaymentInfo", null), L([R], U.prototype, "onError", null), L([R], U.prototype, "onSuccess", null), L([R], U.prototype, "onPreAuth", null), L([R], U.prototype, "onAuth", null), L([R], U.prototype, "onPostAuth", null), L([R], U.prototype, "threeDSInvoke", null), L([R], U.prototype, "getGatewayData", null), L([R], U.prototype, "tokeniseCard", null), L([R], U.prototype, "updateTokenExternal3dsData", null);
|
|
707
707
|
// src/sdk/utils/loading.ts
|
|
708
|
-
var
|
|
709
|
-
function
|
|
708
|
+
var Ot = g(!1);
|
|
709
|
+
function W() {
|
|
710
710
|
return {
|
|
711
|
-
isLoading:
|
|
711
|
+
isLoading: Ot,
|
|
712
712
|
startLoading: () => {
|
|
713
|
-
|
|
713
|
+
Ot.value = !0;
|
|
714
714
|
},
|
|
715
715
|
stopLoading: () => {
|
|
716
|
-
|
|
716
|
+
Ot.value = !1;
|
|
717
717
|
}
|
|
718
718
|
};
|
|
719
719
|
}
|
|
720
720
|
// src/sdk/components/PaypalForm.vue?vue&type=script&setup=true&lang.ts
|
|
721
|
-
var
|
|
721
|
+
var kt = { style: { position: "relative" } }, At = {
|
|
722
722
|
key: 0,
|
|
723
723
|
class: "error text-normal"
|
|
724
|
-
},
|
|
724
|
+
}, jt = "payfurl-paypal-script", Mt = /* @__PURE__ */ k({
|
|
725
725
|
__name: "PaypalForm",
|
|
726
726
|
props: {
|
|
727
727
|
log: { type: Function },
|
|
@@ -738,12 +738,12 @@ var jt = { style: { position: "relative" } }, Mt = {
|
|
|
738
738
|
"close"
|
|
739
739
|
],
|
|
740
740
|
setup(e, { emit: t }) {
|
|
741
|
-
let n = e, r = t, i = g(null), a = g(!0), o = g(""), s = g(null), c = !1, l = null, { isLoading: u } =
|
|
741
|
+
let n = e, r = t, i = g(null), a = g(!0), o = g(""), s = g(null), c = !1, l = null, { isLoading: u } = W();
|
|
742
742
|
function d(e) {
|
|
743
743
|
s.value = e, n.log && n.log("[Paypal]: checkout", s.value), c || (c = !0, f());
|
|
744
744
|
}
|
|
745
745
|
function f() {
|
|
746
|
-
if (document.getElementById(
|
|
746
|
+
if (document.getElementById(jt)) {
|
|
747
747
|
p();
|
|
748
748
|
return;
|
|
749
749
|
}
|
|
@@ -756,13 +756,13 @@ var jt = { style: { position: "relative" } }, Mt = {
|
|
|
756
756
|
let t = `https://www.paypal.com/sdk/js?${new URLSearchParams(e)}`;
|
|
757
757
|
window.paypal = null;
|
|
758
758
|
let r = document.createElement("script");
|
|
759
|
-
r.src = t, r.id =
|
|
759
|
+
r.src = t, r.id = jt, r.onload = p, r.onerror = () => {
|
|
760
760
|
r.remove(), h("PayPal script failed to load");
|
|
761
761
|
}, document.body.appendChild(r);
|
|
762
762
|
}
|
|
763
763
|
function p() {
|
|
764
|
-
window.paypal && window.paypal.Buttons && window.paypal.Buttons({
|
|
765
|
-
style: { color: n.buttonStyle },
|
|
764
|
+
window.paypal && window.paypal.Buttons && new Promise((e) => e(window.paypal.Buttons({
|
|
765
|
+
style: typeof n.buttonStyle == "string" ? { color: n.buttonStyle } : n.buttonStyle ?? {},
|
|
766
766
|
createOrder: function() {
|
|
767
767
|
return s.value?.gatewayTransactionId;
|
|
768
768
|
},
|
|
@@ -777,52 +777,52 @@ var jt = { style: { position: "relative" } }, Mt = {
|
|
|
777
777
|
n.clickGate()?.() === !1 ? t.disable() : t.enable();
|
|
778
778
|
}, 1e3);
|
|
779
779
|
}
|
|
780
|
-
}).render(n.el).then(() => window.postMessage({
|
|
781
|
-
status:
|
|
780
|
+
}).render(n.el))).then(() => window.postMessage({
|
|
781
|
+
status: Xe,
|
|
782
782
|
paymentMethod: "paypal"
|
|
783
783
|
}, "*")).catch((e) => h(e?.message || "PayPal buttons failed to render"));
|
|
784
784
|
}
|
|
785
785
|
function h(e) {
|
|
786
786
|
window.postMessage({
|
|
787
|
-
status:
|
|
787
|
+
status: _,
|
|
788
788
|
paymentMethod: "paypal",
|
|
789
789
|
reason: "error",
|
|
790
790
|
message: e
|
|
791
791
|
}, "*");
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function v(e) {
|
|
794
794
|
e?.data?.status && (e.data.status === "activate" && e.data.component === "paypal" && (n.log?.(`[PayPal]: message "${e.data.status}" received`, e.data), a.value = !0, r("activate")), e.data.status === "deactivate" && e.data.component === "paypal" && (n.log?.(`[PayPal]: message "${e.data.status}" received`, e.data), a.value = !1), e.data.status === "checkout-ready" && e.data.component === "paypal" && (n.log?.(`[PayPal]: message "${e.data.status}" received`, e.data), d(e.data.checkoutData)), e.data.status === "message" && e.data.component === "paypal" && (n.log?.(`[PayPal]: message "${e.data.status}" received`, e.data), o.value = e.data.message), e.data.status === "error" && e.data.component === "paypal" && (n.log?.(`[PayPal]: message "${e.data.status}" received`, e.data), o.value = e.data.error));
|
|
795
795
|
}
|
|
796
|
-
return
|
|
797
|
-
window.removeEventListener("message",
|
|
796
|
+
return Fe(() => {
|
|
797
|
+
window.removeEventListener("message", v), l && clearInterval(l);
|
|
798
798
|
}), m(() => {
|
|
799
|
-
window.addEventListener("message",
|
|
800
|
-
}), (e, t) => (
|
|
799
|
+
window.addEventListener("message", v), ft(i.value, "payfurl-combined-container") || (a.value = !0, r("activate"));
|
|
800
|
+
}), (e, t) => (w(), E(Ce, null, [T("div", kt, [F(ue(Oe, null, null, 512), [[Je, D(u)]])]), T("div", {
|
|
801
801
|
style: { position: "relative" },
|
|
802
802
|
ref_key: "root",
|
|
803
803
|
ref: i
|
|
804
|
-
}, [o.value ? (
|
|
804
|
+
}, [o.value ? (w(), E("div", At, O(o.value), 1)) : P("", !0)], 512)], 64));
|
|
805
805
|
}
|
|
806
|
-
}),
|
|
806
|
+
}), Nt = {
|
|
807
807
|
APPROVED: "Approved",
|
|
808
808
|
DECLINED: "Declined",
|
|
809
809
|
UNDECIDED: "Undecided"
|
|
810
810
|
};
|
|
811
|
-
function
|
|
812
|
-
return e ? e.decision ===
|
|
811
|
+
function Pt(e) {
|
|
812
|
+
return e ? e.decision === Nt.DECLINED && e.stopPaymentOnFailure === !0 : !1;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function Ft(e) {
|
|
815
815
|
return e === "forter";
|
|
816
816
|
}
|
|
817
817
|
// src/sdk/utils/optionCleaning.ts
|
|
818
|
-
function
|
|
818
|
+
function G(e) {
|
|
819
819
|
if (e == null) return null;
|
|
820
820
|
var t = {};
|
|
821
821
|
for (var n in e) t[n] = e[n];
|
|
822
822
|
return t;
|
|
823
823
|
}
|
|
824
824
|
// src/sdk/processors/paypalProcessor.ts
|
|
825
|
-
var { hideSpinner:
|
|
825
|
+
var { hideSpinner: It, showSpinner: Lt } = Re(), Rt = class {
|
|
826
826
|
container = null;
|
|
827
827
|
log;
|
|
828
828
|
apiUrl = "";
|
|
@@ -834,7 +834,7 @@ var { hideSpinner: Rt, showSpinner: zt } = Be(), Bt = class {
|
|
|
834
834
|
destroy = () => {};
|
|
835
835
|
checkoutExternalId = "";
|
|
836
836
|
amount = 0;
|
|
837
|
-
userSuccessMessage =
|
|
837
|
+
userSuccessMessage = me;
|
|
838
838
|
constructor(e, t) {
|
|
839
839
|
this.log = e, this.apiUrl = t.apiUrl, this.failureCallback = t.onFailure || null, this.successCallback = t.onSuccess || null;
|
|
840
840
|
let n = new o(t.environment, s(t.publicKey));
|
|
@@ -867,9 +867,9 @@ var { hideSpinner: Rt, showSpinner: zt } = Be(), Bt = class {
|
|
|
867
867
|
}), this.validateOptions(e, n, r);
|
|
868
868
|
let o = !1;
|
|
869
869
|
this.container = e, this.fraudProcessor && (this.fraudProcessor.setAmount(n), this.fraudProcessor.setCurrency(r));
|
|
870
|
-
let s =
|
|
870
|
+
let s = Me({
|
|
871
871
|
el: e,
|
|
872
|
-
component:
|
|
872
|
+
component: Mt,
|
|
873
873
|
props: {
|
|
874
874
|
log: this.log,
|
|
875
875
|
el: e,
|
|
@@ -879,7 +879,7 @@ var { hideSpinner: Rt, showSpinner: zt } = Be(), Bt = class {
|
|
|
879
879
|
clickGate: this.getOnValidate.bind(this)
|
|
880
880
|
},
|
|
881
881
|
on: {
|
|
882
|
-
activate:
|
|
882
|
+
activate: z(this, "[Paypal]: activate", () => {
|
|
883
883
|
o || (o = !0, this.log("[Paypal]: activate paypal form"), this.checkout(this.amount || n, r, i, a || {}, () => {
|
|
884
884
|
o = !1;
|
|
885
885
|
}), this.setAmount = (e) => {
|
|
@@ -888,7 +888,7 @@ var { hideSpinner: Rt, showSpinner: zt } = Be(), Bt = class {
|
|
|
888
888
|
});
|
|
889
889
|
});
|
|
890
890
|
}),
|
|
891
|
-
approve:
|
|
891
|
+
approve: z(this, "[Paypal]: approved", ({ data: t, actions: n }) => {
|
|
892
892
|
this.log("[Paypal]: approved", {
|
|
893
893
|
data: t,
|
|
894
894
|
actions: n
|
|
@@ -901,7 +901,7 @@ var { hideSpinner: Rt, showSpinner: zt } = Be(), Bt = class {
|
|
|
901
901
|
try {
|
|
902
902
|
this.chargeApproved(e, r);
|
|
903
903
|
} catch (t) {
|
|
904
|
-
|
|
904
|
+
It(), I(e, "Payment couldn't be processed"), this.failureCallback?.({ error: t?.message || "Payment couldn't be processed" });
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
907
|
}, 200);
|
|
@@ -917,10 +917,10 @@ var { hideSpinner: Rt, showSpinner: zt } = Be(), Bt = class {
|
|
|
917
917
|
paymentStatus: t.value.status,
|
|
918
918
|
payerAccountCountry: t.value.payer.address?.country_code,
|
|
919
919
|
paymentId: t.value.id
|
|
920
|
-
}),
|
|
921
|
-
|
|
920
|
+
}), Lt(), this.fraudProcessor.fraudCheck((t) => {
|
|
921
|
+
It(), Pt(t) ? (I(e, "Payment couldn't be processed"), this.failureCallback?.({ error: "Payment couldn't be processed" })) : this.addCharge(e, t);
|
|
922
922
|
}, (t) => {
|
|
923
|
-
|
|
923
|
+
It(), I(e, t.error), this.failureCallback?.(t);
|
|
924
924
|
})) : this.addCharge(e, null);
|
|
925
925
|
}
|
|
926
926
|
setAmount(e) {
|
|
@@ -939,17 +939,17 @@ var { hideSpinner: Rt, showSpinner: zt } = Be(), Bt = class {
|
|
|
939
939
|
amount: e,
|
|
940
940
|
currency: t,
|
|
941
941
|
options: { HideShipping: r.hideShipping ? "true" : "false" },
|
|
942
|
-
metadata:
|
|
942
|
+
metadata: G(r?.metadata)
|
|
943
943
|
};
|
|
944
944
|
r.transfer?.amount && (o.transfer = {
|
|
945
945
|
account: r.transfer.account,
|
|
946
946
|
amount: r.transfer.amount
|
|
947
|
-
}),
|
|
947
|
+
}), W().startLoading(), this.httpInvoker?.invoke(a, "POST", JSON.stringify(o), this.successCheckoutHandler.bind(this), (e, t) => {
|
|
948
948
|
i?.(e, t), this.failureCheckoutHandler.bind(this)(e, t);
|
|
949
949
|
});
|
|
950
950
|
}
|
|
951
951
|
failureCheckoutHandler = (e, t) => {
|
|
952
|
-
|
|
952
|
+
W().stopLoading(), this.failureCallback?.({
|
|
953
953
|
error: "Failed to configure paypal",
|
|
954
954
|
body: t
|
|
955
955
|
}), window.postMessage({
|
|
@@ -958,29 +958,29 @@ var { hideSpinner: Rt, showSpinner: zt } = Be(), Bt = class {
|
|
|
958
958
|
error: "Failed to configure paypal"
|
|
959
959
|
}, "*");
|
|
960
960
|
};
|
|
961
|
-
successCheckoutHandler =
|
|
962
|
-
|
|
961
|
+
successCheckoutHandler = z(this, "[PayPal][successCheckoutHandler]", (e, t) => {
|
|
962
|
+
W().stopLoading();
|
|
963
963
|
let n = JSON.parse(t);
|
|
964
964
|
this.log("paypal success", n);
|
|
965
965
|
let r = JSON.parse(t), i = JSON.parse(window.atob(r.checkoutData));
|
|
966
966
|
this.checkoutExternalId = i.externalId, window.postMessage({
|
|
967
|
-
status:
|
|
967
|
+
status: Be,
|
|
968
968
|
component: "paypal",
|
|
969
969
|
checkoutData: i
|
|
970
970
|
}, "*");
|
|
971
971
|
});
|
|
972
972
|
getFailureAddChargeHandler(e) {
|
|
973
|
-
return
|
|
974
|
-
|
|
973
|
+
return z(this, "[PayPalProcessor][getFailureAddChargeHandler]", (t, n) => {
|
|
974
|
+
I(e, "Unable to tokenise payment information"), this.failureCallback?.({
|
|
975
975
|
error: "Unable to finish AddCharge",
|
|
976
976
|
body: n
|
|
977
977
|
}), this.log("Unable to finish AddCharge, error: " + n);
|
|
978
978
|
});
|
|
979
979
|
}
|
|
980
980
|
getSuccessAddChargeHandler(e) {
|
|
981
|
-
return
|
|
981
|
+
return z(this, "[PayPalProcessor][getSuccessAddChargeHandler]", (t, n) => {
|
|
982
982
|
let r = JSON.parse(n);
|
|
983
|
-
this.log("[getSuccessAddChargeHandler]", r),
|
|
983
|
+
this.log("[getSuccessAddChargeHandler]", r), tt(e, this.getSuccessMessage()), this.successCallback?.({ transactionId: r.chargeId });
|
|
984
984
|
});
|
|
985
985
|
}
|
|
986
986
|
addCharge(e, t) {
|
|
@@ -991,16 +991,16 @@ var { hideSpinner: Rt, showSpinner: zt } = Be(), Bt = class {
|
|
|
991
991
|
}), this.getSuccessAddChargeHandler(e).bind(this), this.getFailureAddChargeHandler(e).bind(this));
|
|
992
992
|
}
|
|
993
993
|
validateOptions(e, t, n) {
|
|
994
|
-
if (!
|
|
995
|
-
if (!
|
|
994
|
+
if (!B(n)) throw I(e, "Invalid currency: " + n), TypeError("invalid currency: " + n);
|
|
995
|
+
if (!j(t)) throw I(e, "Invalid amount: " + t), TypeError("invalid amount: " + t);
|
|
996
996
|
}
|
|
997
997
|
};
|
|
998
|
-
|
|
998
|
+
L([R], Rt.prototype, "cleanUp", null), L([R], Rt.prototype, "addPaypal", null), L([R], Rt.prototype, "setAmount", null), L([R], Rt.prototype, "checkout", null), L([R], Rt.prototype, "getFailureAddChargeHandler", null), L([R], Rt.prototype, "getSuccessAddChargeHandler", null), L([R], Rt.prototype, "addCharge", null), L([R], Rt.prototype, "validateOptions", null);
|
|
999
999
|
// src/sdk/components/CardForm.vue?vue&type=script&setup=true&lang.ts
|
|
1000
|
-
var
|
|
1000
|
+
var zt = ["src"], Bt = {
|
|
1001
1001
|
key: 0,
|
|
1002
1002
|
id: "threeDs"
|
|
1003
|
-
},
|
|
1003
|
+
}, Vt = 620, Ht = /* @__PURE__ */ k({
|
|
1004
1004
|
__name: "CardForm",
|
|
1005
1005
|
props: {
|
|
1006
1006
|
log: { type: Function },
|
|
@@ -1018,7 +1018,7 @@ var Vt = ["src"], Ht = {
|
|
|
1018
1018
|
let n = e, r = t, i = g(null), a = g(n.iframeSrc + "?v=" + Math.random()), o = g(n.threeDSEnabled), s = g(!1), c = g(!0), l = g(!1), u = "";
|
|
1019
1019
|
function d(e) {
|
|
1020
1020
|
if (e?.data?.status) {
|
|
1021
|
-
if (e.data.status === "iframe-has-changed" && (n.log?.(`[CardForm]: message "${e.data.status}" received`, e.data), e.stopPropagation(), p(e.data.message?.height || 0)), (e.data.status === "secure-orchestrator-show-challenge" || e.data.status === "secure-orchestrator-hide-challenge") && (n.log?.(`[CardForm]: message "${e.data.status}" received`, e.data), h(e.data.status ===
|
|
1021
|
+
if (e.data.status === "iframe-has-changed" && (n.log?.(`[CardForm]: message "${e.data.status}" received`, e.data), e.stopPropagation(), p(e.data.message?.height || 0)), (e.data.status === "secure-orchestrator-show-challenge" || e.data.status === "secure-orchestrator-hide-challenge") && (n.log?.(`[CardForm]: message "${e.data.status}" received`, e.data), h(e.data.status === Pe)), e.data.status === "submit-card-form") {
|
|
1022
1022
|
if (n.log?.(`[CardForm]: message "${e.data.status}" received`, e.data), !n.form || !c.value) return;
|
|
1023
1023
|
if (e.stopPropagation(), n.form.querySelector("input[name=\"token\"]")?.value) {
|
|
1024
1024
|
n.form.submit();
|
|
@@ -1030,7 +1030,7 @@ var Vt = ["src"], Ht = {
|
|
|
1030
1030
|
e.data.status === "activate" && e.data.component === "card" && (n.log?.(`[CardForm]: message "${e.data.status}" received`, e.data), c.value = !0), e.data.status === "deactivate" && e.data.component === "card" && (n.log?.(`[CardForm]: message "${e.data.status}" received`, e.data), c.value = !1);
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
|
-
|
|
1033
|
+
Fe(() => {
|
|
1034
1034
|
window.removeEventListener("message", d);
|
|
1035
1035
|
}), m(() => {
|
|
1036
1036
|
window.addEventListener("message", d);
|
|
@@ -1050,18 +1050,18 @@ var Vt = ["src"], Ht = {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
function h(e) {
|
|
1052
1052
|
let t = i.value;
|
|
1053
|
-
t && (e ? (u = t.style.height || "200px", l.value = !0, t.setAttribute("style", `height: ${
|
|
1053
|
+
t && (e ? (u = t.style.height || "200px", l.value = !0, t.setAttribute("style", `height: ${Vt}px`)) : (l.value = !1, t.setAttribute("style", `height: ${u}`)));
|
|
1054
1054
|
}
|
|
1055
|
-
return (e, t) => (
|
|
1055
|
+
return (e, t) => (w(), E(Ce, null, [T("iframe", {
|
|
1056
1056
|
src: a.value,
|
|
1057
1057
|
onLoad: f,
|
|
1058
1058
|
ref_key: "iframe",
|
|
1059
1059
|
ref: i,
|
|
1060
|
-
style:
|
|
1060
|
+
style: ge(`height:${D(200)}px`),
|
|
1061
1061
|
id: "payfurl-card-iframe"
|
|
1062
|
-
}, null, 44,
|
|
1062
|
+
}, null, 44, zt), o.value ? (w(), E("div", Bt)) : P("", !0)], 64));
|
|
1063
1063
|
}
|
|
1064
|
-
}),
|
|
1064
|
+
}), Ut = class {
|
|
1065
1065
|
log;
|
|
1066
1066
|
startLoadingCardFormHandler = null;
|
|
1067
1067
|
constructor(e) {
|
|
@@ -1078,7 +1078,7 @@ var Vt = ["src"], Ht = {
|
|
|
1078
1078
|
else {
|
|
1079
1079
|
this.startLoadingCardFormHandler = null, this.log("[startLoadingCardForm]");
|
|
1080
1080
|
try {
|
|
1081
|
-
e.contentWindow?.postMessage({ status:
|
|
1081
|
+
e.contentWindow?.postMessage({ status: S }, "*");
|
|
1082
1082
|
} catch (e) {
|
|
1083
1083
|
this.log("[startLoadingCardForm] iframe error", e);
|
|
1084
1084
|
}
|
|
@@ -1093,7 +1093,7 @@ var Vt = ["src"], Ht = {
|
|
|
1093
1093
|
else {
|
|
1094
1094
|
this.log("[stopLoadingCardForm]");
|
|
1095
1095
|
try {
|
|
1096
|
-
e.contentWindow?.postMessage({ status:
|
|
1096
|
+
e.contentWindow?.postMessage({ status: ie }, "*");
|
|
1097
1097
|
} catch (e) {
|
|
1098
1098
|
this.log("[stopLoadingCardForm] iframe error", e);
|
|
1099
1099
|
}
|
|
@@ -1102,7 +1102,7 @@ var Vt = ["src"], Ht = {
|
|
|
1102
1102
|
pauseLoadingCardForm() {
|
|
1103
1103
|
let e = this.getCardFormFrame();
|
|
1104
1104
|
if (e) try {
|
|
1105
|
-
e.contentWindow?.postMessage({ status:
|
|
1105
|
+
e.contentWindow?.postMessage({ status: Se }, "*");
|
|
1106
1106
|
} catch (e) {
|
|
1107
1107
|
this.log("[pauseLoadingCardForm] iframe error", e);
|
|
1108
1108
|
}
|
|
@@ -1118,29 +1118,29 @@ var Vt = ["src"], Ht = {
|
|
|
1118
1118
|
showMessage(e) {
|
|
1119
1119
|
let t = this.getCardFormFrame();
|
|
1120
1120
|
t && t.contentWindow?.postMessage({
|
|
1121
|
-
status:
|
|
1121
|
+
status: Le,
|
|
1122
1122
|
message: e
|
|
1123
1123
|
}, "*");
|
|
1124
1124
|
}
|
|
1125
1125
|
showInfoMessage(e) {
|
|
1126
1126
|
let t = this.getCardFormFrame();
|
|
1127
1127
|
t && t.contentWindow?.postMessage({
|
|
1128
|
-
status:
|
|
1128
|
+
status: qe,
|
|
1129
1129
|
message: e
|
|
1130
1130
|
}, "*");
|
|
1131
1131
|
}
|
|
1132
1132
|
requestCardDetails() {
|
|
1133
1133
|
let e = this.getCardFormFrame();
|
|
1134
1134
|
if (e) try {
|
|
1135
|
-
e.contentWindow?.postMessage({ status:
|
|
1135
|
+
e.contentWindow?.postMessage({ status: Ye }, "*");
|
|
1136
1136
|
} catch (e) {
|
|
1137
1137
|
this.log("[requestCardDetails] iframe error", e);
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
1140
1140
|
};
|
|
1141
|
-
|
|
1141
|
+
L([R], Ut.prototype, "startLoadingCardForm", null), L([R], Ut.prototype, "stopLoadingCardForm", null), L([R], Ut.prototype, "pauseLoadingCardForm", null), L([R], Ut.prototype, "unpauseLoadingCardForm", null), L([R], Ut.prototype, "showMessage", null), L([R], Ut.prototype, "showInfoMessage", null), L([R], Ut.prototype, "requestCardDetails", null);
|
|
1142
1142
|
// src/utils/networkTokenOptions.ts
|
|
1143
|
-
function
|
|
1143
|
+
function Wt(e) {
|
|
1144
1144
|
return e === t.PRODUCTION ? {
|
|
1145
1145
|
acquirerMerchantId: "550e8400",
|
|
1146
1146
|
acquirerBIN: "444444",
|
|
@@ -1152,10 +1152,10 @@ function Gt(e) {
|
|
|
1152
1152
|
};
|
|
1153
1153
|
}
|
|
1154
1154
|
// src/sdk/processors/networkToken/mastercardTokenAuthenticationProcessor.ts
|
|
1155
|
-
var { hideSpinner:
|
|
1155
|
+
var { hideSpinner: Gt, showSpinner: Kt } = Re(), qt = { UPDATE: "UPDATE" }, Jt = (e, t) => ({ [qt.UPDATE]: {
|
|
1156
1156
|
url: e + ("/token/" + t + "/authentication"),
|
|
1157
1157
|
method: "PUT"
|
|
1158
|
-
} }),
|
|
1158
|
+
} }), Yt = class extends Ut {
|
|
1159
1159
|
environment;
|
|
1160
1160
|
token;
|
|
1161
1161
|
networkToken;
|
|
@@ -1172,7 +1172,7 @@ var { hideSpinner: Kt, showSpinner: qt } = Be(), Jt = { UPDATE: "UPDATE" }, Yt =
|
|
|
1172
1172
|
onFailureCallback;
|
|
1173
1173
|
constructor(e, t) {
|
|
1174
1174
|
super(e), this.log("[MastercardTokenAuthenticationProcessor]", t), this.environment = t.environment, this.token = t.token, this.networkToken = t.networkToken, this.networkTokenData = t.networkTokenData, this.networkTokenAuthenticateUrl = t.redirectUrl, this.networkTokenProvider = t.networkTokenProvider;
|
|
1175
|
-
let n =
|
|
1175
|
+
let n = Wt(this.environment);
|
|
1176
1176
|
this.networkTokenOptions = {
|
|
1177
1177
|
...n,
|
|
1178
1178
|
...t.networkTokenOptions
|
|
@@ -1257,7 +1257,7 @@ var { hideSpinner: Kt, showSpinner: qt } = Be(), Jt = { UPDATE: "UPDATE" }, Yt =
|
|
|
1257
1257
|
modalShow() {
|
|
1258
1258
|
if (this.modal) return;
|
|
1259
1259
|
let e = "maxTouchPoints" in navigator && navigator.maxTouchPoints > 0 ? 791 : 637, t = window.screenLeft === void 0 ? window.screenX : window.screenLeft, n = window.screenTop === void 0 ? window.screenY : window.screenTop, r = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width, i = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height, a = r / window.screen.availWidth, o = (r - 375) / 2 / a + t, s = (i - e) / 2 / a + n;
|
|
1260
|
-
|
|
1260
|
+
Gt(), Ae(this.networkTokenAuthenticateUrl) && (this.modal = window.open(this.networkTokenAuthenticateUrl + "?origin=" + window.location.origin, "targetWindow", `toolbar=no,
|
|
1261
1261
|
location=no,
|
|
1262
1262
|
status=no,
|
|
1263
1263
|
menubar=no,
|
|
@@ -1269,7 +1269,7 @@ var { hideSpinner: Kt, showSpinner: qt } = Be(), Jt = { UPDATE: "UPDATE" }, Yt =
|
|
|
1269
1269
|
left=${o}`));
|
|
1270
1270
|
}
|
|
1271
1271
|
modalHide() {
|
|
1272
|
-
this.modal && (
|
|
1272
|
+
this.modal && (Kt(), this.modal.close());
|
|
1273
1273
|
}
|
|
1274
1274
|
updateToken(e) {
|
|
1275
1275
|
if (this.log("[MastercardTokenAuthenticationProcessor][updateToken]", e), !e.assuranceData?.verificationData.length) {
|
|
@@ -1281,7 +1281,7 @@ var { hideSpinner: Kt, showSpinner: qt } = Be(), Jt = { UPDATE: "UPDATE" }, Yt =
|
|
|
1281
1281
|
return;
|
|
1282
1282
|
}
|
|
1283
1283
|
let t = e.assuranceData.verificationData[0];
|
|
1284
|
-
this.httpInvoker?.invoke(
|
|
1284
|
+
this.httpInvoker?.invoke(Jt(this.apiUrl, this.token)[qt.UPDATE].url, Jt(this.apiUrl, this.token)[qt.UPDATE].method, JSON.stringify({
|
|
1285
1285
|
VerificationType: t.verificationType,
|
|
1286
1286
|
VerificationEntity: t.verificationEntity,
|
|
1287
1287
|
VerificationMethod: t.verificationMethod,
|
|
@@ -1289,16 +1289,16 @@ var { hideSpinner: Kt, showSpinner: qt } = Be(), Jt = { UPDATE: "UPDATE" }, Yt =
|
|
|
1289
1289
|
VerificationTimestamp: t.verificationTimestamp,
|
|
1290
1290
|
AdditionalData: t.additionalData,
|
|
1291
1291
|
VerificationEvents: JSON.stringify(t.verificationEvents)
|
|
1292
|
-
}),
|
|
1292
|
+
}), z(this, "[MastercardTokenAuthenticationProcessor][updateToken]: successCallback", (t, n) => {
|
|
1293
1293
|
this.log("[MastercardTokenAuthenticationProcessor][updateToken]: successCallback", t, n), this.modalHide(), this.onSuccessCallback?.(e);
|
|
1294
|
-
}),
|
|
1294
|
+
}), z(this, "[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback", (e, t) => {
|
|
1295
1295
|
this.log("[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback", e, t), this.modalHide(), this.onFailureCallback?.({ error: "Unknown error" });
|
|
1296
1296
|
}));
|
|
1297
1297
|
}
|
|
1298
1298
|
};
|
|
1299
|
-
|
|
1299
|
+
L([R], Yt.prototype, "invoke", null), L([R], Yt.prototype, "messageHandler", null), L([R], Yt.prototype, "authenticate", null), L([R], Yt.prototype, "init", null), L([R], Yt.prototype, "initCss", null), L([R], Yt.prototype, "modalShow", null), L([R], Yt.prototype, "modalHide", null), L([R], Yt.prototype, "updateToken", null);
|
|
1300
1300
|
// src/sdk/processors/cardProcessor.ts
|
|
1301
|
-
var { hideSpinner: K, showSpinner: Xt } =
|
|
1301
|
+
var { hideSpinner: K, showSpinner: Xt } = Re(), Zt = {
|
|
1302
1302
|
TOKENISE_CARD: "TOKENISE_CARD",
|
|
1303
1303
|
GET_PROVIDER_INFO: "GET_PROVIDER_INFO"
|
|
1304
1304
|
}, Qt = (e, t, n) => ({
|
|
@@ -1310,7 +1310,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1310
1310
|
url: e + "/info/providers/" + t,
|
|
1311
1311
|
method: "GET"
|
|
1312
1312
|
}
|
|
1313
|
-
}), q = class extends
|
|
1313
|
+
}), q = class extends Ut {
|
|
1314
1314
|
container = null;
|
|
1315
1315
|
iframe = null;
|
|
1316
1316
|
form = null;
|
|
@@ -1332,7 +1332,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1332
1332
|
vault;
|
|
1333
1333
|
verifyCard;
|
|
1334
1334
|
metadata;
|
|
1335
|
-
userSuccessMessage =
|
|
1335
|
+
userSuccessMessage = me;
|
|
1336
1336
|
threeDSEnabled = !1;
|
|
1337
1337
|
threeDsProcessor = null;
|
|
1338
1338
|
secondaryThreeDsProcessor = null;
|
|
@@ -1352,6 +1352,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1352
1352
|
secureWindow = null;
|
|
1353
1353
|
secureOrigin = "";
|
|
1354
1354
|
secureReady = !1;
|
|
1355
|
+
tokenisingFailedThreeDs = !1;
|
|
1355
1356
|
secureEnabled = !1;
|
|
1356
1357
|
secureFallback = !1;
|
|
1357
1358
|
secureConfig = null;
|
|
@@ -1413,7 +1414,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1413
1414
|
options: a
|
|
1414
1415
|
}), this.attachMessageListener(), a?.createNetworkToken && !a?.tokenAuthenticationEnabled && (a.clickToPayEnabled = !1), a?.clickToPayEnabled && this.clickToPayProcessor && (a.threeDSEnabled = !1), this.secureFallback = !1, this.secureReady = !1, this.secureEnabled = !!a?.secureCardOrchestration?.enabled, this.threeDSEmail = a?.threeDSEmail || "";
|
|
1415
1416
|
let o = this.getEmail();
|
|
1416
|
-
this.amount = r, this.currency = i, this.vault =
|
|
1417
|
+
this.amount = r, this.currency = i, this.vault = A(a?.vault), this.verifyCard = A(a?.verifyCard), this.metadata = G(a?.metadata), this.fraudProcessor && (this.fraudProcessor.setAmount(r), this.fraudProcessor.setCurrency(i)), this.threeDsProcessor && (this.threeDsProcessor.setEmail(o), this.threeDsProcessor.setAmount(r), this.threeDsProcessor.setCurrency(i), this.threeDsProcessor.setClientParameters(a?.clientParameters || {})), a?.threeDSEnabled && (He(r, M, "Missing or invalid amount", this.failureCallback), He(i, B, "Missing or invalid currency", this.failureCallback), this.threeDSEnabled = !0);
|
|
1417
1418
|
let s = Object.keys(a?.networkTokenOptions || {}).length ? a?.networkTokenOptions : a?.clickToPayOptions?.networkTokenOptions;
|
|
1418
1419
|
a?.clickToPayEnabled && this.clickToPayProcessor && (this.clickToPayProcessor.setAmount(r), this.clickToPayProcessor.setCurrency(i), this.clickToPayProcessor.setCustomerInfo({
|
|
1419
1420
|
...this.customer || {},
|
|
@@ -1424,9 +1425,9 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1424
1425
|
tokenAuthenticationEnabled: !!a?.tokenAuthenticationEnabled,
|
|
1425
1426
|
networkTokenOptions: s
|
|
1426
1427
|
}), this.clickToPayProcessor.setContainer(e), this.clickToPayProcessor.init(), this.clickToPayProcessor.start()), !a?.clickToPayEnabled && this.clickToPayProcessor && this.clickToPayProcessor.isInitialized() && this.clickToPayProcessor.stopUsing(), this.createNetworkToken = !!a?.createNetworkToken, this.tokenAuthenticationEnabled = !!a?.tokenAuthenticationEnabled, this.networkTokenProviders = a?.networkTokenProviders || [], this.networkTokenOptions = a?.networkTokenOptions || {}, this.container = e || null, this.form = t;
|
|
1427
|
-
let c =
|
|
1428
|
+
let c = Me({
|
|
1428
1429
|
el: this.container,
|
|
1429
|
-
component:
|
|
1430
|
+
component: Ht,
|
|
1430
1431
|
props: {
|
|
1431
1432
|
log: this.log,
|
|
1432
1433
|
iframeSrc: this.url,
|
|
@@ -1435,7 +1436,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1435
1436
|
clickGate: this.getOnValidate.bind(this)
|
|
1436
1437
|
},
|
|
1437
1438
|
on: {
|
|
1438
|
-
load:
|
|
1439
|
+
load: z(this, "[addCard], onload", (e) => {
|
|
1439
1440
|
this.iframe = e;
|
|
1440
1441
|
let t = this.secureEnabled ? {
|
|
1441
1442
|
...a?.secureCardOrchestration,
|
|
@@ -1467,7 +1468,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1467
1468
|
} : null;
|
|
1468
1469
|
this.secureConfig = t;
|
|
1469
1470
|
let o = {
|
|
1470
|
-
status:
|
|
1471
|
+
status: Qe,
|
|
1471
1472
|
environment: this.environment,
|
|
1472
1473
|
debug: this.debug,
|
|
1473
1474
|
publicKey: this.publicKey,
|
|
@@ -1475,9 +1476,9 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1475
1476
|
apiUrl: this.apiUrl,
|
|
1476
1477
|
amount: r,
|
|
1477
1478
|
currency: i,
|
|
1478
|
-
vault:
|
|
1479
|
-
verifyCard:
|
|
1480
|
-
showEmail: a?.threeDSEnabled && !
|
|
1479
|
+
vault: A(a?.vault),
|
|
1480
|
+
verifyCard: A(a?.verifyCard),
|
|
1481
|
+
showEmail: a?.threeDSEnabled && !Ve(this.getEmail()),
|
|
1481
1482
|
visProviderId: a?.visProviderId,
|
|
1482
1483
|
requiredFields: a?.requiredFields,
|
|
1483
1484
|
clickToPayEnabled: a?.clickToPayEnabled,
|
|
@@ -1489,12 +1490,12 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1489
1490
|
let t = new MessageChannel();
|
|
1490
1491
|
this.setCardDetailsPort(t.port1), e?.contentWindow?.postMessage(o, "*", [t.port2]);
|
|
1491
1492
|
} else e?.contentWindow?.postMessage(o, "*");
|
|
1492
|
-
this.customer?.phoneNumber && !
|
|
1493
|
-
status:
|
|
1493
|
+
this.customer?.phoneNumber && !Ie(String(this.customer?.phoneNumber)) && this.getCardFormFrame()?.contentWindow?.postMessage({
|
|
1494
|
+
status: Le,
|
|
1494
1495
|
message: "Invalid phone number"
|
|
1495
1496
|
}, "*");
|
|
1496
1497
|
}),
|
|
1497
|
-
submit:
|
|
1498
|
+
submit: z(this, "[addCard], onsubmit", () => {
|
|
1498
1499
|
this.log("[CardProcessor]: submit event"), Xt(), this.requestCardDetails();
|
|
1499
1500
|
})
|
|
1500
1501
|
}
|
|
@@ -1509,7 +1510,8 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1509
1510
|
this.tokenise({
|
|
1510
1511
|
threeDSServerTransID: t.threeDSServerTransID,
|
|
1511
1512
|
fraudCheckResult: t.fraudCheckResult,
|
|
1512
|
-
externalThreeDsData: t.externalThreeDsData
|
|
1513
|
+
externalThreeDsData: t.externalThreeDsData,
|
|
1514
|
+
threeDsFailed: t.threeDsFailed === !0
|
|
1513
1515
|
});
|
|
1514
1516
|
} else if (e.data.status === "secure-orchestrator-three-ds-progress" && this.isTrustedSecureMessage(e)) this.threeDsProgressCallback?.(e.data.progress);
|
|
1515
1517
|
else if (e.data.status === "secure-orchestrator-click-to-pay-card" && this.isTrustedSecureMessage(e)) this.checkoutWithSecureClickToPayCard(e.data.message || {});
|
|
@@ -1528,8 +1530,15 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1528
1530
|
else if (e.data.status === "card-form-validation-error") this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`, e.data), K(), this.failureCallback?.({ error: e.data.message });
|
|
1529
1531
|
else if (e.data.status === "card-form-validation-status-change") this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`, e.data), K(), this.validationStatusChangeCallback?.(e.data.message?.status, e.data.message?.message);
|
|
1530
1532
|
else if (e.data.status === "tokenise-card-failure") {
|
|
1531
|
-
if (this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`, e.data), K(),
|
|
1532
|
-
this.
|
|
1533
|
+
if (this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`, e.data), K(), this.tokenisingFailedThreeDs) {
|
|
1534
|
+
this.tokenisingFailedThreeDs = !1, this.showMessage(re), this.failureCallback?.({
|
|
1535
|
+
error: re,
|
|
1536
|
+
errorDetails: { reason: e.data.message }
|
|
1537
|
+
});
|
|
1538
|
+
return;
|
|
1539
|
+
}
|
|
1540
|
+
if (e.data.message === "3D Secure required" && this.isSecureFlowEnabled()) {
|
|
1541
|
+
this.postSecureMessage(ce);
|
|
1533
1542
|
return;
|
|
1534
1543
|
}
|
|
1535
1544
|
if (e.data.message === "3D Secure required" && this.secondaryThreeDsProcessor) {
|
|
@@ -1546,7 +1555,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1546
1555
|
body: e.data.body
|
|
1547
1556
|
});
|
|
1548
1557
|
} else if (e.data.status === "tokenise-card-success") {
|
|
1549
|
-
this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`, e.data), e.stopPropagation(), this.iframe = null;
|
|
1558
|
+
this.log(`[sdk][cardProcessor]: message "${e.data.status}" received`, e.data), e.stopPropagation(), this.tokenisingFailedThreeDs = !1, this.iframe = null;
|
|
1550
1559
|
let t = { token: e.data.tokenId };
|
|
1551
1560
|
if (e.data.options?.cardDetails && (t.cardDetails = e.data.options?.cardDetails), e.data.options?.iinData && (t.iinData = e.data.options?.iinData), e.data.options?.clickToPay && (t.clickToPayData = {
|
|
1552
1561
|
billingAddress: e.data.options?.clickToPay.billingAddress,
|
|
@@ -1557,20 +1566,20 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1557
1566
|
}), this.tokenAuthenticationEnabled && e.data.options?.networkTokenAuthenticateUrl && e.data.options?.networkToken) {
|
|
1558
1567
|
let n = this.initTokenAuthenticationProcessor(e.data.tokenId, e.data.options.networkToken, e.data.options?.networkTokenData, e.data.options.networkTokenAuthenticateUrl, e.data.options?.cardDetails, this.networkTokenOptions);
|
|
1559
1568
|
if (n) {
|
|
1560
|
-
n.invoke(this.amount, this.currency,
|
|
1561
|
-
this.log("[sdk][cardProcessor], token authentication success"), K(),
|
|
1562
|
-
}),
|
|
1569
|
+
n.invoke(this.amount, this.currency, z(this, "[sdk][cardProcessor], token authentication success", () => {
|
|
1570
|
+
this.log("[sdk][cardProcessor], token authentication success"), K(), tt(this.container, this.getSuccessMessage()), this.successCallback?.(t);
|
|
1571
|
+
}), z(this, "[sdk][cardProcessor], token authentication error", (e) => {
|
|
1563
1572
|
K(), this.log("[sdk][cardProcessor], token authentication error", e);
|
|
1564
1573
|
}));
|
|
1565
1574
|
return;
|
|
1566
1575
|
}
|
|
1567
1576
|
}
|
|
1568
|
-
K(),
|
|
1577
|
+
K(), tt(this.container, this.getSuccessMessage()), this.successCallback?.(t);
|
|
1569
1578
|
}
|
|
1570
1579
|
}
|
|
1571
1580
|
}
|
|
1572
1581
|
setCardDetailsPort(e) {
|
|
1573
|
-
this.closeCardDetailsPort(), this.cardDetailsPort = e, this.cardDetailsPort.onmessage =
|
|
1582
|
+
this.closeCardDetailsPort(), this.cardDetailsPort = e, this.cardDetailsPort.onmessage = z(this, "[sdk][cardProcessor]: cardDetailsPort message", (e) => {
|
|
1574
1583
|
e?.data?.status && e.data.status === "card-details" && this.handleCardDetailsMessage(e.data);
|
|
1575
1584
|
});
|
|
1576
1585
|
}
|
|
@@ -1598,14 +1607,14 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1598
1607
|
return this.secureEnabled && !this.secureFallback;
|
|
1599
1608
|
}
|
|
1600
1609
|
requestCardDetails() {
|
|
1601
|
-
this.isSecureFlowEnabled() && !this.secureReady ? (K(), this.showMessage("Secure payment flow is not ready. Please try again."), this.failureCallback?.({ error: "Secure payment flow is not ready" })) : this.isSecureFlowEnabled() && this.secureReady ? (this.secureConfig?.clickToPay && this.clickToPayProcessor && this.postSecureMessage(
|
|
1610
|
+
this.isSecureFlowEnabled() && !this.secureReady ? (K(), this.showMessage("Secure payment flow is not ready. Please try again."), this.failureCallback?.({ error: "Secure payment flow is not ready" })) : this.isSecureFlowEnabled() && this.secureReady ? (this.secureConfig?.clickToPay && this.clickToPayProcessor && this.postSecureMessage(C, { clickToPay: {
|
|
1602
1611
|
...this.secureConfig.clickToPay,
|
|
1603
1612
|
rememberMe: this.clickToPayProcessor.getRememberMe()
|
|
1604
|
-
} }), this.postSecureMessage(
|
|
1613
|
+
} }), this.postSecureMessage(se)) : this.cardDetailsPort ? this.cardDetailsPort.postMessage({ status: Ye }) : super.requestCardDetails();
|
|
1605
1614
|
}
|
|
1606
1615
|
handleCardDetailsMessage(e) {
|
|
1607
1616
|
if (!e?.message) return;
|
|
1608
|
-
this.log(`[sdk][cardProcessor]: "${
|
|
1617
|
+
this.log(`[sdk][cardProcessor]: "${We}" message received`, e);
|
|
1609
1618
|
let t = !!(this.clickToPayProcessor?.isEnabled() && this.clickToPayProcessor?.getRememberMe()), n = !!(this.clickToPayProcessor?.isEnabled() && e.message.srcDigitalCardId), r = !!(t && !n && e.message.cardNumber);
|
|
1610
1619
|
if (r && !this.clickToPayProcessor?.isSchemeSupported(e.message.cardNumber)) {
|
|
1611
1620
|
this.log("[clickToPayProcessor]: checkoutWithNewCard - Scheme is not supported!"), K(), this.showMessage("Please use another card or use an alternative payment method");
|
|
@@ -1642,15 +1651,15 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1642
1651
|
ccv: e.message.ccv
|
|
1643
1652
|
});
|
|
1644
1653
|
let i = e.message.email || this.getEmail();
|
|
1645
|
-
i && (this.threeDsProcessor?.setEmail(i), this.secondaryThreeDsProcessor?.setEmail(i)), this.fraudProcessor && !(n || r) ? (Xt(), this.fraudProcessor.fraudCheck(
|
|
1646
|
-
|
|
1654
|
+
i && (this.threeDsProcessor?.setEmail(i), this.secondaryThreeDsProcessor?.setEmail(i)), this.fraudProcessor && !(n || r) ? (Xt(), this.fraudProcessor.fraudCheck(z(this, "[fraudProcessor][fraudCheck], success", (t) => {
|
|
1655
|
+
Pt(t) ? (K(), I(this.container, "Payment couldn't be processed"), this.failureCallback?.({ error: "Payment couldn't be processed" })) : this.onSubmit({
|
|
1647
1656
|
cardNumber: e.message.cardNumber,
|
|
1648
1657
|
expiryDate: e.message.expiryDate,
|
|
1649
1658
|
cardholder: e.message.cardholder,
|
|
1650
1659
|
ccv: e.message.ccv
|
|
1651
1660
|
}, t);
|
|
1652
|
-
}),
|
|
1653
|
-
K(),
|
|
1661
|
+
}), z(this, "[fraudProcessor][fraudCheck], error", (e) => {
|
|
1662
|
+
K(), I(this.container, e.error), this.failureCallback?.(e);
|
|
1654
1663
|
}))) : this.onSubmit({
|
|
1655
1664
|
cardNumber: e.message.cardNumber,
|
|
1656
1665
|
expiryDate: e.message.expiryDate,
|
|
@@ -1666,8 +1675,8 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1666
1675
|
ccv: "***"
|
|
1667
1676
|
},
|
|
1668
1677
|
fraudCheckResult: t
|
|
1669
|
-
}), t?.managedOrderToken ? (K(),
|
|
1670
|
-
error:
|
|
1678
|
+
}), t?.managedOrderToken ? (K(), I(this.container, re), this.failureCallback?.({
|
|
1679
|
+
error: re,
|
|
1671
1680
|
errorDetails: { reason: "3DS challenge could not be started" }
|
|
1672
1681
|
})) : this.clickToPayProcessor?.isEnabled() && this.clickToPayProcessor?.getRememberMe() ? this.tokeniseWithClickToPay(e, void 0, t) : this.threeDsProcessor ? this.threeDsProcessor?.threeDSInvoke(this.container, !1, (e) => {
|
|
1673
1682
|
K(), this.log("[threeDSInvoke], postAuthData", e), this.tokenise({
|
|
@@ -1679,15 +1688,15 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1679
1688
|
}
|
|
1680
1689
|
tokenise(e) {
|
|
1681
1690
|
if (this.log("[cardProcessor]: tokenise", e), !this.iframe) return;
|
|
1682
|
-
Xt();
|
|
1691
|
+
this.tokenisingFailedThreeDs = e.threeDsFailed === !0, Xt();
|
|
1683
1692
|
let t = {
|
|
1684
|
-
status:
|
|
1693
|
+
status: ve,
|
|
1685
1694
|
threeDSServerTransID: e.threeDSServerTransID,
|
|
1686
1695
|
fraudCheckResult: e.fraudCheckResult,
|
|
1687
1696
|
externalThreeDsData: e.externalThreeDsData,
|
|
1688
1697
|
createNetworkToken: this.tokenAuthenticationEnabled || this.createNetworkToken,
|
|
1689
|
-
vault:
|
|
1690
|
-
verifyCard:
|
|
1698
|
+
vault: A(this.vault),
|
|
1699
|
+
verifyCard: A(this.verifyCard),
|
|
1691
1700
|
email: this.getEmail() || void 0,
|
|
1692
1701
|
phone: this.customer?.phoneNumber,
|
|
1693
1702
|
billingAddress: this.billingAddress || void 0,
|
|
@@ -1700,7 +1709,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1700
1709
|
}), this.iframe.contentWindow?.postMessage(t, "*");
|
|
1701
1710
|
}
|
|
1702
1711
|
tokeniseWithClickToPay(e, t, n) {
|
|
1703
|
-
K(), this.clickToPayProcessor?.checkoutWithNewCard(e.cardNumber, e.expiryDate, e.ccv || "", !0,
|
|
1712
|
+
K(), this.clickToPayProcessor?.checkoutWithNewCard(e.cardNumber, e.expiryDate, e.ccv || "", !0, z(this, "[clickToPayProcessor]: checkoutWithNewCard", (r) => {
|
|
1704
1713
|
this.log("[clickToPayProcessor]: checkoutWithNewCard", r), r.checkoutActionCode !== "CANCEL" && (Xt(), this.tokenise({
|
|
1705
1714
|
threeDSServerTransID: t,
|
|
1706
1715
|
fraudCheckResult: n,
|
|
@@ -1712,65 +1721,65 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1712
1721
|
digitalCardId: r.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/, "")
|
|
1713
1722
|
}
|
|
1714
1723
|
}));
|
|
1715
|
-
}),
|
|
1716
|
-
this.log("[clickToPayProcessor]: checkoutWithNewCard, error", e), K(),
|
|
1724
|
+
}), z(this, "[clickToPayProcessor]: checkoutWithNewCard, error", (e) => {
|
|
1725
|
+
this.log("[clickToPayProcessor]: checkoutWithNewCard, error", e), K(), I(this.container, e.message);
|
|
1717
1726
|
}));
|
|
1718
1727
|
}
|
|
1719
1728
|
checkoutWithSecureClickToPayCard(e) {
|
|
1720
|
-
K(), this.clickToPayProcessor?.checkoutWithCard(e,
|
|
1729
|
+
K(), this.clickToPayProcessor?.checkoutWithCard(e, z(this, "[clickToPayProcessor]: secure checkoutWithCard", (e) => {
|
|
1721
1730
|
this.log("[clickToPayProcessor]: secure checkoutWithCard", e), e.checkoutActionCode !== "CANCEL" && e.checkoutActionCode !== "CHANGE_CARD" && (Xt(), this.tokenise({ clickToPayInfo: {
|
|
1722
1731
|
correlationId: e.checkoutResponseData.srcCorrelationId,
|
|
1723
1732
|
srcFlowId: e.headers["x-src-cx-flow-id"],
|
|
1724
1733
|
merchantTransactionId: e.headers["merchant-transaction-id"],
|
|
1725
1734
|
digitalCardId: e.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/, "")
|
|
1726
1735
|
} }));
|
|
1727
|
-
}),
|
|
1736
|
+
}), z(this, "[clickToPayProcessor]: secure checkoutWithCard, error", (e) => {
|
|
1728
1737
|
this.log("[clickToPayProcessor]: secure checkoutWithCard, error", e), K();
|
|
1729
1738
|
}));
|
|
1730
1739
|
}
|
|
1731
1740
|
checkoutWithSecureClickToPayNewCard(e) {
|
|
1732
|
-
!e.encryptedCard || !e.cardBrand ? (K(), this.showMessage("Unable to process Click to Pay card"), this.failureCallback?.({ error: "Unable to process Click to Pay card" })) : (K(), this.clickToPayProcessor?.checkoutWithEncryptedNewCard(e.encryptedCard, e.cardBrand,
|
|
1741
|
+
!e.encryptedCard || !e.cardBrand ? (K(), this.showMessage("Unable to process Click to Pay card"), this.failureCallback?.({ error: "Unable to process Click to Pay card" })) : (K(), this.clickToPayProcessor?.checkoutWithEncryptedNewCard(e.encryptedCard, e.cardBrand, z(this, "[clickToPayProcessor]: secure checkoutWithEncryptedNewCard", (e) => {
|
|
1733
1742
|
this.log("[clickToPayProcessor]: secure checkoutWithEncryptedNewCard", e), e.checkoutActionCode !== "CANCEL" && (Xt(), this.tokenise({ clickToPayInfo: {
|
|
1734
1743
|
correlationId: e.checkoutResponseData.srcCorrelationId,
|
|
1735
1744
|
srcFlowId: e.headers["x-src-cx-flow-id"],
|
|
1736
1745
|
merchantTransactionId: e.headers["merchant-transaction-id"],
|
|
1737
1746
|
digitalCardId: e.checkoutResponseData.maskedCard.srcDigitalCardId.replace(/^-/, "")
|
|
1738
1747
|
} }));
|
|
1739
|
-
}),
|
|
1740
|
-
this.log("[clickToPayProcessor]: secure checkoutWithEncryptedNewCard, error", e), K(),
|
|
1748
|
+
}), z(this, "[clickToPayProcessor]: secure checkoutWithEncryptedNewCard, error", (e) => {
|
|
1749
|
+
this.log("[clickToPayProcessor]: secure checkoutWithEncryptedNewCard, error", e), K(), I(this.container, e.message);
|
|
1741
1750
|
})));
|
|
1742
1751
|
}
|
|
1743
1752
|
setAmount(e) {
|
|
1744
|
-
this.amount = e, this.clickToPayProcessor?.setAmount(e), this.isSecureFlowEnabled() && this.postSecureMessage(
|
|
1745
|
-
status:
|
|
1753
|
+
this.amount = e, this.clickToPayProcessor?.setAmount(e), this.isSecureFlowEnabled() && this.postSecureMessage(C, { amount: e }), this.iframe && this.iframe.contentWindow?.postMessage({
|
|
1754
|
+
status: ae,
|
|
1746
1755
|
amount: e
|
|
1747
1756
|
}, "*");
|
|
1748
1757
|
}
|
|
1749
1758
|
setCurrency(e) {
|
|
1750
|
-
this.currency = e, this.clickToPayProcessor?.setCurrency(e), this.isSecureFlowEnabled() && this.postSecureMessage(
|
|
1751
|
-
status:
|
|
1759
|
+
this.currency = e, this.clickToPayProcessor?.setCurrency(e), this.isSecureFlowEnabled() && this.postSecureMessage(C, { currency: e }), this.iframe && this.iframe.contentWindow?.postMessage({
|
|
1760
|
+
status: et,
|
|
1752
1761
|
currency: e
|
|
1753
1762
|
}, "*");
|
|
1754
1763
|
}
|
|
1755
1764
|
setCustomerInfo(e) {
|
|
1756
1765
|
this.customer = { ...e }, this.clickToPayProcessor?.setCustomerInfo(e);
|
|
1757
1766
|
let t = this.getEmail();
|
|
1758
|
-
t && (this.threeDsProcessor?.setEmail(t), this.secondaryThreeDsProcessor?.setEmail(t)), this.isSecureFlowEnabled() && this.postSecureMessage(
|
|
1759
|
-
status:
|
|
1767
|
+
t && (this.threeDsProcessor?.setEmail(t), this.secondaryThreeDsProcessor?.setEmail(t)), this.isSecureFlowEnabled() && this.postSecureMessage(C, { customer: this.getCustomerWithEmail() }), this.iframe && t && this.iframe.contentWindow?.postMessage({
|
|
1768
|
+
status: _e,
|
|
1760
1769
|
email: t
|
|
1761
1770
|
}, this.getOriginFromUrl(this.url) || "*");
|
|
1762
1771
|
}
|
|
1763
1772
|
setBillingAddress(e) {
|
|
1764
|
-
this.billingAddress = { ...e }, this.isSecureFlowEnabled() && this.postSecureMessage(
|
|
1773
|
+
this.billingAddress = { ...e }, this.isSecureFlowEnabled() && this.postSecureMessage(C, { billingAddress: e });
|
|
1765
1774
|
}
|
|
1766
1775
|
setOrderInfo(e) {
|
|
1767
|
-
this.order = { ...e }, this.isSecureFlowEnabled() && this.postSecureMessage(
|
|
1776
|
+
this.order = { ...e }, this.isSecureFlowEnabled() && this.postSecureMessage(C, { order: e });
|
|
1768
1777
|
}
|
|
1769
1778
|
setGeolocation(e) {
|
|
1770
|
-
this.geolocation = { ...e }, this.isSecureFlowEnabled() && this.postSecureMessage(
|
|
1779
|
+
this.geolocation = { ...e }, this.isSecureFlowEnabled() && this.postSecureMessage(C, { geolocation: e });
|
|
1771
1780
|
}
|
|
1772
1781
|
tokeniseCard(e, t, n, r, i, a, o, s, c) {
|
|
1773
|
-
|
|
1782
|
+
M(e) ? Ne(t) ? Te(n) ? xe(i) ? this.httpInvoker?.invoke(Qt(this.apiUrl, e)[Zt.TOKENISE_CARD].url, Qt(this.apiUrl, e)[Zt.TOKENISE_CARD].method, JSON.stringify({
|
|
1774
1783
|
paymentInformation: {
|
|
1775
1784
|
cardNumber: t,
|
|
1776
1785
|
expiryDate: n,
|
|
@@ -1816,7 +1825,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1816
1825
|
});
|
|
1817
1826
|
let o = (i?.scheme || "").toLowerCase(), s = this.networkTokenProviders.find((e) => e.providerType.toLowerCase() === o);
|
|
1818
1827
|
switch (String(s?.providerType).toLowerCase()) {
|
|
1819
|
-
case "mastercard": return new
|
|
1828
|
+
case "mastercard": return new Yt(this.log.bind(this), {
|
|
1820
1829
|
container: this.container,
|
|
1821
1830
|
token: e,
|
|
1822
1831
|
networkToken: t,
|
|
@@ -1832,7 +1841,7 @@ var { hideSpinner: K, showSpinner: Xt } = Be(), Zt = {
|
|
|
1832
1841
|
}
|
|
1833
1842
|
}
|
|
1834
1843
|
};
|
|
1835
|
-
|
|
1844
|
+
L([R], q.prototype, "cleanUp", null), L([R], q.prototype, "addCard", null), L([R], q.prototype, "messageHandler", null), L([R], q.prototype, "setCardDetailsPort", null), L([R], q.prototype, "closeCardDetailsPort", null), L([R], q.prototype, "postSecureMessage", null), L([R], q.prototype, "requestCardDetails", null), L([R], q.prototype, "handleCardDetailsMessage", null), L([R], q.prototype, "onSubmit", null), L([R], q.prototype, "tokenise", null), L([R], q.prototype, "tokeniseWithClickToPay", null), L([R], q.prototype, "checkoutWithSecureClickToPayCard", null), L([R], q.prototype, "checkoutWithSecureClickToPayNewCard", null), L([R], q.prototype, "setAmount", null), L([R], q.prototype, "setCurrency", null), L([R], q.prototype, "setCustomerInfo", null), L([R], q.prototype, "setBillingAddress", null), L([R], q.prototype, "setOrderInfo", null), L([R], q.prototype, "setGeolocation", null), L([R], q.prototype, "tokeniseCard", null), L([R], q.prototype, "initTokenAuthenticationProcessor", null);
|
|
1836
1845
|
// src/sdk/utils/error.ts
|
|
1837
1846
|
var $t = g("");
|
|
1838
1847
|
function en() {
|
|
@@ -1859,7 +1868,7 @@ var tn = {
|
|
|
1859
1868
|
}, ln = {
|
|
1860
1869
|
key: 1,
|
|
1861
1870
|
class: "error"
|
|
1862
|
-
}, un = /*#__PURE__*/
|
|
1871
|
+
}, un = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
1863
1872
|
__name: "PayToForm",
|
|
1864
1873
|
props: {
|
|
1865
1874
|
log: { type: Function },
|
|
@@ -1867,9 +1876,9 @@ var tn = {
|
|
|
1867
1876
|
},
|
|
1868
1877
|
emits: ["submit"],
|
|
1869
1878
|
setup(e, { emit: t }) {
|
|
1870
|
-
let n = e, r = t, i = g({}), { isLoading: o } =
|
|
1879
|
+
let n = e, r = t, i = g({}), { isLoading: o } = W(), s = g(""), c = g("PHONE"), l = g(""), u = Ze(() => c.value === "PHONE" ? "0405123456 or 0212341234" : a(c.value.toLowerCase())), d = g(!0), { errorMessage: f } = en();
|
|
1871
1880
|
function p() {
|
|
1872
|
-
return i.value.payId = "", c.value === "PHONE" && (
|
|
1881
|
+
return i.value.payId = "", c.value === "PHONE" && (Ie(l.value) || (i.value.payId = "Invalid phone number")), c.value === "EMAIL" && (Ve(l.value) || (i.value.payId = "Invalid email")), c.value === "ABN" && (ze(l.value.replace(/ /g, "")) || (i.value.payId = "Invalid ABN")), i.value.payId === "";
|
|
1873
1882
|
}
|
|
1874
1883
|
function h(e) {
|
|
1875
1884
|
if (e?.data?.status) {
|
|
@@ -1882,7 +1891,7 @@ var tn = {
|
|
|
1882
1891
|
r("submit", {
|
|
1883
1892
|
payerName: s.value,
|
|
1884
1893
|
payIdType: c.value,
|
|
1885
|
-
payId: c.value === "PHONE" ?
|
|
1894
|
+
payId: c.value === "PHONE" ? Ke(l.value) : String(l.value).toLowerCase().replace(/ /g, "")
|
|
1886
1895
|
});
|
|
1887
1896
|
}
|
|
1888
1897
|
e.data.status === "activate" && e.data.component === "payto" && (n.log?.(`[PayTo]: message "${e.data.status}" received`, e.data), f.value = "", d.value = !0), e.data.status === "deactivate" && e.data.component === "payto" && (n.log?.(`[PayTo]: message "${e.data.status}" received`, e.data), d.value = !1);
|
|
@@ -1892,48 +1901,48 @@ var tn = {
|
|
|
1892
1901
|
window.addEventListener("message", h), window.addEventListener("keypress", function(e) {
|
|
1893
1902
|
e.altKey && e.code === "KeyP" && (e.preventDefault(), s.value = "test", c.value = "ABN", l.value = "67384721620");
|
|
1894
1903
|
}), window.postMessage({
|
|
1895
|
-
status:
|
|
1904
|
+
status: Xe,
|
|
1896
1905
|
paymentMethod: "payto"
|
|
1897
1906
|
}, "*");
|
|
1898
|
-
}),
|
|
1907
|
+
}), Fe(() => {
|
|
1899
1908
|
window.removeEventListener("message", h);
|
|
1900
|
-
}), (e, t) => (
|
|
1909
|
+
}), (e, t) => (w(), E("div", tn, [F(ue(Oe, null, null, 512), [[Je, D(o)]]), T("div", {
|
|
1901
1910
|
class: "container-form",
|
|
1902
|
-
style:
|
|
1911
|
+
style: ge(`visibility: ${D(o) ? "hidden" : "visible"}`)
|
|
1903
1912
|
}, [
|
|
1904
|
-
|
|
1905
|
-
|
|
1913
|
+
D(f) ? (w(), E("div", nn, O(D(f)), 1)) : P("", !0),
|
|
1914
|
+
T("div", rn, [t[3] ||= T("label", null, "Payer Name", -1), T("div", null, [F(T("input", {
|
|
1906
1915
|
type: "text",
|
|
1907
1916
|
maxlength: "100",
|
|
1908
1917
|
placeholder: "Payer Name",
|
|
1909
1918
|
"onUpdate:modelValue": t[0] ||= (e) => s.value = e
|
|
1910
|
-
}, null, 512), [[
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
]], 512), [[
|
|
1916
|
-
|
|
1917
|
-
|
|
1919
|
+
}, null, 512), [[ye, s.value]])])]),
|
|
1920
|
+
T("div", an, [t[5] ||= T("label", null, "Payer Id Type", -1), T("div", null, [F(T("select", { "onUpdate:modelValue": t[1] ||= (e) => c.value = e }, [...t[4] ||= [
|
|
1921
|
+
T("option", { value: "PHONE" }, "Phone", -1),
|
|
1922
|
+
T("option", { value: "EMAIL" }, "Email", -1),
|
|
1923
|
+
T("option", { value: "ABN" }, "Abn", -1)
|
|
1924
|
+
]], 512), [[je, c.value]])])]),
|
|
1925
|
+
T("div", on, [t[6] ||= T("label", null, " Pay Id ", -1), T("div", null, [
|
|
1926
|
+
F(T("input", {
|
|
1918
1927
|
type: "text",
|
|
1919
1928
|
maxlength: "100",
|
|
1920
1929
|
placeholder: u.value,
|
|
1921
1930
|
"onUpdate:modelValue": t[2] ||= (e) => l.value = e,
|
|
1922
1931
|
onKeyup: p
|
|
1923
|
-
}, null, 40, sn), [[
|
|
1924
|
-
c.value === "PHONE" ? (
|
|
1925
|
-
i.value.payId ? (
|
|
1932
|
+
}, null, 40, sn), [[ye, l.value]]),
|
|
1933
|
+
c.value === "PHONE" ? (w(), E("div", cn, "(mobile or landline with area code)")) : P("", !0),
|
|
1934
|
+
i.value.payId ? (w(), E("p", ln, O(i.value.payId), 1)) : P("", !0)
|
|
1926
1935
|
])])
|
|
1927
1936
|
], 4)]));
|
|
1928
1937
|
}
|
|
1929
1938
|
}), [["__scopeId", "data-v-edac356c"]]), dn = {
|
|
1930
1939
|
id: "payfurl-payto-agreement",
|
|
1931
1940
|
class: "payfurl-form"
|
|
1932
|
-
}, fn = /*#__PURE__*/
|
|
1941
|
+
}, fn = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
1933
1942
|
__name: "PayToAgreement",
|
|
1934
1943
|
props: { debug: { type: Boolean } },
|
|
1935
1944
|
setup(e) {
|
|
1936
|
-
return (e, t) => (
|
|
1945
|
+
return (e, t) => (w(), E("div", dn, [ue(Oe), t[0] ||= T("div", { class: "message" }, "Approve the agreement in your banking app", -1)]));
|
|
1937
1946
|
}
|
|
1938
1947
|
}), [["__scopeId", "data-v-f90fa6e7"]]), pn = {
|
|
1939
1948
|
TOKENISE: "TOKENISE",
|
|
@@ -1979,17 +1988,17 @@ var tn = {
|
|
|
1979
1988
|
amount: t,
|
|
1980
1989
|
providerId: n,
|
|
1981
1990
|
options: r
|
|
1982
|
-
}), this.container = e, this.providerId = n, this.options = r, this.options.metadata =
|
|
1991
|
+
}), this.container = e, this.providerId = n, this.options = r, this.options.metadata = G(r?.metadata);
|
|
1983
1992
|
let i = (t) => {
|
|
1984
|
-
throw
|
|
1985
|
-
status:
|
|
1993
|
+
throw I(e, t), window.postMessage({
|
|
1994
|
+
status: _,
|
|
1986
1995
|
paymentMethod: "payto",
|
|
1987
1996
|
reason: "error",
|
|
1988
1997
|
message: t
|
|
1989
1998
|
}, "*"), TypeError(t);
|
|
1990
1999
|
};
|
|
1991
|
-
|
|
1992
|
-
let a =
|
|
2000
|
+
j(t) || i("Invalid amount: " + t), String(r.description).trim() || i("Invalid description"), r.maximumAmount ||= 1e3, (r.maximumAmount < 0 || r.maximumAmount > 9999) && i("Invalid maximum amount: " + r.maximumAmount);
|
|
2001
|
+
let a = Me({
|
|
1993
2002
|
el: this.container,
|
|
1994
2003
|
component: un,
|
|
1995
2004
|
props: {
|
|
@@ -1997,8 +2006,8 @@ var tn = {
|
|
|
1997
2006
|
log: this.log,
|
|
1998
2007
|
clickGate: this.getOnValidate.bind(this)
|
|
1999
2008
|
},
|
|
2000
|
-
on: { submit:
|
|
2001
|
-
this.log("[PayTo]: submit payto form", e),
|
|
2009
|
+
on: { submit: z(this, "[PayTo]: submit", (e) => {
|
|
2010
|
+
this.log("[PayTo]: submit payto form", e), W().startLoading(), setTimeout(() => {
|
|
2002
2011
|
this.tokenise(e);
|
|
2003
2012
|
}, 500);
|
|
2004
2013
|
}) }
|
|
@@ -2019,11 +2028,11 @@ var tn = {
|
|
|
2019
2028
|
};
|
|
2020
2029
|
this.httpInvoker?.invoke(mn(this.apiUrl)[pn.TOKENISE].url, mn(this.apiUrl)[pn.TOKENISE].method, JSON.stringify(t), this.successPayToHandler.bind(this), this.failurePayToHandler.bind(this));
|
|
2021
2030
|
}
|
|
2022
|
-
successPayToHandler =
|
|
2031
|
+
successPayToHandler = z(this, "[PayTo][tokenise][successPayToHandler]", (e, t) => {
|
|
2023
2032
|
this.log("successPayToHandler", e, t);
|
|
2024
2033
|
let n = JSON.parse(t);
|
|
2025
2034
|
if (!n || !n?.tokenId) return this.failurePayToHandler(e, t);
|
|
2026
|
-
this.tokenId = n.tokenId,
|
|
2035
|
+
this.tokenId = n.tokenId, Me({
|
|
2027
2036
|
el: this.container,
|
|
2028
2037
|
component: fn,
|
|
2029
2038
|
props: {
|
|
@@ -2032,31 +2041,31 @@ var tn = {
|
|
|
2032
2041
|
}
|
|
2033
2042
|
}), this.checkAgreement();
|
|
2034
2043
|
});
|
|
2035
|
-
failurePayToHandler =
|
|
2036
|
-
this.log("failurePayToHandler", e, t),
|
|
2044
|
+
failurePayToHandler = z(this, "[PayTo][tokenise][failurePayToHandler]", (e, t) => {
|
|
2045
|
+
this.log("failurePayToHandler", e, t), W().stopLoading(), en().showErrorMessage("Invalid payment details"), this.failureCallback?.({
|
|
2037
2046
|
error: "Invalid payment details",
|
|
2038
2047
|
body: t
|
|
2039
2048
|
});
|
|
2040
2049
|
});
|
|
2041
|
-
failurePayToAgreementHandler =
|
|
2042
|
-
|
|
2050
|
+
failurePayToAgreementHandler = z(this, "[PayTo][tokenise][failurePayToAgreementHandler]", (e, t) => {
|
|
2051
|
+
W().stopLoading(), this.log("failurePayToAgreementHandler", e, t), I(this.container, "Agreement has been canceled"), this.failureCallback?.({
|
|
2043
2052
|
error: "Agreement has been canceled",
|
|
2044
2053
|
body: t
|
|
2045
2054
|
});
|
|
2046
2055
|
});
|
|
2047
2056
|
successPayToAgreementHandler() {
|
|
2048
|
-
|
|
2057
|
+
W().stopLoading(), this.log("success agreement", this.tokenId), tt(this.container, "PayTo Agreement Approved"), this.successCallback?.({ token: this.tokenId });
|
|
2049
2058
|
}
|
|
2050
2059
|
checkAgreement() {
|
|
2051
|
-
this.checkAgreementHandler ||= setInterval(this.checkAgreement.bind(this), 5e3), this.httpInvoker?.invoke(mn(this.apiUrl, this.tokenId)[pn.TOKEN_STATUS].url, mn(this.apiUrl, this.tokenId)[pn.TOKEN_STATUS].method, {},
|
|
2060
|
+
this.checkAgreementHandler ||= setInterval(this.checkAgreement.bind(this), 5e3), this.httpInvoker?.invoke(mn(this.apiUrl, this.tokenId)[pn.TOKEN_STATUS].url, mn(this.apiUrl, this.tokenId)[pn.TOKEN_STATUS].method, {}, z(this, "[checkAgreement], success", (e, t) => {
|
|
2052
2061
|
this.log("checkAgreement", e, t);
|
|
2053
2062
|
let n = JSON.parse(t);
|
|
2054
2063
|
if (!n) return clearInterval(this.checkAgreementHandler), this.failurePayToAgreementHandler(e, t);
|
|
2055
2064
|
if (n.payToStatus !== "PENDING") return n.payToStatus === "ACTIVE" ? (clearInterval(this.checkAgreementHandler), this.successPayToAgreementHandler()) : (clearInterval(this.checkAgreementHandler), this.failurePayToAgreementHandler(e, ""));
|
|
2056
|
-
}),
|
|
2065
|
+
}), z(this, "[checkAgreement], failure", (e, t) => (this.log("checkAgreement", e, t), clearInterval(this.checkAgreementHandler), this.failurePayToAgreementHandler(e, t))));
|
|
2057
2066
|
}
|
|
2058
2067
|
};
|
|
2059
|
-
|
|
2068
|
+
L([R], hn.prototype, "cleanUp", null), L([R], hn.prototype, "addPayTo", null), L([R], hn.prototype, "tokenise", null), L([R], hn.prototype, "successPayToAgreementHandler", null), L([R], hn.prototype, "checkAgreement", null);
|
|
2060
2069
|
// src/sdk/checkout/checkoutProvider.type.ts
|
|
2061
2070
|
var J;
|
|
2062
2071
|
(function(e) {
|
|
@@ -2451,7 +2460,7 @@ var gn = {
|
|
|
2451
2460
|
}, _n = { class: "modal-header" }, vn = { class: "main-title" }, yn = { class: "modal-body" }, bn = {
|
|
2452
2461
|
key: 0,
|
|
2453
2462
|
class: "modal-footer"
|
|
2454
|
-
}, xn = /*#__PURE__*/
|
|
2463
|
+
}, xn = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
2455
2464
|
__name: "Modal",
|
|
2456
2465
|
props: {
|
|
2457
2466
|
width: {},
|
|
@@ -2468,31 +2477,31 @@ var gn = {
|
|
|
2468
2477
|
function a() {
|
|
2469
2478
|
n.backdrop !== "static" && i();
|
|
2470
2479
|
}
|
|
2471
|
-
let o =
|
|
2480
|
+
let o = ne(), s = Ze(() => !!o.footer), c = Ze(() => {
|
|
2472
2481
|
let e = [];
|
|
2473
2482
|
return n.width && e.push(`width: ${n.width}`), n.height && e.push(`height: ${n.height}`), e.join(";");
|
|
2474
|
-
}), l =
|
|
2475
|
-
return (e, t) => (
|
|
2483
|
+
}), l = Ze(() => n.mode == "confirm" ? "small" : "");
|
|
2484
|
+
return (e, t) => (w(), E("div", {
|
|
2476
2485
|
class: "modal-mask",
|
|
2477
|
-
onMousedown:
|
|
2478
|
-
}, [
|
|
2479
|
-
class:
|
|
2486
|
+
onMousedown: $e(a, ["self"])
|
|
2487
|
+
}, [T("div", {
|
|
2488
|
+
class: te(["modal-wrapper", l.value]),
|
|
2480
2489
|
role: "document",
|
|
2481
|
-
onClick: t[0] ||=
|
|
2482
|
-
}, [
|
|
2490
|
+
onClick: t[0] ||= $e(() => {}, ["stop"])
|
|
2491
|
+
}, [T("div", {
|
|
2483
2492
|
class: "modal-content",
|
|
2484
|
-
style:
|
|
2493
|
+
style: ge(c.value)
|
|
2485
2494
|
}, [
|
|
2486
|
-
|
|
2495
|
+
T("div", _n, [T("div", {
|
|
2487
2496
|
class: "close-icon",
|
|
2488
|
-
onClick:
|
|
2489
|
-
}, [
|
|
2490
|
-
|
|
2491
|
-
s.value ? (
|
|
2492
|
-
|
|
2497
|
+
onClick: $e(i, ["stop"])
|
|
2498
|
+
}, [ue(Ge, { size: 15 })]), T("div", vn, [de(e.$slots, "title", {}, void 0, !0)])]),
|
|
2499
|
+
T("div", yn, [de(e.$slots, "body", {}, void 0, !0)]),
|
|
2500
|
+
s.value ? (w(), E("div", bn, [de(e.$slots, "footer", {}, void 0, !0)])) : P("", !0),
|
|
2501
|
+
de(e.$slots, "default", {}, void 0, !0)
|
|
2493
2502
|
], 4)], 2)], 32));
|
|
2494
2503
|
}
|
|
2495
|
-
}), [["__scopeId", "data-v-2b2c8fc7"]]), Sn = ["src"], Cn = /*#__PURE__*/
|
|
2504
|
+
}), [["__scopeId", "data-v-2b2c8fc7"]]), Sn = ["src"], Cn = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
2496
2505
|
__name: "CheckoutPopup",
|
|
2497
2506
|
props: {
|
|
2498
2507
|
url: {},
|
|
@@ -2501,16 +2510,16 @@ var gn = {
|
|
|
2501
2510
|
emits: ["close"],
|
|
2502
2511
|
setup(e, { emit: t }) {
|
|
2503
2512
|
let n = e, r = t, i = g(n.url);
|
|
2504
|
-
return
|
|
2513
|
+
return oe(() => n.url, (e) => {
|
|
2505
2514
|
i.value = e;
|
|
2506
|
-
}), m(() => {}), (t, n) => (
|
|
2515
|
+
}), m(() => {}), (t, n) => (w(), v(xn, {
|
|
2507
2516
|
width: "80vw",
|
|
2508
2517
|
height: "80vh",
|
|
2509
2518
|
backdrop: "static",
|
|
2510
2519
|
onClose: n[0] ||= (e) => r("close")
|
|
2511
2520
|
}, {
|
|
2512
|
-
title:
|
|
2513
|
-
body:
|
|
2521
|
+
title: pe(() => [y(O(e.name), 1)]),
|
|
2522
|
+
body: pe(() => [T("iframe", {
|
|
2514
2523
|
src: i.value,
|
|
2515
2524
|
sandbox: "allow-same-origin allow-scripts allow-popups allow-forms"
|
|
2516
2525
|
}, null, 8, Sn)]),
|
|
@@ -2545,7 +2554,7 @@ var En = ["id"], Dn = {
|
|
|
2545
2554
|
}, On = { class: "row" }, kn = {
|
|
2546
2555
|
key: 1,
|
|
2547
2556
|
class: "error"
|
|
2548
|
-
}, An = /*#__PURE__*/
|
|
2557
|
+
}, An = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
2549
2558
|
__name: "CheckoutForm",
|
|
2550
2559
|
props: {
|
|
2551
2560
|
log: { type: Function },
|
|
@@ -2562,33 +2571,33 @@ var En = ["id"], Dn = {
|
|
|
2562
2571
|
"newWindowClose"
|
|
2563
2572
|
],
|
|
2564
2573
|
setup(e, { emit: t }) {
|
|
2565
|
-
let n = e, r = t, i = g(null), { isLoading: a } =
|
|
2574
|
+
let n = e, r = t, i = g(null), { isLoading: a } = W(), o = g(!0), s = g(n.providerType), c = g(""), l = g(!!n.options.checkoutOptions?.newWindow), u = null, d = g(null), { errorMessage: f } = en(), p = Ze(() => gn[s.value]?.buttonTitle || `Pay with ${s.value}`), h = Ze(() => {
|
|
2566
2575
|
let e = d.value?.gatewayTransactionData?.RedirectUrl || "";
|
|
2567
|
-
return !e || !
|
|
2568
|
-
}),
|
|
2569
|
-
function
|
|
2576
|
+
return !e || !Ae(e) ? "" : l.value ? e : `${e}${e.includes("?") ? "&" : "?"}embedded=true`;
|
|
2577
|
+
}), y = g(!1), b = g(!1), x = Ze(() => h.value && !y.value && !b.value);
|
|
2578
|
+
function S(e) {
|
|
2570
2579
|
if (e?.data?.status) {
|
|
2571
2580
|
if (e.data.status === "activate" && e.data.component === "checkout" && e.data.providerType === s.value && (n.log?.(`[Checkout]: message "${e.data.status}" received`, e.data), o.value = !0, r("activate", n.options)), e.data.status === "deactivate" && e.data.component === "checkout" && e.data.providerType === s.value && (n.log?.(`[Checkout]: message "${e.data.status}" received`, e.data), o.value = !1), e.data.status === "checkout-ready" && e.data.component === "checkout" && e.data.providerType === s.value) {
|
|
2572
2581
|
n.log?.(`[Checkout]: message "${e.data.status}" received`, e.data), f.value = "", d.value = e.data.checkoutData, n.log?.("[BNPL]: checkout", d.value);
|
|
2573
2582
|
let t = Tn(s.value);
|
|
2574
2583
|
window.postMessage(h.value ? {
|
|
2575
|
-
status:
|
|
2584
|
+
status: Xe,
|
|
2576
2585
|
...t
|
|
2577
2586
|
} : {
|
|
2578
|
-
status:
|
|
2587
|
+
status: _,
|
|
2579
2588
|
...t,
|
|
2580
2589
|
reason: "error",
|
|
2581
2590
|
message: "The checkout has no payment page"
|
|
2582
2591
|
}, "*");
|
|
2583
2592
|
}
|
|
2584
|
-
if (e.data.status === "message" && e.data.component === "checkout" && e.data.providerType === s.value && (n.log?.(`[Checkout]: message "${e.data.status}" received`, e.data), c.value = e.data.message,
|
|
2593
|
+
if (e.data.status === "message" && e.data.component === "checkout" && e.data.providerType === s.value && (n.log?.(`[Checkout]: message "${e.data.status}" received`, e.data), c.value = e.data.message, b.value = !1, y.value = !1), e.data.status === "error" && e.data.component === "checkout" && e.data.providerType === s.value && (n.log?.(`[Checkout]: message "${e.data.status}" received`, e.data), c.value = e.data.error, e.data.originalError)) {
|
|
2585
2594
|
let t = JSON.parse(e.data.originalError);
|
|
2586
2595
|
t?.message && (c.value = t.message);
|
|
2587
2596
|
}
|
|
2588
|
-
e.data.status === "redirect" && e.data.component === "checkout" && (n.log?.(`[Checkout]: message "${e.data.status}" received`, e.data),
|
|
2597
|
+
e.data.status === "redirect" && e.data.component === "checkout" && (n.log?.(`[Checkout]: message "${e.data.status}" received`, e.data), y.value = !1, e.data.result === "failed" && (c.value = "Payment has been canceled", te())), e.data.component === "checkout" && e.data.providerType === J.PAYBYACCOUNT && (e.data.status === "failure" ? (n.log?.("[BNPL][PayByAccount]: message received", e.data), c.value = e.data.error, r("newWindowClose")) : e.data.status === "success" && (n.log?.("[BNPL][PayByAccount]: message received", e.data), f.value = ""));
|
|
2589
2598
|
}
|
|
2590
2599
|
}
|
|
2591
|
-
function
|
|
2600
|
+
function ee() {
|
|
2592
2601
|
if (c.value = "", n.clickGate()?.() !== !1) {
|
|
2593
2602
|
if (l.value) {
|
|
2594
2603
|
let e = "maxTouchPoints" in navigator && navigator.maxTouchPoints > 0 ? 791 : 637, t = window.screenLeft === void 0 ? window.screenX : window.screenLeft, n = window.screenTop === void 0 ? window.screenY : window.screenTop, i = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width, a = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height, o = i / window.screen.availWidth, s = (i - 400) / 2 / o + t, c = (a - e) / 2 / o + n;
|
|
@@ -2603,42 +2612,42 @@ var En = ["id"], Dn = {
|
|
|
2603
2612
|
height=${e},
|
|
2604
2613
|
top=${c},
|
|
2605
2614
|
left=${s}`), r("newWindow", d.value?.externalId);
|
|
2606
|
-
} else
|
|
2615
|
+
} else y.value = !0, b.value = !0, r("popup", d.value?.externalId);
|
|
2607
2616
|
return !1;
|
|
2608
2617
|
}
|
|
2609
2618
|
}
|
|
2610
|
-
function
|
|
2611
|
-
|
|
2619
|
+
function te() {
|
|
2620
|
+
y.value = !1, b.value = !1, u?.close(), r("popupClose");
|
|
2612
2621
|
}
|
|
2613
2622
|
return m(() => {
|
|
2614
|
-
window.addEventListener("message",
|
|
2615
|
-
}),
|
|
2616
|
-
window.removeEventListener("message",
|
|
2617
|
-
}), (e, t) => (
|
|
2618
|
-
|
|
2619
|
-
|
|
2623
|
+
window.addEventListener("message", S), ft(i.value, "payfurl-combined-container") || (o.value = !0, r("activate", n.options));
|
|
2624
|
+
}), Fe(() => {
|
|
2625
|
+
window.removeEventListener("message", S);
|
|
2626
|
+
}), (e, t) => (w(), E(Ce, null, [
|
|
2627
|
+
F(ue(Oe, { "use-local": "" }, null, 512), [[Je, !h.value]]),
|
|
2628
|
+
b.value && !y.value ? (w(), v(Oe, {
|
|
2620
2629
|
key: 0,
|
|
2621
2630
|
message: "Finalise the payment"
|
|
2622
|
-
})) :
|
|
2623
|
-
|
|
2631
|
+
})) : P("", !0),
|
|
2632
|
+
T("div", {
|
|
2624
2633
|
id: `payfurl-${s.value}-form`,
|
|
2625
2634
|
class: "payfurl-checkout-form",
|
|
2626
2635
|
ref_key: "root",
|
|
2627
2636
|
ref: i
|
|
2628
|
-
}, [
|
|
2637
|
+
}, [T("div", {
|
|
2629
2638
|
class: "container-form",
|
|
2630
|
-
style:
|
|
2631
|
-
}, [
|
|
2639
|
+
style: ge(`visibility: ${D(a) ? "hidden" : "visible"}`)
|
|
2640
|
+
}, [D(f) ? (w(), E("div", Dn, O(D(f)), 1)) : P("", !0), T("div", On, [x.value ? (w(), E("button", {
|
|
2632
2641
|
key: 0,
|
|
2633
|
-
onClick:
|
|
2642
|
+
onClick: ee,
|
|
2634
2643
|
type: "button"
|
|
2635
|
-
},
|
|
2636
|
-
|
|
2644
|
+
}, O(p.value), 1)) : P("", !0), c.value ? (w(), E("p", kn, O(c.value), 1)) : P("", !0)])], 4)], 8, En),
|
|
2645
|
+
y.value ? (w(), v(Cn, {
|
|
2637
2646
|
key: 1,
|
|
2638
|
-
onClose:
|
|
2647
|
+
onClose: te,
|
|
2639
2648
|
url: h.value,
|
|
2640
2649
|
name: p.value
|
|
2641
|
-
}, null, 8, ["url", "name"])) :
|
|
2650
|
+
}, null, 8, ["url", "name"])) : P("", !0)
|
|
2642
2651
|
], 64));
|
|
2643
2652
|
}
|
|
2644
2653
|
}), [["__scopeId", "data-v-ae6f5b6e"]]), jn = {
|
|
@@ -2687,7 +2696,7 @@ var En = ["id"], Dn = {
|
|
|
2687
2696
|
options: a,
|
|
2688
2697
|
checkoutOptions: o
|
|
2689
2698
|
}), this.container = e;
|
|
2690
|
-
let s = !1, c, l =
|
|
2699
|
+
let s = !1, c, l = Me({
|
|
2691
2700
|
el: e,
|
|
2692
2701
|
component: An,
|
|
2693
2702
|
props: {
|
|
@@ -2702,7 +2711,7 @@ var En = ["id"], Dn = {
|
|
|
2702
2711
|
clickGate: this.getOnValidate.bind(this)
|
|
2703
2712
|
},
|
|
2704
2713
|
on: {
|
|
2705
|
-
activate:
|
|
2714
|
+
activate: z(this, "[sdk][checkoutProcessor][${providerType}]: activate checkout form", (e) => {
|
|
2706
2715
|
if (s) return;
|
|
2707
2716
|
s = !0, this.log(`[sdk][checkoutProcessor][${r}]: activate checkout form`, e);
|
|
2708
2717
|
let t = () => {
|
|
@@ -2710,16 +2719,16 @@ var En = ["id"], Dn = {
|
|
|
2710
2719
|
};
|
|
2711
2720
|
this.checkout(e, r, a, t), c = this.getMessageHandler(e, r, a, t).bind(this), window.addEventListener("message", c);
|
|
2712
2721
|
}),
|
|
2713
|
-
popup:
|
|
2722
|
+
popup: z(this, "[sdk][checkoutProcessor][${providerType}]: popup open", (t) => {
|
|
2714
2723
|
this.log(`[sdk][checkoutProcessor][${r}]: popup open`, t), this.checkStatus(e, t, r, c);
|
|
2715
2724
|
}),
|
|
2716
|
-
popupClose:
|
|
2725
|
+
popupClose: z(this, "[sdk][checkoutProcessor][${providerType}]: popup close", () => {
|
|
2717
2726
|
this.log(`[sdk][checkoutProcessor][${r}]: popup close`), this.stopCheckingStatus(null);
|
|
2718
2727
|
}),
|
|
2719
|
-
newWindow:
|
|
2728
|
+
newWindow: z(this, "[sdk][checkoutProcessor][${providerType}]: new window open", (t) => {
|
|
2720
2729
|
this.log(`[sdk][checkoutProcessor][${r}]: new window open`, t), this.checkStatus(e, t, r, c);
|
|
2721
2730
|
}),
|
|
2722
|
-
newWindowClose:
|
|
2731
|
+
newWindowClose: z(this, "[sdk][checkoutProcessor][${providerType}]: new window close", () => {
|
|
2723
2732
|
this.log(`[sdk][checkoutProcessor][${r}]: new window close`), this.stopCheckingStatus(null);
|
|
2724
2733
|
})
|
|
2725
2734
|
}
|
|
@@ -2757,17 +2766,17 @@ var En = ["id"], Dn = {
|
|
|
2757
2766
|
...e.checkoutOptions,
|
|
2758
2767
|
redirectUrl: this.redirectUrl
|
|
2759
2768
|
},
|
|
2760
|
-
metadata:
|
|
2761
|
-
}), this.getSuccessCheckoutHandler(t).bind(this),
|
|
2769
|
+
metadata: G(n?.metadata)
|
|
2770
|
+
}), this.getSuccessCheckoutHandler(t).bind(this), z(this, "[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler", (e, n) => {
|
|
2762
2771
|
r?.(e, n), this.getFailureCheckoutHandler(t).bind(this)(e, n);
|
|
2763
2772
|
}));
|
|
2764
2773
|
}
|
|
2765
2774
|
getSuccessCheckoutHandler(e) {
|
|
2766
|
-
return
|
|
2775
|
+
return z(this, "[sdk][checkoutProcessor][${providerType}]: successCheckoutHandler", (t, n) => {
|
|
2767
2776
|
this.log(`[sdk][checkoutProcessor][${e}]: successCheckoutHandler`, t, n);
|
|
2768
2777
|
let r = JSON.parse(n), i = JSON.parse(window.atob(r.checkoutData));
|
|
2769
2778
|
window.postMessage({
|
|
2770
|
-
status:
|
|
2779
|
+
status: Be,
|
|
2771
2780
|
component: "checkout",
|
|
2772
2781
|
providerType: e,
|
|
2773
2782
|
checkoutData: i
|
|
@@ -2775,8 +2784,8 @@ var En = ["id"], Dn = {
|
|
|
2775
2784
|
});
|
|
2776
2785
|
}
|
|
2777
2786
|
getFailureCheckoutHandler(e) {
|
|
2778
|
-
return
|
|
2779
|
-
this.log(`[sdk][checkoutProcessor][${e}]: failureCheckoutHandler`, t, n),
|
|
2787
|
+
return z(this, "[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler", (t, n) => {
|
|
2788
|
+
this.log(`[sdk][checkoutProcessor][${e}]: failureCheckoutHandler`, t, n), W().stopLoading(), window.postMessage({
|
|
2780
2789
|
status: "error",
|
|
2781
2790
|
component: "checkout",
|
|
2782
2791
|
providerType: e,
|
|
@@ -2788,7 +2797,7 @@ var En = ["id"], Dn = {
|
|
|
2788
2797
|
r = JSON.parse(n)?.message || r;
|
|
2789
2798
|
} catch {}
|
|
2790
2799
|
window.postMessage({
|
|
2791
|
-
status:
|
|
2800
|
+
status: _,
|
|
2792
2801
|
...Tn(e),
|
|
2793
2802
|
reason: "error",
|
|
2794
2803
|
message: r
|
|
@@ -2800,8 +2809,8 @@ var En = ["id"], Dn = {
|
|
|
2800
2809
|
}
|
|
2801
2810
|
checkStatus(e, t, n, r) {
|
|
2802
2811
|
this.checkStatusHandler || (this.checkStatusHandler = setInterval(this.checkStatus.bind(this, e, t, n, r), 5e3), this.statusSettled = !1, this.log(`[sdk][checkoutProcessor][${n}]: Starting polling...`));
|
|
2803
|
-
let i = this, a =
|
|
2804
|
-
i.statusSettled || (i.statusSettled = !0,
|
|
2812
|
+
let i = this, a = z(this, `[sdk][checkoutProcessor][${n}]: failureCheckStatusHandler`, (e, t) => {
|
|
2813
|
+
i.statusSettled || (i.statusSettled = !0, W().stopLoading(), i.log(`[sdk][checkoutProcessor][${n}]: failureCheckStatusHandler`, e, t), window.postMessage({
|
|
2805
2814
|
status: "message",
|
|
2806
2815
|
component: "checkout",
|
|
2807
2816
|
providerType: n,
|
|
@@ -2810,26 +2819,26 @@ var En = ["id"], Dn = {
|
|
|
2810
2819
|
error: "Checkout has been cancelled",
|
|
2811
2820
|
body: t
|
|
2812
2821
|
}));
|
|
2813
|
-
}), o =
|
|
2822
|
+
}), o = z(this, `[sdk][checkoutProcessor][${n}]: successCheckStatusHandler`, (t, r) => {
|
|
2814
2823
|
if (i.statusSettled) return;
|
|
2815
|
-
i.statusSettled = !0,
|
|
2824
|
+
i.statusSettled = !0, W().stopLoading(), i.log(`[sdk][checkoutProcessor][${n}]: successCheckStatusHandler`, {
|
|
2816
2825
|
transactionId: t,
|
|
2817
2826
|
token: r
|
|
2818
|
-
}),
|
|
2827
|
+
}), tt(e, "Transaction in progress. Please don't close the window or navigate away");
|
|
2819
2828
|
let a = {};
|
|
2820
2829
|
t && (a.transactionId = t), r && (a.token = r), i.successCallback?.(a);
|
|
2821
2830
|
});
|
|
2822
|
-
this.httpInvoker?.invoke(Mn(this.apiUrl, t)[jn.CHECK_STATUS].url, Mn(this.apiUrl, t)[jn.CHECK_STATUS].method, {},
|
|
2831
|
+
this.httpInvoker?.invoke(Mn(this.apiUrl, t)[jn.CHECK_STATUS].url, Mn(this.apiUrl, t)[jn.CHECK_STATUS].method, {}, z(this, `[sdk][checkoutProcessor][${n}]: checkStatus, success`, (e, t) => {
|
|
2823
2832
|
let n = JSON.parse(t);
|
|
2824
2833
|
if (this.log("checkoutStatus", n), !n) return this.stopCheckingStatus(r), a(e, t);
|
|
2825
2834
|
if (n.status == "SUCCESS" && n.status === "SUCCESS") return this.stopCheckingStatus(r), o(n.transactionId, n.tokenId);
|
|
2826
|
-
}),
|
|
2835
|
+
}), z(this, `[sdk][checkoutProcessor][${n}]: checkStatus, failure`, (e, t) => (this.log(`[sdk][checkoutProcessor][${n}]: checkStatus`, {
|
|
2827
2836
|
status: e,
|
|
2828
2837
|
body: t
|
|
2829
2838
|
}), this.stopCheckingStatus(r), a(e, t))));
|
|
2830
2839
|
}
|
|
2831
2840
|
getMessageHandler(e, t, n, r) {
|
|
2832
|
-
return
|
|
2841
|
+
return z(this, `[sdk][checkoutProcessor][${t}]: message received`, (i) => {
|
|
2833
2842
|
if (i?.data?.status) {
|
|
2834
2843
|
if (i.data.status === "set-amount") {
|
|
2835
2844
|
if (Number(e.amount) == Number(i.data.amount)) return;
|
|
@@ -2842,7 +2851,7 @@ var En = ["id"], Dn = {
|
|
|
2842
2851
|
});
|
|
2843
2852
|
}
|
|
2844
2853
|
};
|
|
2845
|
-
|
|
2854
|
+
L([R], Nn.prototype, "cleanUp", null), L([R], Nn.prototype, "addCheckout", null), L([R], Nn.prototype, "checkout", null), L([R], Nn.prototype, "getSuccessCheckoutHandler", null), L([R], Nn.prototype, "getFailureCheckoutHandler", null), L([R], Nn.prototype, "stopCheckingStatus", null), L([R], Nn.prototype, "checkStatus", null), L([R], Nn.prototype, "getMessageHandler", null);
|
|
2846
2855
|
// src/sdk/processors/fraudProcessor.ts
|
|
2847
2856
|
var Pn = {
|
|
2848
2857
|
CHECK_FRAUD: "CHECK_FRAUD",
|
|
@@ -2907,7 +2916,7 @@ var Rn = class {
|
|
|
2907
2916
|
address: this.address,
|
|
2908
2917
|
order: this.order,
|
|
2909
2918
|
metadata: this.metadata
|
|
2910
|
-
}), this.httpInvoker?.invoke(Fn(this.apiUrl)[Pn.CHECK_FRAUD].url, Fn(this.apiUrl)[Pn.CHECK_FRAUD].method, this.getFraudCheckData(this.providerId, this.amount, this.currency, this.paymentInformation, this.paypalInformation, this.customer, this.address, this.order, this.metadata, this.paymentReference, this.walletInformation),
|
|
2919
|
+
}), this.httpInvoker?.invoke(Fn(this.apiUrl)[Pn.CHECK_FRAUD].url, Fn(this.apiUrl)[Pn.CHECK_FRAUD].method, this.getFraudCheckData(this.providerId, this.amount, this.currency, this.paymentInformation, this.paypalInformation, this.customer, this.address, this.order, this.metadata, this.paymentReference, this.walletInformation), z(this, "[fraudCheck], success", (n, r) => {
|
|
2911
2920
|
this.log("[fraudCheck], success", n, r, this.stopPaymentOnFailure);
|
|
2912
2921
|
let i = In(r);
|
|
2913
2922
|
if (!Ln(i)) return t({
|
|
@@ -2915,7 +2924,7 @@ var Rn = class {
|
|
|
2915
2924
|
body: r
|
|
2916
2925
|
});
|
|
2917
2926
|
i.providerId = this.providerId, i.stopPaymentOnFailure = this.stopPaymentOnFailure, e(i);
|
|
2918
|
-
}),
|
|
2927
|
+
}), z(this, "[fraudCheck], failure", (e, n) => {
|
|
2919
2928
|
this.log("[fraudCheck], failure", e, n), t({
|
|
2920
2929
|
error: "Fraud Check Failed",
|
|
2921
2930
|
body: n
|
|
@@ -2923,7 +2932,7 @@ var Rn = class {
|
|
|
2923
2932
|
}));
|
|
2924
2933
|
}
|
|
2925
2934
|
resolveThreeDsResult(e, t, n) {
|
|
2926
|
-
this.httpInvoker?.invoke(Fn(this.apiUrl)[Pn.RESOLVE_THREE_DS].url, Fn(this.apiUrl)[Pn.RESOLVE_THREE_DS].method, JSON.stringify({ threeDSServerTransID: e }),
|
|
2935
|
+
this.httpInvoker?.invoke(Fn(this.apiUrl)[Pn.RESOLVE_THREE_DS].url, Fn(this.apiUrl)[Pn.RESOLVE_THREE_DS].method, JSON.stringify({ threeDSServerTransID: e }), z(this, "[resolveThreeDsResult], success", (e, r) => {
|
|
2927
2936
|
this.log("[resolveThreeDsResult], success", e, r);
|
|
2928
2937
|
let i = In(r);
|
|
2929
2938
|
if (i == null) return n({
|
|
@@ -2931,7 +2940,7 @@ var Rn = class {
|
|
|
2931
2940
|
body: r
|
|
2932
2941
|
});
|
|
2933
2942
|
t(i);
|
|
2934
|
-
}),
|
|
2943
|
+
}), z(this, "[resolveThreeDsResult], failure", (e, t) => {
|
|
2935
2944
|
this.log("[resolveThreeDsResult], failure", e, t), n({
|
|
2936
2945
|
error: "3DS result resolution failed",
|
|
2937
2946
|
body: t
|
|
@@ -2939,9 +2948,9 @@ var Rn = class {
|
|
|
2939
2948
|
}));
|
|
2940
2949
|
}
|
|
2941
2950
|
cancelThreeDsOrder(e, t, n) {
|
|
2942
|
-
this.httpInvoker?.invoke(Fn(this.apiUrl)[Pn.CANCEL_THREE_DS].url, Fn(this.apiUrl)[Pn.CANCEL_THREE_DS].method, JSON.stringify({ threeDSServerTransID: e }),
|
|
2951
|
+
this.httpInvoker?.invoke(Fn(this.apiUrl)[Pn.CANCEL_THREE_DS].url, Fn(this.apiUrl)[Pn.CANCEL_THREE_DS].method, JSON.stringify({ threeDSServerTransID: e }), z(this, "[cancelThreeDsOrder], success", (e, n) => {
|
|
2943
2952
|
this.log("[cancelThreeDsOrder], success", e, n), t({});
|
|
2944
|
-
}),
|
|
2953
|
+
}), z(this, "[cancelThreeDsOrder], failure", (e, t) => {
|
|
2945
2954
|
this.log("[cancelThreeDsOrder], failure", e, t), n({
|
|
2946
2955
|
error: "3DS cancel notification failed",
|
|
2947
2956
|
body: t
|
|
@@ -2979,7 +2988,7 @@ var Rn = class {
|
|
|
2979
2988
|
return this.providerId;
|
|
2980
2989
|
}
|
|
2981
2990
|
};
|
|
2982
|
-
|
|
2991
|
+
L([R], Rn.prototype, "fraudCheck", null), L([R], Rn.prototype, "resolveThreeDsResult", null), L([R], Rn.prototype, "cancelThreeDsOrder", null);
|
|
2983
2992
|
// src/sdk/fraud/fraudGate.ts
|
|
2984
2993
|
var zn = 18e4, Bn = 3e4, Vn = "Payment couldn't be processed";
|
|
2985
2994
|
function Hn(e) {
|
|
@@ -2995,11 +3004,11 @@ async function Un(e, t, n, r = {}) {
|
|
|
2995
3004
|
} catch (e) {
|
|
2996
3005
|
return r.log?.("fraud check failed", e), { error: e.message };
|
|
2997
3006
|
}
|
|
2998
|
-
if (
|
|
3007
|
+
if (Pt(i)) return { error: Vn };
|
|
2999
3008
|
if (!i.managedOrderToken) return { fraudCheckResult: i };
|
|
3000
3009
|
let a = await Wn(e, t, i, n, r);
|
|
3001
3010
|
return a ? {
|
|
3002
|
-
error:
|
|
3011
|
+
error: re,
|
|
3003
3012
|
reason: a
|
|
3004
3013
|
} : {
|
|
3005
3014
|
fraudCheckResult: i,
|
|
@@ -3042,7 +3051,7 @@ function Kn(e, t, n, r) {
|
|
|
3042
3051
|
}
|
|
3043
3052
|
let o = !1, s = !1, c, l = (e) => {
|
|
3044
3053
|
o || (o = !0, clearTimeout(u), d(), c?.(), s && r.onHide?.(), e());
|
|
3045
|
-
}, u = setTimeout(() => l(() => a(/* @__PURE__ */ Error("3DS challenge timed out"))), zn), d =
|
|
3054
|
+
}, u = setTimeout(() => l(() => a(/* @__PURE__ */ Error("3DS challenge timed out"))), zn), d = nt(n, () => {
|
|
3046
3055
|
o || (s = !0, r.onShow?.(), r.onProgress?.({ step: "challenge" }));
|
|
3047
3056
|
}), f = (e) => l(() => a(e instanceof Error ? e : Error(String(e))));
|
|
3048
3057
|
try {
|
|
@@ -3105,7 +3114,7 @@ function Zn(e, t) {
|
|
|
3105
3114
|
var Qn = { style: { position: "relative" } }, $n = {
|
|
3106
3115
|
key: 0,
|
|
3107
3116
|
class: "error text-normal"
|
|
3108
|
-
}, er = "payfurl-googlepay-script", tr = /* @__PURE__ */
|
|
3117
|
+
}, er = "payfurl-googlepay-script", tr = /* @__PURE__ */ k({
|
|
3109
3118
|
__name: "GooglePayForm",
|
|
3110
3119
|
props: {
|
|
3111
3120
|
log: { type: Function },
|
|
@@ -3123,24 +3132,24 @@ var Qn = { style: { position: "relative" } }, $n = {
|
|
|
3123
3132
|
"error"
|
|
3124
3133
|
],
|
|
3125
3134
|
setup(e, { emit: n }) {
|
|
3126
|
-
let r = e, i = n, a = g(null), o = g(r.amount), s = g(r.currency), c = g(!0), l = g(""), u = !1, { isLoading: d } =
|
|
3135
|
+
let r = e, i = n, a = g(null), o = g(r.amount), s = g(r.currency), c = g(!0), l = g(""), u = !1, { isLoading: d } = W();
|
|
3127
3136
|
function f() {
|
|
3128
3137
|
if (u) return;
|
|
3129
3138
|
if (u = !0, document.getElementById(er)) {
|
|
3130
|
-
|
|
3139
|
+
te();
|
|
3131
3140
|
return;
|
|
3132
3141
|
}
|
|
3133
3142
|
window.google = null;
|
|
3134
3143
|
let e = document.createElement("script");
|
|
3135
|
-
e.src = "https://pay.google.com/gp/p/js/pay.js", e.type = "text/javascript", e.id = er, e.onload =
|
|
3136
|
-
e.remove(),
|
|
3144
|
+
e.src = "https://pay.google.com/gp/p/js/pay.js", e.type = "text/javascript", e.id = er, e.onload = te, e.onerror = () => {
|
|
3145
|
+
e.remove(), C("error", "Google Pay script failed to load");
|
|
3137
3146
|
}, document.body.appendChild(e);
|
|
3138
3147
|
}
|
|
3139
3148
|
let p = null;
|
|
3140
3149
|
function h() {
|
|
3141
3150
|
return p === null && (p = new window.google.payments.api.PaymentsClient({ environment: r.environment == t.PRODUCTION ? "PRODUCTION" : "TEST" })), p;
|
|
3142
3151
|
}
|
|
3143
|
-
let
|
|
3152
|
+
let v = {
|
|
3144
3153
|
type: "CARD",
|
|
3145
3154
|
parameters: {
|
|
3146
3155
|
allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"],
|
|
@@ -3154,26 +3163,26 @@ var Qn = { style: { position: "relative" } }, $n = {
|
|
|
3154
3163
|
]
|
|
3155
3164
|
}
|
|
3156
3165
|
};
|
|
3157
|
-
function
|
|
3166
|
+
function y() {
|
|
3158
3167
|
return {
|
|
3159
3168
|
apiVersion: 2,
|
|
3160
3169
|
apiVersionMinor: 0,
|
|
3161
|
-
allowedPaymentMethods: [
|
|
3170
|
+
allowedPaymentMethods: [v]
|
|
3162
3171
|
};
|
|
3163
3172
|
}
|
|
3164
|
-
function
|
|
3165
|
-
let e = h().createButton(Zn(
|
|
3173
|
+
function b() {
|
|
3174
|
+
let e = h().createButton(Zn(S, r.options.buttonOptions));
|
|
3166
3175
|
r.el.appendChild(e);
|
|
3167
3176
|
}
|
|
3168
|
-
function
|
|
3177
|
+
function x() {
|
|
3169
3178
|
return r.environment == t.PRODUCTION ? {
|
|
3170
3179
|
merchantName: r.options.googlePayMerchantName ?? "Example Merchant",
|
|
3171
3180
|
merchantId: r.options.googlePayMerchantId
|
|
3172
3181
|
} : { merchantName: r.options.googlePayMerchantName ?? "Example Merchant" };
|
|
3173
3182
|
}
|
|
3174
|
-
function
|
|
3183
|
+
function S() {
|
|
3175
3184
|
if (r.log("[onGooglePaymentButtonClicked]"), r.clickGate()?.() === !1) return;
|
|
3176
|
-
let e =
|
|
3185
|
+
let e = ee(), t = h();
|
|
3177
3186
|
r.log("[paymentData], request", e), t.loadPaymentData(e).then(function(e) {
|
|
3178
3187
|
r.log("[paymentData], success", e);
|
|
3179
3188
|
let t = JSON.parse(e.paymentMethodData.tokenizationData.token);
|
|
@@ -3185,16 +3194,16 @@ var Qn = { style: { position: "relative" } }, $n = {
|
|
|
3185
3194
|
r.log("[paymentData], error", e), e?.statusCode !== "CANCELED" && i("error", e?.statusMessage || e?.message || "Google Pay failed");
|
|
3186
3195
|
});
|
|
3187
3196
|
}
|
|
3188
|
-
function
|
|
3197
|
+
function ee() {
|
|
3189
3198
|
let e = r.options.billingDetailsRequired === !0;
|
|
3190
3199
|
return {
|
|
3191
3200
|
apiVersion: 2,
|
|
3192
3201
|
apiVersionMinor: 0,
|
|
3193
3202
|
...e ? { emailRequired: !0 } : {},
|
|
3194
3203
|
allowedPaymentMethods: [{
|
|
3195
|
-
...
|
|
3204
|
+
...v,
|
|
3196
3205
|
parameters: {
|
|
3197
|
-
...
|
|
3206
|
+
...v.parameters,
|
|
3198
3207
|
...e ? {
|
|
3199
3208
|
billingAddressRequired: !0,
|
|
3200
3209
|
billingAddressParameters: { format: "FULL" }
|
|
@@ -3214,39 +3223,39 @@ var Qn = { style: { position: "relative" } }, $n = {
|
|
|
3214
3223
|
currencyCode: s.value,
|
|
3215
3224
|
totalPrice: Number(o.value).toFixed(2)
|
|
3216
3225
|
},
|
|
3217
|
-
merchantInfo:
|
|
3226
|
+
merchantInfo: x()
|
|
3218
3227
|
};
|
|
3219
3228
|
}
|
|
3220
|
-
function
|
|
3221
|
-
h().isReadyToPay(
|
|
3222
|
-
e.result ? (
|
|
3223
|
-
status:
|
|
3229
|
+
function te() {
|
|
3230
|
+
h().isReadyToPay(y()).then(function(e) {
|
|
3231
|
+
e.result ? (b(), window.postMessage({
|
|
3232
|
+
status: Xe,
|
|
3224
3233
|
paymentMethod: "googlepay"
|
|
3225
|
-
}, "*")) :
|
|
3234
|
+
}, "*")) : C("unsupported");
|
|
3226
3235
|
}).catch(function(e) {
|
|
3227
|
-
console.error("Load GooglePay error", e),
|
|
3236
|
+
console.error("Load GooglePay error", e), C("error", e?.statusMessage || e?.message || "Google Pay availability check failed");
|
|
3228
3237
|
});
|
|
3229
3238
|
}
|
|
3230
|
-
function
|
|
3239
|
+
function C(e, t) {
|
|
3231
3240
|
window.postMessage({
|
|
3232
|
-
status:
|
|
3241
|
+
status: _,
|
|
3233
3242
|
paymentMethod: "googlepay",
|
|
3234
3243
|
reason: e,
|
|
3235
3244
|
message: t
|
|
3236
3245
|
}, "*");
|
|
3237
3246
|
}
|
|
3238
|
-
function
|
|
3247
|
+
function ne(e) {
|
|
3239
3248
|
e?.data?.status && (e.data.status === "activate" && e.data.component === "googlepay" && (r.log?.(`[GooglePay]: message "${e.data.status}" received`, e.data), c.value = !0, i("activate"), f()), e.data.status === "deactivate" && e.data.component === "googlepay" && (r.log?.(`[GooglePay]: message "${e.data.status}" received`, e.data), c.value = !1), e.data.status === "message" && e.data.component === "googlepay" && (r.log?.(`[GooglePay]: message "${e.data.status}" received`, e.data), l.value = e.data.message), e.data.status === "error" && e.data.component === "googlepay" && (r.log?.(`[GooglePay]: message "${e.data.status}" received`, e.data), l.value = e.data.error), e.data.status === "set-amount" && (r.log?.(`[GooglePay]: message "${e.data.status}" received`, e.data), o.value = Number(e.data.amount)), e.data.status === "set-currency" && (r.log?.(`[GooglePay]: message "${e.data.status}" received`, e.data), s.value = e.data.currency));
|
|
3240
3249
|
}
|
|
3241
|
-
return
|
|
3242
|
-
window.removeEventListener("message",
|
|
3250
|
+
return Fe(() => {
|
|
3251
|
+
window.removeEventListener("message", ne);
|
|
3243
3252
|
}), m(() => {
|
|
3244
|
-
window.addEventListener("message",
|
|
3245
|
-
}), (e, t) => (
|
|
3253
|
+
window.addEventListener("message", ne), ft(a.value, "payfurl-combined-container") || (c.value = !0, i("activate"), f());
|
|
3254
|
+
}), (e, t) => (w(), E(Ce, null, [T("div", Qn, [F(ue(Oe, null, null, 512), [[Je, D(d)]])]), T("div", {
|
|
3246
3255
|
style: { position: "relative" },
|
|
3247
3256
|
ref_key: "root",
|
|
3248
3257
|
ref: a
|
|
3249
|
-
}, [l.value ? (
|
|
3258
|
+
}, [l.value ? (w(), E("div", $n, O(l.value), 1)) : P("", !0)], 512)], 64));
|
|
3250
3259
|
}
|
|
3251
3260
|
}), nr = { ADD_CHARGE_WITH_GOOGLE_PAY: "ADD_CHARGE_WITH_GOOGLE_PAY" }, rr = (e) => ({ [nr.ADD_CHARGE_WITH_GOOGLE_PAY]: {
|
|
3252
3261
|
url: e + "/charge/token/google",
|
|
@@ -3310,7 +3319,7 @@ var Qn = { style: { position: "relative" } }, $n = {
|
|
|
3310
3319
|
this.validateOptions(e, n, r, i), this.setAmount(n), this.setCurrency(r);
|
|
3311
3320
|
let o = !1;
|
|
3312
3321
|
this.container = e;
|
|
3313
|
-
let s =
|
|
3322
|
+
let s = Me({
|
|
3314
3323
|
el: e,
|
|
3315
3324
|
component: tr,
|
|
3316
3325
|
props: {
|
|
@@ -3323,10 +3332,10 @@ var Qn = { style: { position: "relative" } }, $n = {
|
|
|
3323
3332
|
clickGate: this.getOnValidate.bind(this)
|
|
3324
3333
|
},
|
|
3325
3334
|
on: {
|
|
3326
|
-
activate:
|
|
3335
|
+
activate: z(this, "[GooglePay]: activate", () => {
|
|
3327
3336
|
o || (o = !0, this.log("[GooglePay]: activate googlepay form"));
|
|
3328
3337
|
}),
|
|
3329
|
-
complete:
|
|
3338
|
+
complete: z(this, "[GooglePay]: complete", (n) => {
|
|
3330
3339
|
this.log("[GooglePay]: complete", n);
|
|
3331
3340
|
let r = n.paymentMethodData.info.billingAddress, [o, ...s] = r?.name?.trim().split(/\s+/) ?? [], c = this.billingAddress ? {
|
|
3332
3341
|
line1: this.billingAddress.streetAddress,
|
|
@@ -3373,12 +3382,12 @@ var Qn = { style: { position: "relative" } }, $n = {
|
|
|
3373
3382
|
unitOfMeasure: e.unitOfMeasure
|
|
3374
3383
|
}))
|
|
3375
3384
|
} || void 0,
|
|
3376
|
-
metadata:
|
|
3385
|
+
metadata: G(i?.metadata)
|
|
3377
3386
|
};
|
|
3378
3387
|
this.fraudCheckAndCharge(e, t, l, a);
|
|
3379
3388
|
}),
|
|
3380
|
-
error:
|
|
3381
|
-
this.log("[GooglePay]: error", t),
|
|
3389
|
+
error: z(this, "[GooglePay]: error", (t) => {
|
|
3390
|
+
this.log("[GooglePay]: error", t), I(e, "Unable to pay with Google Pay"), this.failureCallback?.({
|
|
3382
3391
|
error: "Unable to pay with Google Pay",
|
|
3383
3392
|
body: t
|
|
3384
3393
|
});
|
|
@@ -3389,7 +3398,7 @@ var Qn = { style: { position: "relative" } }, $n = {
|
|
|
3389
3398
|
}
|
|
3390
3399
|
fraudCheckAndCharge(e, t, n, r) {
|
|
3391
3400
|
let i = (t, n) => {
|
|
3392
|
-
|
|
3401
|
+
I(e, t), this.failureCallback?.({
|
|
3393
3402
|
error: t,
|
|
3394
3403
|
...n && { errorDetails: { reason: n } }
|
|
3395
3404
|
});
|
|
@@ -3409,27 +3418,27 @@ var Qn = { style: { position: "relative" } }, $n = {
|
|
|
3409
3418
|
this.log("[addChargeWithGooglePay]", n), this.httpInvoker?.invoke(rr(this.apiUrl)[nr.ADD_CHARGE_WITH_GOOGLE_PAY].url, rr(this.apiUrl)[nr.ADD_CHARGE_WITH_GOOGLE_PAY].method, JSON.stringify(n), this.getSuccessAddChargeHandler(e).bind(this), this.getFailureAddChargeHandler(e).bind(this), { providerId: t });
|
|
3410
3419
|
}
|
|
3411
3420
|
getFailureAddChargeHandler(e) {
|
|
3412
|
-
return
|
|
3413
|
-
this.log("[GooglePay], failure", n),
|
|
3421
|
+
return z(this, "[GooglePay], failure", (t, n) => {
|
|
3422
|
+
this.log("[GooglePay], failure", n), I(e, "Unable to pay with Google Pay"), this.failureCallback?.({
|
|
3414
3423
|
error: "Unable to pay with Google Pay",
|
|
3415
3424
|
body: n
|
|
3416
3425
|
});
|
|
3417
3426
|
});
|
|
3418
3427
|
}
|
|
3419
3428
|
getSuccessAddChargeHandler(e) {
|
|
3420
|
-
return
|
|
3429
|
+
return z(this, "[GooglePay], success", (e, t) => {
|
|
3421
3430
|
let n = JSON.parse(t);
|
|
3422
3431
|
this.log("[GooglePay], success", n), this.successCallback?.({ transactionId: n.chargeId });
|
|
3423
3432
|
});
|
|
3424
3433
|
}
|
|
3425
3434
|
validateOptions(e, t, n, r) {
|
|
3426
|
-
if (!
|
|
3427
|
-
if (!
|
|
3428
|
-
if (!r.gateway) throw
|
|
3429
|
-
if (!r.googlePayGatewayMerchantId) throw
|
|
3435
|
+
if (!B(n)) throw I(e, "Invalid currency: " + n), TypeError("invalid currency: " + n);
|
|
3436
|
+
if (!j(t)) throw I(e, "Invalid amount: " + t), TypeError("invalid amount: " + t);
|
|
3437
|
+
if (!r.gateway) throw I(e, "Invalid gateway parameter"), TypeError("Invalid gateway parameter");
|
|
3438
|
+
if (!r.googlePayGatewayMerchantId) throw I(e, "Invalid gateway merchant id parameter"), TypeError("Invalid gateway merchant id parameter");
|
|
3430
3439
|
}
|
|
3431
3440
|
};
|
|
3432
|
-
|
|
3441
|
+
L([R], ir.prototype, "cleanUp", null), L([R], ir.prototype, "addGooglePay", null), L([R], ir.prototype, "addChargeWithGooglePay", null), L([R], ir.prototype, "getFailureAddChargeHandler", null), L([R], ir.prototype, "getSuccessAddChargeHandler", null), L([R], ir.prototype, "validateOptions", null);
|
|
3433
3442
|
// \0rolldown_dynamic_import_helper.js
|
|
3434
3443
|
var ar = (e, t, n) => {
|
|
3435
3444
|
let r = t.lastIndexOf("?"), i = e[r === -1 || r < t.lastIndexOf("/") ? t : t.slice(0, r)];
|
|
@@ -3495,7 +3504,7 @@ function vr() {
|
|
|
3495
3504
|
var yr = { style: { position: "relative" } }, br = {
|
|
3496
3505
|
key: 0,
|
|
3497
3506
|
class: "error text-normal"
|
|
3498
|
-
}, xr = /* @__PURE__ */
|
|
3507
|
+
}, xr = /* @__PURE__ */ k({
|
|
3499
3508
|
__name: "ApplePayForm",
|
|
3500
3509
|
props: {
|
|
3501
3510
|
log: { type: Function },
|
|
@@ -3515,7 +3524,7 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3515
3524
|
"cancel"
|
|
3516
3525
|
],
|
|
3517
3526
|
setup(e, { emit: t }) {
|
|
3518
|
-
let n = e, r = t, i = g(null), a = g(n.amount), o = g(n.currency), s = g(!0), c = g(""), l = !1, { isLoading: u } =
|
|
3527
|
+
let n = e, r = t, i = g(null), a = g(n.amount), o = g(n.currency), s = g(!0), c = g(""), l = !1, { isLoading: u } = W();
|
|
3519
3528
|
function d() {
|
|
3520
3529
|
if (n.log("[onApplePayButtonClicked]"), !ApplePaySession || n.clickGate()?.() === !1) return;
|
|
3521
3530
|
let e = fr(n.options, o.value, a.value), t = ur(n.options.applePayVersion);
|
|
@@ -3537,7 +3546,7 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3537
3546
|
l || (l = !0, window.google = null, vr().then(() => {
|
|
3538
3547
|
let e = document.createElement("apple-pay-button");
|
|
3539
3548
|
e.buttonstyle = "black", e.locale = "en-US", e.type = "buy", e.onclick = d, i.value?.appendChild(e), window.postMessage({
|
|
3540
|
-
status:
|
|
3549
|
+
status: Xe,
|
|
3541
3550
|
paymentMethod: "applepay"
|
|
3542
3551
|
}, "*");
|
|
3543
3552
|
}));
|
|
@@ -3545,15 +3554,15 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3545
3554
|
function p(e) {
|
|
3546
3555
|
e?.data?.status && (e.data.status === "activate" && e.data.component === "applepay" && (n.log?.(`[ApplePay]: message "${e.data.status}" received`, e.data), s.value = !0, r("activate"), f()), e.data.status === "deactivate" && e.data.component === "applepay" && (n.log?.(`[ApplePay]: message "${e.data.status}" received`, e.data), s.value = !1), e.data.status === "message" && e.data.component === "applepay" && (n.log?.(`[ApplePay]: message "${e.data.status}" received`, e.data), c.value = e.data.message), e.data.status === "error" && e.data.component === "applepay" && (n.log?.(`[ApplePay]: message "${e.data.status}" received`, e.data), c.value = e.data.error), e.data.status === "set-amount" && (n.log?.(`[ApplePay]: message "${e.data.status}" received`, e.data), a.value = Number(e.data.amount)), e.data.status === "set-currency" && (n.log?.(`[ApplePay]: message "${e.data.status}" received`, e.data), o.value = e.data.currency));
|
|
3547
3556
|
}
|
|
3548
|
-
return
|
|
3557
|
+
return Fe(() => {
|
|
3549
3558
|
window.removeEventListener("message", p);
|
|
3550
3559
|
}), m(() => {
|
|
3551
|
-
window.addEventListener("message", p),
|
|
3552
|
-
}), (e, t) => (
|
|
3560
|
+
window.addEventListener("message", p), ft(i.value, "payfurl-combined-container") || (s.value = !0, r("activate"), f());
|
|
3561
|
+
}), (e, t) => (w(), E(Ce, null, [T("div", yr, [F(ue(Oe, null, null, 512), [[Je, D(u)]])]), T("div", {
|
|
3553
3562
|
style: { position: "relative" },
|
|
3554
3563
|
ref_key: "root",
|
|
3555
3564
|
ref: i
|
|
3556
|
-
}, [c.value ? (
|
|
3565
|
+
}, [c.value ? (w(), E("div", br, O(c.value), 1)) : P("", !0)], 512)], 64));
|
|
3557
3566
|
}
|
|
3558
3567
|
}), Sr = {
|
|
3559
3568
|
VALIDATE_MERCHANT: "VALIDATE_MERCHANT",
|
|
@@ -3629,14 +3638,14 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3629
3638
|
this.validateOptions(e, n, r, i), this.setAmount(n), this.setCurrency(r);
|
|
3630
3639
|
let o = !1;
|
|
3631
3640
|
this.container = e;
|
|
3632
|
-
let s =
|
|
3641
|
+
let s = z(this, "[ApplePay][renderDefaultComponent]", () => {
|
|
3633
3642
|
this.log("[addApplePay], renderDefaultComponent", {
|
|
3634
3643
|
providerId: t,
|
|
3635
3644
|
amount: n,
|
|
3636
3645
|
currency: r,
|
|
3637
3646
|
options: i
|
|
3638
3647
|
});
|
|
3639
|
-
let s =
|
|
3648
|
+
let s = Me({
|
|
3640
3649
|
el: e,
|
|
3641
3650
|
component: xr,
|
|
3642
3651
|
props: {
|
|
@@ -3652,10 +3661,10 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3652
3661
|
activate: () => {
|
|
3653
3662
|
o || (o = !0, this.log("activate applepay form"));
|
|
3654
3663
|
},
|
|
3655
|
-
validateMerchant:
|
|
3664
|
+
validateMerchant: z(this, "[addApplePay], validateMerchant", (n, r) => {
|
|
3656
3665
|
this.log("[ApplePay]: validate", n), this.validateMerchant(e, t, n, r);
|
|
3657
3666
|
}),
|
|
3658
|
-
submit:
|
|
3667
|
+
submit: z(this, "[addApplePay], submit", (n, r) => {
|
|
3659
3668
|
this.log("[ApplePay]: complete", n);
|
|
3660
3669
|
let o = {
|
|
3661
3670
|
amount: this.amount,
|
|
@@ -3687,8 +3696,8 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3687
3696
|
};
|
|
3688
3697
|
this.fraudCheckAndCharge(e, t, o, r, a);
|
|
3689
3698
|
}),
|
|
3690
|
-
error:
|
|
3691
|
-
this.log("[ApplePay]: error", t),
|
|
3699
|
+
error: z(this, "[addApplePay], error", (t, n) => {
|
|
3700
|
+
this.log("[ApplePay]: error", t), I(e, "Unable to pay with ApplePay"), n.completePayment({
|
|
3692
3701
|
status: ApplePaySession.STATUS_FAILURE,
|
|
3693
3702
|
errors: [{
|
|
3694
3703
|
code: "unknown",
|
|
@@ -3699,13 +3708,13 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3699
3708
|
body: t
|
|
3700
3709
|
});
|
|
3701
3710
|
}),
|
|
3702
|
-
cancel:
|
|
3703
|
-
this.log("[ApplePay]: cancel"),
|
|
3711
|
+
cancel: z(this, "[addApplePay], calcel", () => {
|
|
3712
|
+
this.log("[ApplePay]: cancel"), I(e, "ApplePay canceled"), this.failureCallback?.({ error: "ApplePay canceled" });
|
|
3704
3713
|
})
|
|
3705
3714
|
}
|
|
3706
3715
|
});
|
|
3707
3716
|
this.destroy = s.destroy;
|
|
3708
|
-
}), c =
|
|
3717
|
+
}), c = z(this, "[ApplePay][renderCustomComponent]", (a) => {
|
|
3709
3718
|
this.log("[addApplePay], renderCustomComponent", {
|
|
3710
3719
|
providerId: t,
|
|
3711
3720
|
amount: n,
|
|
@@ -3719,7 +3728,7 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3719
3728
|
options: i,
|
|
3720
3729
|
clientParameters: i.clientParameters,
|
|
3721
3730
|
onValidate: this.getOnValidate.bind(this),
|
|
3722
|
-
onSuccess:
|
|
3731
|
+
onSuccess: z(this, "[addApplePay], success", (e) => {
|
|
3723
3732
|
this.log("[addApplePay], success", e), this.applePayButton?.hide();
|
|
3724
3733
|
let t = {
|
|
3725
3734
|
token: e.token,
|
|
@@ -3727,35 +3736,35 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3727
3736
|
};
|
|
3728
3737
|
e.clickToPayData && (t.clickToPayData = e.clickToPayData), this.successCallback?.(t);
|
|
3729
3738
|
}),
|
|
3730
|
-
onFailure:
|
|
3739
|
+
onFailure: z(this, "[addApplePay], failure", (e) => {
|
|
3731
3740
|
this.log("[addApplePay], failure", e), this.applePayButton?.redraw(), this.failureCallback?.({ error: e.error });
|
|
3732
3741
|
})
|
|
3733
3742
|
}), this.billingAddress && this.applePayButton?.setBillingAddress(this.billingAddress), this.customer && this.applePayButton?.setCustomerInfo(this.customer), this.order && this.applePayButton?.setOrderInfo(this.order), this.applePayButton?.draw(), window.postMessage({
|
|
3734
|
-
status:
|
|
3743
|
+
status: Xe,
|
|
3735
3744
|
paymentMethod: "applepay"
|
|
3736
3745
|
}, "*");
|
|
3737
3746
|
});
|
|
3738
3747
|
ar(/* #__PURE__ */ Object.assign({
|
|
3739
3748
|
"./applepay/ApplePayButton.interface.ts": () => import("./ApplePayButton.interface-BvRk9kiK.js"),
|
|
3740
3749
|
"./applepay/ApplePayButtonOptions.type.ts": () => import("./ApplePayButtonOptions.type-BvRk9kiK.js"),
|
|
3741
|
-
"./applepay/PayWayAppleButton.ts": () => import("./PayWayAppleButton-
|
|
3742
|
-
"./applepay/payway_rest.ts": () => import("./payway_rest-
|
|
3743
|
-
}), `./applepay/${i.providerType?.toLowerCase()}.ts`, 3).then(
|
|
3750
|
+
"./applepay/PayWayAppleButton.ts": () => import("./PayWayAppleButton-u5eH-Gev.js"),
|
|
3751
|
+
"./applepay/payway_rest.ts": () => import("./payway_rest-DvyvbsDG.js")
|
|
3752
|
+
}), `./applepay/${i.providerType?.toLowerCase()}.ts`, 3).then(z(this, "[localAddApplePay], then", (e) => {
|
|
3744
3753
|
this.log(`Loading ${i.providerType}...`, e), c(e);
|
|
3745
3754
|
})).catch(() => {
|
|
3746
3755
|
this.log(`Error loading ${i.providerType}`), s();
|
|
3747
3756
|
});
|
|
3748
3757
|
}
|
|
3749
3758
|
validateMerchant(e, t, n, r) {
|
|
3750
|
-
this.log("[validateMerchant]", n), this.httpInvoker?.invoke(Cr(this.apiUrl)[Sr.VALIDATE_MERCHANT].url, Cr(this.apiUrl)[Sr.VALIDATE_MERCHANT].method, JSON.stringify(n),
|
|
3759
|
+
this.log("[validateMerchant]", n), this.httpInvoker?.invoke(Cr(this.apiUrl)[Sr.VALIDATE_MERCHANT].url, Cr(this.apiUrl)[Sr.VALIDATE_MERCHANT].method, JSON.stringify(n), z(this, "[validateMerchant], success", (e, t) => {
|
|
3751
3760
|
try {
|
|
3752
3761
|
let e = JSON.parse(t);
|
|
3753
3762
|
this.log("[validateMerchant], success", e), r.completeMerchantValidation(e);
|
|
3754
3763
|
} catch (e) {
|
|
3755
3764
|
this.log("error parsing validateMerchant response", e);
|
|
3756
3765
|
}
|
|
3757
|
-
}),
|
|
3758
|
-
this.log("[validateMerchant], failure", n),
|
|
3766
|
+
}), z(this, "[validateMerchant], failure", (t, n) => {
|
|
3767
|
+
this.log("[validateMerchant], failure", n), I(e, "Unable to pay with ApplePay"), this.failureCallback?.({
|
|
3759
3768
|
error: "Unable to pay with ApplePay",
|
|
3760
3769
|
body: n
|
|
3761
3770
|
});
|
|
@@ -3763,7 +3772,7 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3763
3772
|
}
|
|
3764
3773
|
fraudCheckAndCharge(e, t, n, r, i) {
|
|
3765
3774
|
let a = (t, n) => {
|
|
3766
|
-
|
|
3775
|
+
I(e, t), r.completePayment({
|
|
3767
3776
|
status: ApplePaySession.STATUS_FAILURE,
|
|
3768
3777
|
errors: []
|
|
3769
3778
|
}), this.failureCallback?.({
|
|
@@ -3786,8 +3795,8 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3786
3795
|
this.log("[addChargeWithApplePay]", n), this.httpInvoker?.invoke(Cr(this.apiUrl)[Sr.ADD_CHARGE_WITH_APPLE_PAY].url, Cr(this.apiUrl)[Sr.ADD_CHARGE_WITH_APPLE_PAY].method, JSON.stringify(n), this.getSuccessAddChargeHandler(e, r).bind(this), this.getFailureAddChargeHandler(e, r).bind(this), { providerId: t });
|
|
3787
3796
|
}
|
|
3788
3797
|
getFailureAddChargeHandler(e, t) {
|
|
3789
|
-
return
|
|
3790
|
-
this.log("[ApplePay], failure", r),
|
|
3798
|
+
return z(this, "[getFailureAddChargeHandler]", (n, r) => {
|
|
3799
|
+
this.log("[ApplePay], failure", r), I(e, "Unable to pay with ApplePay"), t.completePayment({
|
|
3791
3800
|
status: ApplePaySession.STATUS_FAILURE,
|
|
3792
3801
|
errors: [{
|
|
3793
3802
|
code: "unknown",
|
|
@@ -3800,7 +3809,7 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3800
3809
|
});
|
|
3801
3810
|
}
|
|
3802
3811
|
getSuccessAddChargeHandler(e, t) {
|
|
3803
|
-
return
|
|
3812
|
+
return z(this, "[getSuccessAddChargeHandler]", (e, n) => {
|
|
3804
3813
|
let r = JSON.parse(n);
|
|
3805
3814
|
this.log("[ApplePay], success", r);
|
|
3806
3815
|
let i = {
|
|
@@ -3811,14 +3820,14 @@ var yr = { style: { position: "relative" } }, br = {
|
|
|
3811
3820
|
});
|
|
3812
3821
|
}
|
|
3813
3822
|
validateOptions(e, t, n, r) {
|
|
3814
|
-
if (!
|
|
3815
|
-
if (!
|
|
3816
|
-
if (!r.lineItemLabel) throw
|
|
3823
|
+
if (!B(n)) throw I(e, "Invalid currency: " + n), TypeError("invalid currency: " + n);
|
|
3824
|
+
if (!j(t)) throw I(e, "Invalid amount: " + t), TypeError("invalid amount: " + t);
|
|
3825
|
+
if (!r.lineItemLabel) throw I(e, "Invalid lineItemLabel parameter"), TypeError("Invalid lineItemLabel parameter");
|
|
3817
3826
|
}
|
|
3818
3827
|
};
|
|
3819
|
-
|
|
3828
|
+
L([R], wr.prototype, "cleanUp", null), L([R], wr.prototype, "addApplePay", null), L([R], wr.prototype, "validateMerchant", null), L([R], wr.prototype, "addChargeWithApplePay", null), L([R], wr.prototype, "getFailureAddChargeHandler", null), L([R], wr.prototype, "getSuccessAddChargeHandler", null), L([R], wr.prototype, "validateOptions", null);
|
|
3820
3829
|
// src/components/ApplePayIcon.vue
|
|
3821
|
-
var Tr = /*#__PURE__*/
|
|
3830
|
+
var Tr = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
3822
3831
|
__name: "ApplePayIcon",
|
|
3823
3832
|
props: {
|
|
3824
3833
|
size: {},
|
|
@@ -3826,12 +3835,12 @@ var Tr = /*#__PURE__*/ j(/* @__PURE__ */ D({
|
|
|
3826
3835
|
},
|
|
3827
3836
|
setup(e) {
|
|
3828
3837
|
let t = `--size: ${e.size}px`;
|
|
3829
|
-
return (e, n) => (
|
|
3838
|
+
return (e, n) => (w(), E("svg", {
|
|
3830
3839
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3831
3840
|
viewBox: "0 0 512 210.2",
|
|
3832
3841
|
"xml:space": "preserve",
|
|
3833
3842
|
style: t
|
|
3834
|
-
}, [...n[0] ||= [
|
|
3843
|
+
}, [...n[0] ||= [T("path", {
|
|
3835
3844
|
id: "XMLID_34_",
|
|
3836
3845
|
d: "M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9\n C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2\n c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7\n c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2\n C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z\n M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2\n c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8\n c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4\n l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5\n l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z\n "
|
|
3837
3846
|
}, null, -1)]]));
|
|
@@ -3867,25 +3876,25 @@ var Or = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csv
|
|
|
3867
3876
|
key: 3,
|
|
3868
3877
|
src: jr,
|
|
3869
3878
|
alt: "Discover"
|
|
3870
|
-
}, Lr = /*#__PURE__*/
|
|
3879
|
+
}, Lr = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
3871
3880
|
__name: "ClickToPayLogo",
|
|
3872
3881
|
props: { options: {} },
|
|
3873
3882
|
setup(e) {
|
|
3874
3883
|
let t = e, n = g(t.options.cardBrands || Er);
|
|
3875
|
-
return
|
|
3884
|
+
return oe(() => t, () => {
|
|
3876
3885
|
n.value = t.options.cardBrands || [];
|
|
3877
3886
|
}, {
|
|
3878
3887
|
flush: "post",
|
|
3879
3888
|
deep: !0
|
|
3880
|
-
}), (e, t) => (
|
|
3881
|
-
t[0] ||=
|
|
3889
|
+
}), (e, t) => (w(), E("div", Mr, [
|
|
3890
|
+
t[0] ||= T("img", {
|
|
3882
3891
|
src: "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20viewBox='0%204.1942%20233.76%20118.7958'%20width='233.76'%20height='118.7958'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23000000'%20d='%20M%200.00%20103.74%20L%200.00%2023.26%20Q%202.71%209.47%2014.47%205.49%20Q%2018.21%204.22%2025.63%204.29%20Q%2036.12%204.39%2046.57%204.28%20Q%2049.98%204.25%2051.32%204.95%20C%2054.47%206.62%2054.71%2012.27%2051.60%2014.18%20Q%2050.30%2014.99%2047.25%2015.02%20Q%2035.25%2015.14%2023.26%2015.04%20Q%2014.82%2014.97%2012.04%2021.22%20Q%2010.75%2024.12%2010.75%2032.47%20Q%2010.77%2064.65%2010.78%2096.84%20C%2010.79%20108.05%2013.62%20112.09%2024.83%20112.11%20Q%2044.80%20112.15%2064.75%20112.07%20C%2068.72%20112.05%2071.55%20109.52%2074.24%20106.26%20Q%2091.06%2085.85%20108.91%2064.44%20A%200.86%200.86%200.0%200%200%20108.91%2063.34%20Q%2088.54%2038.50%2067.91%2013.34%20C%2065.75%2010.71%2065.99%207.28%2068.57%205.40%20Q%2070.05%204.32%2073.59%204.32%20Q%2088.43%204.31%20103.25%204.33%20Q%20105.90%204.33%20107.17%205.80%20Q%20130.58%2032.79%20153.94%2059.81%20C%20156.70%2063.00%20155.25%2065.90%20152.73%2068.88%20Q%20134.57%2090.29%20116.24%20111.71%20A%200.35%200.35%200.0%200%200%20116.51%20112.29%20L%20132.44%20112.24%20A%201.43%201.43%200.0%200%200%20133.55%20111.71%20L%20172.96%2063.93%20A%200.83%200.83%200.0%200%200%20172.96%2062.87%20Q%20152.96%2038.50%20132.93%2014.07%20Q%20131.33%2012.10%20131.02%2010.69%20C%20130.23%207.08%20133.94%203.44%20137.37%204.33%20Q%20139.27%204.83%20141.51%207.48%20Q%20163.74%2033.77%20186.06%2059.98%20Q%20189.13%2063.58%20185.65%2067.66%20Q%20162.44%2094.91%20139.34%20121.71%20A%203.12%203.10%2020.2%200%201%20137.01%20122.78%20Q%20120.84%20122.82%20104.23%20122.76%20C%2097.72%20122.74%2097.24%20117.14%20100.66%20112.96%20Q%20120.69%2088.51%20140.71%2064.30%20A%200.99%200.99%200.0%200%200%20140.71%2063.04%20L%20101.46%2015.56%20A%201.23%201.23%200.0%200%200%20100.51%2015.11%20L%2084.28%2015.01%20A%200.39%200.39%200.0%200%200%2083.98%2015.65%20Q%20102.93%2037.75%20121.70%2059.56%20C%20125.42%2063.89%20122.26%2066.94%20118.90%2070.92%20Q%2099.67%2093.66%2080.30%20116.30%20Q%2077.34%20119.77%2072.30%20121.55%20Q%2068.93%20122.74%2063.06%20122.75%20Q%2042.72%20122.77%2022.39%20122.77%20C%2010.50%20122.77%202.31%20115.51%200.00%20103.74%20Z'%20transform='matrix(1,%200,%200,%201,%20-3.552713678800501e-15,%200)'/%3e%3crect%20fill='%23000000'%20x='228.78'%20y='4.23'%20width='4.98'%20height='118.76'%20rx='2.41'%20transform='matrix(1,%200,%200,%201,%20-3.552713678800501e-15,%200)'/%3e%3c/svg%3e",
|
|
3883
3892
|
alt: "Click To Pay"
|
|
3884
3893
|
}, null, -1),
|
|
3885
|
-
n.value.includes(
|
|
3886
|
-
n.value.includes(
|
|
3887
|
-
n.value.includes(
|
|
3888
|
-
n.value.includes(
|
|
3894
|
+
n.value.includes(D(X).mastercard) ? (w(), E("img", Nr)) : P("", !0),
|
|
3895
|
+
n.value.includes(D(X).visa) ? (w(), E("img", Pr)) : P("", !0),
|
|
3896
|
+
n.value.includes(D(X).amex) ? (w(), E("img", Fr)) : P("", !0),
|
|
3897
|
+
n.value.includes(D(X).discover) ? (w(), E("img", Ir)) : P("", !0)
|
|
3889
3898
|
]));
|
|
3890
3899
|
}
|
|
3891
3900
|
}), [["__scopeId", "data-v-c2abe5c3"]]), Rr = { style: {
|
|
@@ -3897,7 +3906,7 @@ var Or = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csv
|
|
|
3897
3906
|
}, Wr = { class: "row" }, Gr = { style: { width: "100%" } }, Kr = {
|
|
3898
3907
|
key: 0,
|
|
3899
3908
|
class: "error"
|
|
3900
|
-
}, qr = /*#__PURE__*/
|
|
3909
|
+
}, qr = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
3901
3910
|
__name: "LoginForm",
|
|
3902
3911
|
props: {
|
|
3903
3912
|
log: { type: Function },
|
|
@@ -3911,7 +3920,7 @@ var Or = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csv
|
|
|
3911
3920
|
setup(e, { emit: t }) {
|
|
3912
3921
|
let n = e, r = t, i = g(""), a = g(""), o = g({});
|
|
3913
3922
|
function s() {
|
|
3914
|
-
return o.value = {}, !a.value && !
|
|
3923
|
+
return o.value = {}, !a.value && !Ve(i.value) && (o.value.email = "Please type valid email address"), a.value && !Ie(a.value) && (o.value.phone = "Please type phone in international format"), Object.keys(o.value).length === 0;
|
|
3915
3924
|
}
|
|
3916
3925
|
function c() {
|
|
3917
3926
|
s() && r("submit", {
|
|
@@ -3925,25 +3934,25 @@ var Or = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csv
|
|
|
3925
3934
|
function u() {
|
|
3926
3935
|
r("logout");
|
|
3927
3936
|
}
|
|
3928
|
-
return (e, t) => (
|
|
3937
|
+
return (e, t) => (w(), v(xn, {
|
|
3929
3938
|
width: "350",
|
|
3930
3939
|
onClose: l
|
|
3931
3940
|
}, {
|
|
3932
|
-
title:
|
|
3933
|
-
body:
|
|
3941
|
+
title: pe(() => [T("div", Rr, [ue(Lr, { options: n.options }, null, 8, ["options"]), t[2] ||= y(" Click To Pay Login ", -1)])]),
|
|
3942
|
+
body: pe(() => [T("div", zr, [T("div", Br, [T("div", Vr, [t[3] ||= T("label", null, "Email Address", -1), T("div", Hr, [F(T("input", {
|
|
3934
3943
|
type: "text",
|
|
3935
3944
|
maxlength: "100",
|
|
3936
3945
|
placeholder: "Email Address",
|
|
3937
3946
|
name: "email",
|
|
3938
3947
|
"onUpdate:modelValue": t[0] ||= (e) => i.value = e
|
|
3939
|
-
}, null, 512), [[
|
|
3948
|
+
}, null, 512), [[ye, i.value]]), o.value.email ? (w(), E("p", Ur, O(o.value.email), 1)) : P("", !0)])]), T("div", Wr, [t[4] ||= T("label", null, "Phone", -1), T("div", Gr, [F(T("input", {
|
|
3940
3949
|
type: "text",
|
|
3941
3950
|
maxlength: "100",
|
|
3942
3951
|
placeholder: "Phone",
|
|
3943
3952
|
name: "phone",
|
|
3944
3953
|
"onUpdate:modelValue": t[1] ||= (e) => a.value = e
|
|
3945
|
-
}, null, 512), [[
|
|
3946
|
-
footer:
|
|
3954
|
+
}, null, 512), [[ye, a.value]]), o.value.phone ? (w(), E("p", Kr, O(o.value.phone), 1)) : P("", !0)])])])])]),
|
|
3955
|
+
footer: pe(() => [T("div", { class: "payfurl-form payfurl-form-footer" }, [T("button", { onClick: u }, "Continue as Guest"), T("button", { onClick: c }, "Login")])]),
|
|
3947
3956
|
_: 1
|
|
3948
3957
|
}));
|
|
3949
3958
|
}
|
|
@@ -3958,7 +3967,7 @@ var Or = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csv
|
|
|
3958
3967
|
];
|
|
3959
3968
|
function Yr(e, n) {
|
|
3960
3969
|
if (n === t.PRODUCTION || !Jr.includes(e)) return null;
|
|
3961
|
-
switch (
|
|
3970
|
+
switch (De(e)) {
|
|
3962
3971
|
case "visa": return {
|
|
3963
3972
|
cardNumber: "4622943123103732",
|
|
3964
3973
|
expiryDate: "12/25",
|
|
@@ -3990,7 +3999,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
3990
3999
|
sdk: "https://src.mastercard.com/sdk/srcsdk.mastercard.js",
|
|
3991
4000
|
lib: "https://src.mastercard.com/srci/integration/2/lib.js?srcDpaId={dpaId}&locale=en_AU"
|
|
3992
4001
|
}
|
|
3993
|
-
}, Z = class extends
|
|
4002
|
+
}, Z = class extends Ut {
|
|
3994
4003
|
enabled = !0;
|
|
3995
4004
|
initialized = !1;
|
|
3996
4005
|
loaded = !1;
|
|
@@ -4024,7 +4033,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4024
4033
|
visibilityObserver = null;
|
|
4025
4034
|
constructor(e, n) {
|
|
4026
4035
|
super(e), this.options = n.options || {}, this.container = n.container || document.body, this.environment = n.environment || t.DEVELOPMENT;
|
|
4027
|
-
let r =
|
|
4036
|
+
let r = Wt(this.environment);
|
|
4028
4037
|
this.options.networkTokenOptions = {
|
|
4029
4038
|
...r,
|
|
4030
4039
|
...this.options.networkTokenOptions || {}
|
|
@@ -4094,7 +4103,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4094
4103
|
let t = this.getCardFormFrame();
|
|
4095
4104
|
if (t) try {
|
|
4096
4105
|
t.contentWindow?.postMessage({
|
|
4097
|
-
status:
|
|
4106
|
+
status: we,
|
|
4098
4107
|
cards: e
|
|
4099
4108
|
}, "*");
|
|
4100
4109
|
} catch (e) {
|
|
@@ -4103,7 +4112,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4103
4112
|
else this.log("[setCards] iframe not found");
|
|
4104
4113
|
}
|
|
4105
4114
|
isSchemeSupported(e) {
|
|
4106
|
-
return this.availableCardBrands.includes(
|
|
4115
|
+
return this.availableCardBrands.includes(De(e));
|
|
4107
4116
|
}
|
|
4108
4117
|
messageHandler(e) {
|
|
4109
4118
|
e?.data?.status && (e.data.status === "click2pay-remember-me" ? (this.log(`[clickToPayProcessor]: message "${e.data.status}" received`, e.data), this.setRememberMe(!!e.data.message)) : (e.data.status === "click2pay-change-user" && (this.log(`[clickToPayProcessor]: message "${e.data.status}" received`, e.data), this.showChangeUserPopup()), e.data.status === "click2pay-show-learn-more" && (this.log(`[clickToPayProcessor]: message "${e.data.status}" received`, e.data), this.mcShowLearnMore())));
|
|
@@ -4134,9 +4143,9 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4134
4143
|
return;
|
|
4135
4144
|
}
|
|
4136
4145
|
let t = document.createElement("script");
|
|
4137
|
-
t.src = e, t.onload =
|
|
4146
|
+
t.src = e, t.onload = z(this, "[ClickToPayProcessor]: CheckoutServiceLib loaded", () => {
|
|
4138
4147
|
this.log("[ClickToPayProcessor]: CheckoutServiceLib loaded"), this.mcInitClickToPay();
|
|
4139
|
-
}), t.onerror =
|
|
4148
|
+
}), t.onerror = z(this, "[ClickToPayProcessor]: CheckoutServiceLib error", (t) => {
|
|
4140
4149
|
this.log("[ClickToPayProcessor]: CheckoutServiceLib error", t), this.sendErrorNotification("CheckoutServiceLib error", [e, t]), this.stopUsing();
|
|
4141
4150
|
}), document.head.appendChild(t);
|
|
4142
4151
|
}
|
|
@@ -4254,7 +4263,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4254
4263
|
mcShowOtpInput(e, t, n) {
|
|
4255
4264
|
this.log("[mcShowOtpInput]", this.requestedValidationChannelId, e, t, n);
|
|
4256
4265
|
let r = this;
|
|
4257
|
-
customElements.whenDefined("src-otp-input").then(
|
|
4266
|
+
customElements.whenDefined("src-otp-input").then(z(this, "[mcShowOtpInput], success", () => {
|
|
4258
4267
|
let i = e.find((e) => e.identityType === "SMS"), a = e.find((e) => e.identityType === "EMAIL"), o = [];
|
|
4259
4268
|
this.requestedValidationChannelId && this.requestedValidationChannelId !== "EMAIL" || !a || this.requestedValidationChannelId != "EMAIL" && (this.requestedValidationChannelId || t !== "visa") || o.push(a.maskedValidationChannel), (!this.requestedValidationChannelId || this.requestedValidationChannelId === "SMS") && i && o.push(i.maskedValidationChannel), this.log("[src-otp-input], mcShowOtpInput", r.srcOtpInput, e, t, o, n), r.srcOtpInput.loadSupportedValidationChannels?.(e), r.srcOtpInput.setAttribute("network-id", t), r.srcOtpInput.setAttribute("card-brands", t), r.srcOtpInput.setAttribute("masked-identity-value", o.join(",")), n ? r.srcOtpInput.setAttribute("error-reason", n) : r.srcOtpInput.removeAttribute("error-reason"), r.srcOtpInput.style.display = "block", r.adjustRememberMeOnOtpInput(), r.pauseLoadingCardForm();
|
|
4260
4269
|
})).catch((e) => {
|
|
@@ -4281,7 +4290,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4281
4290
|
this.showLoginForm();
|
|
4282
4291
|
}
|
|
4283
4292
|
showLoginForm() {
|
|
4284
|
-
let { destroy: e } =
|
|
4293
|
+
let { destroy: e } = Me({
|
|
4285
4294
|
el: document.body,
|
|
4286
4295
|
component: qr,
|
|
4287
4296
|
props: {
|
|
@@ -4289,10 +4298,10 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4289
4298
|
options: this.options
|
|
4290
4299
|
},
|
|
4291
4300
|
on: {
|
|
4292
|
-
close:
|
|
4301
|
+
close: z(this, "[showLoginForm], onclose", () => {
|
|
4293
4302
|
this.log("[LoginForm.close]"), this.stopLoadingCardForm(), e();
|
|
4294
4303
|
}),
|
|
4295
|
-
submit:
|
|
4304
|
+
submit: z(this, "[showLoginForm], onsubmit", ({ email: t, phone: n }) => {
|
|
4296
4305
|
this.log("[LoginForm.submit]", t, n), e(), this.customer || this.setCustomerInfo({
|
|
4297
4306
|
firstName: "",
|
|
4298
4307
|
lastName: "",
|
|
@@ -4300,7 +4309,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4300
4309
|
phoneNumber: ""
|
|
4301
4310
|
}), this.customer.email = t, this.customer.phoneNumber = n, !t && !n ? this.stopLoadingCardForm() : (this.setCards([]), this.mcIdLookup(!1, ++this.run));
|
|
4302
4311
|
}),
|
|
4303
|
-
logout:
|
|
4312
|
+
logout: z(this, "[showLoginForm], onlogout", () => {
|
|
4304
4313
|
this.log("[LoginForm.logout]"), e(), this.stopLoadingCardForm(), this.setCards([]), this.mcLogout();
|
|
4305
4314
|
})
|
|
4306
4315
|
}
|
|
@@ -4308,9 +4317,9 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4308
4317
|
}
|
|
4309
4318
|
checkoutWithCard(e, t, n) {
|
|
4310
4319
|
this.log("ClickToPayProcessor.checkoutWithExistingCard", e);
|
|
4311
|
-
let r = this, i =
|
|
4320
|
+
let r = this, i = z(this, "[checkoutWithCard.promiseResolvedHandler]", (e) => {
|
|
4312
4321
|
r.log("[checkoutWithCard.promiseResolvedHandler]", e), r.hideModalForm(), t(e);
|
|
4313
|
-
}), a =
|
|
4322
|
+
}), a = z(this, "[checkoutWithCard.promiseRejectedHandler]", (t) => {
|
|
4314
4323
|
r.log("[checkoutWithCard.promiseRejectedHandler]", t), r.stopUsing(), r.showInfoMessage(Qr), n(t), r.sendErrorNotification("checkoutWithCard error", [
|
|
4315
4324
|
e,
|
|
4316
4325
|
o,
|
|
@@ -4332,11 +4341,11 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4332
4341
|
expiryDate: t,
|
|
4333
4342
|
ccv: "***",
|
|
4334
4343
|
enrollCard: i
|
|
4335
|
-
}), this.tokenAuthenticationEnabled && this.showModalForm(), this.encryptCard(e, t, n,
|
|
4344
|
+
}), this.tokenAuthenticationEnabled && this.showModalForm(), this.encryptCard(e, t, n, z(this, "[mcEncryptCard], success", (e, t) => {
|
|
4336
4345
|
this.checkoutWithEncryptedNewCard(e, t, (e) => {
|
|
4337
4346
|
a(e);
|
|
4338
4347
|
}, o);
|
|
4339
|
-
}),
|
|
4348
|
+
}), z(this, "[mcEncryptCard], error", (n) => {
|
|
4340
4349
|
o(n), this.sendErrorNotification("mcEncryptCard error", [{
|
|
4341
4350
|
cardNumber: e,
|
|
4342
4351
|
expiryDate: t,
|
|
@@ -4345,9 +4354,9 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4345
4354
|
}));
|
|
4346
4355
|
}
|
|
4347
4356
|
checkoutWithEncryptedNewCard(e, t, n, r) {
|
|
4348
|
-
let i = this, a =
|
|
4357
|
+
let i = this, a = z(this, "[checkoutWithNewCard.promiseResolvedHandler]", (e) => {
|
|
4349
4358
|
i.log("[checkoutWithNewCard.promiseResolvedHandler]", e), i.hideModalForm(), e.checkoutActionCode === "SWITCH_CONSUMER" ? i.showLoginForm() : ["CHANGE_CARD", "CANCEL"].includes(e.checkoutActionCode) || n(e);
|
|
4350
|
-
}), o =
|
|
4359
|
+
}), o = z(this, "[checkoutWithNewCard.promiseRejectedHandler]", (e) => {
|
|
4351
4360
|
i.log("[checkoutWithNewCard.promiseRejectedHandler]", e), i.stopUsing(), i.showInfoMessage(Qr), r(e), i.sendErrorNotification("checkoutWithNewCard error", [s, e]);
|
|
4352
4361
|
});
|
|
4353
4362
|
this.showModalForm();
|
|
@@ -4374,9 +4383,9 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4374
4383
|
this.log("[mcInitClickToPay] mcCheckoutService or sdk not found", window.MastercardCheckoutServices, window.SRCSDK_MASTERCARD), this.stopUsing();
|
|
4375
4384
|
return;
|
|
4376
4385
|
}
|
|
4377
|
-
let e = this, t =
|
|
4386
|
+
let e = this, t = z(this, "[mcInitClickToPay.promiseResolvedHandler]", (t) => {
|
|
4378
4387
|
e.log("[mcInitClickToPay.promiseResolvedHandler]", t), e.updateAvailableCardBrands(t.availableCardBrands), e.loaded = !0, e.resolveReadyCallbacks(), e.localStartCallback && e.localStartCallback();
|
|
4379
|
-
}), n =
|
|
4388
|
+
}), n = z(this, "[mcInitClickToPay.promiseRejectedHandler]", (t) => {
|
|
4380
4389
|
e.log("[mcInitClickToPay.promiseRejectedHandler]", t), e.loaded = !0, e.sendErrorNotification("mcInitClickToPay error", [r, t]), e.stopUsing();
|
|
4381
4390
|
}), r = {
|
|
4382
4391
|
srcDpaId: this.options.dpaId,
|
|
@@ -4393,9 +4402,9 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4393
4402
|
return;
|
|
4394
4403
|
}
|
|
4395
4404
|
this.customer?.email || (t = !0);
|
|
4396
|
-
let r = this, i =
|
|
4405
|
+
let r = this, i = z(this, "[mcIdLookup.promiseResolvedHandler]", (e) => {
|
|
4397
4406
|
r.log("[mcIdLookup.promiseResolvedHandler]", e), n === r.run && (e.consumerPresent ? r.initiateValidationWhenVisible(n) : !e.consumerPresent && !t && r.customer?.phoneNumber ? r.mcIdLookup(!0, n) : r.stopLoadingCardForm());
|
|
4398
|
-
}), a =
|
|
4407
|
+
}), a = z(this, "[mcIdLookup.promiseRejectedHandler]", (e) => {
|
|
4399
4408
|
r.log("[mcIdLookup.promiseRejectedHandler]", e), r.stopLoadingCardForm(), r.sendErrorNotification("mcIdLookup error", [s, e]), r.stopUsing();
|
|
4400
4409
|
}), o = e(this.customer?.phoneNumber || ""), s = t ? { mobileNumber: {
|
|
4401
4410
|
phoneNumber: o[1] || "",
|
|
@@ -4405,7 +4414,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4405
4414
|
}
|
|
4406
4415
|
initiateValidationWhenVisible(e) {
|
|
4407
4416
|
let t = this.container;
|
|
4408
|
-
t.getClientRects().length > 0 || typeof IntersectionObserver > "u" ? this.mcInitiateValidation() : (this.stopWaitingForVisibility(), this.visibilityObserver = new IntersectionObserver(
|
|
4417
|
+
t.getClientRects().length > 0 || typeof IntersectionObserver > "u" ? this.mcInitiateValidation() : (this.stopWaitingForVisibility(), this.visibilityObserver = new IntersectionObserver(z(this, "[initiateValidationWhenVisible]", (t) => {
|
|
4409
4418
|
t.some((e) => e.isIntersecting) && (this.stopWaitingForVisibility(), e === this.run && this.mcInitiateValidation());
|
|
4410
4419
|
})), this.visibilityObserver.observe(t));
|
|
4411
4420
|
}
|
|
@@ -4413,7 +4422,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4413
4422
|
this.log("[mcInitiateValidation]", e);
|
|
4414
4423
|
let t = this;
|
|
4415
4424
|
this.requestedValidationChannelId = e || "";
|
|
4416
|
-
let n =
|
|
4425
|
+
let n = z(this, "[mcInitiateValidation.promiseResolvedHandler]", (e) => {
|
|
4417
4426
|
t.log("[mcInitiateValidation.promiseResolvedHandler]", e), t.supportedValidationChannels = e.supportedValidationChannels, t.validationChannelsNetwork = e.network, e.maskedValidationChannel && (!t.supportedValidationChannels || t.supportedValidationChannels.length === 0) && (t.supportedValidationChannels = [], (e.maskedValidationChannel.split(",") || []).forEach((e) => {
|
|
4418
4427
|
t.supportedValidationChannels.push({
|
|
4419
4428
|
maskedValidationChannel: e,
|
|
@@ -4421,16 +4430,16 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4421
4430
|
validationChannelId: e.includes("@") ? "EMAIL" : "SMS"
|
|
4422
4431
|
});
|
|
4423
4432
|
})), t.mcShowOtpInput(t.supportedValidationChannels, e.network);
|
|
4424
|
-
}), r =
|
|
4433
|
+
}), r = z(this, "[mcInitiateValidation.promiseRejectedHandler]", (n) => {
|
|
4425
4434
|
t.log("[mcInitiateValidation.promiseRejectedHandler]", n), t.stopUsing(), t.sendErrorNotification("mcInitiateValidation error", [{ requestedValidationChannelId: e }, n]);
|
|
4426
4435
|
});
|
|
4427
4436
|
this.log("[mcInitiateValidation]", e ? { requestedValidationChannelId: e } : null), window.mcCheckoutService.initiateValidation(e ? { requestedValidationChannelId: e } : void 0).then(n).catch(r);
|
|
4428
4437
|
}
|
|
4429
4438
|
mcValidate(e) {
|
|
4430
4439
|
try {
|
|
4431
|
-
let t = this, n =
|
|
4440
|
+
let t = this, n = z(this, "[mcValidate.promiseResolvedHandler]", (e) => {
|
|
4432
4441
|
t.log("[mcValidate.promiseResolvedHandler]", e), e.cards ? (t.setCards(e.cards), t.stopLoadingCardForm()) : t.mcGetCards(), t.saveRecognitionToken(e.recognitionToken);
|
|
4433
|
-
}), r =
|
|
4442
|
+
}), r = z(this, "[mcValidate.promiseRejectedHandler]", (e) => {
|
|
4434
4443
|
t.log("[mcValidate.promiseRejectedHandler]", e), t.sendErrorNotification("mcValidate error", [{ recognitionTokenRequested: i.recognitionTokenRequested }, e]), t.attempts++, t.attempts > 2 || !e?.reason || e.reason == "REQUEST_TIMEOUT" ? (t.stopLoadingCardForm(), t.showMessage("Too many attempts to access your click to pay profile. Please check out as a guest.")) : e.reason === "CODE_INVALID" || e.reason === "RETRIES_EXCEEDED" || e.reason === "ACCT_INACCESSIBLE" || e.reason === "CODE_EXPIRED" ? t.mcShowOtpInput(t.supportedValidationChannels, t.validationChannelsNetwork, e.reason) : (t.stopUsing(), t.showInfoMessage(Qr));
|
|
4435
4444
|
}), i = {
|
|
4436
4445
|
value: e,
|
|
@@ -4444,25 +4453,25 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4444
4453
|
runClickToPay() {
|
|
4445
4454
|
let e = this, t = ++this.run;
|
|
4446
4455
|
this.lookedUp.add(Zr(this.customer));
|
|
4447
|
-
let n =
|
|
4456
|
+
let n = z(this, "[runClickToPay.promiseResolvedHandler]", (n) => {
|
|
4448
4457
|
e.log("[runClickToPay.promiseResolvedHandler]", n), t === e.run && (!n || !n.length ? e.mcIdLookup(!1, t) : (e.setCards(n), e.stopLoadingCardForm()));
|
|
4449
|
-
}), r =
|
|
4458
|
+
}), r = z(this, "[runClickToPay.promiseRejectedHandler]", (t) => {
|
|
4450
4459
|
e.log("[runClickToPay.promiseRejectedHandler]", t), e.stopUsing(), e.stopLoadingCardForm(), e.sendErrorNotification("mcCheckoutService.getCards error", [t]);
|
|
4451
4460
|
});
|
|
4452
4461
|
this.log("[runClickToPay]"), window.mcCheckoutService.getCards().then(n).catch(r);
|
|
4453
4462
|
}
|
|
4454
4463
|
mcGetCards() {
|
|
4455
|
-
let e = this, t =
|
|
4464
|
+
let e = this, t = z(this, "[getCards.promiseResolvedHandler]", (t) => {
|
|
4456
4465
|
e.log("[getCards.promiseResolvedHandler]", t), e.setCards(t), e.stopLoadingCardForm();
|
|
4457
|
-
}), n =
|
|
4466
|
+
}), n = z(this, "[getCards.promiseRejectedHandler]", (t) => {
|
|
4458
4467
|
e.log("[getCards.promiseRejectedHandler]", t), e.stopLoadingCardForm(), e.stopUsing(), e.sendErrorNotification("getCards error", [t]);
|
|
4459
4468
|
});
|
|
4460
4469
|
this.log("[getCards]"), window.mcCheckoutService.getCards().then(t).catch(n);
|
|
4461
4470
|
}
|
|
4462
4471
|
mcEncryptCard(e, t, n, r, i) {
|
|
4463
|
-
let a = this, o =
|
|
4472
|
+
let a = this, o = z(this, "[encryptCard.promiseResolvedHandler]", (e) => {
|
|
4464
4473
|
a.log("[encryptCard.promiseResolvedHandler]", e), r(e.encryptedCard, e.cardBrand);
|
|
4465
|
-
}), s =
|
|
4474
|
+
}), s = z(this, "[encryptCard.promiseResolvedHandler]", (e) => {
|
|
4466
4475
|
a.log("[encryptCard.promiseResolvedHandler]", e), i(e), a.sendErrorNotification("encryptCard error", [l, e]);
|
|
4467
4476
|
}), c = t.split("/"), l = {
|
|
4468
4477
|
primaryAccountNumber: e,
|
|
@@ -4479,7 +4488,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4479
4488
|
this.log("[ClickToPayProcessor]: stop using Click To Pay"), this.enabled = !1, this.cleanUp(this.container);
|
|
4480
4489
|
let e = this.getCardFormFrame();
|
|
4481
4490
|
if (e) try {
|
|
4482
|
-
e.contentWindow?.postMessage({ status:
|
|
4491
|
+
e.contentWindow?.postMessage({ status: Ee }, "*"), e.contentWindow?.postMessage({ status: he }, "*");
|
|
4483
4492
|
} catch (e) {
|
|
4484
4493
|
this.log("[stopUsing] iframe error", e);
|
|
4485
4494
|
}
|
|
@@ -4489,7 +4498,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4489
4498
|
let t = this.getCardFormFrame();
|
|
4490
4499
|
if (t) try {
|
|
4491
4500
|
t.contentWindow?.postMessage({
|
|
4492
|
-
status:
|
|
4501
|
+
status: ke,
|
|
4493
4502
|
availableCardBrands: e
|
|
4494
4503
|
}, "*");
|
|
4495
4504
|
} catch (e) {
|
|
@@ -4513,7 +4522,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4513
4522
|
return e.length === 2 && e.pop().split(";").shift() || "";
|
|
4514
4523
|
}
|
|
4515
4524
|
sendErrorNotification(e, t) {
|
|
4516
|
-
|
|
4525
|
+
it("[ClickToPayProcessor]", e, t);
|
|
4517
4526
|
}
|
|
4518
4527
|
generateDpaTransactionOptions() {
|
|
4519
4528
|
let e = {
|
|
@@ -4546,7 +4555,7 @@ var Xr = 1e3, Zr = (e) => `${(e?.email || "").trim().toLowerCase()}|${e?.phoneNu
|
|
|
4546
4555
|
return t;
|
|
4547
4556
|
}
|
|
4548
4557
|
};
|
|
4549
|
-
|
|
4558
|
+
L([R], Z.prototype, "setContainer", null), L([R], Z.prototype, "setCustomerInfo", null), L([R], Z.prototype, "setCards", null), L([R], Z.prototype, "isSchemeSupported", null), L([R], Z.prototype, "messageHandler", null), L([R], Z.prototype, "init", null), L([R], Z.prototype, "cleanUp", null), L([R], Z.prototype, "start", null), L([R], Z.prototype, "initCheckoutServiceLib", null), L([R], Z.prototype, "initScripts", null), L([R], Z.prototype, "initCss", null), L([R], Z.prototype, "createOtpInput", null), L([R], Z.prototype, "attachOtpInput", null), L([R], Z.prototype, "createLearnMore", null), L([R], Z.prototype, "createModalForm", null), L([R], Z.prototype, "showModalForm", null), L([R], Z.prototype, "hideModalForm", null), L([R], Z.prototype, "mcHideOtpInput", null), L([R], Z.prototype, "mcShowOtpInput", null), L([R], Z.prototype, "adjustRememberMeOnOtpInput", null), L([R], Z.prototype, "mcHideLearnMore", null), L([R], Z.prototype, "mcShowLearnMore", null), L([R], Z.prototype, "showChangeUserPopup", null), L([R], Z.prototype, "showLoginForm", null), L([R], Z.prototype, "checkoutWithCard", null), L([R], Z.prototype, "checkoutWithNewCard", null), L([R], Z.prototype, "checkoutWithEncryptedNewCard", null), L([R], Z.prototype, "encryptCard", null), L([R], Z.prototype, "mcLogout", null), L([R], Z.prototype, "mcInitClickToPay", null), L([R], Z.prototype, "mcIdLookup", null), L([R], Z.prototype, "mcInitiateValidation", null), L([R], Z.prototype, "runClickToPay", null), L([R], Z.prototype, "mcGetCards", null), L([R], Z.prototype, "mcEncryptCard", null), L([R], Z.prototype, "stopUsing", null), L([R], Z.prototype, "updateAvailableCardBrands", null), L([R], Z.prototype, "getLibUrl", null), L([R], Z.prototype, "saveRecognitionToken", null), L([R], Z.prototype, "getRecognitionToken", null), L([R], Z.prototype, "sendErrorNotification", null), L([R], Z.prototype, "generateDpaTransactionOptions", null), L([R], Z.prototype, "generateConsumerInfo", null);
|
|
4550
4559
|
// src/sdk/types/PaymentMethodInfo.type.ts
|
|
4551
4560
|
var ei;
|
|
4552
4561
|
(function(e) {
|
|
@@ -4556,7 +4565,7 @@ var ei;
|
|
|
4556
4565
|
var ti = {
|
|
4557
4566
|
key: 0,
|
|
4558
4567
|
class: "payment-method-info"
|
|
4559
|
-
}, ni = ["src", "alt"], ri = { class: "payment-method-details" }, ii = { class: "payment-method-details-name" }, ai = { key: 0 }, oi = { key: 1 }, si = { key: 2 }, ci = /*#__PURE__*/
|
|
4568
|
+
}, ni = ["src", "alt"], ri = { class: "payment-method-details" }, ii = { class: "payment-method-details-name" }, ai = { key: 0 }, oi = { key: 1 }, si = { key: 2 }, ci = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
4560
4569
|
__name: "PaymentMethod",
|
|
4561
4570
|
props: {
|
|
4562
4571
|
log: { type: Function },
|
|
@@ -4565,7 +4574,7 @@ var ti = {
|
|
|
4565
4574
|
},
|
|
4566
4575
|
setup(e) {
|
|
4567
4576
|
let t = e, n = g(t.paymentMethod);
|
|
4568
|
-
|
|
4577
|
+
oe(() => t.paymentMethod, () => {
|
|
4569
4578
|
n.value = t.paymentMethod;
|
|
4570
4579
|
}, { flush: "post" });
|
|
4571
4580
|
function r() {
|
|
@@ -4609,34 +4618,34 @@ var ti = {
|
|
|
4609
4618
|
default: return "Unknown";
|
|
4610
4619
|
}
|
|
4611
4620
|
}
|
|
4612
|
-
return
|
|
4621
|
+
return oe(() => t.paymentMethod, () => {
|
|
4613
4622
|
n.value = t.paymentMethod;
|
|
4614
|
-
}, { flush: "post" }), (e, t) => n.value ? (
|
|
4623
|
+
}, { flush: "post" }), (e, t) => n.value ? (w(), E("div", ti, [T("img", {
|
|
4615
4624
|
src: i(),
|
|
4616
4625
|
alt: r()
|
|
4617
|
-
}, null, 8, ni),
|
|
4618
|
-
|
|
4619
|
-
n.value.type ===
|
|
4620
|
-
|
|
4621
|
-
t[0] ||=
|
|
4622
|
-
|
|
4623
|
-
])) :
|
|
4624
|
-
n.value.type ===
|
|
4625
|
-
|
|
4626
|
-
t[1] ||=
|
|
4627
|
-
|
|
4628
|
-
])) :
|
|
4629
|
-
n.value.type ===
|
|
4630
|
-
|
|
4631
|
-
t[3] ||=
|
|
4632
|
-
n.value.payTo?.payerPayIdDetails ? (
|
|
4633
|
-
n.value.payTo?.payerDirectDebitDetails ? (
|
|
4634
|
-
|
|
4635
|
-
t[2] ||=
|
|
4636
|
-
|
|
4637
|
-
], 64)) :
|
|
4638
|
-
])) :
|
|
4639
|
-
])])) :
|
|
4626
|
+
}, null, 8, ni), T("div", ri, [
|
|
4627
|
+
T("div", ii, O(r()), 1),
|
|
4628
|
+
n.value.type === D(ei).CARD ? (w(), E("div", ai, [
|
|
4629
|
+
y(" Card: " + O(n.value.card?.cardNumber || "Unknown"), 1),
|
|
4630
|
+
t[0] ||= T("br", null, null, -1),
|
|
4631
|
+
y(" Expire: " + O(n.value.card?.expiryDate || "Unknown"), 1)
|
|
4632
|
+
])) : P("", !0),
|
|
4633
|
+
n.value.type === D(ei).BANKPAYMENT ? (w(), E("div", oi, [
|
|
4634
|
+
y(" Name: " + O(n.value.bankPayment?.accountName), 1),
|
|
4635
|
+
t[1] ||= T("br", null, null, -1),
|
|
4636
|
+
y(" Acc No: " + O(n.value.bankPayment?.accountNumber), 1)
|
|
4637
|
+
])) : P("", !0),
|
|
4638
|
+
n.value.type === D(ei).PAYTO ? (w(), E("div", si, [
|
|
4639
|
+
y(" Name: " + O(n.value.payTo?.payerName), 1),
|
|
4640
|
+
t[3] ||= T("br", null, null, -1),
|
|
4641
|
+
n.value.payTo?.payerPayIdDetails ? (w(), E(Ce, { key: 0 }, [y(O(n.value.payTo?.payerPayIdDetails?.payIdType) + ": " + O(n.value.payTo?.payerPayIdDetails?.payId), 1)], 64)) : P("", !0),
|
|
4642
|
+
n.value.payTo?.payerDirectDebitDetails ? (w(), E(Ce, { key: 1 }, [
|
|
4643
|
+
y(" BSB: " + O(n.value.payTo?.payerDirectDebitDetails?.bsb), 1),
|
|
4644
|
+
t[2] ||= T("br", null, null, -1),
|
|
4645
|
+
y(" Acc No: " + O(n.value.payTo?.payerDirectDebitDetails?.accountNumber), 1)
|
|
4646
|
+
], 64)) : P("", !0)
|
|
4647
|
+
])) : P("", !0)
|
|
4648
|
+
])])) : P("", !0);
|
|
4640
4649
|
}
|
|
4641
4650
|
}), [["__scopeId", "data-v-7894e1cd"]]), li = {
|
|
4642
4651
|
key: 0,
|
|
@@ -4653,7 +4662,7 @@ var ti = {
|
|
|
4653
4662
|
}, hi = {
|
|
4654
4663
|
key: 1,
|
|
4655
4664
|
class: "saved-payment-methods"
|
|
4656
|
-
}, gi = /*#__PURE__*/
|
|
4665
|
+
}, gi = /*#__PURE__*/ N(/* @__PURE__ */ k({
|
|
4657
4666
|
__name: "PaymentMethodsForm",
|
|
4658
4667
|
props: {
|
|
4659
4668
|
log: { type: Function },
|
|
@@ -4663,7 +4672,7 @@ var ti = {
|
|
|
4663
4672
|
},
|
|
4664
4673
|
emits: ["submit", "select"],
|
|
4665
4674
|
setup(e, { emit: t }) {
|
|
4666
|
-
let n = e, r = t, i = g(!0), a = g(null), o = g(n.paymentMethods), s = g(!1), c = g({}), l =
|
|
4675
|
+
let n = e, r = t, i = g(!0), a = g(null), o = g(n.paymentMethods), s = g(!1), c = g({}), l = Ze(() => s.value ? o.value : a.value ? [a.value] : [o.value[0]]);
|
|
4667
4676
|
function u(e) {
|
|
4668
4677
|
if (e?.data?.status) {
|
|
4669
4678
|
if (e.data.status === "submit-card-form") {
|
|
@@ -4673,7 +4682,7 @@ var ti = {
|
|
|
4673
4682
|
e.data.status === "activate" && e.data.component === "payment-methods" && (n.log?.(`[PaymentMethods]: message "${e.data.status}" received`, e.data), i.value = !0), e.data.status === "deactivate" && e.data.component === "payment-methods" && (n.log?.(`[PaymentMethods]: message "${e.data.status}" received`, e.data), i.value = !1), e.data.status === "message" && e.data.component === "payment-methods" && (n.log?.(`[PaymentMethods]: message "${e.data.status}" received`, e.data), c.value = e.data.message), e.data.status === "error" && e.data.component === "payment-methods" && (n.log?.(`[PaymentMethods]: message "${e.data.status}" received`, e.data), c.value[e.data.paymentMethodId || "global"] = e.data.error);
|
|
4674
4683
|
}
|
|
4675
4684
|
}
|
|
4676
|
-
|
|
4685
|
+
oe(() => n.paymentMethods, () => {
|
|
4677
4686
|
o.value = n.paymentMethods, f();
|
|
4678
4687
|
}, { flush: "post" });
|
|
4679
4688
|
function d(e) {
|
|
@@ -4681,13 +4690,13 @@ var ti = {
|
|
|
4681
4690
|
}
|
|
4682
4691
|
function f() {
|
|
4683
4692
|
o.value.length > 0 ? (d(o.value.find((e) => e.isDefault) || o.value[0]), window.postMessage({
|
|
4684
|
-
status:
|
|
4693
|
+
status: be,
|
|
4685
4694
|
message: {
|
|
4686
4695
|
status: "success",
|
|
4687
4696
|
message: ""
|
|
4688
4697
|
}
|
|
4689
4698
|
}, "*")) : window.postMessage({
|
|
4690
|
-
status:
|
|
4699
|
+
status: be,
|
|
4691
4700
|
message: {
|
|
4692
4701
|
status: "error",
|
|
4693
4702
|
message: "No saved payment methods found"
|
|
@@ -4695,23 +4704,23 @@ var ti = {
|
|
|
4695
4704
|
}, "*");
|
|
4696
4705
|
}
|
|
4697
4706
|
return m(() => {
|
|
4698
|
-
window.addEventListener("message", u), window.postMessage({ status:
|
|
4699
|
-
}),
|
|
4707
|
+
window.addEventListener("message", u), window.postMessage({ status: Xe }, "*"), f();
|
|
4708
|
+
}), Fe(() => {
|
|
4700
4709
|
window.removeEventListener("message", u);
|
|
4701
|
-
}), (e, t) => o.value.length > 0 ? (
|
|
4702
|
-
c.value.global ? (
|
|
4703
|
-
(
|
|
4710
|
+
}), (e, t) => o.value.length > 0 ? (w(), E("div", li, [
|
|
4711
|
+
c.value.global ? (w(), E("div", ui, O(c.value.global), 1)) : P("", !0),
|
|
4712
|
+
(w(!0), E(Ce, null, le(l.value, (e, t) => (w(), E("div", {
|
|
4704
4713
|
key: `paymentMethod${t}`,
|
|
4705
|
-
class:
|
|
4714
|
+
class: te(["payment-method-container", `${a.value?.paymentMethodId === e?.paymentMethodId ? "selected" : ""} ${c.value[`${e?.paymentMethodId}`] ? "error" : ""}`]),
|
|
4706
4715
|
onClick: (t) => d(e)
|
|
4707
4716
|
}, [
|
|
4708
|
-
|
|
4717
|
+
T("input", {
|
|
4709
4718
|
type: "radio",
|
|
4710
4719
|
name: "paymentMethod",
|
|
4711
4720
|
id: `payment-method-${e?.paymentMethodId}`,
|
|
4712
4721
|
checked: a.value?.paymentMethodId === e?.paymentMethodId
|
|
4713
4722
|
}, null, 8, fi),
|
|
4714
|
-
|
|
4723
|
+
ue(ci, {
|
|
4715
4724
|
log: n.log,
|
|
4716
4725
|
"css-url": n.cssUrl,
|
|
4717
4726
|
"payment-method": e
|
|
@@ -4720,20 +4729,20 @@ var ti = {
|
|
|
4720
4729
|
"css-url",
|
|
4721
4730
|
"payment-method"
|
|
4722
4731
|
]),
|
|
4723
|
-
c.value[`${e?.paymentMethodId}`] ? (
|
|
4732
|
+
c.value[`${e?.paymentMethodId}`] ? (w(), E("div", pi, O(c.value[`${e?.paymentMethodId}`]), 1)) : P("", !0)
|
|
4724
4733
|
], 10, di))), 128)),
|
|
4725
|
-
o.value.length > 1 ? (
|
|
4734
|
+
o.value.length > 1 ? (w(), E("div", mi, [t[2] ||= T("div", { style: { width: "20px" } }, null, -1), T("div", null, [s.value ? (w(), E("a", {
|
|
4726
4735
|
key: 0,
|
|
4727
4736
|
href: "#",
|
|
4728
4737
|
class: "black",
|
|
4729
4738
|
onClick: t[0] ||= (e) => s.value = !1
|
|
4730
|
-
}, "Show less")) : (
|
|
4739
|
+
}, "Show less")) : (w(), E("a", {
|
|
4731
4740
|
key: 1,
|
|
4732
4741
|
href: "#",
|
|
4733
4742
|
class: "black",
|
|
4734
4743
|
onClick: t[1] ||= (e) => s.value = !0
|
|
4735
|
-
}, "Show all"))])])) :
|
|
4736
|
-
])) : (
|
|
4744
|
+
}, "Show all"))])])) : P("", !0)
|
|
4745
|
+
])) : (w(), E("div", hi, [...t[3] ||= [T("div", { class: "title" }, "No saved payment methods found", -1)]]));
|
|
4737
4746
|
}
|
|
4738
4747
|
}), [["__scopeId", "data-v-d3f0944f"]]), _i = class {
|
|
4739
4748
|
log;
|
|
@@ -4755,7 +4764,7 @@ var ti = {
|
|
|
4755
4764
|
order = null;
|
|
4756
4765
|
paymentInfo = null;
|
|
4757
4766
|
geolocation = null;
|
|
4758
|
-
userSuccessMessage =
|
|
4767
|
+
userSuccessMessage = me;
|
|
4759
4768
|
constructor(e, t) {
|
|
4760
4769
|
this.log = e, this.debug = t.debug, this.environment = t.environment, this.apiUrl = t.apiUrl, this.publicKey = t.publicKey, this.version = t.version, this.failureCallback = t.onFailure || null, this.successCallback = t.onSuccess || null;
|
|
4761
4770
|
let n = new o(t.environment, s(t.publicKey));
|
|
@@ -4857,9 +4866,9 @@ var ti = {
|
|
|
4857
4866
|
};
|
|
4858
4867
|
}
|
|
4859
4868
|
};
|
|
4860
|
-
|
|
4869
|
+
L([R], _i.prototype, "setPaymentInfo", null), L([R], _i.prototype, "cleanUp", null);
|
|
4861
4870
|
// src/sdk/processors/paymentMethodProcessor.ts
|
|
4862
|
-
var { hideSpinner: vi, showSpinner: yi } =
|
|
4871
|
+
var { hideSpinner: vi, showSpinner: yi } = Re(), bi = {
|
|
4863
4872
|
CUSTOMER_INFO: "CUSTOMER_INFO",
|
|
4864
4873
|
PAYMENT_METHODS_INFO: "PAYMENT_METHODS_INFO",
|
|
4865
4874
|
TOKENISE: "TOKENISE"
|
|
@@ -4895,11 +4904,11 @@ var { hideSpinner: vi, showSpinner: yi } = Be(), bi = {
|
|
|
4895
4904
|
currency: r,
|
|
4896
4905
|
customerId: t,
|
|
4897
4906
|
options: i
|
|
4898
|
-
}), this.container = e, this.networkTokenProviders = i?.networkTokenProviders || [], this.networkTokenProviders = i?.networkTokenProviders || [], !
|
|
4907
|
+
}), this.container = e, this.networkTokenProviders = i?.networkTokenProviders || [], this.networkTokenProviders = i?.networkTokenProviders || [], !j(n)) throw I(e, "Invalid amount: " + n), TypeError("invalid amount: " + n);
|
|
4899
4908
|
this.getCustomerData(t, (a) => {
|
|
4900
4909
|
this.log("[addPaymentMethods], customerInfo", a), this.getPaymentMethodsInfo(t, (t) => {
|
|
4901
4910
|
this.log("[addPaymentMethods], paymentMethods", t);
|
|
4902
|
-
let o =
|
|
4911
|
+
let o = Me({
|
|
4903
4912
|
el: this.container,
|
|
4904
4913
|
component: gi,
|
|
4905
4914
|
props: {
|
|
@@ -4943,7 +4952,7 @@ var { hideSpinner: vi, showSpinner: yi } = Be(), bi = {
|
|
|
4943
4952
|
networkToken: e.networkToken
|
|
4944
4953
|
}))
|
|
4945
4954
|
},
|
|
4946
|
-
on: { submit:
|
|
4955
|
+
on: { submit: z(this, "[PaymentMethods]: submit", (t) => {
|
|
4947
4956
|
this.log("[PaymentMethods]: submit", t), t?.paymentMethodId && (yi(), setTimeout(() => {
|
|
4948
4957
|
this.onSubmit(e, n, r, i, t);
|
|
4949
4958
|
}, 500));
|
|
@@ -4965,7 +4974,7 @@ var { hideSpinner: vi, showSpinner: yi } = Be(), bi = {
|
|
|
4965
4974
|
fraud: i,
|
|
4966
4975
|
authenticationData: a
|
|
4967
4976
|
});
|
|
4968
|
-
let o =
|
|
4977
|
+
let o = z(this, "[PaymentMethodProcessor][tokenise], success", (t, n) => {
|
|
4969
4978
|
this.log("[PaymentMethodProcessor][tokenise], success", t, n), vi();
|
|
4970
4979
|
let r = JSON.parse(n), i = { token: r.tokenId };
|
|
4971
4980
|
r.card && (i.cardDetails = {
|
|
@@ -4981,8 +4990,8 @@ var { hideSpinner: vi, showSpinner: yi } = Be(), bi = {
|
|
|
4981
4990
|
issuer: r.card.iinData.issuer || "",
|
|
4982
4991
|
countryCode: r.card.iinData.countryCode || "",
|
|
4983
4992
|
cardType: r.card.iinData.cardType || ""
|
|
4984
|
-
}), this.successCallback?.(i),
|
|
4985
|
-
}), s =
|
|
4993
|
+
}), this.successCallback?.(i), tt(e, this.getSuccessMessage());
|
|
4994
|
+
}), s = z(this, "[PaymentMethodProcessor][tokenise], failure", (e, n) => {
|
|
4986
4995
|
this.log("[PaymentMethodProcessor][tokenise], failure", e, n), vi();
|
|
4987
4996
|
let r = JSON.parse(n);
|
|
4988
4997
|
this.failureCallback?.({ error: r.message }), this.sendError(t, r.message);
|
|
@@ -5006,17 +5015,17 @@ var { hideSpinner: vi, showSpinner: yi } = Be(), bi = {
|
|
|
5006
5015
|
this.httpInvoker?.invoke(xi(this.apiUrl)[bi.TOKENISE].url, xi(this.apiUrl)[bi.TOKENISE].method, JSON.stringify(c), o, s);
|
|
5007
5016
|
}
|
|
5008
5017
|
getCustomerData(e, t, n) {
|
|
5009
|
-
let r =
|
|
5018
|
+
let r = z(this, "[getCustomerData], success", (e, n) => {
|
|
5010
5019
|
this.log("[getCustomerData], success", e, n), t(JSON.parse(n));
|
|
5011
|
-
}), i =
|
|
5020
|
+
}), i = z(this, "[getCustomerData], failure", (e, t) => {
|
|
5012
5021
|
this.log("[getCustomerData], failure", e, t), n(JSON.parse(t));
|
|
5013
5022
|
});
|
|
5014
5023
|
this.httpInvoker?.invoke(xi(this.apiUrl, e)[bi.CUSTOMER_INFO].url, xi(this.apiUrl, e)[bi.CUSTOMER_INFO].method, {}, r, i);
|
|
5015
5024
|
}
|
|
5016
5025
|
getPaymentMethodsInfo(e, t, n) {
|
|
5017
|
-
let r =
|
|
5026
|
+
let r = z(this, "[getPaymentMethodsInfo], success", (e, n) => {
|
|
5018
5027
|
this.log("[getPaymentMethodsInfo], success", e, n), t(JSON.parse(n));
|
|
5019
|
-
}), i =
|
|
5028
|
+
}), i = z(this, "[getPaymentMethodsInfo], failure", (e, t) => {
|
|
5020
5029
|
this.log("[getPaymentMethodsInfo], failure", e, t), n(JSON.parse(t));
|
|
5021
5030
|
});
|
|
5022
5031
|
this.httpInvoker?.invoke(xi(this.apiUrl, e)[bi.PAYMENT_METHODS_INFO].url, xi(this.apiUrl, e)[bi.PAYMENT_METHODS_INFO].method, {}, r, i);
|
|
@@ -5031,8 +5040,8 @@ var { hideSpinner: vi, showSpinner: yi } = Be(), bi = {
|
|
|
5031
5040
|
onShow: vi,
|
|
5032
5041
|
onProgress: this.threeDsProgressCallback,
|
|
5033
5042
|
log: this.log
|
|
5034
|
-
}).then(
|
|
5035
|
-
"error" in o ? (vi(),
|
|
5043
|
+
}).then(z(this, "[PaymentMethodProcessor][fraudGate]", (o) => {
|
|
5044
|
+
"error" in o ? (vi(), I(e, o.error), this.failureCallback?.({
|
|
5036
5045
|
error: o.error,
|
|
5037
5046
|
...o.reason && { errorDetails: { reason: o.reason } }
|
|
5038
5047
|
}), this.sendError(a, o.reason || o.error)) : this.onFraudGatePassed(e, t, n, o, r, i);
|
|
@@ -5051,9 +5060,9 @@ var { hideSpinner: vi, showSpinner: yi } = Be(), bi = {
|
|
|
5051
5060
|
this.tokenise(e, a.paymentMethodId, t, n, r);
|
|
5052
5061
|
return;
|
|
5053
5062
|
}
|
|
5054
|
-
s.invoke(this.amount, this.currency,
|
|
5063
|
+
s.invoke(this.amount, this.currency, z(this, "[sdk][paymentMethodProcessor], token authentication success", (i) => {
|
|
5055
5064
|
this.log("[sdk][paymentMethodProcessor], token authentication success"), this.tokenise(e, a.paymentMethodId, t, n, r, i.assuranceData?.verificationData?.[0]);
|
|
5056
|
-
}),
|
|
5065
|
+
}), z(this, "[sdk][paymentMethodProcessor], token authentication error", (e) => {
|
|
5057
5066
|
vi(), this.log("[sdk][paymentMethodProcessor], token authentication error", e), this.failureCallback?.({ error: "Token Authentication Error" });
|
|
5058
5067
|
}));
|
|
5059
5068
|
}
|
|
@@ -5074,7 +5083,7 @@ var { hideSpinner: vi, showSpinner: yi } = Be(), bi = {
|
|
|
5074
5083
|
});
|
|
5075
5084
|
let o = (i?.scheme || "").toLowerCase(), s = this.networkTokenProviders.find((e) => e.providerType.toLowerCase() === o);
|
|
5076
5085
|
switch (String(s?.providerType).toLowerCase()) {
|
|
5077
|
-
case "mastercard": return new
|
|
5086
|
+
case "mastercard": return new Yt(this.log.bind(this), {
|
|
5078
5087
|
container: this.container,
|
|
5079
5088
|
token: e,
|
|
5080
5089
|
networkToken: t,
|
|
@@ -5093,22 +5102,22 @@ var { hideSpinner: vi, showSpinner: yi } = Be(), bi = {
|
|
|
5093
5102
|
e?.data?.status && e.data.status === "card-form-validation-status-change" && (this.log(`[sdk][paymentMethodProcessor]: message "${e.data.status}" received`, e.data), vi(), this.validationStatusChangeCallback?.(e.data.message?.status, e.data.message?.message));
|
|
5094
5103
|
}
|
|
5095
5104
|
};
|
|
5096
|
-
|
|
5105
|
+
L([R], Q.prototype, "addPaymentMethods", null), L([R], Q.prototype, "tokenise", null), L([R], Q.prototype, "getCustomerData", null), L([R], Q.prototype, "getPaymentMethodsInfo", null), L([R], Q.prototype, "onSubmit", null), L([R], Q.prototype, "onFraudGatePassed", null), L([R], Q.prototype, "sendError", null), L([R], Q.prototype, "initTokenAuthenticationProcessor", null), L([R], Q.prototype, "messageHandler", null);
|
|
5097
5106
|
// src/sdk/utils/moduleLoader.ts
|
|
5098
5107
|
var Si = {
|
|
5099
|
-
cxpay: () => import("./cxpay-
|
|
5100
|
-
default: () => import("./default-
|
|
5101
|
-
ecentric: () => import("./ecentric-
|
|
5102
|
-
epna: () => import("./epna-
|
|
5103
|
-
flashbanc: () => import("./flashbanc-
|
|
5104
|
-
forter: () => import("./forter-
|
|
5105
|
-
gpayments: () => import("./gpayments-
|
|
5106
|
-
metrics_global: () => import("./metrics_global-
|
|
5107
|
-
nmi: () => import("./nmi-
|
|
5108
|
-
nuvei: () => import("./nuvei-
|
|
5109
|
-
payabli: () => import("./payabli-
|
|
5110
|
-
payglocal: () => import("./payglocal-
|
|
5111
|
-
skybank: () => import("./skybank-
|
|
5108
|
+
cxpay: () => import("./cxpay-Dugz0O74.js"),
|
|
5109
|
+
default: () => import("./default-DGxERUSN.js"),
|
|
5110
|
+
ecentric: () => import("./ecentric-ByBa3UWI.js"),
|
|
5111
|
+
epna: () => import("./epna-DQVvimvd.js"),
|
|
5112
|
+
flashbanc: () => import("./flashbanc-CBdnGJ_h.js"),
|
|
5113
|
+
forter: () => import("./forter-BbB3-cUq.js"),
|
|
5114
|
+
gpayments: () => import("./gpayments-CmUdD9kJ.js"),
|
|
5115
|
+
metrics_global: () => import("./metrics_global-DzTY7GMQ.js"),
|
|
5116
|
+
nmi: () => import("./nmi-EgdsSmhg.js"),
|
|
5117
|
+
nuvei: () => import("./nuvei-DSwwNCnf.js"),
|
|
5118
|
+
payabli: () => import("./payabli-M87Lxo_m.js"),
|
|
5119
|
+
payglocal: () => import("./payglocal-HYHj4xrA.js"),
|
|
5120
|
+
skybank: () => import("./skybank-Divo_TW3.js")
|
|
5112
5121
|
}, Ci = { forter: () => import("./forter-DXQjpKVH.js") };
|
|
5113
5122
|
async function wi(e) {
|
|
5114
5123
|
let t = Si[e.toLowerCase()];
|
|
@@ -5121,7 +5130,7 @@ async function Ti(e) {
|
|
|
5121
5130
|
return await t();
|
|
5122
5131
|
}
|
|
5123
5132
|
// src/sdk/payfurl.ts
|
|
5124
|
-
var { hideSpinner: Ei } =
|
|
5133
|
+
var { hideSpinner: Ei } = Re(), Di = {
|
|
5125
5134
|
PROVIDER_INFO: "PROVIDER_INFO",
|
|
5126
5135
|
PROVIDERS_INFO: "PROVIDERS_INFO"
|
|
5127
5136
|
}, Oi = (e, t, n) => ({
|
|
@@ -5133,7 +5142,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5133
5142
|
url: e + (n ? "/info/providers/token/" + n : "/info/providers/" + t),
|
|
5134
5143
|
method: "GET"
|
|
5135
5144
|
}
|
|
5136
|
-
}), $ = class {
|
|
5145
|
+
}), $ = class e {
|
|
5137
5146
|
_submitFormHandlers = {};
|
|
5138
5147
|
_destroyDropIns = {};
|
|
5139
5148
|
environment = t.PRODUCTION;
|
|
@@ -5166,7 +5175,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5166
5175
|
userOnLoaded = null;
|
|
5167
5176
|
userOnPaymentMethodStatus = null;
|
|
5168
5177
|
userOnThreeDsProgress = null;
|
|
5169
|
-
userSuccessMessage =
|
|
5178
|
+
userSuccessMessage = me;
|
|
5170
5179
|
userOnValidationStatusChange = null;
|
|
5171
5180
|
userOnValidate;
|
|
5172
5181
|
billingAddress = null;
|
|
@@ -5176,12 +5185,12 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5176
5185
|
initProcessorsRunning = !1;
|
|
5177
5186
|
initProcessorsQueue = [];
|
|
5178
5187
|
init(e, t, r) {
|
|
5179
|
-
if (this.environment = String(e).toLowerCase(),
|
|
5188
|
+
if (this.environment = String(e).toLowerCase(), rt.init(this.environment, t, n.version), window._payfurl) return window._payfurl;
|
|
5180
5189
|
if (this.debug = r, this.publicKey = t, this.config = i(this.environment), !this.config) throw this.showErrorMessage(null, "Error: Unable to configure SDK due to an incorrect environment setting."), this.userOnFailure?.({ error: "Unable to configure SDK" }), TypeError("Error: Unable to configure SDK due to an incorrect environment setting.");
|
|
5181
5190
|
return this.regionResolver = new o(e, s(t)), this.httpInvoker = new c(t, n.version, this.regionResolver), this.loadCss(), window._payfurl = this, window.addEventListener("message", this.messageHandler.bind(this)), this;
|
|
5182
5191
|
}
|
|
5183
5192
|
execute() {
|
|
5184
|
-
window.postMessage({ status:
|
|
5193
|
+
window.postMessage({ status: Ue }, "*");
|
|
5185
5194
|
}
|
|
5186
5195
|
messageHandler(e) {
|
|
5187
5196
|
if (!e?.data?.status || (e.data.status === "payfurl-init" && this.userOnLoaded?.(), e.source !== window)) return;
|
|
@@ -5224,12 +5233,12 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5224
5233
|
secureUrl: this.config.secureUrl,
|
|
5225
5234
|
apiUrl: this.config.apiUrl,
|
|
5226
5235
|
version: n.version,
|
|
5227
|
-
onSuccess:
|
|
5236
|
+
onSuccess: z(this, "[cardProcessor], success", (t) => {
|
|
5228
5237
|
this.log("[cardProcessor], success", t), t.token && (this._setToken(e, t.token), setTimeout(() => {
|
|
5229
5238
|
this.userOnSuccess || this.getForm(e)?.submit();
|
|
5230
5239
|
}, 500)), this.userOnSuccess?.(t);
|
|
5231
5240
|
}),
|
|
5232
|
-
onFailure:
|
|
5241
|
+
onFailure: z(this, "[cardProcessor], failure", (e) => {
|
|
5233
5242
|
this.log("[cardProcessor], failure", e);
|
|
5234
5243
|
let t = Xn(e.body) || e.errorDetails;
|
|
5235
5244
|
e.body && !t && this.log("[cardProcessor], failure", "no structured error detail in body"), this.userOnFailure?.({
|
|
@@ -5237,7 +5246,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5237
5246
|
...t && { errorDetails: t }
|
|
5238
5247
|
});
|
|
5239
5248
|
}),
|
|
5240
|
-
onValidationStatusChangeCallback:
|
|
5249
|
+
onValidationStatusChangeCallback: z(this, "[cardProcessor], ValidationStatusChange", (e, t) => {
|
|
5241
5250
|
this.log("[cardProcessor], ValidationStatusChange", e, t), this.userOnValidationStatusChange?.(e, t);
|
|
5242
5251
|
}),
|
|
5243
5252
|
onThreeDsProgress: this.threeDsProgress.bind(this)
|
|
@@ -5253,18 +5262,18 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5253
5262
|
}
|
|
5254
5263
|
initPaypalProcessor(e) {
|
|
5255
5264
|
if (this.log("[initPaypalProcessor]", { container: e }), this.paypalProcessor) return this.paypalProcessor;
|
|
5256
|
-
let t = new
|
|
5265
|
+
let t = new Rt(this.log.bind(this), {
|
|
5257
5266
|
debug: this.debug,
|
|
5258
5267
|
environment: this.environment,
|
|
5259
5268
|
publicKey: this.publicKey,
|
|
5260
5269
|
apiUrl: this.config.apiUrl,
|
|
5261
5270
|
version: n.version,
|
|
5262
|
-
onSuccess:
|
|
5271
|
+
onSuccess: z(this, "[paypalProcessor], success", (t) => {
|
|
5263
5272
|
this.log("[paypalProcessor], success", t, this.userOnSuccess), !this.userOnSuccess && t.transactionId && (this._setToken(e, t.transactionId, "transactionId"), setTimeout(() => {
|
|
5264
5273
|
this.getForm(e)?.submit();
|
|
5265
5274
|
}, 500)), this.userOnSuccess?.({ transactionId: t.transactionId });
|
|
5266
5275
|
}),
|
|
5267
|
-
onFailure:
|
|
5276
|
+
onFailure: z(this, "[paypalProcessor], failure", (e) => {
|
|
5268
5277
|
this.log("[paypalProcessor], failure", e), this.userOnFailure?.({ error: e.error });
|
|
5269
5278
|
})
|
|
5270
5279
|
});
|
|
@@ -5279,14 +5288,14 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5279
5288
|
apiUrl: this.config.apiUrl,
|
|
5280
5289
|
redirectUrl: this.config.redirectUrl,
|
|
5281
5290
|
version: n.version,
|
|
5282
|
-
onSuccess:
|
|
5291
|
+
onSuccess: z(this, "[checkoutProcessor], success", (t) => {
|
|
5283
5292
|
this.log("[checkoutProcessor], success", t), this.userOnSuccess || (t.transactionId && this._setToken(e, t.transactionId, "transactionId"), t.token && this._setToken(e, t.token, "token"), setTimeout(() => {
|
|
5284
5293
|
this.getForm(e)?.submit();
|
|
5285
5294
|
}, 500));
|
|
5286
5295
|
let n = {};
|
|
5287
5296
|
t.transactionId && (n.transactionId = t.transactionId), t.token && (n.token = t.token), this.userOnSuccess?.(n);
|
|
5288
5297
|
}),
|
|
5289
|
-
onFailure:
|
|
5298
|
+
onFailure: z(this, "[checkoutProcessor], failure", (e) => {
|
|
5290
5299
|
this.log("[checkoutProcessor], failure", e);
|
|
5291
5300
|
let t = Xn(e.body);
|
|
5292
5301
|
this.userOnFailure?.({
|
|
@@ -5305,12 +5314,12 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5305
5314
|
publicKey: this.publicKey,
|
|
5306
5315
|
apiUrl: this.config.apiUrl,
|
|
5307
5316
|
version: n.version,
|
|
5308
|
-
onSuccess:
|
|
5317
|
+
onSuccess: z(this, "[googlePayProcessor], success", (t) => {
|
|
5309
5318
|
this.log("[googlePayProcessor], success", t), !this.userOnSuccess && t.transactionId && (this._setToken(e, t.transactionId, "transactionId"), setTimeout(() => {
|
|
5310
5319
|
this.getForm(e)?.submit();
|
|
5311
5320
|
}, 500)), this.userOnSuccess?.({ transactionId: t.transactionId });
|
|
5312
5321
|
}),
|
|
5313
|
-
onFailure:
|
|
5322
|
+
onFailure: z(this, "[googlePayProcessor], failure", (e) => {
|
|
5314
5323
|
this.log("[googlePayProcessor], failure", e), this.userOnFailure?.({
|
|
5315
5324
|
error: e.error,
|
|
5316
5325
|
...e.errorDetails && { errorDetails: e.errorDetails }
|
|
@@ -5327,7 +5336,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5327
5336
|
publicKey: this.publicKey,
|
|
5328
5337
|
apiUrl: this.config.apiUrl,
|
|
5329
5338
|
version: n.version,
|
|
5330
|
-
onSuccess:
|
|
5339
|
+
onSuccess: z(this, "[applePayProcessor], success", (t) => {
|
|
5331
5340
|
this.log("[applePayProcessor], success", t), !this.userOnSuccess && t.transactionId ? (this._setToken(e, t.transactionId, "transactionId"), setTimeout(() => {
|
|
5332
5341
|
this.getForm(e)?.submit();
|
|
5333
5342
|
}, 500)) : !this.userOnSuccess && t.token ? (this._setToken(e, t.token), setTimeout(() => {
|
|
@@ -5337,7 +5346,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5337
5346
|
token: t.token
|
|
5338
5347
|
});
|
|
5339
5348
|
}),
|
|
5340
|
-
onFailure:
|
|
5349
|
+
onFailure: z(this, "[applePayProcessor], failure", (e) => {
|
|
5341
5350
|
this.log("[applePayProcessor], failure", e), this.userOnFailure?.({
|
|
5342
5351
|
error: e.error,
|
|
5343
5352
|
...e.errorDetails && { errorDetails: e.errorDetails }
|
|
@@ -5354,12 +5363,12 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5354
5363
|
apiUrl: this.config.apiUrl,
|
|
5355
5364
|
version: n.version,
|
|
5356
5365
|
getPaymentOptions: this.getPaymentOptions.bind(this),
|
|
5357
|
-
onSuccess:
|
|
5366
|
+
onSuccess: z(this, "[payToProcessor], success", (t) => {
|
|
5358
5367
|
this.log("[payToProcessor], success", t), t.token && (this._setToken(e, t.token), setTimeout(() => {
|
|
5359
5368
|
this.userOnSuccess || this.getForm(e)?.submit();
|
|
5360
5369
|
}, 500)), this.userOnSuccess?.({ token: t.token });
|
|
5361
5370
|
}),
|
|
5362
|
-
onFailure:
|
|
5371
|
+
onFailure: z(this, "[payToProcessor], failure", (e) => {
|
|
5363
5372
|
this.log("[payToProcessor], failure", e);
|
|
5364
5373
|
let t = Xn(e.body);
|
|
5365
5374
|
this.userOnFailure?.({
|
|
@@ -5377,18 +5386,18 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5377
5386
|
apiUrl: this.config.apiUrl,
|
|
5378
5387
|
cssUrl: this.config.cssUrl,
|
|
5379
5388
|
version: n.version,
|
|
5380
|
-
onSuccess:
|
|
5389
|
+
onSuccess: z(this, "[paymentMethodProcessor], success", (t) => {
|
|
5381
5390
|
this.log("[paymentMethodProcessor], success", t), t.token && (this._setToken(e, t.token), setTimeout(() => {
|
|
5382
5391
|
this.userOnSuccess || this.getForm(e)?.submit();
|
|
5383
5392
|
}, 500)), this.userOnSuccess?.(t);
|
|
5384
5393
|
}),
|
|
5385
|
-
onFailure:
|
|
5394
|
+
onFailure: z(this, "[paymentMethodProcessor], failure", (e) => {
|
|
5386
5395
|
this.log("[paymentMethodProcessor], failure", e), this.userOnFailure?.({
|
|
5387
5396
|
error: e.error,
|
|
5388
5397
|
...e.errorDetails && { errorDetails: e.errorDetails }
|
|
5389
5398
|
});
|
|
5390
5399
|
}),
|
|
5391
|
-
onValidationStatusChangeCallback:
|
|
5400
|
+
onValidationStatusChangeCallback: z(this, "[paymentMethodProcessor], ValidationStatusChange", (e, t) => {
|
|
5392
5401
|
this.log("[paymentMethodProcessor], ValidationStatusChange", e, t), this.userOnValidationStatusChange?.(e, t);
|
|
5393
5402
|
}),
|
|
5394
5403
|
onThreeDsProgress: this.threeDsProgress.bind(this)
|
|
@@ -5435,10 +5444,10 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5435
5444
|
t && !t.id && (t.id = "payfurl-form-" + Math.random().toString(36).slice(2, 9));
|
|
5436
5445
|
let n = t?.id || e?.id || "container";
|
|
5437
5446
|
if (this._submitFormHandlers[n]) return this._submitFormHandlers[n];
|
|
5438
|
-
let r =
|
|
5447
|
+
let r = z(this, "[getSubmitFormHandler][handler]", (t) => {
|
|
5439
5448
|
this.log("[sdk], submitForm", t), t.preventDefault();
|
|
5440
5449
|
let n = this.getForm(e);
|
|
5441
|
-
(!n?.onsubmit || n.onsubmit(new SubmitEvent("submit"))) && (n && this.getInput(e, "token")?.value ? n.submit() : window.postMessage({ status:
|
|
5450
|
+
(!n?.onsubmit || n.onsubmit(new SubmitEvent("submit"))) && (n && this.getInput(e, "token")?.value ? n.submit() : window.postMessage({ status: Ue }, "*"));
|
|
5442
5451
|
});
|
|
5443
5452
|
return this._submitFormHandlers[n] = r, r;
|
|
5444
5453
|
}
|
|
@@ -5457,12 +5466,12 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5457
5466
|
});
|
|
5458
5467
|
let i = e && document.getElementById(e) || null;
|
|
5459
5468
|
if (!i) throw this.userOnFailure?.({ error: "Container is not available" }), TypeError("Container is not available");
|
|
5460
|
-
if (!
|
|
5469
|
+
if (!M(t)) throw this.showErrorMessage(i, "Missing parameter: providerId"), this.userOnFailure?.({ error: "Missing parameter: Provider Id" }), TypeError("Missing parameter: providerId");
|
|
5461
5470
|
let a = Number(r?.amount) || 0;
|
|
5462
5471
|
r?.currency && (r.currency = r?.currency.toUpperCase());
|
|
5463
5472
|
let o = r?.currency || "";
|
|
5464
|
-
if (a && !
|
|
5465
|
-
return this._cleanUp(i), this._initForm(i), this.setAmount(a), this.setCurrency(o), this.initProcessors(i, a, o, t, "", r || {},
|
|
5473
|
+
if (a && !j(a)) throw this.showErrorMessage(i, "Missing parameter: amount"), this.userOnFailure?.({ error: "Missing parameter: amount" }), TypeError("Missing parameter: amount");
|
|
5474
|
+
return this._cleanUp(i), this._initForm(i), this.setAmount(a), this.setCurrency(o), this.initProcessors(i, a, o, t, "", r || {}, z(this, "[addCard][initProcessors], callback", (e, s) => {
|
|
5466
5475
|
let c = this.resolveThreeDsProvider(e, s), l = s.allThreeDsProviders?.[0], u = this.skipCardFraud ? void 0 : s.fraudProviders?.[0], d = {
|
|
5467
5476
|
...r,
|
|
5468
5477
|
requiredFields: e.requiredFields,
|
|
@@ -5478,9 +5487,9 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5478
5487
|
networkTokenProviders: s.networkTokenProviders || [],
|
|
5479
5488
|
createNetworkToken: r?.createNetworkToken !== !1 && s.hasNetworkTokenProviders,
|
|
5480
5489
|
networkTokenOptions: r?.networkTokenOptions,
|
|
5481
|
-
vault:
|
|
5482
|
-
verifyCard:
|
|
5483
|
-
metadata:
|
|
5490
|
+
vault: A(r?.vault),
|
|
5491
|
+
verifyCard: A(r?.verifyCard),
|
|
5492
|
+
metadata: G(r?.metadata),
|
|
5484
5493
|
secureCardOrchestration: {
|
|
5485
5494
|
enabled: !0,
|
|
5486
5495
|
secureUrl: this.config.secureUrl,
|
|
@@ -5491,7 +5500,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5491
5500
|
version: n.version,
|
|
5492
5501
|
amount: a,
|
|
5493
5502
|
currency: o,
|
|
5494
|
-
metadata:
|
|
5503
|
+
metadata: G(r?.metadata),
|
|
5495
5504
|
billingAddress: this.billingAddress,
|
|
5496
5505
|
customer: this.customer,
|
|
5497
5506
|
order: this.order,
|
|
@@ -5523,11 +5532,11 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5523
5532
|
}
|
|
5524
5533
|
};
|
|
5525
5534
|
if (d.threeDSEnabled) {
|
|
5526
|
-
if (!
|
|
5535
|
+
if (!j(a)) {
|
|
5527
5536
|
this.showErrorMessage(i, "Missing parameter: amount"), this.userOnFailure?.({ error: "Missing parameter: amount" });
|
|
5528
5537
|
return;
|
|
5529
5538
|
}
|
|
5530
|
-
if (!
|
|
5539
|
+
if (!B(o)) {
|
|
5531
5540
|
this.showErrorMessage(i, "Missing parameter: currency"), this.userOnFailure?.({ error: "Missing parameter: currency" });
|
|
5532
5541
|
return;
|
|
5533
5542
|
}
|
|
@@ -5543,7 +5552,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5543
5552
|
});
|
|
5544
5553
|
let a = e && document.getElementById(e) || null;
|
|
5545
5554
|
if (!a) throw this.userOnFailure?.({ error: "Container is not available" }), TypeError("Container is not available");
|
|
5546
|
-
return r &&= r.toUpperCase(), this._cleanUp(a), this._initForm(a), this.setAmount(t), this.setCurrency(r), this.initProcessors(a, t, r, "", "", i || {},
|
|
5555
|
+
return r &&= r.toUpperCase(), this._cleanUp(a), this._initForm(a), this.setAmount(t), this.setCurrency(r), this.initProcessors(a, t, r, "", "", i || {}, z(this, "[addCardLeastCost][initProcessors], callback", (e, o) => {
|
|
5547
5556
|
let s = this.resolveThreeDsProvider(e, o), c = o.allThreeDsProviders?.[0], l = this.skipCardFraud ? void 0 : o.fraudProviders?.[0], u = {
|
|
5548
5557
|
...i,
|
|
5549
5558
|
requiredFields: e.requiredFields,
|
|
@@ -5559,9 +5568,9 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5559
5568
|
networkTokenProviders: o.networkTokenProviders || [],
|
|
5560
5569
|
createNetworkToken: i?.createNetworkToken !== !1 && o.hasNetworkTokenProviders,
|
|
5561
5570
|
networkTokenOptions: i?.networkTokenOptions,
|
|
5562
|
-
vault:
|
|
5563
|
-
verifyCard:
|
|
5564
|
-
metadata:
|
|
5571
|
+
vault: A(i?.vault),
|
|
5572
|
+
verifyCard: A(i?.verifyCard),
|
|
5573
|
+
metadata: G(i?.metadata),
|
|
5565
5574
|
secureCardOrchestration: {
|
|
5566
5575
|
enabled: !0,
|
|
5567
5576
|
secureUrl: this.config.secureUrl,
|
|
@@ -5572,7 +5581,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5572
5581
|
version: n.version,
|
|
5573
5582
|
amount: t,
|
|
5574
5583
|
currency: r,
|
|
5575
|
-
metadata:
|
|
5584
|
+
metadata: G(i?.metadata),
|
|
5576
5585
|
billingAddress: this.billingAddress,
|
|
5577
5586
|
customer: this.customer,
|
|
5578
5587
|
order: this.order,
|
|
@@ -5604,11 +5613,11 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5604
5613
|
}
|
|
5605
5614
|
};
|
|
5606
5615
|
if (u.threeDSEnabled) {
|
|
5607
|
-
if (!
|
|
5616
|
+
if (!j(t)) {
|
|
5608
5617
|
this.showErrorMessage(a, "Missing parameter: amount"), this.userOnFailure?.({ error: "Missing parameter: amount" });
|
|
5609
5618
|
return;
|
|
5610
5619
|
}
|
|
5611
|
-
if (!
|
|
5620
|
+
if (!B(r)) {
|
|
5612
5621
|
this.showErrorMessage(a, "Missing parameter: currency"), this.userOnFailure?.({ error: "Missing parameter: currency" });
|
|
5613
5622
|
return;
|
|
5614
5623
|
}
|
|
@@ -5616,56 +5625,56 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5616
5625
|
this.initCardProcessor(a).addCard(a, this.getForm(a), "", t, r, u);
|
|
5617
5626
|
})), this;
|
|
5618
5627
|
}
|
|
5619
|
-
addDropIn(
|
|
5628
|
+
addDropIn(t, r, i, a) {
|
|
5620
5629
|
this.log("[addDropIn]", {
|
|
5621
|
-
amount:
|
|
5622
|
-
currency:
|
|
5623
|
-
options:
|
|
5630
|
+
amount: r,
|
|
5631
|
+
currency: i,
|
|
5632
|
+
options: a
|
|
5624
5633
|
});
|
|
5625
|
-
let
|
|
5626
|
-
if (!
|
|
5627
|
-
|
|
5628
|
-
let
|
|
5629
|
-
return this.initProcessors(
|
|
5630
|
-
clickToPayEnabled:
|
|
5631
|
-
clickToPayOptions:
|
|
5632
|
-
createNetworkToken:
|
|
5633
|
-
tokenAuthenticationEnabled:
|
|
5634
|
-
networkTokenOptions:
|
|
5635
|
-
},
|
|
5636
|
-
let
|
|
5637
|
-
|
|
5634
|
+
let o = t && document.getElementById(t) || null;
|
|
5635
|
+
if (!o) throw this.userOnFailure?.({ error: "Container is not available" }), TypeError("Container is not available");
|
|
5636
|
+
i &&= i.toUpperCase(), this._cleanUp(o), this._initForm(o), this.setAmount(r), this.setCurrency(i);
|
|
5637
|
+
let s = this.filterAllowedPaymentTypes(a?.allowedPaymentTypes || []), c = (e) => s.length === 0 || s.includes(e), l = a?.cardProviderId || "";
|
|
5638
|
+
return this.initProcessors(o, r, i, l, "", {
|
|
5639
|
+
clickToPayEnabled: a?.clickToPayEnabled,
|
|
5640
|
+
clickToPayOptions: a?.clickToPayOptions,
|
|
5641
|
+
createNetworkToken: a?.createNetworkToken,
|
|
5642
|
+
tokenAuthenticationEnabled: a?.tokenAuthenticationEnabled || a?.clickToPayOptions?.tokenAuthenticationEnabled,
|
|
5643
|
+
networkTokenOptions: a?.networkTokenOptions || a?.clickToPayOptions?.networkTokenOptions
|
|
5644
|
+
}, z(this, "[addDropIn][initProcessors], callback", async (s, u) => {
|
|
5645
|
+
let d = u.hasApplePayProviders && await e.isApplePayAvailable();
|
|
5646
|
+
u.hasApplePayProviders && !d && c(Y.applepay) && this.paymentMethodStatus({
|
|
5638
5647
|
paymentMethod: "applepay",
|
|
5639
5648
|
status: "unavailable",
|
|
5640
5649
|
reason: "unsupported"
|
|
5641
|
-
}),
|
|
5642
|
-
let
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
].filter(Boolean).length > 1,
|
|
5650
|
-
threeDSEnabled: !!
|
|
5651
|
-
threeDsProviderId:
|
|
5652
|
-
threeDSEmail:
|
|
5653
|
-
visProviderId:
|
|
5654
|
-
clickToPayEnabled:
|
|
5650
|
+
}), a?.paypalProviderId && u.hasPaypalProviders && u.paypalProviders.includes(a?.paypalProviderId) && (u.hasPaypalProviders = !0, u.paypalProviders.unshift(a?.paypalProviderId)), a?.payToProviderId && u.hasPayToProviders && u.payToProviders.includes(a?.payToProviderId) && (u.hasPayToProviders = !0, u.payToProviders.unshift(a?.payToProviderId));
|
|
5651
|
+
let f = [
|
|
5652
|
+
u.hasCardProviders,
|
|
5653
|
+
u.hasPaypalProviders,
|
|
5654
|
+
u.hasPayToProviders,
|
|
5655
|
+
u.hasBnplProviders,
|
|
5656
|
+
u.hasGooglePayProviders,
|
|
5657
|
+
d
|
|
5658
|
+
].filter(Boolean).length > 1, p = this.resolveThreeDsProvider(s, u), m = this.skipCardFraud ? void 0 : u.fraudProviders?.[0], h = {
|
|
5659
|
+
threeDSEnabled: !!u.required3dsProvider,
|
|
5660
|
+
threeDsProviderId: u.required3dsProvider || "",
|
|
5661
|
+
threeDSEmail: a?.threeDSEmail || "",
|
|
5662
|
+
visProviderId: u.hasVisaInstallmentsProviders && u.visaInstallmentsProviders[0] || "",
|
|
5663
|
+
clickToPayEnabled: a?.clickToPayEnabled !== !1 && u.clickToPayEnabled,
|
|
5655
5664
|
clickToPayOptions: {
|
|
5656
|
-
...
|
|
5657
|
-
...
|
|
5665
|
+
...u.clickToPayOptions,
|
|
5666
|
+
...a?.clickToPayOptions
|
|
5658
5667
|
},
|
|
5659
|
-
requiredFields:
|
|
5660
|
-
clientParameters:
|
|
5661
|
-
style:
|
|
5662
|
-
tokenAuthenticationEnabled:
|
|
5663
|
-
networkTokenProviders:
|
|
5664
|
-
createNetworkToken:
|
|
5665
|
-
networkTokenOptions:
|
|
5666
|
-
vault:
|
|
5667
|
-
verifyCard:
|
|
5668
|
-
metadata:
|
|
5668
|
+
requiredFields: s.requiredFields,
|
|
5669
|
+
clientParameters: s.clientParameters,
|
|
5670
|
+
style: a?.cardFormStyle || "compact",
|
|
5671
|
+
tokenAuthenticationEnabled: a?.tokenAuthenticationEnabled && u.hasNetworkTokenProviders,
|
|
5672
|
+
networkTokenProviders: u.networkTokenProviders || [],
|
|
5673
|
+
createNetworkToken: a?.createNetworkToken !== !1 && u.hasNetworkTokenProviders,
|
|
5674
|
+
networkTokenOptions: a?.networkTokenOptions,
|
|
5675
|
+
vault: A(a?.vault),
|
|
5676
|
+
verifyCard: A(a?.verifyCard),
|
|
5677
|
+
metadata: G(a?.metadata),
|
|
5669
5678
|
secureCardOrchestration: {
|
|
5670
5679
|
enabled: !0,
|
|
5671
5680
|
secureUrl: this.config.secureUrl,
|
|
@@ -5674,99 +5683,99 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5674
5683
|
publicKey: this.publicKey,
|
|
5675
5684
|
apiUrl: this.config.apiUrl,
|
|
5676
5685
|
version: n.version,
|
|
5677
|
-
amount:
|
|
5678
|
-
currency:
|
|
5679
|
-
metadata:
|
|
5686
|
+
amount: r,
|
|
5687
|
+
currency: i,
|
|
5688
|
+
metadata: G(a?.metadata),
|
|
5680
5689
|
billingAddress: this.billingAddress,
|
|
5681
5690
|
customer: this.customer,
|
|
5682
5691
|
order: this.order,
|
|
5683
5692
|
geolocation: this.geolocation,
|
|
5684
|
-
fraud: !(
|
|
5693
|
+
fraud: !(a?.clickToPayEnabled !== !1 && u.clickToPayEnabled) && m ? {
|
|
5694
|
+
providerId: m.providerId,
|
|
5695
|
+
providerType: m.providerType,
|
|
5696
|
+
stopPaymentOnFailure: !!m.stopPaymentOnFailure,
|
|
5697
|
+
clientParameters: m.clientParameters || {}
|
|
5698
|
+
} : void 0,
|
|
5699
|
+
threeDs: !(a?.clickToPayEnabled !== !1 && u.clickToPayEnabled) && p ? {
|
|
5685
5700
|
providerId: p.providerId,
|
|
5686
5701
|
providerType: p.providerType,
|
|
5687
|
-
|
|
5688
|
-
clientParameters: p.clientParameters || {}
|
|
5689
|
-
} : void 0,
|
|
5690
|
-
threeDs: !(i?.clickToPayEnabled !== !1 && l.clickToPayEnabled) && f ? {
|
|
5691
|
-
providerId: f.providerId,
|
|
5692
|
-
providerType: f.providerType,
|
|
5693
|
-
cardProviderId: i?.cardProviderId || "",
|
|
5702
|
+
cardProviderId: a?.cardProviderId || "",
|
|
5694
5703
|
clientParameters: {
|
|
5695
|
-
...
|
|
5696
|
-
...
|
|
5704
|
+
...s.clientParameters,
|
|
5705
|
+
...p.clientParameters
|
|
5697
5706
|
}
|
|
5698
5707
|
} : void 0,
|
|
5699
|
-
secondaryThreeDs: !(
|
|
5700
|
-
providerId:
|
|
5701
|
-
providerType:
|
|
5702
|
-
cardProviderId:
|
|
5708
|
+
secondaryThreeDs: !(a?.clickToPayEnabled !== !1 && u.clickToPayEnabled) && u.allThreeDsProviders?.[0] ? {
|
|
5709
|
+
providerId: u.allThreeDsProviders[0].providerId,
|
|
5710
|
+
providerType: u.allThreeDsProviders[0].providerType,
|
|
5711
|
+
cardProviderId: a?.cardProviderId || "",
|
|
5703
5712
|
clientParameters: {
|
|
5704
|
-
...
|
|
5705
|
-
...
|
|
5713
|
+
...s.clientParameters,
|
|
5714
|
+
...u.allThreeDsProviders[0].clientParameters
|
|
5706
5715
|
}
|
|
5707
5716
|
} : void 0
|
|
5708
5717
|
}
|
|
5709
|
-
}, h = {
|
|
5710
|
-
hideShipping: !1,
|
|
5711
|
-
paypalButtonStyle: null,
|
|
5712
|
-
paypalEnablePayIn4: !1,
|
|
5713
|
-
transfer: null,
|
|
5714
|
-
metadata: U(i?.metadata)
|
|
5715
5718
|
}, g = {
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5719
|
+
hideShipping: !!a?.paypalHideShipping,
|
|
5720
|
+
paypalButtonStyle: a?.paypalButtonStyle,
|
|
5721
|
+
paypalEnablePayIn4: !!a?.paypalEnablePayIn4,
|
|
5722
|
+
transfer: null,
|
|
5723
|
+
metadata: G(a?.metadata)
|
|
5724
|
+
}, _ = {
|
|
5725
|
+
description: String(a?.payToDescription).trim() || String(u.payToProvidersWithOptions[0]?.description) || "",
|
|
5726
|
+
maximumAmount: a?.payToMaximumAmount || Number(u.payToProvidersWithOptions[0]?.maximumAmount) || 0,
|
|
5727
|
+
metadata: G(a?.metadata)
|
|
5728
|
+
}, v = {
|
|
5720
5729
|
taxAmount: this.order?.taxAmount,
|
|
5721
5730
|
shippingAmount: this.order?.shippingAmount,
|
|
5722
5731
|
discountAmount: this.order?.discountAmount,
|
|
5723
5732
|
orderItems: this.order?.orderItems,
|
|
5724
5733
|
customer: this.customer || void 0,
|
|
5725
5734
|
billingAddress: this.billingAddress || void 0,
|
|
5726
|
-
metadata:
|
|
5727
|
-
},
|
|
5728
|
-
gateway:
|
|
5729
|
-
googlePayGatewayMerchantId:
|
|
5730
|
-
googlePayMerchantId:
|
|
5731
|
-
googlePayMerchantName:
|
|
5732
|
-
buttonOptions:
|
|
5733
|
-
billingDetailsRequired:
|
|
5734
|
-
metadata:
|
|
5735
|
-
},
|
|
5736
|
-
lineItemLabel:
|
|
5737
|
-
displayName:
|
|
5738
|
-
domainName:
|
|
5739
|
-
merchantIdentifier:
|
|
5740
|
-
providerId:
|
|
5741
|
-
providerType:
|
|
5742
|
-
countryCode:
|
|
5743
|
-
merchantCapabilities:
|
|
5744
|
-
supportedNetworks:
|
|
5745
|
-
supportedCountries:
|
|
5746
|
-
applePayVersion:
|
|
5747
|
-
clientParameters:
|
|
5748
|
-
metadata:
|
|
5735
|
+
metadata: G(a?.metadata)
|
|
5736
|
+
}, y = u.hasGooglePayProviders ? u.googlePayProviders.find((e) => e.providerId === a?.googlePayOptions?.providerId) || u.googlePayProviders[0] : null, b = {
|
|
5737
|
+
gateway: a?.googlePayOptions?.gateway || y?.gateway || "",
|
|
5738
|
+
googlePayGatewayMerchantId: a?.googlePayOptions?.googlePayGatewayMerchantId || y?.googlePayGatewayMerchantId || "",
|
|
5739
|
+
googlePayMerchantId: a?.googlePayOptions?.googlePayMerchantId || y?.googlePayMerchantId || "",
|
|
5740
|
+
googlePayMerchantName: a?.googlePayOptions?.googlePayMerchantName || y?.googlePayMerchantName || "",
|
|
5741
|
+
buttonOptions: a?.googlePayOptions?.buttonOptions,
|
|
5742
|
+
billingDetailsRequired: a?.googlePayOptions?.billingDetailsRequired,
|
|
5743
|
+
metadata: G(a?.metadata)
|
|
5744
|
+
}, x = u.hasApplePayProviders ? u.applePayProviders.find((e) => e.providerId === a?.applePayOptions?.providerId) || u.applePayProviders[0] : null, S = {
|
|
5745
|
+
lineItemLabel: a?.applePayOptions?.lineItemLabel || x?.lineItemLabel || "",
|
|
5746
|
+
displayName: a?.applePayOptions?.displayName || x?.displayName || "",
|
|
5747
|
+
domainName: a?.applePayOptions?.domainName || x?.domainName || "",
|
|
5748
|
+
merchantIdentifier: a?.applePayOptions?.merchantIdentifier || x?.merchantIdentifier || "",
|
|
5749
|
+
providerId: a?.applePayOptions?.providerId || x?.providerId || "",
|
|
5750
|
+
providerType: a?.applePayOptions?.providerType || x?.providerType || "",
|
|
5751
|
+
countryCode: a?.applePayOptions?.countryCode || x?.countryCode,
|
|
5752
|
+
merchantCapabilities: a?.applePayOptions?.merchantCapabilities || x?.merchantCapabilities,
|
|
5753
|
+
supportedNetworks: a?.applePayOptions?.supportedNetworks || x?.supportedNetworks,
|
|
5754
|
+
supportedCountries: a?.applePayOptions?.supportedCountries || x?.supportedCountries,
|
|
5755
|
+
applePayVersion: a?.applePayOptions?.applePayVersion || x?.applePayVersion,
|
|
5756
|
+
clientParameters: s.clientParameters,
|
|
5757
|
+
metadata: G(a?.metadata)
|
|
5749
5758
|
};
|
|
5750
|
-
if (!
|
|
5751
|
-
if (
|
|
5752
|
-
let
|
|
5753
|
-
this.initCardProcessor(
|
|
5759
|
+
if (!f && u.hasCardProviders) {
|
|
5760
|
+
if (c(Y.card)) {
|
|
5761
|
+
let e = t && document.getElementById(t) || null;
|
|
5762
|
+
this.initCardProcessor(e).addCard(e, this.getForm(e), l, r, i, h);
|
|
5754
5763
|
}
|
|
5755
|
-
} else if (!
|
|
5756
|
-
else if (!
|
|
5757
|
-
else if (!
|
|
5758
|
-
if (
|
|
5764
|
+
} else if (!f && u.hasPaypalProviders) c(Y.paypal) && this.addPaypal(t, r, i, u.paypalProviders[0], g);
|
|
5765
|
+
else if (!f && u.hasPayToProviders) c(Y.payto) && this.addPayTo(t, r, u.payToProviders[0], _);
|
|
5766
|
+
else if (!f && u.hasBnplProviders && gn[u.bnplProviders[0].providerType]) {
|
|
5767
|
+
if (u.bnplProviders[0].providerType === "upi") c(Y.upi) && this.addUpi(t, r, u.bnplProviders[0].providerId, a?.upiOptions || {});
|
|
5759
5768
|
else {
|
|
5760
|
-
let
|
|
5761
|
-
|
|
5762
|
-
...
|
|
5763
|
-
...
|
|
5769
|
+
let e = wn(u.bnplProviders[0].providerType);
|
|
5770
|
+
e && c(e) && this.addCheckout(t, r, i, u.bnplProviders[0].providerType, u.bnplProviders[0].providerId, v, {
|
|
5771
|
+
...u.bnplProviders[0].options,
|
|
5772
|
+
...u.bnplProviders[0].clientParameters
|
|
5764
5773
|
});
|
|
5765
5774
|
}
|
|
5766
|
-
} else if (!
|
|
5767
|
-
else if (!
|
|
5768
|
-
else if (
|
|
5769
|
-
let
|
|
5775
|
+
} else if (!f && u.hasGooglePayProviders) c(Y.googlepay) && this.addGooglePay(t, r, i, u.googlePayProviders[0].providerId, b);
|
|
5776
|
+
else if (!f && d) c(Y.applepay) && this.addApplePay(t, r, i, S.providerId || "", S);
|
|
5777
|
+
else if (f) {
|
|
5778
|
+
let e = () => {
|
|
5770
5779
|
window.postMessage({
|
|
5771
5780
|
status: "deactivate",
|
|
5772
5781
|
component: "paypal"
|
|
@@ -5782,113 +5791,113 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5782
5791
|
}, "*"), window.postMessage({
|
|
5783
5792
|
status: "deactivate",
|
|
5784
5793
|
component: "applepay"
|
|
5785
|
-
}, "*"),
|
|
5794
|
+
}, "*"), u.hasBnplProviders && u.bnplProviders.forEach((e) => {
|
|
5786
5795
|
window.postMessage({
|
|
5787
5796
|
status: "deactivate",
|
|
5788
5797
|
component: "checkout",
|
|
5789
5798
|
providerType: e.providerType
|
|
5790
5799
|
}, "*");
|
|
5791
5800
|
});
|
|
5792
|
-
},
|
|
5793
|
-
if (
|
|
5801
|
+
}, n = [];
|
|
5802
|
+
if (u.hasCardProviders && c(Y.card) && n.push({
|
|
5794
5803
|
title: "Card",
|
|
5795
5804
|
description: "Credit or Debit",
|
|
5796
|
-
icon:
|
|
5805
|
+
icon: st,
|
|
5797
5806
|
render: (e) => {
|
|
5798
|
-
this.initCardProcessor(e).addCard(e, this.getForm(e),
|
|
5807
|
+
this.initCardProcessor(e).addCard(e, this.getForm(e), a?.cardProviderId || "", r, i, h);
|
|
5799
5808
|
},
|
|
5800
5809
|
activate: () => {
|
|
5801
|
-
|
|
5810
|
+
e(), window.postMessage({
|
|
5802
5811
|
status: "activate",
|
|
5803
5812
|
component: "card"
|
|
5804
5813
|
}, "*");
|
|
5805
5814
|
}
|
|
5806
|
-
}),
|
|
5815
|
+
}), u.hasPaypalProviders && c(Y.paypal) && n.push({
|
|
5807
5816
|
title: "Paypal",
|
|
5808
|
-
icon:
|
|
5817
|
+
icon: ot,
|
|
5809
5818
|
render: (e) => {
|
|
5810
|
-
this.initPaypalProcessor(e).addPaypal(e, this.getForm(e),
|
|
5819
|
+
this.initPaypalProcessor(e).addPaypal(e, this.getForm(e), r, i, u.paypalProviders[0], g);
|
|
5811
5820
|
},
|
|
5812
5821
|
activate: () => {
|
|
5813
|
-
|
|
5822
|
+
e(), window.postMessage({
|
|
5814
5823
|
status: "activate",
|
|
5815
5824
|
component: "paypal"
|
|
5816
5825
|
}, "*");
|
|
5817
5826
|
}
|
|
5818
|
-
}),
|
|
5819
|
-
if (
|
|
5827
|
+
}), u.hasPayToProviders && c(Y.payto)) {
|
|
5828
|
+
if (M(_.description)) n.push({
|
|
5820
5829
|
title: "PayTo",
|
|
5821
|
-
icon:
|
|
5830
|
+
icon: ut,
|
|
5822
5831
|
render: (e) => {
|
|
5823
|
-
this.initPayToProcessor(e).addPayTo(e,
|
|
5832
|
+
this.initPayToProcessor(e).addPayTo(e, r, u.payToProviders[0], _);
|
|
5824
5833
|
},
|
|
5825
5834
|
activate: () => {
|
|
5826
|
-
|
|
5835
|
+
e(), window.postMessage({
|
|
5827
5836
|
status: "activate",
|
|
5828
5837
|
component: "payto"
|
|
5829
5838
|
}, "*");
|
|
5830
5839
|
}
|
|
5831
5840
|
});
|
|
5832
5841
|
else {
|
|
5833
|
-
this.showErrorMessage(
|
|
5842
|
+
this.showErrorMessage(o, "Missing parameter: PayTo Description"), this.userOnFailure?.({ error: "Missing parameter: PayTo Description" });
|
|
5834
5843
|
return;
|
|
5835
5844
|
}
|
|
5836
5845
|
}
|
|
5837
|
-
|
|
5838
|
-
let
|
|
5839
|
-
if (!
|
|
5840
|
-
let
|
|
5841
|
-
if (!
|
|
5842
|
-
let l =
|
|
5843
|
-
|
|
5844
|
-
title:
|
|
5845
|
-
description:
|
|
5846
|
+
u.hasBnplProviders && u.bnplProviders.forEach((t) => {
|
|
5847
|
+
let o = gn[t.providerType];
|
|
5848
|
+
if (!o) return;
|
|
5849
|
+
let s = wn(t.providerType);
|
|
5850
|
+
if (!s || !c(s)) return;
|
|
5851
|
+
let l = o.icon ? `${this.config.cssUrl}icons/${o.icon}.svg` : null;
|
|
5852
|
+
n.push({
|
|
5853
|
+
title: o.name || t.providerType,
|
|
5854
|
+
description: o.description || t.options?.terms?.replaceAll(/(\d+\.\d{3,})/g, (e, t) => parseFloat(t).toFixed(2)),
|
|
5846
5855
|
icon: l,
|
|
5847
|
-
render: (
|
|
5848
|
-
|
|
5849
|
-
...
|
|
5850
|
-
...
|
|
5856
|
+
render: (e) => {
|
|
5857
|
+
t.providerType === "upi" ? this.addUpi(e.id, r, t.providerId, a?.upiOptions || {}) : this.initCheckoutProcessor(e).addCheckout(e, r, i, t.providerType, t.providerId, v, {
|
|
5858
|
+
...t.options,
|
|
5859
|
+
...t.clientParameters
|
|
5851
5860
|
});
|
|
5852
5861
|
},
|
|
5853
5862
|
activate: () => {
|
|
5854
|
-
|
|
5863
|
+
e(), window.postMessage({
|
|
5855
5864
|
status: "activate",
|
|
5856
5865
|
component: "checkout",
|
|
5857
|
-
providerType:
|
|
5866
|
+
providerType: t.providerType
|
|
5858
5867
|
}, "*");
|
|
5859
5868
|
}
|
|
5860
5869
|
});
|
|
5861
|
-
}),
|
|
5870
|
+
}), u.hasGooglePayProviders && c(Y.googlepay) && n.push({
|
|
5862
5871
|
title: "Google Pay",
|
|
5863
|
-
icon:
|
|
5872
|
+
icon: ct,
|
|
5864
5873
|
render: (e) => {
|
|
5865
|
-
this.initGooglePayProcessor(e).addGooglePay(e,
|
|
5874
|
+
this.initGooglePayProcessor(e).addGooglePay(e, u.hasGooglePayProviders ? u.googlePayProviders[0].providerId : "", r, i, b);
|
|
5866
5875
|
},
|
|
5867
5876
|
activate: () => {
|
|
5868
|
-
|
|
5877
|
+
e(), window.postMessage({
|
|
5869
5878
|
status: "activate",
|
|
5870
5879
|
component: "googlepay"
|
|
5871
5880
|
}, "*");
|
|
5872
5881
|
}
|
|
5873
|
-
}),
|
|
5882
|
+
}), d && c(Y.applepay) && n.push({
|
|
5874
5883
|
title: "Apple Pay",
|
|
5875
5884
|
icon: Tr,
|
|
5876
5885
|
render: (e) => {
|
|
5877
|
-
this.addApplePay(e.id,
|
|
5886
|
+
this.addApplePay(e.id, r, i, S.providerId || "", S);
|
|
5878
5887
|
},
|
|
5879
5888
|
activate: () => {
|
|
5880
|
-
|
|
5889
|
+
e(), window.postMessage({
|
|
5881
5890
|
status: "activate",
|
|
5882
5891
|
component: "applepay"
|
|
5883
5892
|
}, "*");
|
|
5884
5893
|
}
|
|
5885
5894
|
});
|
|
5886
|
-
let
|
|
5887
|
-
el: document.getElementById(
|
|
5888
|
-
component:
|
|
5889
|
-
props: { elements:
|
|
5895
|
+
let s = Me({
|
|
5896
|
+
el: document.getElementById(t),
|
|
5897
|
+
component: xt,
|
|
5898
|
+
props: { elements: n }
|
|
5890
5899
|
});
|
|
5891
|
-
this.setDestroyDropIn(
|
|
5900
|
+
this.setDestroyDropIn(o, s.destroy);
|
|
5892
5901
|
}
|
|
5893
5902
|
})), this;
|
|
5894
5903
|
}
|
|
@@ -5901,9 +5910,9 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5901
5910
|
});
|
|
5902
5911
|
let a = e && document.getElementById(e) || null;
|
|
5903
5912
|
if (!a) throw this.userOnFailure?.({ error: "Container is not available" }), TypeError("Container is not available");
|
|
5904
|
-
if (!
|
|
5905
|
-
if (!
|
|
5906
|
-
return n &&= n.toUpperCase(), this._cleanUp(a), this._initForm(a), this.setAmount(t), this.setCurrency(n), this.initProcessors(a, t, n, r || "", "", { clickToPayEnabled: !1 },
|
|
5913
|
+
if (!j(t)) throw this.showErrorMessage(a, "Missing parameter: amount"), this.userOnFailure?.({ error: "Missing parameter: amount" }), TypeError("Missing parameter: amount");
|
|
5914
|
+
if (!B(n)) throw this.showErrorMessage(a, "Missing parameter: currency"), this.userOnFailure?.({ error: "Missing parameter: currency" }), TypeError("Missing parameter: currency");
|
|
5915
|
+
return n &&= n.toUpperCase(), this._cleanUp(a), this._initForm(a), this.setAmount(t), this.setCurrency(n), this.initProcessors(a, t, n, r || "", "", { clickToPayEnabled: !1 }, z(this, "[addPaypal][initProcessors], callback", (e, o) => {
|
|
5907
5916
|
let s = o.paypalProviders[0] || r || "";
|
|
5908
5917
|
s ? this.initPaypalProcessor(a).addPaypal(a, this.getForm(a), t, n, s, i) : (this.paymentMethodStatus({
|
|
5909
5918
|
paymentMethod: "paypal",
|
|
@@ -5920,16 +5929,16 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5920
5929
|
});
|
|
5921
5930
|
let i = e && document.getElementById(e) || null;
|
|
5922
5931
|
if (!i) throw this.userOnFailure?.({ error: "Container is not available" }), TypeError("Container is not available");
|
|
5923
|
-
if (!
|
|
5932
|
+
if (!j(t)) throw this.showErrorMessage(i, "Missing parameter: amount"), this.userOnFailure?.({ error: "Missing parameter: amount" }), TypeError("Missing parameter: amount");
|
|
5924
5933
|
this._cleanUp(i), this._initForm(i), this.setAmount(t), this.setCurrency("AUD");
|
|
5925
|
-
let a =
|
|
5934
|
+
let a = z(this, "[localAddPayTo]", (e, n) => {
|
|
5926
5935
|
this.log("[addPayTo, local]", {
|
|
5927
5936
|
amount: t,
|
|
5928
5937
|
localProviderId: e,
|
|
5929
5938
|
localOptions: n
|
|
5930
5939
|
}), this.initPayToProcessor(i).addPayTo(i, t, e, n);
|
|
5931
5940
|
});
|
|
5932
|
-
return n && r?.maximumAmount && r?.description ? (a(n, r), this) : (this.initProcessors(i, t, "AUD", n || "", "", {},
|
|
5941
|
+
return n && r?.maximumAmount && r?.description ? (a(n, r), this) : (this.initProcessors(i, t, "AUD", n || "", "", {}, z(this, "[addPayTo][initProcessors], callback", (e, t) => {
|
|
5933
5942
|
if (!t.hasPayToProviders) {
|
|
5934
5943
|
this.paymentMethodStatus({
|
|
5935
5944
|
paymentMethod: "payto",
|
|
@@ -5942,7 +5951,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5942
5951
|
a(n.providerId, {
|
|
5943
5952
|
maximumAmount: n.maximumAmount,
|
|
5944
5953
|
description: n.description,
|
|
5945
|
-
metadata:
|
|
5954
|
+
metadata: G(r?.metadata)
|
|
5946
5955
|
});
|
|
5947
5956
|
})), this);
|
|
5948
5957
|
}
|
|
@@ -5955,10 +5964,10 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5955
5964
|
});
|
|
5956
5965
|
let a = e && document.getElementById(e) || null;
|
|
5957
5966
|
if (!a) throw this.userOnFailure?.({ error: "Container is not available" }), TypeError("Container is not available");
|
|
5958
|
-
if (!
|
|
5959
|
-
if (!
|
|
5967
|
+
if (!j(t)) throw this.showErrorMessage(a, "Missing parameter: amount"), this.userOnFailure?.({ error: "Missing parameter: amount" }), TypeError("Missing parameter: amount");
|
|
5968
|
+
if (!B(n)) throw this.showErrorMessage(a, "Missing parameter: currency"), this.userOnFailure?.({ error: "Missing parameter: currency" }), TypeError("Missing parameter: currency");
|
|
5960
5969
|
n &&= n.toUpperCase(), this._cleanUp(a), this._initForm(a), this.setAmount(t), this.setCurrency(n);
|
|
5961
|
-
let o =
|
|
5970
|
+
let o = z(this, "[localAddGooglePay]", (e, r) => {
|
|
5962
5971
|
this.log("[addGooglePay, local]", {
|
|
5963
5972
|
amount: t,
|
|
5964
5973
|
currency: n,
|
|
@@ -5966,7 +5975,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5966
5975
|
localOptions: r
|
|
5967
5976
|
}), this.initGooglePayProcessor(a).addGooglePay(a, e, t, n, r);
|
|
5968
5977
|
});
|
|
5969
|
-
return this.initProcessors(a, t, n, r || "", "", { clickToPayEnabled: !1 },
|
|
5978
|
+
return this.initProcessors(a, t, n, r || "", "", { clickToPayEnabled: !1 }, z(this, "[addGooglePay][initProcessors], callback", (e, t) => {
|
|
5970
5979
|
if (r && i?.gateway && i?.googlePayGatewayMerchantId) {
|
|
5971
5980
|
o(r, i);
|
|
5972
5981
|
return;
|
|
@@ -5987,11 +5996,11 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5987
5996
|
googlePayMerchantName: n.googlePayMerchantName,
|
|
5988
5997
|
buttonOptions: i?.buttonOptions,
|
|
5989
5998
|
billingDetailsRequired: i?.billingDetailsRequired,
|
|
5990
|
-
metadata:
|
|
5999
|
+
metadata: G(i?.metadata)
|
|
5991
6000
|
});
|
|
5992
6001
|
})), this;
|
|
5993
6002
|
}
|
|
5994
|
-
async isApplePayAvailable() {
|
|
6003
|
+
static async isApplePayAvailable() {
|
|
5995
6004
|
if (await vr(), typeof window > "u" || !window.ApplePaySession) return !1;
|
|
5996
6005
|
try {
|
|
5997
6006
|
return ApplePaySession.canMakePayments() === !0;
|
|
@@ -5999,9 +6008,12 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
5999
6008
|
return !1;
|
|
6000
6009
|
}
|
|
6001
6010
|
}
|
|
6002
|
-
|
|
6003
|
-
return
|
|
6004
|
-
|
|
6011
|
+
isApplePayAvailable() {
|
|
6012
|
+
return e.isApplePayAvailable();
|
|
6013
|
+
}
|
|
6014
|
+
addApplePay(t, n, r, i, a) {
|
|
6015
|
+
return e.isApplePayAvailable().then(z(this, "[addApplePay], available", (e) => {
|
|
6016
|
+
e ? this.renderApplePay(t, n, r, i, a) : (this.log("Your browser does not support ApplePay"), this.paymentMethodStatus({
|
|
6005
6017
|
paymentMethod: "applepay",
|
|
6006
6018
|
status: "unavailable",
|
|
6007
6019
|
reason: "unsupported"
|
|
@@ -6017,10 +6029,10 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6017
6029
|
});
|
|
6018
6030
|
let a = e && document.getElementById(e) || null;
|
|
6019
6031
|
if (!a) throw this.userOnFailure?.({ error: "Container is not available" }), TypeError("Container is not available");
|
|
6020
|
-
if (!
|
|
6021
|
-
if (!
|
|
6032
|
+
if (!j(t)) throw this.showErrorMessage(a, "Missing parameter: amount"), this.userOnFailure?.({ error: "Missing parameter: amount" }), TypeError("Missing parameter: amount");
|
|
6033
|
+
if (!B(n)) throw this.showErrorMessage(a, "Missing parameter: currency"), this.userOnFailure?.({ error: "Missing parameter: currency" }), TypeError("Missing parameter: currency");
|
|
6022
6034
|
n &&= n.toUpperCase(), this._cleanUp(a), this._initForm(a), this.setAmount(t), this.setCurrency(n);
|
|
6023
|
-
let o =
|
|
6035
|
+
let o = z(this, "[localAddApplePay]", (e, r, i, o) => {
|
|
6024
6036
|
this.log("[addApplePay, local]", {
|
|
6025
6037
|
amount: t,
|
|
6026
6038
|
currency: n,
|
|
@@ -6033,7 +6045,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6033
6045
|
clientParameters: o
|
|
6034
6046
|
});
|
|
6035
6047
|
});
|
|
6036
|
-
this.initProcessors(a, t, n, r || "", "", { clickToPayEnabled: !1 },
|
|
6048
|
+
this.initProcessors(a, t, n, r || "", "", { clickToPayEnabled: !1 }, z(this, "[addApplePay][initProcessors], callback", (e, t) => {
|
|
6037
6049
|
if (!t.hasApplePayProviders) {
|
|
6038
6050
|
this.paymentMethodStatus({
|
|
6039
6051
|
paymentMethod: "applepay",
|
|
@@ -6055,7 +6067,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6055
6067
|
supportedNetworks: i?.supportedNetworks || n.supportedNetworks,
|
|
6056
6068
|
supportedCountries: i?.supportedCountries || n.supportedCountries,
|
|
6057
6069
|
applePayVersion: i?.applePayVersion || n.applePayVersion,
|
|
6058
|
-
metadata:
|
|
6070
|
+
metadata: G(i?.metadata)
|
|
6059
6071
|
}, e.clientParameters || n.clientParameters);
|
|
6060
6072
|
}));
|
|
6061
6073
|
}
|
|
@@ -6080,13 +6092,13 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6080
6092
|
});
|
|
6081
6093
|
let i = e && document.getElementById(e) || null;
|
|
6082
6094
|
if (!i) throw this.userOnFailure?.({ error: "Container is not available" }), TypeError("Container is not available");
|
|
6083
|
-
if (!
|
|
6084
|
-
if (!
|
|
6085
|
-
if (!
|
|
6086
|
-
if (!
|
|
6095
|
+
if (!M(n)) throw this.showErrorMessage(i, "Missing parameter: providerId"), this.userOnFailure?.({ error: "Missing parameter: Provider Id" }), TypeError("Missing parameter: providerId");
|
|
6096
|
+
if (!M(r?.email)) throw this.showErrorMessage(i, "Missing parameter: options.email"), this.userOnFailure?.({ error: "Missing parameter: options.email" }), TypeError("Missing parameter: options.email");
|
|
6097
|
+
if (!M(r?.name)) throw this.showErrorMessage(i, "Missing parameter: options.name"), this.userOnFailure?.({ error: "Missing parameter: options.name" }), TypeError("Missing parameter: options.name");
|
|
6098
|
+
if (!M(r?.documentId)) throw this.showErrorMessage(i, "Missing parameter: options.documentId"), this.userOnFailure?.({ error: "Missing parameter: options.documentId" }), TypeError("Missing parameter: options.documentId");
|
|
6087
6099
|
this._initForm(i), this.setAmount(t);
|
|
6088
6100
|
let a = this.order?.orderItems || [], o = this.customer || {}, s = this.billingAddress || {};
|
|
6089
|
-
|
|
6101
|
+
M(o.firstName) || (o.firstName = r.name), M(o.email) || (o.email = r.email), M(s.firstName) || (s.firstName = r.name), M(s.email) || (s.email = r.email), M(o.phoneNumber) || (o.phoneNumber = "+3146781223"), M(s.phoneNumber) || (s.phoneNumber = "+3146781223"), a.length === 0 && a.push({
|
|
6090
6102
|
name: "UPI Payment",
|
|
6091
6103
|
sku: "UPI Payment",
|
|
6092
6104
|
quantity: 1,
|
|
@@ -6100,7 +6112,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6100
6112
|
orderItems: a,
|
|
6101
6113
|
customer: o,
|
|
6102
6114
|
billingAddress: s,
|
|
6103
|
-
metadata:
|
|
6115
|
+
metadata: G(r?.metadata)
|
|
6104
6116
|
};
|
|
6105
6117
|
return this.initCheckoutProcessor(i).addCheckout(i, t, this.currency, "upi", n, c, {
|
|
6106
6118
|
documentId: r.documentId,
|
|
@@ -6124,10 +6136,10 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6124
6136
|
options: u
|
|
6125
6137
|
});
|
|
6126
6138
|
let d = e && document.getElementById(e) || null;
|
|
6127
|
-
if (!
|
|
6128
|
-
if (!
|
|
6129
|
-
return s &&= s.toUpperCase(), this._cleanUp(d), this._initForm(d), this.setAmount(o), this.setCurrency(s), t = l(t), this.getPaymentOptions(o, s,
|
|
6130
|
-
e.hasThreeDsProviders ? this.add3DsProcessor(d, e.threeDsProviders[0].providerId, e.threeDsProviders[0].providerType, "", e.threeDsProviders[0].clientParameters || {},
|
|
6139
|
+
if (!j(o)) throw this.showErrorMessage(d, "Missing parameter: amount"), this.userOnFailure?.({ error: "Missing parameter: amount" }), TypeError("Missing parameter: amount");
|
|
6140
|
+
if (!B(s)) throw this.showErrorMessage(d, "Missing parameter: currency"), this.userOnFailure?.({ error: "Missing parameter: currency" }), TypeError("Missing parameter: currency");
|
|
6141
|
+
return s &&= s.toUpperCase(), this._cleanUp(d), this._initForm(d), this.setAmount(o), this.setCurrency(s), t = l(t), this.getPaymentOptions(o, s, z(this, "[addThreeDsWithFullParameters][getPaymentOptions], callback", (e) => {
|
|
6142
|
+
e.hasThreeDsProviders ? this.add3DsProcessor(d, e.threeDsProviders[0].providerId, e.threeDsProviders[0].providerType, "", e.threeDsProviders[0].clientParameters || {}, z(this, "[addThreeDsWithFullParameters][add3DsProcessor], onload", () => {
|
|
6131
6143
|
this.threeDsProcessor?.setEmail(a), this.threeDsProcessor?.setPaymentInfo({
|
|
6132
6144
|
cardNumber: t,
|
|
6133
6145
|
expiryDate: n,
|
|
@@ -6136,7 +6148,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6136
6148
|
}), this.threeDsProcessor?.threeDSInvoke(d, !!u?.requireChallenge, (e) => {
|
|
6137
6149
|
Ei(), this.log("[threeDSInvoke], postAuthData", e), this.userOnSuccess?.({ threeDSServerTransID: e.threeDSServerTransID });
|
|
6138
6150
|
});
|
|
6139
|
-
}),
|
|
6151
|
+
}), z(this, "[addThreeDsWithFullParameters][add3DsProcessor], onerror", () => {
|
|
6140
6152
|
this.log(`Cannot load 3DS provider (${e.threeDsProviders[0].providerType})`), this.userOnSuccess?.({});
|
|
6141
6153
|
})) : (this.log("No 3DS providers found"), this.userOnSuccess?.({}));
|
|
6142
6154
|
})), this;
|
|
@@ -6155,13 +6167,13 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6155
6167
|
options: f
|
|
6156
6168
|
});
|
|
6157
6169
|
let p = e && document.getElementById(e) || null;
|
|
6158
|
-
if (!
|
|
6159
|
-
if (!
|
|
6160
|
-
if (!
|
|
6170
|
+
if (!M(t)) throw this.showErrorMessage(p, "Missing parameter: providerId"), this.userOnFailure?.({ error: "Missing parameter: Provider Id" }), TypeError("Missing parameter: providerId");
|
|
6171
|
+
if (!j(c)) throw this.userOnFailure?.({ error: "Missing parameter: amount" }), TypeError("Missing parameter: amount");
|
|
6172
|
+
if (!B(u)) throw this.userOnFailure?.({ error: "Missing parameter: currency" }), TypeError("Missing parameter: currency");
|
|
6161
6173
|
return u &&= u.toUpperCase(), this._cleanUp(p), this._initForm(p), this.setAmount(c), this.setCurrency(u), n = l(n), this.initProcessors(p, c, u, t, "", {
|
|
6162
6174
|
createNetworkToken: f?.createNetworkToken,
|
|
6163
6175
|
clickToPayEnabled: !1
|
|
6164
|
-
},
|
|
6176
|
+
}, z(this, "[tokeniseWith3Ds][initProcessors], callback", (e, r) => {
|
|
6165
6177
|
this.fraudProcessor?.setPaymentInfo({
|
|
6166
6178
|
cardNumber: n,
|
|
6167
6179
|
expiryDate: i,
|
|
@@ -6169,7 +6181,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6169
6181
|
ccv: o
|
|
6170
6182
|
}), this.runFraudGate(p, (r, s) => {
|
|
6171
6183
|
let c = (e) => {
|
|
6172
|
-
this.initCardProcessor(null).tokeniseCard(t, n, i, a, o,
|
|
6184
|
+
this.initCardProcessor(null).tokeniseCard(t, n, i, a, o, G(d), e, f, r);
|
|
6173
6185
|
};
|
|
6174
6186
|
s ? c(s) : this.threeDsOrTokenise(p, e, n, i, a, o, f, c);
|
|
6175
6187
|
});
|
|
@@ -6193,14 +6205,14 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6193
6205
|
cardHolderName: i,
|
|
6194
6206
|
options: c,
|
|
6195
6207
|
metadata: o
|
|
6196
|
-
}), t = l(t), c?.amount &&
|
|
6208
|
+
}), t = l(t), c?.amount && j(c.amount) && this.setAmount(c.amount), c?.currency && B(c.currency) && this.setCurrency(c.currency.toUpperCase());
|
|
6197
6209
|
let u = (r, l) => {
|
|
6198
|
-
this.initCardProcessor(null).tokeniseCard(e, t, n, i, a,
|
|
6210
|
+
this.initCardProcessor(null).tokeniseCard(e, t, n, i, a, G(o), l || s, c, r);
|
|
6199
6211
|
};
|
|
6200
6212
|
return !this.amount || !this.currency ? (u(), this) : (this.initProcessors(null, this.amount, this.currency, e, "", {
|
|
6201
6213
|
createNetworkToken: c?.createNetworkToken,
|
|
6202
6214
|
clickToPayEnabled: !1
|
|
6203
|
-
},
|
|
6215
|
+
}, z(this, "[tokeniseCard][initProcessors], callback", () => {
|
|
6204
6216
|
this.fraudProcessor?.setPaymentInfo({
|
|
6205
6217
|
cardNumber: t,
|
|
6206
6218
|
expiryDate: n,
|
|
@@ -6216,10 +6228,10 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6216
6228
|
amount: n,
|
|
6217
6229
|
currency: r,
|
|
6218
6230
|
options: a
|
|
6219
|
-
}), !
|
|
6220
|
-
if (!
|
|
6221
|
-
if (!
|
|
6222
|
-
return r &&= r.toUpperCase(), this.setAmount(n), this.setCurrency(r), this.initProcessors(null, n, r, "", e, { clickToPayEnabled: !1 },
|
|
6231
|
+
}), !M(e)) throw this.userOnFailure?.({ error: "Missing parameter: Token Id" }), TypeError("Missing parameter: tokenId");
|
|
6232
|
+
if (!j(n)) throw this.userOnFailure?.({ error: "Missing parameter: amount" }), TypeError("Missing parameter: amount");
|
|
6233
|
+
if (!B(r)) throw this.userOnFailure?.({ error: "Missing parameter: currency" }), TypeError("Missing parameter: currency");
|
|
6234
|
+
return r &&= r.toUpperCase(), this.setAmount(n), this.setCurrency(r), this.initProcessors(null, n, r, "", e, { clickToPayEnabled: !1 }, z(this, "[addThreeDsWithToken][initProcessors], callback", () => {
|
|
6223
6235
|
this.fraudProcessor?.setPaymentReference({ tokenId: e }), this.runFraudGate(null, (n, r) => {
|
|
6224
6236
|
r ? this.userOnSuccess?.({ threeDSServerTransID: r }) : this.threeDsWithToken(e, t, i, a);
|
|
6225
6237
|
});
|
|
@@ -6240,7 +6252,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6240
6252
|
onShow: Ei,
|
|
6241
6253
|
onProgress: this.threeDsProgress.bind(this),
|
|
6242
6254
|
log: this.log.bind(this)
|
|
6243
|
-
}).then(
|
|
6255
|
+
}).then(z(this, "[runFraudGate]", (n) => {
|
|
6244
6256
|
"error" in n ? (Ei(), this.log("[runFraudGate], failure", n), this.showErrorMessage(e, n.error), this.userOnFailure?.({
|
|
6245
6257
|
error: n.error,
|
|
6246
6258
|
...n.reason && { errorDetails: { reason: n.reason } }
|
|
@@ -6257,9 +6269,9 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6257
6269
|
n?.(this.paymentOptions[i]);
|
|
6258
6270
|
return;
|
|
6259
6271
|
}
|
|
6260
|
-
let a =
|
|
6272
|
+
let a = z(this, "[getPaymentOptions], failure", (e, t) => {
|
|
6261
6273
|
this.log("[getPaymentOptions], failure", t), r?.(), this.showErrorMessage(null, "Unable to configure SDK"), this.userOnFailure?.({ error: "Unable to configure SDK" });
|
|
6262
|
-
}), o =
|
|
6274
|
+
}), o = z(this, "[getPaymentOptions], success", (e, t) => {
|
|
6263
6275
|
let r = JSON.parse(t);
|
|
6264
6276
|
this.log("[getPaymentOptions], success", r), this.paymentOptions[i] = r, n?.(r);
|
|
6265
6277
|
});
|
|
@@ -6277,9 +6289,9 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6277
6289
|
i?.(this.paymentOptions[o]);
|
|
6278
6290
|
return;
|
|
6279
6291
|
}
|
|
6280
|
-
let s =
|
|
6292
|
+
let s = z(this, "[getProviderInfo], error", (e, t) => {
|
|
6281
6293
|
this.log("[getProviderInfo], error", e, t), a({ error: "Unable to get provider information" });
|
|
6282
|
-
}), c =
|
|
6294
|
+
}), c = z(this, "[getProviderInfo], success", (e, t) => {
|
|
6283
6295
|
this.log("[getProviderInfo], success", e, t);
|
|
6284
6296
|
let n = JSON.parse(t);
|
|
6285
6297
|
this.log("[getProviderInfo], data", n), this.paymentOptions[o] = n, i(n);
|
|
@@ -6288,13 +6300,13 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6288
6300
|
}
|
|
6289
6301
|
setAmount(e) {
|
|
6290
6302
|
return Number(e) === Number(this.amount) || Number(e) < 0 || (this.log("[setAmount]", Number(e)), this.amount = Number(e), this.cardProcessor?.setAmount(this.amount), this.threeDsProcessor?.setAmount(this.amount), this.secondaryThreeDsProcessor?.setAmount(this.amount), this.paypalProcessor?.setAmount(this.amount), this.fraudProcessor?.setAmount(this.amount), this.googlePayProcessor?.setAmount(this.amount), this.applePayProcessor?.setAmount(this.amount), this.paymentMethodProcessor?.setAmount(this.amount), window.postMessage({
|
|
6291
|
-
status:
|
|
6303
|
+
status: ae,
|
|
6292
6304
|
amount: this.amount
|
|
6293
6305
|
}, "*")), this;
|
|
6294
6306
|
}
|
|
6295
6307
|
setCurrency(e) {
|
|
6296
6308
|
return e === this.currency || (e &&= e.toUpperCase(), this.log("[setCurrency]", e), this.currency = e, this.cardProcessor?.setCurrency(e), this.threeDsProcessor?.setCurrency(e), this.secondaryThreeDsProcessor?.setCurrency(e), this.googlePayProcessor?.setCurrency(e), this.applePayProcessor?.setCurrency(e), this.paymentMethodProcessor?.setCurrency(e), window.postMessage({
|
|
6297
|
-
status:
|
|
6309
|
+
status: et,
|
|
6298
6310
|
currency: e
|
|
6299
6311
|
}, "*")), this;
|
|
6300
6312
|
}
|
|
@@ -6324,11 +6336,11 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6324
6336
|
return this;
|
|
6325
6337
|
}
|
|
6326
6338
|
showErrorMessage(e, t) {
|
|
6327
|
-
this.log(t),
|
|
6339
|
+
this.log(t), I(e, t);
|
|
6328
6340
|
}
|
|
6329
6341
|
setBillingAddress(e) {
|
|
6330
6342
|
return this.log("[setBillingAddress]", e), this.billingAddress = { ...e }, this.cardProcessor?.setBillingAddress(this.billingAddress), this.googlePayProcessor?.setBillingAddress(this.billingAddress), this.applePayProcessor?.setBillingAddress(this.billingAddress), this.threeDsProcessor?.setAddressInfo(this.billingAddress), this.fraudProcessor?.setAddressInfo(this.billingAddress), this.paymentMethodProcessor?.setBillingAddress(this.billingAddress), window.postMessage({
|
|
6331
|
-
status:
|
|
6343
|
+
status: fe,
|
|
6332
6344
|
address: e
|
|
6333
6345
|
}, "*"), this;
|
|
6334
6346
|
}
|
|
@@ -6340,7 +6352,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6340
6352
|
}
|
|
6341
6353
|
setOrderInfo(e) {
|
|
6342
6354
|
return this.log("[setOrderInfo]", e), this.order = { ...e }, this.cardProcessor?.setOrderInfo(this.order), this.googlePayProcessor?.setOrderInfo(this.order), this.applePayProcessor?.setOrderInfo(this.order), this.fraudProcessor?.setOrderInfo(this.order), this.paymentMethodProcessor?.setOrderInfo(this.order), window.postMessage({
|
|
6343
|
-
status:
|
|
6355
|
+
status: ee,
|
|
6344
6356
|
order: e
|
|
6345
6357
|
}, "*"), this;
|
|
6346
6358
|
}
|
|
@@ -6372,60 +6384,60 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6372
6384
|
this.initProcessorsRunning = !0;
|
|
6373
6385
|
let s = () => {
|
|
6374
6386
|
this.initProcessorsRunning = !1, this.initProcessorsQueue.shift()?.();
|
|
6375
|
-
}, c = {}, l = "", u = "", d = !1, f = {}, p = "", m = "", h = {}, g = "",
|
|
6376
|
-
this.getProviderInfo(r, t, n, i || "",
|
|
6377
|
-
c = { ...t }, !
|
|
6378
|
-
}),
|
|
6387
|
+
}, c = {}, l = "", u = "", d = !1, f = {}, p = "", m = "", h = {}, g = "", _ = "", v = {}, y = !1, b = !1, x = (e) => {
|
|
6388
|
+
this.getProviderInfo(r, t, n, i || "", z(this, "[getProviderInfo], success", (t) => {
|
|
6389
|
+
c = { ...t }, !y && t.threeDsProviderId && (p = t.threeDsProviderId, m = t.threeDsProviderType, h = t.threeDsClientParameters || {}), e();
|
|
6390
|
+
}), z(this, "[getProviderInfo], error", (t) => {
|
|
6379
6391
|
this.log("Unable to get provider information", t), e();
|
|
6380
6392
|
}));
|
|
6381
|
-
},
|
|
6382
|
-
this.fraudProcessor = null, this.fraudManageOrder = null, this.skipCardFraud =
|
|
6393
|
+
}, S = z(this, "[initFraudProcessor]", (e, t, n, r, i) => {
|
|
6394
|
+
this.fraudProcessor = null, this.fraudManageOrder = null, this.skipCardFraud = Ft(m), this.cardProcessor?.addFraudProcessor(null), this.paypalProcessor?.addFraudProcessor(null), this.googlePayProcessor?.addFraudProcessor(null), this.applePayProcessor?.addFraudProcessor(null), this.paymentMethodProcessor?.addFraudProcessor(null, null), !e || !t ? i() : this.addFraudProcessor(e, t, n, r, {}, z(this, "[addFraudProcessor], success", () => {
|
|
6383
6395
|
i();
|
|
6384
|
-
}),
|
|
6396
|
+
}), z(this, "[addFraudProcessor], error", () => {
|
|
6385
6397
|
this.log("Error loading fraud provider", t), i();
|
|
6386
6398
|
}));
|
|
6387
|
-
}),
|
|
6399
|
+
}), ee = z(this, "[initThreeDsProcessor]", (t, n, i) => {
|
|
6388
6400
|
!t || !n ? i() : this.add3DsProcessor(e, t, n, r, {
|
|
6389
6401
|
...c.clientParameters,
|
|
6390
6402
|
...h
|
|
6391
|
-
},
|
|
6403
|
+
}, z(this, "[add3DsProcessor], success", () => {
|
|
6392
6404
|
i();
|
|
6393
|
-
}),
|
|
6405
|
+
}), z(this, "[add3DsProcessor], error", () => {
|
|
6394
6406
|
this.log("Error loading 3ds provider", n), i();
|
|
6395
6407
|
}));
|
|
6396
|
-
}),
|
|
6408
|
+
}), te = z(this, "[initSecondaryThreeDsProcessor]", (t, n, i) => {
|
|
6397
6409
|
!t || !n ? i() : this.addSecondary3DsProcessor(e, t, n, r, {
|
|
6398
6410
|
...c.clientParameters,
|
|
6399
|
-
...
|
|
6400
|
-
},
|
|
6411
|
+
...v
|
|
6412
|
+
}, z(this, "[addSecondary3DsProcessor], success", () => {
|
|
6401
6413
|
i();
|
|
6402
|
-
}),
|
|
6414
|
+
}), z(this, "[addSecondary3DsProcessor], error", () => {
|
|
6403
6415
|
this.log("Error loading 3ds provider", n), i();
|
|
6404
6416
|
}));
|
|
6405
|
-
}),
|
|
6417
|
+
}), C = z(this, "[callCallback]", (e, t) => {
|
|
6406
6418
|
try {
|
|
6407
6419
|
o(e, t);
|
|
6408
6420
|
} finally {
|
|
6409
6421
|
s();
|
|
6410
6422
|
}
|
|
6411
6423
|
});
|
|
6412
|
-
this.getPaymentOptions(t, n,
|
|
6413
|
-
a?.createNetworkToken && !a?.tokenAuthenticationEnabled && (t.clickToPayEnabled = !1), t?.clickToPayEnabled && a?.clickToPayEnabled !== !1 && (
|
|
6424
|
+
this.getPaymentOptions(t, n, z(this, "[getPaymentOptions], callback", (t) => {
|
|
6425
|
+
a?.createNetworkToken && !a?.tokenAuthenticationEnabled && (t.clickToPayEnabled = !1), t?.clickToPayEnabled && a?.clickToPayEnabled !== !1 && (y = !0, b = !0), t?.hasNetworkTokenProviders && a?.tokenAuthenticationEnabled && (y = !0), !y && t.hasThreeDsProviders && (p = t.threeDsProviders[0].providerId, m = t.threeDsProviders[0].providerType, h = t.threeDsProviders[0].clientParameters || {}), !y && t.allThreeDsProviders?.[0]?.providerId && (g = t.allThreeDsProviders[0].providerId, _ = t.allThreeDsProviders[0].providerType, v = t.allThreeDsProviders[0].clientParameters || {}), !b && t.hasFraudProviders && (l = t.fraudProviders[0].providerId, u = t.fraudProviders[0].providerType, d = t.fraudProviders[0].stopPaymentOnFailure, f = t.fraudProviders[0].clientParameters || {}), t.clickToPayEnabled && a?.clickToPayEnabled !== !1 && this.initClickToPayProcessor(e, {
|
|
6414
6426
|
...t.clickToPayOptions,
|
|
6415
6427
|
...a?.clickToPayOptions,
|
|
6416
6428
|
tokenAuthenticationEnabled: !!a?.tokenAuthenticationEnabled,
|
|
6417
6429
|
networkTokenOptions: a?.networkTokenOptions
|
|
6418
|
-
}), !r && !i ?
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6430
|
+
}), !r && !i ? S(l, u, d, f, () => {
|
|
6431
|
+
ee(p, m, () => {
|
|
6432
|
+
te(g, _, () => {
|
|
6433
|
+
C(c, t);
|
|
6422
6434
|
});
|
|
6423
6435
|
});
|
|
6424
|
-
}) :
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6436
|
+
}) : x(() => {
|
|
6437
|
+
S(l, u, d, f, () => {
|
|
6438
|
+
ee(p, m, () => {
|
|
6439
|
+
te(g, _, () => {
|
|
6440
|
+
C(c, t);
|
|
6429
6441
|
});
|
|
6430
6442
|
});
|
|
6431
6443
|
});
|
|
@@ -6439,7 +6451,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6439
6451
|
billingAddress: this.billingAddress,
|
|
6440
6452
|
customer: this.customer,
|
|
6441
6453
|
order: this.order
|
|
6442
|
-
}), o?.()) : Ti(t).then(
|
|
6454
|
+
}), o?.()) : Ti(t).then(z(this, "[addFraudProcessor], onload", (s) => {
|
|
6443
6455
|
this.log(`Loading ${t}...`, s);
|
|
6444
6456
|
let c = s.default(i);
|
|
6445
6457
|
c?.getFraudCheckData && (this.fraudProcessor = new Rn(this.log.bind(this), {
|
|
@@ -6459,7 +6471,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6459
6471
|
this.log("[fraudProcessor], failure", e);
|
|
6460
6472
|
}
|
|
6461
6473
|
}), this.amount && this.fraudProcessor.setAmount(this.amount), this.currency && this.fraudProcessor.setCurrency(this.currency), this.billingAddress && this.fraudProcessor.setAddressInfo(this.billingAddress), this.customer && this.fraudProcessor.setCustomerInfo(this.customer), this.order && this.fraudProcessor.setOrderInfo(this.order), this.fraudManageOrder = typeof c.manageOrder == "function" ? c.manageOrder : null, this.cardProcessor?.addFraudProcessor(this.cardFraudProcessor), this.paypalProcessor?.addFraudProcessor(this.fraudProcessor), this.googlePayProcessor?.addFraudProcessor(this.fraudProcessor), this.applePayProcessor?.addFraudProcessor(this.fraudProcessor), this.paymentMethodProcessor?.addFraudProcessor(this.cardFraudProcessor, this.fraudManageOrder), o?.());
|
|
6462
|
-
})).catch(
|
|
6474
|
+
})).catch(z(this, "[addFraudProcessor], onerror", (e) => {
|
|
6463
6475
|
this.log(`Error loading ${t}`, e), s?.();
|
|
6464
6476
|
}));
|
|
6465
6477
|
}
|
|
@@ -6471,14 +6483,14 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6471
6483
|
} : t.threeDsProviders?.find((e) => e.providerId === t.required3dsProvider) || t.threeDsProviders?.[0];
|
|
6472
6484
|
}
|
|
6473
6485
|
add3DsProcessor(e, t, r, i, a, o, s) {
|
|
6474
|
-
this.log("[add3DsProcessor]", t, r), wi(r).then(
|
|
6486
|
+
this.log("[add3DsProcessor]", t, r), wi(r).then(z(this, "[add3DsProcessor], onload", (s) => {
|
|
6475
6487
|
this.log(`Loading ${r}...`, s);
|
|
6476
6488
|
let c = s.default(this.log.bind(this), e, {
|
|
6477
6489
|
environment: this.environment,
|
|
6478
6490
|
apiUrl: this.config.apiUrl,
|
|
6479
6491
|
clientParameters: a
|
|
6480
6492
|
});
|
|
6481
|
-
c?.setThreeDsProcessor && (this.threeDsProcessor = new
|
|
6493
|
+
c?.setThreeDsProcessor && (this.threeDsProcessor = new U(this.log.bind(this), {
|
|
6482
6494
|
debug: this.debug,
|
|
6483
6495
|
environment: this.environment,
|
|
6484
6496
|
publicKey: this.publicKey,
|
|
@@ -6496,25 +6508,25 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6496
6508
|
},
|
|
6497
6509
|
onFailure: (e) => {
|
|
6498
6510
|
this.log("[threeDsProcessor], failure", e), this.userOnFailure?.({
|
|
6499
|
-
error:
|
|
6511
|
+
error: re,
|
|
6500
6512
|
errorDetails: { reason: e.error }
|
|
6501
6513
|
});
|
|
6502
6514
|
},
|
|
6503
6515
|
onProgress: this.threeDsProgress.bind(this)
|
|
6504
6516
|
}), this.amount && this.threeDsProcessor.setAmount(this.amount), this.currency && this.threeDsProcessor.setCurrency(this.currency), this.billingAddress && this.threeDsProcessor.setAddressInfo(this.billingAddress), this.cardProcessor?.addThreeDsProcessor(this.threeDsProcessor), c.setThreeDsProcessor(this.threeDsProcessor), o?.());
|
|
6505
|
-
})).catch(
|
|
6517
|
+
})).catch(z(this, "[add3DsProcessor], onerror", (n) => {
|
|
6506
6518
|
this.log(`Error loading ${r}`, n), r === "default" ? s?.() : this.add3DsProcessor(e, t, "default", i, a, o, s);
|
|
6507
6519
|
}));
|
|
6508
6520
|
}
|
|
6509
6521
|
addSecondary3DsProcessor(e, t, r, i, a, o, s) {
|
|
6510
|
-
this.log("[addSecondary3DsProcessor]", t, r), wi(r).then(
|
|
6522
|
+
this.log("[addSecondary3DsProcessor]", t, r), wi(r).then(z(this, "[addSecondary3DsProcessor], onload", (s) => {
|
|
6511
6523
|
this.log(`Loading ${r}...`, s);
|
|
6512
6524
|
let c = s.default(this.log.bind(this), e, {
|
|
6513
6525
|
environment: this.environment,
|
|
6514
6526
|
apiUrl: this.config.apiUrl,
|
|
6515
6527
|
clientParameters: a
|
|
6516
6528
|
});
|
|
6517
|
-
c?.setThreeDsProcessor && (this.secondaryThreeDsProcessor = new
|
|
6529
|
+
c?.setThreeDsProcessor && (this.secondaryThreeDsProcessor = new U(this.log.bind(this), {
|
|
6518
6530
|
debug: this.debug,
|
|
6519
6531
|
environment: this.environment,
|
|
6520
6532
|
publicKey: this.publicKey,
|
|
@@ -6532,13 +6544,13 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6532
6544
|
},
|
|
6533
6545
|
onFailure: (e) => {
|
|
6534
6546
|
this.log("[secondaryThreeDsProcessor], failure", e), this.userOnFailure?.({
|
|
6535
|
-
error:
|
|
6547
|
+
error: re,
|
|
6536
6548
|
errorDetails: { reason: e.error }
|
|
6537
6549
|
});
|
|
6538
6550
|
},
|
|
6539
6551
|
onProgress: this.threeDsProgress.bind(this)
|
|
6540
6552
|
}), this.amount && this.secondaryThreeDsProcessor.setAmount(this.amount), this.currency && this.secondaryThreeDsProcessor.setCurrency(this.currency), this.billingAddress && this.secondaryThreeDsProcessor.setAddressInfo(this.billingAddress), this.cardProcessor?.addSecondaryThreeDsProcessor(this.secondaryThreeDsProcessor), c.setThreeDsProcessor(this.secondaryThreeDsProcessor), o?.());
|
|
6541
|
-
})).catch(
|
|
6553
|
+
})).catch(z(this, "[addSecondary3DsProcessor], onerror", (n) => {
|
|
6542
6554
|
this.log(`Error loading ${r}`, n), r === "default" ? s?.() : this.addSecondary3DsProcessor(e, t, "default", i, a, o, s);
|
|
6543
6555
|
}));
|
|
6544
6556
|
}
|
|
@@ -6547,7 +6559,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6547
6559
|
clickToPayOptions: e,
|
|
6548
6560
|
tokenAuthenticationEnabled: e?.tokenAuthenticationEnabled,
|
|
6549
6561
|
networkTokenOptions: e?.networkTokenOptions
|
|
6550
|
-
},
|
|
6562
|
+
}, z(this, "[preloadClickToPay], callback", (t, n) => {
|
|
6551
6563
|
n.clickToPayEnabled && this.initClickToPayProcessor(null, {
|
|
6552
6564
|
...n.clickToPayOptions,
|
|
6553
6565
|
...e
|
|
@@ -6561,13 +6573,13 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6561
6573
|
});
|
|
6562
6574
|
let r = e && document.getElementById(e) || null;
|
|
6563
6575
|
if (!r) throw this.userOnFailure?.({ error: "Container is not available" }), TypeError("Container is not available");
|
|
6564
|
-
if (!
|
|
6576
|
+
if (!M(t)) throw this.showErrorMessage(r, "Missing parameter: customerId"), this.userOnFailure?.({ error: "Missing parameter: Customer Id" }), TypeError("Missing parameter: customerId");
|
|
6565
6577
|
let i = Number(n?.amount) || 0, a = n?.currency || "";
|
|
6566
|
-
if (i && !
|
|
6578
|
+
if (i && !j(i)) throw this.showErrorMessage(r, "Missing parameter: amount"), this.userOnFailure?.({ error: "Missing parameter: amount" }), TypeError("Missing parameter: amount");
|
|
6567
6579
|
return this._cleanUp(r), this._initForm(r), this.setAmount(i), this.setCurrency(a), this.initProcessors(r, i, a, "", "", {
|
|
6568
6580
|
clickToPayEnabled: !1,
|
|
6569
6581
|
tokenAuthenticationEnabled: n?.tokenAuthenticationEnabled
|
|
6570
|
-
},
|
|
6582
|
+
}, z(this, "[addSavedPaymentMethods][initProcessors], callback", (e, o) => {
|
|
6571
6583
|
let s = {
|
|
6572
6584
|
...n,
|
|
6573
6585
|
tokenAuthenticationEnabled: n?.tokenAuthenticationEnabled && o.hasNetworkTokenProviders,
|
|
@@ -6587,7 +6599,7 @@ var { hideSpinner: Ei } = Be(), Di = {
|
|
|
6587
6599
|
}), t;
|
|
6588
6600
|
}
|
|
6589
6601
|
};
|
|
6590
|
-
|
|
6602
|
+
L([R], $.prototype, "init", null), L([R], $.prototype, "execute", null), L([R], $.prototype, "messageHandler", null), L([R], $.prototype, "initCardProcessor", null), L([R], $.prototype, "initClickToPayProcessor", null), L([R], $.prototype, "initPaypalProcessor", null), L([R], $.prototype, "initCheckoutProcessor", null), L([R], $.prototype, "initGooglePayProcessor", null), L([R], $.prototype, "initApplePayProcessor", null), L([R], $.prototype, "initPayToProcessor", null), L([R], $.prototype, "loadCss", null), L([R], $.prototype, "_cleanUp", null), L([R], $.prototype, "getForm", null), L([R], $.prototype, "getSubmit", null), L([R], $.prototype, "getInput", null), L([R], $.prototype, "_initForm", null), L([R], $.prototype, "_setToken", null), L([R], $.prototype, "getSubmitFormHandler", null), L([R], $.prototype, "getDestroyDropIn", null), L([R], $.prototype, "setDestroyDropIn", null), L([R], $.prototype, "addCard", null), L([R], $.prototype, "addCardLeastCost", null), L([R], $.prototype, "addDropIn", null), L([R], $.prototype, "addPaypal", null), L([R], $.prototype, "addPayTo", null), L([R], $.prototype, "addGooglePay", null), L([R], $.prototype, "addApplePay", null), L([R], $.prototype, "addCheckout", null), L([R], $.prototype, "addUpi", null), L([R], $.prototype, "addThreeDsWithFullParameters", null), L([R], $.prototype, "tokeniseWith3Ds", null), L([R], $.prototype, "threeDsOrTokenise", null), L([R], $.prototype, "tokeniseCard", null), L([R], $.prototype, "addThreeDsWithToken", null), L([R], $.prototype, "threeDsWithToken", null), L([R], $.prototype, "getPaymentOptions", null), L([R], $.prototype, "getProviderInfo", null), L([R], $.prototype, "setAmount", null), L([R], $.prototype, "setCurrency", null), L([R], $.prototype, "onSuccess", null), L([R], $.prototype, "onFailure", null), L([R], $.prototype, "onLoaded", null), L([R], $.prototype, "onPaymentMethodStatus", null), L([R], $.prototype, "onThreeDsProgress", null), L([R], $.prototype, "onValidationStatusChange", null), L([R], $.prototype, "onValidate", null), L([R], $.prototype, "showErrorMessage", null), L([R], $.prototype, "setBillingAddress", null), L([R], $.prototype, "setCustomerInfo", null), L([R], $.prototype, "setOrderInfo", null), L([R], $.prototype, "setGeolocation", null), L([R], $.prototype, "checkGeolocation", null), L([R], $.prototype, "initProcessors", null), L([R], $.prototype, "addFraudProcessor", null), L([R], $.prototype, "resolveThreeDsProvider", null), L([R], $.prototype, "add3DsProcessor", null), L([R], $.prototype, "addSecondary3DsProcessor", null), L([R], $.prototype, "preloadClickToPay", null), L([R], $.prototype, "addSavedPaymentMethods", null);
|
|
6591
6603
|
// src/sdk/main.ts
|
|
6592
6604
|
var ki = new $();
|
|
6593
6605
|
export { ki as default };
|