@payfurl/client 4.6.0 → 4.6.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/README.md +4 -0
- package/dist/sdk/CxPayThreeDsProvider-634589d1.mjs +14 -0
- package/dist/sdk/{DefaultThreeDsProvider-701637b0.mjs → DefaultThreeDsProvider-e92310c2.mjs} +64 -58
- package/dist/sdk/EcentricThreeDsProvider-9bf4643c.mjs +90 -0
- package/dist/sdk/EpnaThreeDsProvider-f4ab5593.mjs +14 -0
- package/dist/sdk/FlashBancThreeDsProvider-9a6d418c.mjs +14 -0
- package/dist/sdk/{GPaymentsThreeDsProvider-740b4c21.mjs → GPaymentsThreeDsProvider-992c1825.mjs} +19 -17
- package/dist/sdk/MetricsGlobalThreeDsProvider-fdada4dd.mjs +153 -0
- package/dist/sdk/NmiThreeDsProvider-8c8ab0f0.mjs +14 -0
- package/dist/sdk/NuveiThreeDsProvider-cc515d25.mjs +173 -0
- package/dist/sdk/PayabliThreeDsProvider-19d2e62a.mjs +14 -0
- package/dist/sdk/SkyBankThreeDsProvider-44644ee8.mjs +14 -0
- package/dist/sdk/cxpay-a965ca2f.mjs +10 -0
- package/dist/sdk/{default-6f6c8e7c.mjs → default-9ec42bc0.mjs} +2 -2
- package/dist/sdk/ecentric-fc332878.mjs +9 -0
- package/dist/sdk/epna-24e6dd6c.mjs +10 -0
- package/dist/sdk/flashbanc-49c4deb2.mjs +10 -0
- package/dist/sdk/{gpayments-455eb705.mjs → gpayments-c0450b55.mjs} +3 -3
- package/dist/sdk/main-6d84dc12.mjs +14068 -0
- package/dist/sdk/metrics_global-3c9bd0de.mjs +9 -0
- package/dist/sdk/nmi-8aabbfd1.mjs +10 -0
- package/dist/sdk/nuvei-3774bd45.mjs +9 -0
- package/dist/sdk/payabli-d52e0c78.mjs +10 -0
- package/dist/sdk/payfurl.es.js +1 -1
- package/dist/sdk/payfurl.umd.js +25 -43
- package/dist/sdk/skybank-f7d58ed5.mjs +10 -0
- package/dist/sdk/style.css +1 -1
- package/package.json +4 -2
- package/dist/sdk/NmiThreeDsProvider-51bf6fff.mjs +0 -135
- package/dist/sdk/ecentric-45331775.mjs +0 -165
- package/dist/sdk/main-f2996bc2.mjs +0 -18729
- package/dist/sdk/nmi-dbb88036.mjs +0 -9
package/README.md
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e92310c2.mjs";
|
|
3
|
+
import "./main-6d84dc12.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
|
+
};
|
package/dist/sdk/{DefaultThreeDsProvider-701637b0.mjs → DefaultThreeDsProvider-e92310c2.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var D = Object.defineProperty;
|
|
2
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
|
|
4
|
-
import { d as S, r as d, o as
|
|
5
|
-
const P = (a) => (f("data-v-c82daa22"), a = a(), y(), a), U = { class: "mask" }, $ = { class: "wrapper" }, L = { class: "container" }, b = /* @__PURE__ */ P(() => /* @__PURE__ */
|
|
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 i, e as _, C as m, u as I, p as f, f as y, _ as A, s as v, T as C, h as c, g as E, F as R } from "./main-6d84dc12.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__ */ i("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), M = ["action"], w = ["value"], N = /* @__PURE__ */ S({
|
|
6
6
|
__name: "ThreeDsChallenge",
|
|
7
7
|
props: {
|
|
8
8
|
threeDSServerTransID: null,
|
|
@@ -11,35 +11,35 @@ const P = (a) => (f("data-v-c82daa22"), a = a(), y(), a), U = { class: "mask" },
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["close", "submit"],
|
|
13
13
|
setup(a, { emit: e }) {
|
|
14
|
-
const s = a, t = d(null),
|
|
14
|
+
const s = a, t = d(null), r = JSON.stringify({
|
|
15
15
|
threeDSServerTransID: s.threeDSServerTransID,
|
|
16
16
|
acsTransID: s.acsTransID,
|
|
17
17
|
messageVersion: "2.1.0",
|
|
18
18
|
messageType: "CReq",
|
|
19
19
|
challengeWindowSize: "01"
|
|
20
|
-
}),
|
|
21
|
-
return
|
|
20
|
+
}), n = encodeURI(window.btoa(r).replace(/=*$/, ""));
|
|
21
|
+
return g(() => {
|
|
22
22
|
var h;
|
|
23
23
|
(h = t.value) == null || h.submit();
|
|
24
|
-
}), (h, l) => (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_(
|
|
24
|
+
}), (h, l) => (p(), T("div", U, [
|
|
25
|
+
i("div", $, [
|
|
26
|
+
i("div", L, [
|
|
27
|
+
_(m, {
|
|
28
28
|
onClick: l[0] || (l[0] = (V) => e("close")),
|
|
29
29
|
id: "3ds-challenge-close"
|
|
30
30
|
}),
|
|
31
31
|
b,
|
|
32
|
-
|
|
32
|
+
i("form", {
|
|
33
33
|
action: s.formAction,
|
|
34
34
|
target: "ThreeDsChallengeIFrame",
|
|
35
35
|
method: "post",
|
|
36
36
|
ref_key: "form",
|
|
37
37
|
ref: t
|
|
38
38
|
}, [
|
|
39
|
-
|
|
39
|
+
i("input", {
|
|
40
40
|
type: "hidden",
|
|
41
41
|
name: "creq",
|
|
42
|
-
value:
|
|
42
|
+
value: I(n)
|
|
43
43
|
}, null, 8, w)
|
|
44
44
|
], 8, M)
|
|
45
45
|
])
|
|
@@ -50,44 +50,43 @@ const P = (a) => (f("data-v-c82daa22"), a = a(), y(), a), U = { class: "mask" },
|
|
|
50
50
|
const k = /* @__PURE__ */ A(N, [["__scopeId", "data-v-c82daa22"]]), O = "3ds_method_invocation_complete", q = "3ds_challenge_complete";
|
|
51
51
|
class F {
|
|
52
52
|
constructor(e, s, t) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
r(this, "threeDSDestroy", () => {
|
|
53
|
+
o(this, "log");
|
|
54
|
+
o(this, "container");
|
|
55
|
+
o(this, "options");
|
|
56
|
+
o(this, "threeDsProcessor", null);
|
|
57
|
+
o(this, "threeDSDestroy", () => {
|
|
59
58
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var t,
|
|
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;
|
|
67
66
|
if (this.closeChallenge(), c(), e === 404) {
|
|
68
67
|
(t = this.threeDsProcessor) == null || t.onError({ error: "This feature is only supported by ActiveServer v1.1.2+" });
|
|
69
68
|
return;
|
|
70
69
|
}
|
|
71
|
-
(
|
|
70
|
+
(r = this.threeDsProcessor) == null || r.onError({ error: "3D Secure failed", body: s });
|
|
72
71
|
});
|
|
73
|
-
|
|
74
|
-
var
|
|
72
|
+
o(this, "onSuccess", (e, s) => {
|
|
73
|
+
var r, n;
|
|
75
74
|
this.closeChallenge(), c();
|
|
76
75
|
const t = JSON.parse(s);
|
|
77
|
-
["Y", "A"].includes(t.transStatus) ? (
|
|
76
|
+
["Y", "A"].includes(t.transStatus) ? (r = this.threeDsProcessor) == null || r.onSuccess(t) : (this.log(`[${this.getType()}]: 3D Secure failed`, t), (n = this.threeDsProcessor) == null || n.onError({ error: "3D Secure failed" }));
|
|
78
77
|
});
|
|
79
|
-
|
|
78
|
+
o(this, "onInitAuthSuccess", (e, s) => {
|
|
80
79
|
const t = JSON.parse(s);
|
|
81
|
-
if (this.log(`[${this.
|
|
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) {
|
|
82
81
|
this.threeDsMethodInvoke(t.threeDSServerTransID, t.threeDSMethodURL);
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
85
84
|
this.onAuth(!1, "");
|
|
86
85
|
});
|
|
87
|
-
|
|
88
|
-
var
|
|
86
|
+
o(this, "onDoAuthSuccess", (e, s) => {
|
|
87
|
+
var r;
|
|
89
88
|
const t = JSON.parse(s);
|
|
90
|
-
if (this.log(`[${this.
|
|
89
|
+
if (this.log(`[${this.getType()}][onDoAuthSuccess]`, t), !t.transStatus) {
|
|
91
90
|
this.onError(e, "No transStatus specified");
|
|
92
91
|
return;
|
|
93
92
|
}
|
|
@@ -97,19 +96,19 @@ class F {
|
|
|
97
96
|
this.onError(e, "Invalid Challenge Url");
|
|
98
97
|
return;
|
|
99
98
|
}
|
|
100
|
-
this.doChallenge(t.acsURL, t.acsTransID);
|
|
99
|
+
this.doChallenge(t.acsURL, t.acsTransID, t.authenticationValue);
|
|
101
100
|
break;
|
|
102
101
|
case "N":
|
|
103
|
-
this.log(`[${this.
|
|
102
|
+
this.log(`[${this.getType()}][threeDsAuth], 3DS Verification failed, transaction denied`), this.onError(400, "3DS Verification failed, transaction denied");
|
|
104
103
|
break;
|
|
105
104
|
case "U":
|
|
106
|
-
this.log(`[${this.
|
|
105
|
+
this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification`), this.onError(400, "Unable to perform 3DS verification");
|
|
107
106
|
break;
|
|
108
107
|
case "R":
|
|
109
|
-
this.log(`[${this.
|
|
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");
|
|
110
109
|
break;
|
|
111
110
|
default:
|
|
112
|
-
this.log(`[${this.
|
|
111
|
+
this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${t.transStatus}`), (r = this.threeDsProcessor) == null || r.onSuccess({
|
|
113
112
|
threeDSServerTransID: t.threeDSServerTransID,
|
|
114
113
|
threeDSRequestorTransID: "",
|
|
115
114
|
acsRenderingType: t.acsRenderingType,
|
|
@@ -132,12 +131,18 @@ class F {
|
|
|
132
131
|
});
|
|
133
132
|
this.log = e, this.container = s, this.options = t;
|
|
134
133
|
}
|
|
134
|
+
getType() {
|
|
135
|
+
return "Default";
|
|
136
|
+
}
|
|
137
|
+
getDomain() {
|
|
138
|
+
return "";
|
|
139
|
+
}
|
|
135
140
|
onPreAuth() {
|
|
136
|
-
this.log(`[${this.
|
|
141
|
+
this.log(`[${this.getType()}][onPreAuth]`), this.threeDsProcessor && (v(), this.threeDsProcessor.onPreAuth(this.onInitAuthSuccess, this.onError), window.addEventListener("message", this.internalMessageHandler));
|
|
137
142
|
}
|
|
138
143
|
onAuth(e, s) {
|
|
139
144
|
var t;
|
|
140
|
-
this.log(`[${this.
|
|
145
|
+
this.log(`[${this.getType()}][onAuth]`, {
|
|
141
146
|
threeDSAuthURL: this.threeDSAuthURL,
|
|
142
147
|
threeDSRequestorTransID: this.threeDSRequestorTransID,
|
|
143
148
|
threeDSServerTransID: this.threeDSServerTransID,
|
|
@@ -146,14 +151,14 @@ class F {
|
|
|
146
151
|
}
|
|
147
152
|
onPostAuth() {
|
|
148
153
|
var e;
|
|
149
|
-
this.log(`[${this.
|
|
154
|
+
this.log(`[${this.getType()}][onPostAuth]`, {
|
|
150
155
|
threeDSServerTransID: this.threeDSServerTransID
|
|
151
156
|
}), (e = this.threeDsProcessor) == null || e.onPostAuth({
|
|
152
157
|
threeDSServerTransID: this.threeDSServerTransID
|
|
153
158
|
}, this.onSuccess, this.onError);
|
|
154
159
|
}
|
|
155
160
|
setThreeDsProcessor(e) {
|
|
156
|
-
this.log(`[${this.
|
|
161
|
+
this.log(`[${this.getType()}][setThreeDsProcessor]`), this.threeDsProcessor = e;
|
|
157
162
|
}
|
|
158
163
|
messageHandler(e) {
|
|
159
164
|
var s, t;
|
|
@@ -166,45 +171,46 @@ class F {
|
|
|
166
171
|
}
|
|
167
172
|
}
|
|
168
173
|
invocationComplete(e) {
|
|
169
|
-
this.log(`[${this.
|
|
174
|
+
this.log(`[${this.getType()}]: 3Ds Method invocation complete`), this.onAuth(!0, "");
|
|
170
175
|
}
|
|
171
176
|
challengeComplete(e) {
|
|
172
|
-
this.log(`[${this.
|
|
177
|
+
this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge();
|
|
173
178
|
const s = JSON.parse(window.atob(e.data.cres));
|
|
174
|
-
this.log(`[${this.
|
|
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"));
|
|
175
180
|
}
|
|
176
|
-
doChallenge(e, s) {
|
|
177
|
-
this.log(`[${this.
|
|
178
|
-
const { destroy:
|
|
181
|
+
doChallenge(e, s, t) {
|
|
182
|
+
this.log(`[${this.getType()}][doChallenge]`), c();
|
|
183
|
+
const { destroy: r } = E({
|
|
179
184
|
el: document.body,
|
|
180
185
|
component: k,
|
|
181
186
|
props: {
|
|
182
187
|
threeDSServerTransID: this.threeDSServerTransID,
|
|
183
188
|
acsTransID: s,
|
|
184
|
-
formAction: e
|
|
189
|
+
formAction: e,
|
|
190
|
+
authenticationValue: t
|
|
185
191
|
},
|
|
186
192
|
on: {
|
|
187
193
|
close: () => {
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
}, (
|
|
194
|
+
var n;
|
|
195
|
+
r(), this.threeDSDestroy = () => {
|
|
196
|
+
}, (n = this.threeDsProcessor) == null || n.onError({ error: "Challenge cancelled" });
|
|
191
197
|
}
|
|
192
198
|
}
|
|
193
199
|
});
|
|
194
|
-
this.threeDSDestroy =
|
|
200
|
+
this.threeDSDestroy = r;
|
|
195
201
|
}
|
|
196
202
|
closeChallenge() {
|
|
197
203
|
var e;
|
|
198
204
|
(e = this.threeDSDestroy) == null || e.call(this), window.removeEventListener("message", this.internalMessageHandler);
|
|
199
205
|
}
|
|
200
206
|
threeDsMethodInvoke(e, s) {
|
|
201
|
-
this.log(`[${this.
|
|
207
|
+
this.log(`[${this.getType()}][threeDsMethodInvoke]`, { threeDSServerTransID: e, threeDSMethodURL: s });
|
|
202
208
|
const t = {
|
|
203
209
|
threeDSServerTransID: e,
|
|
204
210
|
threeDSMethodNotificationURL: this.options.apiUrl + "/3ds/method_invocation"
|
|
205
|
-
},
|
|
211
|
+
}, r = encodeURI(window.btoa(JSON.stringify(t)).replace(/=*$/, ""));
|
|
206
212
|
new R().invoke(s, "POST", {
|
|
207
|
-
threeDSMethodData:
|
|
213
|
+
threeDSMethodData: r
|
|
208
214
|
});
|
|
209
215
|
}
|
|
210
216
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var h = (t, s, e) => s in t ? c(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
|
|
3
|
+
var i = (t, s, e) => (h(t, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
|
+
import { DefaultThreeDsProvider as d } from "./DefaultThreeDsProvider-e92310c2.mjs";
|
|
5
|
+
import { d as p, r as u, o as _, a as D, c as m, b as r, e as g, C as S, u as y, p as f, f as T, _ as v, g as C } from "./main-6d84dc12.mjs";
|
|
6
|
+
const I = (t) => (f("data-v-82a75009"), t = t(), T(), t), P = { class: "mask" }, A = { class: "wrapper" }, V = { class: "container" }, E = /* @__PURE__ */ I(() => /* @__PURE__ */ r("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), $ = ["action"], k = ["value"], x = /* @__PURE__ */ p({
|
|
7
|
+
__name: "ecentric",
|
|
8
|
+
props: {
|
|
9
|
+
threeDSServerTransID: null,
|
|
10
|
+
acsTransID: null,
|
|
11
|
+
formAction: null,
|
|
12
|
+
authenticationValue: null
|
|
13
|
+
},
|
|
14
|
+
setup(t) {
|
|
15
|
+
const s = t, e = u(null), n = s.authenticationValue;
|
|
16
|
+
return _(() => {
|
|
17
|
+
var o;
|
|
18
|
+
(o = e.value) == null || o.submit();
|
|
19
|
+
}), (o, a) => (D(), m("div", P, [
|
|
20
|
+
r("div", A, [
|
|
21
|
+
r("div", V, [
|
|
22
|
+
g(S, {
|
|
23
|
+
onClick: a[0] || (a[0] = (l) => o.emit("close"))
|
|
24
|
+
}),
|
|
25
|
+
E,
|
|
26
|
+
r("form", {
|
|
27
|
+
action: s.formAction,
|
|
28
|
+
target: "ThreeDsChallengeIFrame",
|
|
29
|
+
method: "post",
|
|
30
|
+
ref_key: "form",
|
|
31
|
+
ref: e
|
|
32
|
+
}, [
|
|
33
|
+
r("input", {
|
|
34
|
+
type: "hidden",
|
|
35
|
+
name: "PaReq",
|
|
36
|
+
value: y(n)
|
|
37
|
+
}, null, 8, k)
|
|
38
|
+
], 8, $)
|
|
39
|
+
])
|
|
40
|
+
])
|
|
41
|
+
]));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const R = /* @__PURE__ */ v(x, [["__scopeId", "data-v-82a75009"]]);
|
|
45
|
+
class w extends d {
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments);
|
|
48
|
+
i(this, "paResPayload", "");
|
|
49
|
+
}
|
|
50
|
+
getType() {
|
|
51
|
+
return "Ecentric";
|
|
52
|
+
}
|
|
53
|
+
onPostAuth() {
|
|
54
|
+
var e;
|
|
55
|
+
this.log(`[${this.getType()}][onPostAuth]`, {
|
|
56
|
+
threeDSServerTransID: this.threeDSServerTransID,
|
|
57
|
+
authenticationValue: this.paResPayload
|
|
58
|
+
}), (e = this.threeDsProcessor) == null || e.onPostAuth({
|
|
59
|
+
threeDSServerTransID: this.threeDSServerTransID,
|
|
60
|
+
authenticationValue: this.paResPayload
|
|
61
|
+
}, this.onSuccess, this.onError);
|
|
62
|
+
}
|
|
63
|
+
doChallenge(e, n, o) {
|
|
64
|
+
this.log(`[${this.getType()}][doChallenge]`);
|
|
65
|
+
const { destroy: a } = C({
|
|
66
|
+
el: document.body,
|
|
67
|
+
component: R,
|
|
68
|
+
props: {
|
|
69
|
+
threeDSServerTransID: this.threeDSServerTransID,
|
|
70
|
+
acsTransID: n,
|
|
71
|
+
formAction: e,
|
|
72
|
+
authenticationValue: o
|
|
73
|
+
},
|
|
74
|
+
on: {
|
|
75
|
+
close: () => {
|
|
76
|
+
var l;
|
|
77
|
+
a(), this.threeDSDestroy = () => {
|
|
78
|
+
}, (l = this.threeDsProcessor) == null || l.onError({ error: "Challenge cancelled" });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
this.threeDSDestroy = a;
|
|
83
|
+
}
|
|
84
|
+
challengeComplete(e) {
|
|
85
|
+
this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge(), this.log(`[${this.getType()}]: cresData`, e.data.cres), e.data.cres ? (this.paResPayload = e.data.cres, this.onPostAuth()) : (this.log(`[${this.getType()}]: Failed 3DS Challenge`, e.data), this.onError(400, "Failed 3DS Challenge"));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
w as EcentricThreeDsProvider
|
|
90
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e92310c2.mjs";
|
|
3
|
+
import "./main-6d84dc12.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-fdada4dd.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e92310c2.mjs";
|
|
3
|
+
import "./main-6d84dc12.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
|
+
};
|
package/dist/sdk/{GPaymentsThreeDsProvider-740b4c21.mjs → GPaymentsThreeDsProvider-992c1825.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var i = Object.defineProperty;
|
|
2
2
|
var l = (n, r, e) => r in n ? i(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
3
|
var o = (n, r, e) => (l(n, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
-
import { DefaultThreeDsProvider as c } from "./DefaultThreeDsProvider-
|
|
5
|
-
import { d as u, a as d, c as p, b as a, n as h, _, g as
|
|
6
|
-
const
|
|
4
|
+
import { DefaultThreeDsProvider as c } from "./DefaultThreeDsProvider-e92310c2.mjs";
|
|
5
|
+
import { d as u, a as d, c as p, b as a, n as h, _ as g, g as _ } from "./main-6d84dc12.mjs";
|
|
6
|
+
const m = { class: "mask" }, D = { class: "wrapper" }, S = ["src"], y = /* @__PURE__ */ u({
|
|
7
7
|
__name: "GPayments",
|
|
8
8
|
props: {
|
|
9
9
|
url: null,
|
|
@@ -18,8 +18,8 @@ const D = { class: "mask" }, S = { class: "wrapper" }, y = ["src"], g = /* @__PU
|
|
|
18
18
|
height: `${r.height || 400}px`
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
return (s, t) => (d(), p("div",
|
|
22
|
-
a("div",
|
|
21
|
+
return (s, t) => (d(), p("div", m, [
|
|
22
|
+
a("div", D, [
|
|
23
23
|
a("div", {
|
|
24
24
|
class: "container",
|
|
25
25
|
style: h([e(), { padding: "0", margin: "0" }])
|
|
@@ -27,20 +27,19 @@ const D = { class: "mask" }, S = { class: "wrapper" }, y = ["src"], g = /* @__PU
|
|
|
27
27
|
a("iframe", {
|
|
28
28
|
src: r.url,
|
|
29
29
|
style: h(e())
|
|
30
|
-
}, null, 12,
|
|
30
|
+
}, null, 12, S)
|
|
31
31
|
], 4)
|
|
32
32
|
])
|
|
33
33
|
]));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
const f = /* @__PURE__ */
|
|
37
|
-
class
|
|
36
|
+
const f = /* @__PURE__ */ g(y, [["__scopeId", "data-v-9b0ef3a8"]]);
|
|
37
|
+
class A extends c {
|
|
38
38
|
constructor() {
|
|
39
39
|
super(...arguments);
|
|
40
|
-
o(this, "type", "gpayments");
|
|
41
40
|
o(this, "onDoAuthSuccess", (e, s) => {
|
|
42
41
|
const t = JSON.parse(s);
|
|
43
|
-
if (this.log(`[${this.
|
|
42
|
+
if (this.log(`[${this.getType()}][onDoAuthSuccess]`, t), !t.transStatus) {
|
|
44
43
|
this.onError(e, "No transStatus specified");
|
|
45
44
|
return;
|
|
46
45
|
}
|
|
@@ -53,13 +52,13 @@ class U extends c {
|
|
|
53
52
|
this.doChallenge(t.acsURL);
|
|
54
53
|
break;
|
|
55
54
|
default:
|
|
56
|
-
this.log(`[${this.
|
|
55
|
+
this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${t.transStatus}`), this.onPostAuth();
|
|
57
56
|
break;
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
59
|
o(this, "onInitAuthSuccess", (e, s) => {
|
|
61
60
|
const t = JSON.parse(s);
|
|
62
|
-
if (this.log(`[${this.
|
|
61
|
+
if (this.log(`[${this.getType()}][onInitAuthSuccess]`, t), !t.threeDSAuthURL) {
|
|
63
62
|
this.onError(e, "No AuthUrl specified");
|
|
64
63
|
return;
|
|
65
64
|
}
|
|
@@ -70,9 +69,12 @@ class U extends c {
|
|
|
70
69
|
this.onAuth(!1, "");
|
|
71
70
|
});
|
|
72
71
|
}
|
|
72
|
+
getType() {
|
|
73
|
+
return "GPayments";
|
|
74
|
+
}
|
|
73
75
|
doChallenge(e) {
|
|
74
|
-
this.log(`[${this.
|
|
75
|
-
const { destroy: s } =
|
|
76
|
+
this.log(`[${this.getType()}][doChallenge]`);
|
|
77
|
+
const { destroy: s } = _({
|
|
76
78
|
el: document.body,
|
|
77
79
|
component: f,
|
|
78
80
|
props: {
|
|
@@ -90,14 +92,14 @@ class U extends c {
|
|
|
90
92
|
this.threeDSDestroy = s;
|
|
91
93
|
}
|
|
92
94
|
challengeComplete(e) {
|
|
93
|
-
this.log(`[${this.
|
|
95
|
+
this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge(), this.onPostAuth();
|
|
94
96
|
}
|
|
95
97
|
initFrame(e) {
|
|
96
|
-
this.log(`[${this.
|
|
98
|
+
this.log(`[${this.getType()}][init3DSFrame]`, e);
|
|
97
99
|
const s = document.createElement("iframe");
|
|
98
100
|
s.src = e, s.style.width = "1px", s.style.height = "1px", s.style.border = "0", document.body.appendChild(s);
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
export {
|
|
102
|
-
|
|
104
|
+
A as GPaymentsThreeDsProvider
|
|
103
105
|
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var S = (o, n, t) => n in o ? w(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
|
|
3
|
+
var l = (o, n, t) => (S(o, typeof n != "symbol" ? n + "" : n, t), t);
|
|
4
|
+
import { DefaultThreeDsProvider as P } from "./DefaultThreeDsProvider-e92310c2.mjs";
|
|
5
|
+
import { d as f, r as v, o as E, i as A, w as b, v as T, a as I, c as x, b as p, e as G, C as L, p as N, f as M, _ as $, h as c, j as g, s as H, g as k } from "./main-6d84dc12.mjs";
|
|
6
|
+
const O = (o) => (N("data-v-8a0b6dcb"), o = o(), M(), o), j = { class: "mask" }, B = { class: "wrapper" }, F = { class: "container" }, U = /* @__PURE__ */ O(() => /* @__PURE__ */ p("div", { id: "ThreeDsChallengeIFrame" }, null, -1)), W = /* @__PURE__ */ f({
|
|
7
|
+
__name: "MetricsGlobalThreeDsChallenge",
|
|
8
|
+
emits: ["close", "submit"],
|
|
9
|
+
setup(o, { emit: n }) {
|
|
10
|
+
const t = v(!1);
|
|
11
|
+
function e(s) {
|
|
12
|
+
var r;
|
|
13
|
+
["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes((r = s.data) == null ? void 0 : r.message) && (t.value = s.data.message === "3DS_CHALLENGE_SHOW");
|
|
14
|
+
}
|
|
15
|
+
return E(() => {
|
|
16
|
+
window.addEventListener("message", e);
|
|
17
|
+
}), A(() => {
|
|
18
|
+
window.removeEventListener("message", e);
|
|
19
|
+
}), (s, r) => b((I(), x("div", j, [
|
|
20
|
+
p("div", B, [
|
|
21
|
+
p("div", F, [
|
|
22
|
+
G(L, {
|
|
23
|
+
onClick: r[0] || (r[0] = (u) => n("close")),
|
|
24
|
+
id: "3ds-challenge-close"
|
|
25
|
+
}),
|
|
26
|
+
U
|
|
27
|
+
])
|
|
28
|
+
])
|
|
29
|
+
], 512)), [
|
|
30
|
+
[T, t.value]
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const V = /* @__PURE__ */ $(W, [["__scopeId", "data-v-8a0b6dcb"]]), m = 5;
|
|
35
|
+
class z extends P {
|
|
36
|
+
constructor(t, e, s) {
|
|
37
|
+
var r;
|
|
38
|
+
super(t, e, s);
|
|
39
|
+
l(this, "gateway");
|
|
40
|
+
l(this, "threeDS");
|
|
41
|
+
l(this, "numAttempts", 0);
|
|
42
|
+
this.initScript(((r = s.clientParameters) == null ? void 0 : r.PublicKey) || "");
|
|
43
|
+
}
|
|
44
|
+
getType() {
|
|
45
|
+
return "MetricsGlobal";
|
|
46
|
+
}
|
|
47
|
+
getDomain() {
|
|
48
|
+
return "secure.metricsglobalgateway.com";
|
|
49
|
+
}
|
|
50
|
+
onPreAuth() {
|
|
51
|
+
var t, e;
|
|
52
|
+
if (this.log(`[${this.getType()}]: onPreAuth`), !this.threeDS && this.numAttempts >= m) {
|
|
53
|
+
c(), g(this.container, "Error loading 3D Secure");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (!this.threeDS && this.numAttempts < m) {
|
|
57
|
+
this.numAttempts++, this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`), setTimeout(() => this.onPreAuth(), 1e3);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
(t = this.threeDsProcessor) != null && t.getTokenId() ? (e = this.threeDsProcessor) == null || e.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (s) => {
|
|
61
|
+
var r;
|
|
62
|
+
(r = this.threeDsProcessor) == null || r.setPaymentInfo(s), this.startAuth();
|
|
63
|
+
}, () => {
|
|
64
|
+
g(this.container, "Unable to get card information");
|
|
65
|
+
}) : this.startAuth();
|
|
66
|
+
}
|
|
67
|
+
onAuth(t, e) {
|
|
68
|
+
}
|
|
69
|
+
onPostAuth() {
|
|
70
|
+
}
|
|
71
|
+
startAuth() {
|
|
72
|
+
var D, y, d, _, C;
|
|
73
|
+
this.log(`[${this.getType()}]: startAuth`);
|
|
74
|
+
const t = (D = this.threeDsProcessor) == null ? void 0 : D.getPaymentInfo();
|
|
75
|
+
if (!t) {
|
|
76
|
+
c(), g(this.container, "Payment information is missing");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
H();
|
|
80
|
+
const e = (y = this.threeDsProcessor) == null ? void 0 : y.getAddressInfo(), s = t.expiryDate.length === 4 ? t.expiryDate[2] + t.expiryDate[3] : "", r = t.expiryDate.length === 4 ? t.expiryDate[0] + t.expiryDate[1] : "", u = {
|
|
81
|
+
cardNumber: t.cardNumber,
|
|
82
|
+
cardExpMonth: s,
|
|
83
|
+
cardExpYear: parseInt(r) + 2e3,
|
|
84
|
+
currency: (d = this.threeDsProcessor) == null ? void 0 : d.getCurrency(),
|
|
85
|
+
amount: (_ = this.threeDsProcessor) == null ? void 0 : _.getAmount(),
|
|
86
|
+
email: (C = this.threeDsProcessor) == null ? void 0 : C.getEmail(),
|
|
87
|
+
phone: e == null ? void 0 : e.phoneNumber,
|
|
88
|
+
city: e == null ? void 0 : e.city,
|
|
89
|
+
state: e == null ? void 0 : e.state,
|
|
90
|
+
address1: e == null ? void 0 : e.streetAddress,
|
|
91
|
+
country: e == null ? void 0 : e.country,
|
|
92
|
+
firstName: e == null ? void 0 : e.firstName,
|
|
93
|
+
lastName: e == null ? void 0 : e.lastName,
|
|
94
|
+
postalCode: e == null ? void 0 : e.postalCode
|
|
95
|
+
}, h = this.threeDS.createUI(u);
|
|
96
|
+
h.start("#ThreeDsChallengeIFrame"), h.on("challenge", (i) => {
|
|
97
|
+
this.log(`[${this.getType()}][onChallenge]`, i), c(), this.showChallenge();
|
|
98
|
+
}), h.on("complete", (i) => {
|
|
99
|
+
var a;
|
|
100
|
+
this.log(`[${this.getType()}][onComplete]`, i), this.removeChallenge(), (a = this.threeDsProcessor) == null || a.onSuccess({
|
|
101
|
+
externalThreeDsData: i
|
|
102
|
+
});
|
|
103
|
+
}), h.on("failure", (i) => {
|
|
104
|
+
var a;
|
|
105
|
+
this.log(`[${this.getType()}][onFailure]`, i), c(), this.closeChallenge(), (a = this.threeDsProcessor) == null || a.onError({ error: i.message });
|
|
106
|
+
}), h.on("error", (i) => {
|
|
107
|
+
var a;
|
|
108
|
+
this.log(`[${this.getType()}][error]`, i), c(), this.closeChallenge(), (a = this.threeDsProcessor) == null || a.onError({ error: i.message });
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
initScript(t) {
|
|
112
|
+
const e = document.createElement("script");
|
|
113
|
+
e.type = "text/javascript", e.src = `https://${this.getDomain()}/js/v1/Gateway.js`, e.onload = () => {
|
|
114
|
+
this.initGateway(t), this.initChallenge();
|
|
115
|
+
}, document.head.appendChild(e);
|
|
116
|
+
}
|
|
117
|
+
initGateway(t) {
|
|
118
|
+
this.gateway = window.Gateway.create(t), this.threeDS = this.gateway.get3DSecure(), this.gateway.on("error", (e) => {
|
|
119
|
+
var s;
|
|
120
|
+
this.log(`[${this.getType()}]: gateway error`, e), (s = this.threeDsProcessor) == null || s.onError({ error: e.message }), this.threeDS = null, this.numAttempts = m;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
initChallenge() {
|
|
124
|
+
const { destroy: t } = k({
|
|
125
|
+
el: document.body,
|
|
126
|
+
component: V,
|
|
127
|
+
on: {
|
|
128
|
+
close: () => {
|
|
129
|
+
var e;
|
|
130
|
+
this.closeChallenge(), (e = this.threeDsProcessor) == null || e.onError({ error: "Challenge cancelled" });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
this.threeDSDestroy = t;
|
|
135
|
+
}
|
|
136
|
+
showChallenge() {
|
|
137
|
+
window.postMessage({
|
|
138
|
+
message: "3DS_CHALLENGE_SHOW"
|
|
139
|
+
}, "*");
|
|
140
|
+
}
|
|
141
|
+
closeChallenge() {
|
|
142
|
+
window.postMessage({
|
|
143
|
+
message: "3DS_CHALLENGE_CLOSE"
|
|
144
|
+
}, "*");
|
|
145
|
+
}
|
|
146
|
+
removeChallenge() {
|
|
147
|
+
var t;
|
|
148
|
+
(t = this.threeDSDestroy) == null || t.call(this);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
z as MetricsGlobalThreeDsProvider
|
|
153
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-e92310c2.mjs";
|
|
3
|
+
import "./main-6d84dc12.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
|
+
};
|