@payfurl/client 4.5.9 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/sdk/CxPayThreeDsProvider-068b25ce.mjs +14 -0
- package/dist/sdk/DefaultThreeDsProvider-e98c909f.mjs +220 -0
- package/dist/sdk/EpnaThreeDsProvider-189e652c.mjs +14 -0
- package/dist/sdk/FlashBancThreeDsProvider-36e453b8.mjs +14 -0
- package/dist/sdk/GPaymentsThreeDsProvider-fe5a9704.mjs +105 -0
- package/dist/sdk/MetricsGlobalThreeDsProvider-7f36be7b.mjs +147 -0
- package/dist/sdk/NmiThreeDsProvider-f7c7a154.mjs +14 -0
- package/dist/sdk/PayabliThreeDsProvider-66b568d3.mjs +14 -0
- package/dist/sdk/SkyBankThreeDsProvider-fbfe9597.mjs +14 -0
- package/dist/sdk/{ThreeDsInitResponse.type-06482849.mjs → ThreeDsProvider.interface-da0ab2aa.mjs} +3 -0
- package/dist/sdk/cxpay-6ff3d8ba.mjs +10 -0
- package/dist/sdk/default-957c2000.mjs +8 -0
- package/dist/sdk/{ecentric-cd8695ea.mjs → ecentric-7741cdc3.mjs} +23 -23
- package/dist/sdk/epna-1da33a88.mjs +10 -0
- package/dist/sdk/flashbanc-6eb51520.mjs +10 -0
- package/dist/sdk/gpayments-dce1eccd.mjs +9 -0
- package/dist/sdk/main-eb4bb451.mjs +18753 -0
- package/dist/sdk/metrics_global-5f5b54ee.mjs +9 -0
- package/dist/sdk/nmi-d67f1324.mjs +10 -0
- package/dist/sdk/payabli-02b4bd3b.mjs +10 -0
- package/dist/sdk/payfurl.es.js +1 -1
- package/dist/sdk/payfurl.umd.js +55 -11
- package/dist/sdk/skybank-53b51d4e.mjs +10 -0
- package/dist/sdk/style.css +1 -1
- package/package.json +2 -1
- package/dist/sdk/default-ecf62258.mjs +0 -179
- package/dist/sdk/gpayments-e536251a.mjs +0 -165
- package/dist/sdk/main-041a6652.mjs +0 -8717
package/README.md
CHANGED
|
@@ -30,9 +30,11 @@ Your `readme.md` file looks fine, but I can provide some improvements in formatt
|
|
|
30
30
|
cssUrl: "http://localhost:3001/dist/sdk/",
|
|
31
31
|
url: "http://localhost:3001/dist/iframe/",
|
|
32
32
|
apiUrl: "https://localhost:5001",
|
|
33
|
-
redirectUrl: "http://localhost:3001/checkout/redirect.html"
|
|
33
|
+
redirectUrl: "http://localhost:3001/checkout/redirect.html",
|
|
34
|
+
sentryUrl: "",
|
|
34
35
|
};
|
|
35
36
|
```
|
|
37
|
+
Sentry is disabled if `sentryUrl` value is empty.
|
|
36
38
|
|
|
37
39
|
2. Run the following commands in your project directory:
|
|
38
40
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e98c909f.mjs";
|
|
3
|
+
import "./main-eb4bb451.mjs";
|
|
4
|
+
class i extends r {
|
|
5
|
+
getType() {
|
|
6
|
+
return "CxPay";
|
|
7
|
+
}
|
|
8
|
+
getDomain() {
|
|
9
|
+
return "cxpay.transactiongateway.com";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
i as CxPayThreeDsProvider
|
|
14
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var u = (a, e, s) => e in a ? D(a, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[e] = s;
|
|
3
|
+
var o = (a, e, s) => (u(a, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
+
import { d as S, r as d, o as g, a as p, c as T, b as n, e as _, C as m, u as I, p as f, f as y, _ as A, j as v, T as C, i as c, g as E, F as R } from "./main-eb4bb451.mjs";
|
|
5
|
+
const P = (a) => (f("data-v-c82daa22"), a = a(), y(), a), U = { class: "mask" }, $ = { class: "wrapper" }, L = { class: "container" }, b = /* @__PURE__ */ P(() => /* @__PURE__ */ n("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), M = ["action"], w = ["value"], N = /* @__PURE__ */ S({
|
|
6
|
+
__name: "ThreeDsChallenge",
|
|
7
|
+
props: {
|
|
8
|
+
threeDSServerTransID: null,
|
|
9
|
+
acsTransID: null,
|
|
10
|
+
formAction: null
|
|
11
|
+
},
|
|
12
|
+
emits: ["close", "submit"],
|
|
13
|
+
setup(a, { emit: e }) {
|
|
14
|
+
const s = a, t = d(null), r = JSON.stringify({
|
|
15
|
+
threeDSServerTransID: s.threeDSServerTransID,
|
|
16
|
+
acsTransID: s.acsTransID,
|
|
17
|
+
messageVersion: "2.1.0",
|
|
18
|
+
messageType: "CReq",
|
|
19
|
+
challengeWindowSize: "01"
|
|
20
|
+
}), i = encodeURI(window.btoa(r).replace(/=*$/, ""));
|
|
21
|
+
return g(() => {
|
|
22
|
+
var h;
|
|
23
|
+
(h = t.value) == null || h.submit();
|
|
24
|
+
}), (h, l) => (p(), T("div", U, [
|
|
25
|
+
n("div", $, [
|
|
26
|
+
n("div", L, [
|
|
27
|
+
_(m, {
|
|
28
|
+
onClick: l[0] || (l[0] = (V) => e("close")),
|
|
29
|
+
id: "3ds-challenge-close"
|
|
30
|
+
}),
|
|
31
|
+
b,
|
|
32
|
+
n("form", {
|
|
33
|
+
action: s.formAction,
|
|
34
|
+
target: "ThreeDsChallengeIFrame",
|
|
35
|
+
method: "post",
|
|
36
|
+
ref_key: "form",
|
|
37
|
+
ref: t
|
|
38
|
+
}, [
|
|
39
|
+
n("input", {
|
|
40
|
+
type: "hidden",
|
|
41
|
+
name: "creq",
|
|
42
|
+
value: I(i)
|
|
43
|
+
}, null, 8, w)
|
|
44
|
+
], 8, M)
|
|
45
|
+
])
|
|
46
|
+
])
|
|
47
|
+
]));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const k = /* @__PURE__ */ A(N, [["__scopeId", "data-v-c82daa22"]]), O = "3ds_method_invocation_complete", q = "3ds_challenge_complete";
|
|
51
|
+
class F {
|
|
52
|
+
constructor(e, s, t) {
|
|
53
|
+
o(this, "log");
|
|
54
|
+
o(this, "container");
|
|
55
|
+
o(this, "options");
|
|
56
|
+
o(this, "threeDsProcessor", null);
|
|
57
|
+
o(this, "threeDSDestroy", () => {
|
|
58
|
+
});
|
|
59
|
+
o(this, "threeDSServerTransID", "");
|
|
60
|
+
o(this, "threeDSAuthURL", "");
|
|
61
|
+
o(this, "threeDSRequestorTransID", "");
|
|
62
|
+
o(this, "threeDSMonitorURL", "");
|
|
63
|
+
o(this, "internalMessageHandler", this.messageHandler.bind(this));
|
|
64
|
+
o(this, "onError", (e, s) => {
|
|
65
|
+
var t, r;
|
|
66
|
+
if (this.closeChallenge(), c(), e === 404) {
|
|
67
|
+
(t = this.threeDsProcessor) == null || t.onError({ error: "This feature is only supported by ActiveServer v1.1.2+" });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
(r = this.threeDsProcessor) == null || r.onError({ error: "3D Secure failed", body: s });
|
|
71
|
+
});
|
|
72
|
+
o(this, "onSuccess", (e, s) => {
|
|
73
|
+
var r, i;
|
|
74
|
+
this.closeChallenge(), c();
|
|
75
|
+
const t = JSON.parse(s);
|
|
76
|
+
["Y", "A"].includes(t.transStatus) ? (r = this.threeDsProcessor) == null || r.onSuccess(t) : (this.log(`[${this.getType()}]: 3D Secure failed`, t), (i = this.threeDsProcessor) == null || i.onError({ error: "3D Secure failed" }));
|
|
77
|
+
});
|
|
78
|
+
o(this, "onInitAuthSuccess", (e, s) => {
|
|
79
|
+
const t = JSON.parse(s);
|
|
80
|
+
if (this.log(`[${this.getType()}][onInitAuthSuccess]`, t), this.threeDSRequestorTransID = t.threeDSRequestorTransID, this.threeDSServerTransID = t.threeDSServerTransID, this.threeDSMonitorURL = t.threeDSMonitorURL, this.threeDSAuthURL = t.threeDSAuthURL, t.threeDSMethodURL) {
|
|
81
|
+
this.threeDsMethodInvoke(t.threeDSServerTransID, t.threeDSMethodURL);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.onAuth(!1, "");
|
|
85
|
+
});
|
|
86
|
+
o(this, "onDoAuthSuccess", (e, s) => {
|
|
87
|
+
var r;
|
|
88
|
+
const t = JSON.parse(s);
|
|
89
|
+
if (this.log(`[${this.getType()}][onDoAuthSuccess]`, t), !t.transStatus) {
|
|
90
|
+
this.onError(e, "No transStatus specified");
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
switch (t.transStatus) {
|
|
94
|
+
case "C":
|
|
95
|
+
if (!t.acsURL) {
|
|
96
|
+
this.onError(e, "Invalid Challenge Url");
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.doChallenge(t.acsURL, t.acsTransID);
|
|
100
|
+
break;
|
|
101
|
+
case "N":
|
|
102
|
+
this.log(`[${this.getType()}][threeDsAuth], 3DS Verification failed, transaction denied`), this.onError(400, "3DS Verification failed, transaction denied");
|
|
103
|
+
break;
|
|
104
|
+
case "U":
|
|
105
|
+
this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification`), this.onError(400, "Unable to perform 3DS verification");
|
|
106
|
+
break;
|
|
107
|
+
case "R":
|
|
108
|
+
this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification, rejected at issuer`), this.onError(400, "Unable to perform 3DS verification, rejected at issuer");
|
|
109
|
+
break;
|
|
110
|
+
default:
|
|
111
|
+
this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${t.transStatus}`), (r = this.threeDsProcessor) == null || r.onSuccess({
|
|
112
|
+
threeDSServerTransID: t.threeDSServerTransID,
|
|
113
|
+
threeDSRequestorTransID: "",
|
|
114
|
+
acsRenderingType: t.acsRenderingType,
|
|
115
|
+
acsTransID: t.acsTransID,
|
|
116
|
+
authenticationType: t.authenticationType,
|
|
117
|
+
authenticationValue: t.authenticationValue,
|
|
118
|
+
challengeCancel: "",
|
|
119
|
+
dsTransID: t.dsTransID,
|
|
120
|
+
eci: t.eci,
|
|
121
|
+
interactionCounter: "",
|
|
122
|
+
messageCategory: "",
|
|
123
|
+
messageExtension: t.messageExtension,
|
|
124
|
+
messageType: t.messageType,
|
|
125
|
+
messageVersion: t.messageVersion,
|
|
126
|
+
transStatus: t.transStatus,
|
|
127
|
+
transStatusReason: t.transStatusReason
|
|
128
|
+
});
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
this.log = e, this.container = s, this.options = t;
|
|
133
|
+
}
|
|
134
|
+
getType() {
|
|
135
|
+
return "Default";
|
|
136
|
+
}
|
|
137
|
+
getDomain() {
|
|
138
|
+
return "";
|
|
139
|
+
}
|
|
140
|
+
onPreAuth() {
|
|
141
|
+
this.log(`[${this.getType()}][onPreAuth]`), this.threeDsProcessor && (v(), this.threeDsProcessor.onPreAuth(this.onInitAuthSuccess, this.onError), window.addEventListener("message", this.internalMessageHandler));
|
|
142
|
+
}
|
|
143
|
+
onAuth(e, s) {
|
|
144
|
+
var t;
|
|
145
|
+
this.log(`[${this.getType()}][onAuth]`, {
|
|
146
|
+
threeDSAuthURL: this.threeDSAuthURL,
|
|
147
|
+
threeDSRequestorTransID: this.threeDSRequestorTransID,
|
|
148
|
+
threeDSServerTransID: this.threeDSServerTransID,
|
|
149
|
+
isMethodPerformed: e
|
|
150
|
+
}), (t = this.threeDsProcessor) == null || t.onAuth(this.threeDSAuthURL, this.threeDSRequestorTransID, this.threeDSServerTransID, e, "", this.onDoAuthSuccess, this.onError);
|
|
151
|
+
}
|
|
152
|
+
onPostAuth() {
|
|
153
|
+
var e;
|
|
154
|
+
this.log(`[${this.getType()}][onPostAuth]`, {
|
|
155
|
+
threeDSServerTransID: this.threeDSServerTransID
|
|
156
|
+
}), (e = this.threeDsProcessor) == null || e.onPostAuth({
|
|
157
|
+
threeDSServerTransID: this.threeDSServerTransID
|
|
158
|
+
}, this.onSuccess, this.onError);
|
|
159
|
+
}
|
|
160
|
+
setThreeDsProcessor(e) {
|
|
161
|
+
this.log(`[${this.getType()}][setThreeDsProcessor]`), this.threeDsProcessor = e;
|
|
162
|
+
}
|
|
163
|
+
messageHandler(e) {
|
|
164
|
+
var s, t;
|
|
165
|
+
if (!(!((s = e == null ? void 0 : e.data) != null && s.status) || ((t = e == null ? void 0 : e.data) == null ? void 0 : t.status) === C)) {
|
|
166
|
+
if (e.data.status === O) {
|
|
167
|
+
e.stopPropagation(), this.invocationComplete(e);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
e.data.status === q && (e.stopPropagation(), this.challengeComplete(e));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
invocationComplete(e) {
|
|
174
|
+
this.log(`[${this.getType()}]: 3Ds Method invocation complete`), this.onAuth(!0, "");
|
|
175
|
+
}
|
|
176
|
+
challengeComplete(e) {
|
|
177
|
+
this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge();
|
|
178
|
+
const s = JSON.parse(window.atob(e.data.cres));
|
|
179
|
+
this.log(`[${this.getType()}]: cresData`, s), ["Y", "A"].includes(s.transStatus) ? this.onPostAuth() : ["N", "U", "R"].includes(s.transStatus) && (this.log(`[${this.getType()}]: Failed 3DS Challenge`, e.data), this.onError(400, "Failed 3DS Challenge"));
|
|
180
|
+
}
|
|
181
|
+
doChallenge(e, s) {
|
|
182
|
+
this.log(`[${this.getType()}][doChallenge]`), c();
|
|
183
|
+
const { destroy: t } = E({
|
|
184
|
+
el: document.body,
|
|
185
|
+
component: k,
|
|
186
|
+
props: {
|
|
187
|
+
threeDSServerTransID: this.threeDSServerTransID,
|
|
188
|
+
acsTransID: s,
|
|
189
|
+
formAction: e
|
|
190
|
+
},
|
|
191
|
+
on: {
|
|
192
|
+
close: () => {
|
|
193
|
+
var r;
|
|
194
|
+
t(), this.threeDSDestroy = () => {
|
|
195
|
+
}, (r = this.threeDsProcessor) == null || r.onError({ error: "Challenge cancelled" });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
this.threeDSDestroy = t;
|
|
200
|
+
}
|
|
201
|
+
closeChallenge() {
|
|
202
|
+
var e;
|
|
203
|
+
(e = this.threeDSDestroy) == null || e.call(this), window.removeEventListener("message", this.internalMessageHandler);
|
|
204
|
+
}
|
|
205
|
+
threeDsMethodInvoke(e, s) {
|
|
206
|
+
this.log(`[${this.getType()}][threeDsMethodInvoke]`, { threeDSServerTransID: e, threeDSMethodURL: s });
|
|
207
|
+
const t = {
|
|
208
|
+
threeDSServerTransID: e,
|
|
209
|
+
threeDSMethodNotificationURL: this.options.apiUrl + "/3ds/method_invocation"
|
|
210
|
+
}, r = encodeURI(window.btoa(JSON.stringify(t)).replace(/=*$/, ""));
|
|
211
|
+
new R().invoke(s, "POST", {
|
|
212
|
+
threeDSMethodData: r
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
export {
|
|
217
|
+
F as DefaultThreeDsProvider,
|
|
218
|
+
q as THREE_DS_CHALLENGE_COMPLETE,
|
|
219
|
+
O as THREE_DS_METHOD_INVOCATION_COMPLETE
|
|
220
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e98c909f.mjs";
|
|
3
|
+
import "./main-eb4bb451.mjs";
|
|
4
|
+
class i extends e {
|
|
5
|
+
getType() {
|
|
6
|
+
return "EPNA";
|
|
7
|
+
}
|
|
8
|
+
getDomain() {
|
|
9
|
+
return "epna.transactiongateway.com";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
i as EpnaThreeDsProvider
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e98c909f.mjs";
|
|
3
|
+
import "./main-eb4bb451.mjs";
|
|
4
|
+
class s extends r {
|
|
5
|
+
getType() {
|
|
6
|
+
return "FlashBanc";
|
|
7
|
+
}
|
|
8
|
+
getDomain() {
|
|
9
|
+
return "flashbanc.transactiongateway.com";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
s as FlashBancThreeDsProvider
|
|
14
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var l = (n, r, e) => r in n ? i(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
|
+
var o = (n, r, e) => (l(n, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
+
import { DefaultThreeDsProvider as c } from "./DefaultThreeDsProvider-e98c909f.mjs";
|
|
5
|
+
import { d as u, a as d, c as p, b as a, n as h, _ as g, g as _ } from "./main-eb4bb451.mjs";
|
|
6
|
+
const m = { class: "mask" }, D = { class: "wrapper" }, S = ["src"], y = /* @__PURE__ */ u({
|
|
7
|
+
__name: "GPayments",
|
|
8
|
+
props: {
|
|
9
|
+
url: null,
|
|
10
|
+
width: null,
|
|
11
|
+
height: null
|
|
12
|
+
},
|
|
13
|
+
setup(n) {
|
|
14
|
+
const r = n;
|
|
15
|
+
function e() {
|
|
16
|
+
return {
|
|
17
|
+
width: `${r.width || 650}px`,
|
|
18
|
+
height: `${r.height || 400}px`
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return (s, t) => (d(), p("div", m, [
|
|
22
|
+
a("div", D, [
|
|
23
|
+
a("div", {
|
|
24
|
+
class: "container",
|
|
25
|
+
style: h([e(), { padding: "0", margin: "0" }])
|
|
26
|
+
}, [
|
|
27
|
+
a("iframe", {
|
|
28
|
+
src: r.url,
|
|
29
|
+
style: h(e())
|
|
30
|
+
}, null, 12, S)
|
|
31
|
+
], 4)
|
|
32
|
+
])
|
|
33
|
+
]));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const f = /* @__PURE__ */ g(y, [["__scopeId", "data-v-9b0ef3a8"]]);
|
|
37
|
+
class A extends c {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
o(this, "onDoAuthSuccess", (e, s) => {
|
|
41
|
+
const t = JSON.parse(s);
|
|
42
|
+
if (this.log(`[${this.getType()}][onDoAuthSuccess]`, t), !t.transStatus) {
|
|
43
|
+
this.onError(e, "No transStatus specified");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
switch (t.transStatus) {
|
|
47
|
+
case "C":
|
|
48
|
+
if (!t.acsURL) {
|
|
49
|
+
this.onError(e, "Invalid Challenge Url");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.doChallenge(t.acsURL);
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${t.transStatus}`), this.onPostAuth();
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
o(this, "onInitAuthSuccess", (e, s) => {
|
|
60
|
+
const t = JSON.parse(s);
|
|
61
|
+
if (this.log(`[${this.getType()}][onInitAuthSuccess]`, t), !t.threeDSAuthURL) {
|
|
62
|
+
this.onError(e, "No AuthUrl specified");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (this.threeDSRequestorTransID = t.threeDSRequestorTransID, this.threeDSServerTransID = t.threeDSServerTransID, this.threeDSMonitorURL = t.threeDSMonitorURL, this.threeDSAuthURL = t.threeDSAuthURL, t.threeDsServerCallbackUrl) {
|
|
66
|
+
this.initFrame(t.threeDsServerCallbackUrl);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this.onAuth(!1, "");
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
getType() {
|
|
73
|
+
return "GPayments";
|
|
74
|
+
}
|
|
75
|
+
doChallenge(e) {
|
|
76
|
+
this.log(`[${this.getType()}][doChallenge]`);
|
|
77
|
+
const { destroy: s } = _({
|
|
78
|
+
el: document.body,
|
|
79
|
+
component: f,
|
|
80
|
+
props: {
|
|
81
|
+
url: e,
|
|
82
|
+
width: 390,
|
|
83
|
+
height: 400
|
|
84
|
+
},
|
|
85
|
+
on: {
|
|
86
|
+
close: () => {
|
|
87
|
+
s(), this.threeDSDestroy = () => {
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
this.threeDSDestroy = s;
|
|
93
|
+
}
|
|
94
|
+
challengeComplete(e) {
|
|
95
|
+
this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge(), this.onPostAuth();
|
|
96
|
+
}
|
|
97
|
+
initFrame(e) {
|
|
98
|
+
this.log(`[${this.getType()}][init3DSFrame]`, e);
|
|
99
|
+
const s = document.createElement("iframe");
|
|
100
|
+
s.src = e, s.style.width = "1px", s.style.height = "1px", s.style.border = "0", document.body.appendChild(s);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
A as GPaymentsThreeDsProvider
|
|
105
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var S = (s, o, t) => o in s ? w(s, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[o] = t;
|
|
3
|
+
var c = (s, o, t) => (S(s, typeof o != "symbol" ? o + "" : o, t), t);
|
|
4
|
+
import { DefaultThreeDsProvider as E } from "./DefaultThreeDsProvider-e98c909f.mjs";
|
|
5
|
+
import { d as f, r as v, o as A, h as b, w as P, v as T, a as x, c as G, b as m, e as I, C as L, p as N, f as M, _ as $, i as l, s as C, j as H, g as O } from "./main-eb4bb451.mjs";
|
|
6
|
+
const j = (s) => (N("data-v-8a0b6dcb"), s = s(), M(), s), k = { class: "mask" }, B = { class: "wrapper" }, F = { class: "container" }, W = /* @__PURE__ */ j(() => /* @__PURE__ */ m("div", { id: "ThreeDsChallengeIFrame" }, null, -1)), U = /* @__PURE__ */ f({
|
|
7
|
+
__name: "MetricsGlobalThreeDsChallenge",
|
|
8
|
+
emits: ["close", "submit"],
|
|
9
|
+
setup(s, { emit: o }) {
|
|
10
|
+
const t = v(!1);
|
|
11
|
+
function e(r) {
|
|
12
|
+
var n;
|
|
13
|
+
["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes((n = r.data) == null ? void 0 : n.message) && (t.value = r.data.message === "3DS_CHALLENGE_SHOW");
|
|
14
|
+
}
|
|
15
|
+
return A(() => {
|
|
16
|
+
window.addEventListener("message", e);
|
|
17
|
+
}), b(() => {
|
|
18
|
+
window.removeEventListener("message", e);
|
|
19
|
+
}), (r, n) => P((x(), G("div", k, [
|
|
20
|
+
m("div", B, [
|
|
21
|
+
m("div", F, [
|
|
22
|
+
I(L, {
|
|
23
|
+
onClick: n[0] || (n[0] = (p) => o("close")),
|
|
24
|
+
id: "3ds-challenge-close"
|
|
25
|
+
}),
|
|
26
|
+
W
|
|
27
|
+
])
|
|
28
|
+
])
|
|
29
|
+
], 512)), [
|
|
30
|
+
[T, t.value]
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const V = /* @__PURE__ */ $(U, [["__scopeId", "data-v-8a0b6dcb"]]), g = 5;
|
|
35
|
+
class z extends E {
|
|
36
|
+
constructor(t, e, r) {
|
|
37
|
+
var n;
|
|
38
|
+
super(t, e, r);
|
|
39
|
+
c(this, "gateway");
|
|
40
|
+
c(this, "threeDS");
|
|
41
|
+
c(this, "numAttempts", 0);
|
|
42
|
+
this.initScript(((n = r.clientParameters) == null ? void 0 : n.PublicKey) || "");
|
|
43
|
+
}
|
|
44
|
+
getType() {
|
|
45
|
+
return "MetricsGlobal";
|
|
46
|
+
}
|
|
47
|
+
getDomain() {
|
|
48
|
+
return "secure.metricsglobalgateway.com";
|
|
49
|
+
}
|
|
50
|
+
onPreAuth() {
|
|
51
|
+
if (this.log(`[${this.getType()}]: onPreAuth`), !this.threeDS && this.numAttempts >= g) {
|
|
52
|
+
l(), C(this.container, "Error loading 3D Secure");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!this.threeDS && this.numAttempts < g) {
|
|
56
|
+
this.numAttempts++, this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`), setTimeout(() => this.onPreAuth(), 1e3);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.startAuth();
|
|
60
|
+
}
|
|
61
|
+
onAuth(t, e) {
|
|
62
|
+
}
|
|
63
|
+
onPostAuth() {
|
|
64
|
+
}
|
|
65
|
+
startAuth() {
|
|
66
|
+
var u, D, y, _, d;
|
|
67
|
+
this.log(`[${this.getType()}]: startAuth`);
|
|
68
|
+
const t = (u = this.threeDsProcessor) == null ? void 0 : u.getPaymentInfo();
|
|
69
|
+
if (!t) {
|
|
70
|
+
l(), C(this.container, "Payment information is missing");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
H();
|
|
74
|
+
const e = (D = this.threeDsProcessor) == null ? void 0 : D.getAddressInfo(), r = t.expiryDate.length === 4 ? t.expiryDate[2] + t.expiryDate[3] : "", n = t.expiryDate.length === 4 ? t.expiryDate[0] + t.expiryDate[1] : "", p = {
|
|
75
|
+
cardNumber: t.cardNumber,
|
|
76
|
+
cardExpMonth: r,
|
|
77
|
+
cardExpYear: parseInt(n) + 2e3,
|
|
78
|
+
currency: (y = this.threeDsProcessor) == null ? void 0 : y.getCurrency(),
|
|
79
|
+
amount: (_ = this.threeDsProcessor) == null ? void 0 : _.getAmount(),
|
|
80
|
+
email: (d = this.threeDsProcessor) == null ? void 0 : d.getEmail(),
|
|
81
|
+
phone: e == null ? void 0 : e.phoneNumber,
|
|
82
|
+
city: e == null ? void 0 : e.city,
|
|
83
|
+
state: e == null ? void 0 : e.state,
|
|
84
|
+
address1: e == null ? void 0 : e.streetAddress,
|
|
85
|
+
country: e == null ? void 0 : e.country,
|
|
86
|
+
firstName: e == null ? void 0 : e.firstName,
|
|
87
|
+
lastName: e == null ? void 0 : e.lastName,
|
|
88
|
+
postalCode: e == null ? void 0 : e.postalCode
|
|
89
|
+
}, h = this.threeDS.createUI(p);
|
|
90
|
+
h.start("#ThreeDsChallengeIFrame"), h.on("challenge", (a) => {
|
|
91
|
+
this.log(`[${this.getType()}][onChallenge]`, a), l(), this.showChallenge();
|
|
92
|
+
}), h.on("complete", (a) => {
|
|
93
|
+
var i;
|
|
94
|
+
this.log(`[${this.getType()}][onComplete]`, a), this.removeChallenge(), (i = this.threeDsProcessor) == null || i.onSuccess({
|
|
95
|
+
externalThreeDsData: a
|
|
96
|
+
});
|
|
97
|
+
}), h.on("failure", (a) => {
|
|
98
|
+
var i;
|
|
99
|
+
this.log(`[${this.getType()}][onFailure]`, a), l(), this.closeChallenge(), (i = this.threeDsProcessor) == null || i.onError({ error: a.message });
|
|
100
|
+
}), h.on("error", (a) => {
|
|
101
|
+
var i;
|
|
102
|
+
this.log(`[${this.getType()}][error]`, a), l(), this.closeChallenge(), (i = this.threeDsProcessor) == null || i.onError({ error: a.message });
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
initScript(t) {
|
|
106
|
+
const e = document.createElement("script");
|
|
107
|
+
e.type = "text/javascript", e.src = `https://${this.getDomain()}/js/v1/Gateway.js`, e.onload = () => {
|
|
108
|
+
this.initGateway(t), this.initChallenge();
|
|
109
|
+
}, document.head.appendChild(e);
|
|
110
|
+
}
|
|
111
|
+
initGateway(t) {
|
|
112
|
+
this.gateway = window.Gateway.create(t), this.threeDS = this.gateway.get3DSecure(), this.gateway.on("error", (e) => {
|
|
113
|
+
var r;
|
|
114
|
+
this.log(`[${this.getType()}]: gateway error`, e), (r = this.threeDsProcessor) == null || r.onError({ error: e.message }), this.threeDS = null, this.numAttempts = g;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
initChallenge() {
|
|
118
|
+
const { destroy: t } = O({
|
|
119
|
+
el: document.body,
|
|
120
|
+
component: V,
|
|
121
|
+
on: {
|
|
122
|
+
close: () => {
|
|
123
|
+
var e;
|
|
124
|
+
this.closeChallenge(), (e = this.threeDsProcessor) == null || e.onError({ error: "Challenge cancelled" });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
this.threeDSDestroy = t;
|
|
129
|
+
}
|
|
130
|
+
showChallenge() {
|
|
131
|
+
window.postMessage({
|
|
132
|
+
message: "3DS_CHALLENGE_SHOW"
|
|
133
|
+
}, "*");
|
|
134
|
+
}
|
|
135
|
+
closeChallenge() {
|
|
136
|
+
window.postMessage({
|
|
137
|
+
message: "3DS_CHALLENGE_CLOSE"
|
|
138
|
+
}, "*");
|
|
139
|
+
}
|
|
140
|
+
removeChallenge() {
|
|
141
|
+
var t;
|
|
142
|
+
(t = this.threeDSDestroy) == null || t.call(this);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
z as MetricsGlobalThreeDsProvider
|
|
147
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e98c909f.mjs";
|
|
3
|
+
import "./main-eb4bb451.mjs";
|
|
4
|
+
class m extends e {
|
|
5
|
+
getType() {
|
|
6
|
+
return "NMI";
|
|
7
|
+
}
|
|
8
|
+
getDomain() {
|
|
9
|
+
return "secure.nmi.com";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
m as NmiThreeDsProvider
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e98c909f.mjs";
|
|
3
|
+
import "./main-eb4bb451.mjs";
|
|
4
|
+
class i extends e {
|
|
5
|
+
getType() {
|
|
6
|
+
return "Payabli";
|
|
7
|
+
}
|
|
8
|
+
getDomain() {
|
|
9
|
+
return "centavo.transactiongateway.com";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
i as PayabliThreeDsProvider
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e98c909f.mjs";
|
|
3
|
+
import "./main-eb4bb451.mjs";
|
|
4
|
+
class s extends e {
|
|
5
|
+
getType() {
|
|
6
|
+
return "SkyBank";
|
|
7
|
+
}
|
|
8
|
+
getDomain() {
|
|
9
|
+
return "secure.skybankgateway.com";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
s as SkyBankThreeDsProvider
|
|
14
|
+
};
|
package/dist/sdk/{ThreeDsInitResponse.type-06482849.mjs → ThreeDsProvider.interface-da0ab2aa.mjs}
RENAMED
|
@@ -6,10 +6,13 @@ const e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6
6
|
__proto__: null
|
|
7
7
|
}, Symbol.toStringTag, { value: "Module" })), r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8
8
|
__proto__: null
|
|
9
|
+
}, Symbol.toStringTag, { value: "Module" })), l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10
|
+
__proto__: null
|
|
9
11
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
10
12
|
export {
|
|
11
13
|
o as T,
|
|
12
14
|
t as a,
|
|
13
15
|
r as b,
|
|
16
|
+
l as c,
|
|
14
17
|
e as f
|
|
15
18
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CxPayThreeDsProvider as e } from "./CxPayThreeDsProvider-068b25ce.mjs";
|
|
2
|
+
import "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
|
|
3
|
+
import "./DefaultThreeDsProvider-e98c909f.mjs";
|
|
4
|
+
import "./main-eb4bb451.mjs";
|
|
5
|
+
function n(r, o, t) {
|
|
6
|
+
return new e(r, o, t);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
n as default
|
|
10
|
+
};
|