@payfurl/react-plugin 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/CxPayThreeDsProvider-qI6LA8iK-Bpdve37Y.js +12 -0
  2. package/dist/DefaultThreeDsProvider-BKnpkX8X-DjgfDV-_.js +224 -0
  3. package/dist/EcentricThreeDsProvider-Dor61dsV-wSxgfkFR.js +86 -0
  4. package/dist/EpnaThreeDsProvider-6j4cBf2g-DKKUHzvH.js +12 -0
  5. package/dist/FlashBancThreeDsProvider-B1IMjfpm-Tzb2NaCS.js +12 -0
  6. package/dist/GPaymentsThreeDsProvider-PKB94NB4-DpHbV578.js +100 -0
  7. package/dist/MetricsGlobalThreeDsProvider-CkIGiDkd-DoLM32Cq.js +146 -0
  8. package/dist/NmiThreeDsProvider-CcMEqhmQ-DXmogp9D.js +12 -0
  9. package/dist/NuveiThreeDsProvider-CwXxM_h7-D7sowzvz.js +176 -0
  10. package/dist/PayGLocalThreeDsProvider-sIfhhTia-C-90nFC1.js +127 -0
  11. package/dist/PayWayAppleButton-BhhFv3LB-BWA8af0L.js +141 -0
  12. package/dist/PayabliThreeDsProvider-Dbril8Rp-DjxP1Zjs.js +12 -0
  13. package/dist/SkyBankThreeDsProvider-C07fNAvi-CDQRSmTJ.js +12 -0
  14. package/dist/ThreeDsPostAuthResponse.type-CaV_50Qh-CaV_50Qh.js +26 -0
  15. package/dist/cxpay-CEQ4-BTN-D8-vI4wh.js +7 -0
  16. package/dist/default-C_HQSLX4-BWCZmTvd.js +7 -0
  17. package/dist/ecentric-BNc1h8Eo-IrqJ8q3L.js +7 -0
  18. package/dist/epna-B9Y2q1w--DVGb9J09.js +7 -0
  19. package/dist/flashbanc-C0Ty8vp7-DQKcslty.js +7 -0
  20. package/dist/forter-CfW26Mkn-CmVDxLR0.js +46 -0
  21. package/dist/fraudProvider.type-ewIWghbD-ewIWghbD.js +7 -0
  22. package/dist/gpayments-rnHqXJDK-D68BA53b.js +7 -0
  23. package/dist/index-CQ8WmrJ_.js +13299 -0
  24. package/dist/metrics_global-B6yYoxRR-C3pcjfUz.js +7 -0
  25. package/dist/nmi-2JLTZ129-DIP4ydh7.js +7 -0
  26. package/dist/nuvei-Bh2t9NPs-DiT3vmdx.js +7 -0
  27. package/dist/payabli-NfqCrBOu-D0t1MIbi.js +7 -0
  28. package/dist/payfurl-react.es.js +4 -0
  29. package/dist/payfurl-react.umd.js +303 -0
  30. package/dist/payglocal-D3sg1uGV-D8upA6BT.js +7 -0
  31. package/dist/payway_rest-B7rIKWt2-1A5dJ_Ns.js +7 -0
  32. package/dist/plugins/react/src/components/PayfurlDropin.d.ts +15 -0
  33. package/dist/plugins/react/src/index.d.ts +6 -0
  34. package/dist/skybank-CrMnPsZ3-BoCAKL4P.js +7 -0
  35. package/dist/src/click2pay/ClickToPayOptions.type.d.ts +28 -0
  36. package/dist/src/sdk/checkout/checkoutProvider.type.d.ts +66 -0
  37. package/dist/src/sdk/fraud/fraudProvider.type.d.ts +3 -0
  38. package/dist/src/sdk/types/DropInOptions.type.d.ts +72 -0
  39. package/dist/src/sdk/types/NetworkTokenOptions.type.d.ts +6 -0
  40. package/dist/src/sdk/types/UpiOptions.type.d.ts +9 -0
  41. package/package.json +49 -0
@@ -0,0 +1,12 @@
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-CkIGiDkd-DoLM32Cq.js";
2
+ class t extends e {
3
+ getType() {
4
+ return "CxPay";
5
+ }
6
+ getDomain() {
7
+ return "cxpay.transactiongateway.com";
8
+ }
9
+ }
10
+ export {
11
+ t as CxPayThreeDsProvider
12
+ };
@@ -0,0 +1,224 @@
1
+ import { n as d, f as S, y as g, j as p, M as m, t as T, N as v, W as I, z as f, a as u, x as y, c as A, b as C } from "./index-CQ8WmrJ_.js";
2
+ var R = Object.defineProperty, E = (l, e, s) => e in l ? R(l, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : l[e] = s, n = (l, e, s) => E(l, typeof e != "symbol" ? e + "" : e, s);
3
+ const P = { class: "mask" }, b = { class: "wrapper" }, U = { class: "container" }, M = ["action"], L = ["value"], $ = /* @__PURE__ */ m({
4
+ __name: "ThreeDsChallenge",
5
+ props: {
6
+ threeDSServerTransID: {},
7
+ acsTransID: {},
8
+ formAction: {}
9
+ },
10
+ emits: ["close", "submit"],
11
+ setup(l, { emit: e }) {
12
+ const s = l, a = e, o = T(null), i = JSON.stringify({
13
+ threeDSServerTransID: s.threeDSServerTransID,
14
+ acsTransID: s.acsTransID,
15
+ messageVersion: "2.2.0",
16
+ messageType: "CReq",
17
+ challengeWindowSize: "01"
18
+ }), r = encodeURI(window.btoa(i).replace(/=*$/, ""));
19
+ return v(() => {
20
+ var t;
21
+ (t = o.value) == null || t.submit();
22
+ }), (t, h) => (I(), f("div", P, [
23
+ u("div", b, [
24
+ u("div", U, [
25
+ y(A, {
26
+ onClick: h[0] || (h[0] = (c) => a("close")),
27
+ id: "3ds-challenge-close"
28
+ }),
29
+ h[1] || (h[1] = u("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)),
30
+ u("form", {
31
+ action: s.formAction,
32
+ target: "ThreeDsChallengeIFrame",
33
+ method: "post",
34
+ ref_key: "form",
35
+ ref: o
36
+ }, [
37
+ u("input", {
38
+ type: "hidden",
39
+ name: "creq",
40
+ value: C(r)
41
+ }, null, 8, L)
42
+ ], 8, M)
43
+ ])
44
+ ])
45
+ ]));
46
+ }
47
+ }), _ = /* @__PURE__ */ p($, [["__scopeId", "data-v-ac351494"]]);
48
+ class w {
49
+ constructor() {
50
+ n(this, "iframeId", "threeDsIframeMethod"), n(this, "containerId", "payfurlContainerFormInvoker"), n(this, "iframe", null), n(this, "container", null);
51
+ }
52
+ createIFrame() {
53
+ this.iframe || (this.container = document.createElement("div"), this.container.id = this.containerId, document.body.appendChild(this.container), this.iframe = document.createElement("iframe"), this.iframe.name = this.iframeId, this.iframe.style.display = "none", this.container.appendChild(this.iframe));
54
+ }
55
+ invoke(e, s, a, o, i) {
56
+ var r;
57
+ this.createIFrame();
58
+ const t = document.createElement("form");
59
+ t.action = e, t.target = this.iframeId, t.method = "post", (r = this.container) == null || r.appendChild(t);
60
+ for (let h in a) {
61
+ const c = document.createElement("input");
62
+ c.type = "hidden", c.name = h, c.value = a[h], t.appendChild(c);
63
+ }
64
+ t.submit();
65
+ }
66
+ }
67
+ const { hideSpinner: D, showSpinner: N } = d(), k = "3ds_method_invocation_complete", O = "3ds_challenge_complete";
68
+ class q {
69
+ constructor(e, s, a) {
70
+ n(this, "log"), n(this, "container"), n(this, "options"), n(this, "threeDsProcessor", null), n(this, "threeDSDestroy", () => {
71
+ }), n(this, "threeDSServerTransID", ""), n(this, "threeDSAuthURL", ""), n(this, "threeDSRequestorTransID", ""), n(this, "threeDSMonitorURL", ""), n(this, "internalMessageHandler", this.messageHandler.bind(this)), n(this, "onError", (o, i) => {
72
+ var r, t;
73
+ if (this.closeChallenge(), D(), o === 404) {
74
+ (r = this.threeDsProcessor) == null || r.onError({ error: "This feature is only supported by ActiveServer v1.1.2+" });
75
+ return;
76
+ }
77
+ (t = this.threeDsProcessor) == null || t.onError({ error: "3D Secure failed", body: i });
78
+ }), n(this, "onSuccess", (o, i) => {
79
+ var r, t;
80
+ this.closeChallenge(), D();
81
+ const h = JSON.parse(i);
82
+ ["Y", "A"].includes(h.transStatus) ? (r = this.threeDsProcessor) == null || r.onSuccess(h) : (this.log(`[${this.getType()}]: 3D Secure failed`, h), (t = this.threeDsProcessor) == null || t.onError({ error: "3D Secure failed" }));
83
+ }), n(this, "onInitAuthSuccess", (o, i) => {
84
+ const r = JSON.parse(i);
85
+ if (this.log(`[${this.getType()}][onInitAuthSuccess]`, r), this.threeDSRequestorTransID = r.threeDSRequestorTransID, this.threeDSServerTransID = r.threeDSServerTransID, this.threeDSMonitorURL = r.threeDSMonitorURL, this.threeDSAuthURL = r.threeDSAuthURL, r.threeDSMethodURL) {
86
+ this.threeDsMethodInvoke(r.threeDSServerTransID, r.threeDSMethodURL);
87
+ return;
88
+ }
89
+ this.onAuth(!1, "");
90
+ }), n(this, "onDoAuthSuccess", (o, i) => {
91
+ var r;
92
+ const t = JSON.parse(i);
93
+ if (this.log(`[${this.getType()}][onDoAuthSuccess]`, t), !t.transStatus) {
94
+ this.onError(o, "No transStatus specified");
95
+ return;
96
+ }
97
+ switch (t.transStatus) {
98
+ case "C":
99
+ if (!t.acsURL) {
100
+ this.onError(o, "Invalid Challenge Url");
101
+ return;
102
+ }
103
+ this.doChallenge(t.acsURL, t.acsTransID, t.authenticationValue);
104
+ break;
105
+ case "N":
106
+ this.log(`[${this.getType()}][threeDsAuth], 3DS Verification failed, transaction denied`), this.onError(400, "3DS Verification failed, transaction denied");
107
+ break;
108
+ case "U":
109
+ this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification`), this.onError(400, "Unable to perform 3DS verification");
110
+ break;
111
+ case "R":
112
+ this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification, rejected at issuer`), this.onError(400, "Unable to perform 3DS verification, rejected at issuer");
113
+ break;
114
+ default:
115
+ this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${t.transStatus}`), (r = this.threeDsProcessor) == null || r.onSuccess({
116
+ threeDSServerTransID: t.threeDSServerTransID,
117
+ threeDSRequestorTransID: "",
118
+ acsRenderingType: t.acsRenderingType,
119
+ acsTransID: t.acsTransID,
120
+ authenticationType: t.authenticationType,
121
+ authenticationValue: t.authenticationValue,
122
+ challengeCancel: "",
123
+ dsTransID: t.dsTransID,
124
+ eci: t.eci,
125
+ interactionCounter: "",
126
+ messageCategory: "",
127
+ messageExtension: t.messageExtension,
128
+ messageType: t.messageType,
129
+ messageVersion: t.messageVersion,
130
+ transStatus: t.transStatus,
131
+ transStatusReason: t.transStatusReason
132
+ });
133
+ break;
134
+ }
135
+ }), this.log = e, this.container = s, this.options = a;
136
+ }
137
+ getType() {
138
+ return "Default";
139
+ }
140
+ getDomain() {
141
+ return "";
142
+ }
143
+ onPreAuth() {
144
+ this.log(`[${this.getType()}][onPreAuth]`), this.threeDsProcessor && (N(), this.threeDsProcessor.onPreAuth(this.onInitAuthSuccess, this.onError), window.addEventListener("message", this.internalMessageHandler));
145
+ }
146
+ onAuth(e, s) {
147
+ var a;
148
+ this.log(`[${this.getType()}][onAuth]`, {
149
+ threeDSAuthURL: this.threeDSAuthURL,
150
+ threeDSRequestorTransID: this.threeDSRequestorTransID,
151
+ threeDSServerTransID: this.threeDSServerTransID,
152
+ isMethodPerformed: e
153
+ }), (a = this.threeDsProcessor) == null || a.onAuth(this.threeDSAuthURL, this.threeDSRequestorTransID, this.threeDSServerTransID, e, s, this.onDoAuthSuccess, this.onError);
154
+ }
155
+ onPostAuth() {
156
+ var e;
157
+ this.log(`[${this.getType()}][onPostAuth]`, {
158
+ threeDSServerTransID: this.threeDSServerTransID
159
+ }), (e = this.threeDsProcessor) == null || e.onPostAuth({
160
+ threeDSServerTransID: this.threeDSServerTransID
161
+ }, this.onSuccess, this.onError);
162
+ }
163
+ setThreeDsProcessor(e) {
164
+ this.log(`[${this.getType()}][setThreeDsProcessor]`), this.threeDsProcessor = e;
165
+ }
166
+ messageHandler(e) {
167
+ var s, a;
168
+ if (!(!((s = e == null ? void 0 : e.data) != null && s.status) || ((a = e == null ? void 0 : e.data) == null ? void 0 : a.status) === S)) {
169
+ if (e.data.status === k) {
170
+ e.stopPropagation(), this.invocationComplete(e);
171
+ return;
172
+ }
173
+ e.data.status === O && (e.stopPropagation(), this.challengeComplete(e));
174
+ }
175
+ }
176
+ invocationComplete(e) {
177
+ this.log(`[${this.getType()}]: 3Ds Method invocation complete`), this.onAuth(!0, "");
178
+ }
179
+ challengeComplete(e) {
180
+ this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge();
181
+ const s = JSON.parse(window.atob(e.data.cres));
182
+ 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"));
183
+ }
184
+ doChallenge(e, s, a) {
185
+ this.log(`[${this.getType()}][doChallenge]`), D();
186
+ const { destroy: o } = g({
187
+ el: document.body,
188
+ component: _,
189
+ props: {
190
+ threeDSServerTransID: this.threeDSServerTransID,
191
+ acsTransID: s,
192
+ formAction: e,
193
+ authenticationValue: a
194
+ },
195
+ on: {
196
+ close: () => {
197
+ var i;
198
+ o(), this.threeDSDestroy = () => {
199
+ }, (i = this.threeDsProcessor) == null || i.onError({ error: "Challenge cancelled" });
200
+ }
201
+ }
202
+ });
203
+ this.threeDSDestroy = o;
204
+ }
205
+ closeChallenge() {
206
+ var e;
207
+ (e = this.threeDSDestroy) == null || e.call(this), window.removeEventListener("message", this.internalMessageHandler);
208
+ }
209
+ threeDsMethodInvoke(e, s) {
210
+ this.log(`[${this.getType()}][threeDsMethodInvoke]`, { threeDSServerTransID: e, threeDSMethodURL: s });
211
+ const a = {
212
+ threeDSServerTransID: e,
213
+ threeDSMethodNotificationURL: this.options.apiUrl + "/3ds/method_invocation"
214
+ }, o = encodeURI(window.btoa(JSON.stringify(a)).replace(/=*$/, ""));
215
+ new w().invoke(s, "POST", {
216
+ threeDSMethodData: o
217
+ });
218
+ }
219
+ }
220
+ export {
221
+ q as DefaultThreeDsProvider,
222
+ O as THREE_DS_CHALLENGE_COMPLETE,
223
+ k as THREE_DS_METHOD_INVOCATION_COMPLETE
224
+ };
@@ -0,0 +1,86 @@
1
+ import { DefaultThreeDsProvider as l } from "./DefaultThreeDsProvider-BKnpkX8X-DjgfDV-_.js";
2
+ import { y as i, j as h, M as c, t as u, N as D, W as d, z as p, a as o, x as m, c as g, b as v } from "./index-CQ8WmrJ_.js";
3
+ var y = Object.defineProperty, S = (a, e, t) => e in a ? y(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t, T = (a, e, t) => S(a, e + "", t);
4
+ const f = { class: "mask" }, P = { class: "wrapper" }, I = { class: "container" }, C = ["action"], A = ["value"], b = /* @__PURE__ */ c({
5
+ __name: "ecentric",
6
+ props: {
7
+ threeDSServerTransID: {},
8
+ acsTransID: {},
9
+ formAction: {},
10
+ authenticationValue: {}
11
+ },
12
+ setup(a) {
13
+ const e = a, t = u(null), n = e.authenticationValue;
14
+ return D(() => {
15
+ var r;
16
+ (r = t.value) == null || r.submit();
17
+ }), (r, s) => (d(), p("div", f, [
18
+ o("div", P, [
19
+ o("div", I, [
20
+ m(g, {
21
+ onClick: s[0] || (s[0] = (E) => r.emit("close"))
22
+ }),
23
+ s[1] || (s[1] = o("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)),
24
+ o("form", {
25
+ action: e.formAction,
26
+ target: "ThreeDsChallengeIFrame",
27
+ method: "post",
28
+ ref_key: "form",
29
+ ref: t
30
+ }, [
31
+ o("input", {
32
+ type: "hidden",
33
+ name: "PaReq",
34
+ value: v(n)
35
+ }, null, 8, A)
36
+ ], 8, C)
37
+ ])
38
+ ])
39
+ ]));
40
+ }
41
+ }), V = /* @__PURE__ */ h(b, [["__scopeId", "data-v-8d26953f"]]);
42
+ class R extends l {
43
+ constructor() {
44
+ super(...arguments), T(this, "paResPayload", "");
45
+ }
46
+ getType() {
47
+ return "Ecentric";
48
+ }
49
+ onPostAuth() {
50
+ var e;
51
+ this.log(`[${this.getType()}][onPostAuth]`, {
52
+ threeDSServerTransID: this.threeDSServerTransID,
53
+ authenticationValue: this.paResPayload
54
+ }), (e = this.threeDsProcessor) == null || e.onPostAuth({
55
+ threeDSServerTransID: this.threeDSServerTransID,
56
+ authenticationValue: this.paResPayload
57
+ }, this.onSuccess, this.onError);
58
+ }
59
+ doChallenge(e, t, n) {
60
+ this.log(`[${this.getType()}][doChallenge]`);
61
+ const { destroy: r } = i({
62
+ el: document.body,
63
+ component: V,
64
+ props: {
65
+ threeDSServerTransID: this.threeDSServerTransID,
66
+ acsTransID: t,
67
+ formAction: e,
68
+ authenticationValue: n
69
+ },
70
+ on: {
71
+ close: () => {
72
+ var s;
73
+ r(), this.threeDSDestroy = () => {
74
+ }, (s = this.threeDsProcessor) == null || s.onError({ error: "Challenge cancelled" });
75
+ }
76
+ }
77
+ });
78
+ this.threeDSDestroy = r;
79
+ }
80
+ challengeComplete(e) {
81
+ this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge(), this.log(`[${this.getType()}]: cresData`, e.data.cres), e.data.cres ? (this.paResPayload = e.data.cres, this.onPostAuth()) : (this.log(`[${this.getType()}]: Failed 3DS Challenge`, e.data), this.onError(400, "Failed 3DS Challenge"));
82
+ }
83
+ }
84
+ export {
85
+ R as EcentricThreeDsProvider
86
+ };
@@ -0,0 +1,12 @@
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-CkIGiDkd-DoLM32Cq.js";
2
+ class t extends e {
3
+ getType() {
4
+ return "EPNA";
5
+ }
6
+ getDomain() {
7
+ return "epna.transactiongateway.com";
8
+ }
9
+ }
10
+ export {
11
+ t as EpnaThreeDsProvider
12
+ };
@@ -0,0 +1,12 @@
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-CkIGiDkd-DoLM32Cq.js";
2
+ class s extends e {
3
+ getType() {
4
+ return "FlashBanc";
5
+ }
6
+ getDomain() {
7
+ return "flashbanc.transactiongateway.com";
8
+ }
9
+ }
10
+ export {
11
+ s as FlashBancThreeDsProvider
12
+ };
@@ -0,0 +1,100 @@
1
+ import { DefaultThreeDsProvider as n } from "./DefaultThreeDsProvider-BKnpkX8X-DjgfDV-_.js";
2
+ import { y as o, j as l, M as u, W as c, z as p, a as h, k as i } from "./index-CQ8WmrJ_.js";
3
+ var d = Object.defineProperty, g = (r, e, t) => e in r ? d(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, a = (r, e, t) => g(r, typeof e != "symbol" ? e + "" : e, t);
4
+ const D = { class: "mask" }, S = { class: "wrapper" }, m = ["src"], y = /* @__PURE__ */ u({
5
+ __name: "GPayments",
6
+ props: {
7
+ url: {},
8
+ width: {},
9
+ height: {}
10
+ },
11
+ setup(r) {
12
+ const e = r;
13
+ function t() {
14
+ return {
15
+ width: `${e.width || 650}px`,
16
+ height: `${e.height || 400}px`
17
+ };
18
+ }
19
+ return (s, v) => (c(), p("div", D, [
20
+ h("div", S, [
21
+ h("div", {
22
+ class: "container",
23
+ style: i([t(), { padding: "0", margin: "0" }])
24
+ }, [
25
+ h("iframe", {
26
+ src: e.url,
27
+ style: i(t())
28
+ }, null, 12, m)
29
+ ], 4)
30
+ ])
31
+ ]));
32
+ }
33
+ }), f = /* @__PURE__ */ l(y, [["__scopeId", "data-v-9b0ef3a8"]]);
34
+ class A extends n {
35
+ constructor() {
36
+ super(...arguments), a(this, "onDoAuthSuccess", (e, t) => {
37
+ const s = JSON.parse(t);
38
+ if (this.log(`[${this.getType()}][onDoAuthSuccess]`, s), !s.transStatus) {
39
+ this.onError(e, "No transStatus specified");
40
+ return;
41
+ }
42
+ switch (s.transStatus) {
43
+ case "C":
44
+ if (!s.acsURL) {
45
+ this.onError(e, "Invalid Challenge Url");
46
+ return;
47
+ }
48
+ this.doChallenge(s.acsURL);
49
+ break;
50
+ default:
51
+ this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${s.transStatus}`), this.onPostAuth();
52
+ break;
53
+ }
54
+ }), a(this, "onInitAuthSuccess", (e, t) => {
55
+ const s = JSON.parse(t);
56
+ if (this.log(`[${this.getType()}][onInitAuthSuccess]`, s), !s.threeDSAuthURL) {
57
+ this.onError(e, "No AuthUrl specified");
58
+ return;
59
+ }
60
+ if (this.threeDSRequestorTransID = s.threeDSRequestorTransID, this.threeDSServerTransID = s.threeDSServerTransID, this.threeDSMonitorURL = s.threeDSMonitorURL, this.threeDSAuthURL = s.threeDSAuthURL, s.threeDsServerCallbackUrl) {
61
+ this.initFrame(s.threeDsServerCallbackUrl);
62
+ return;
63
+ }
64
+ this.onAuth(!1, "");
65
+ });
66
+ }
67
+ getType() {
68
+ return "GPayments";
69
+ }
70
+ doChallenge(e) {
71
+ this.log(`[${this.getType()}][doChallenge]`);
72
+ const { destroy: t } = o({
73
+ el: document.body,
74
+ component: f,
75
+ props: {
76
+ url: e,
77
+ width: 390,
78
+ height: 400
79
+ },
80
+ on: {
81
+ close: () => {
82
+ t(), this.threeDSDestroy = () => {
83
+ };
84
+ }
85
+ }
86
+ });
87
+ this.threeDSDestroy = t;
88
+ }
89
+ challengeComplete(e) {
90
+ this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge(), this.onPostAuth();
91
+ }
92
+ initFrame(e) {
93
+ this.log(`[${this.getType()}][init3DSFrame]`, e);
94
+ const t = document.createElement("iframe");
95
+ t.src = e, t.style.width = "1px", t.style.height = "1px", t.style.border = "0", document.body.appendChild(t);
96
+ }
97
+ }
98
+ export {
99
+ A as GPaymentsThreeDsProvider
100
+ };
@@ -0,0 +1,146 @@
1
+ import { DefaultThreeDsProvider as P } from "./DefaultThreeDsProvider-BKnpkX8X-DjgfDV-_.js";
2
+ import { n as C, P as d, y as S, j as w, M as A, t as E, N as f, e as b, A as T, U as x, W as L, z as N, a as g, x as _, c as G } from "./index-CQ8WmrJ_.js";
3
+ var I = Object.defineProperty, M = (l, e, t) => e in l ? I(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, m = (l, e, t) => M(l, typeof e != "symbol" ? e + "" : e, t);
4
+ const $ = { class: "mask" }, H = { class: "wrapper" }, j = { class: "container" }, O = /* @__PURE__ */ A({
5
+ __name: "MetricsGlobalThreeDsChallenge",
6
+ emits: ["close", "submit"],
7
+ setup(l, { emit: e }) {
8
+ const t = e, a = E(!1);
9
+ function o(h) {
10
+ var r;
11
+ ["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes((r = h.data) == null ? void 0 : r.message) && (a.value = h.data.message === "3DS_CHALLENGE_SHOW");
12
+ }
13
+ return f(() => {
14
+ window.addEventListener("message", o);
15
+ }), b(() => {
16
+ window.removeEventListener("message", o);
17
+ }), (h, r) => T((L(), N("div", $, [
18
+ g("div", H, [
19
+ g("div", j, [
20
+ _(G, {
21
+ onClick: r[0] || (r[0] = (s) => t("close")),
22
+ id: "3ds-challenge-close"
23
+ }),
24
+ r[1] || (r[1] = g("div", { id: "ThreeDsChallengeIFrame" }, null, -1))
25
+ ])
26
+ ])
27
+ ], 512)), [
28
+ [x, a.value]
29
+ ]);
30
+ }
31
+ }), k = /* @__PURE__ */ w(O, [["__scopeId", "data-v-8a0b6dcb"]]), { hideSpinner: u, showSpinner: F } = C(), p = 5;
32
+ class K extends P {
33
+ constructor(e, t, a) {
34
+ var o;
35
+ super(e, t, a), m(this, "gateway"), m(this, "threeDS"), m(this, "numAttempts", 0), this.initScript(((o = a.clientParameters) == null ? void 0 : o.PublicKey) || "");
36
+ }
37
+ getType() {
38
+ return "MetricsGlobal";
39
+ }
40
+ getDomain() {
41
+ return "secure.metricsglobalgateway.com";
42
+ }
43
+ onPreAuth() {
44
+ var e, t;
45
+ if (this.log(`[${this.getType()}]: onPreAuth`), !this.threeDS && this.numAttempts >= p) {
46
+ u(), d(this.container, "Error loading 3D Secure");
47
+ return;
48
+ }
49
+ if (!this.threeDS && this.numAttempts < p) {
50
+ this.numAttempts++, this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`), setTimeout(() => this.onPreAuth(), 1e3);
51
+ return;
52
+ }
53
+ (e = this.threeDsProcessor) != null && e.getTokenId() ? (t = this.threeDsProcessor) == null || t.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (a) => {
54
+ var o;
55
+ (o = this.threeDsProcessor) == null || o.setPaymentInfo(a), this.startAuth();
56
+ }, () => {
57
+ d(this.container, "Unable to get card information");
58
+ }) : this.startAuth();
59
+ }
60
+ onAuth(e, t) {
61
+ }
62
+ onPostAuth() {
63
+ }
64
+ startAuth() {
65
+ var e, t, a, o, h;
66
+ this.log(`[${this.getType()}]: startAuth`);
67
+ const r = (e = this.threeDsProcessor) == null ? void 0 : e.getPaymentInfo();
68
+ if (!r) {
69
+ u(), d(this.container, "Payment information is missing");
70
+ return;
71
+ }
72
+ F();
73
+ const s = (t = this.threeDsProcessor) == null ? void 0 : t.getAddressInfo(), D = r.expiryDate.length === 4 ? r.expiryDate[2] + r.expiryDate[3] : "", y = r.expiryDate.length === 4 ? r.expiryDate[0] + r.expiryDate[1] : "", v = {
74
+ cardNumber: r.cardNumber,
75
+ cardExpMonth: D,
76
+ cardExpYear: parseInt(y) + 2e3,
77
+ currency: (a = this.threeDsProcessor) == null ? void 0 : a.getCurrency(),
78
+ amount: (o = this.threeDsProcessor) == null ? void 0 : o.getAmount(),
79
+ email: (h = this.threeDsProcessor) == null ? void 0 : h.getEmail(),
80
+ phone: s == null ? void 0 : s.phoneNumber,
81
+ city: s == null ? void 0 : s.city,
82
+ state: s == null ? void 0 : s.state,
83
+ address1: s == null ? void 0 : s.streetAddress,
84
+ country: s == null ? void 0 : s.country,
85
+ firstName: s == null ? void 0 : s.firstName,
86
+ lastName: s == null ? void 0 : s.lastName,
87
+ postalCode: s == null ? void 0 : s.postalCode
88
+ }, c = this.threeDS.createUI(v);
89
+ c.start("#ThreeDsChallengeIFrame"), c.on("challenge", (i) => {
90
+ this.log(`[${this.getType()}][onChallenge]`, i), u(), this.showChallenge();
91
+ }), c.on("complete", (i) => {
92
+ var n;
93
+ this.log(`[${this.getType()}][onComplete]`, i), this.removeChallenge(), (n = this.threeDsProcessor) == null || n.onSuccess({
94
+ externalThreeDsData: i
95
+ });
96
+ }), c.on("failure", (i) => {
97
+ var n;
98
+ this.log(`[${this.getType()}][onFailure]`, i), u(), this.closeChallenge(), (n = this.threeDsProcessor) == null || n.onError({ error: i.message });
99
+ }), c.on("error", (i) => {
100
+ var n;
101
+ this.log(`[${this.getType()}][error]`, i), u(), this.closeChallenge(), (n = this.threeDsProcessor) == null || n.onError({ error: i.message });
102
+ });
103
+ }
104
+ initScript(e) {
105
+ const t = document.createElement("script");
106
+ t.type = "text/javascript", t.src = `https://${this.getDomain()}/js/v1/Gateway.js`, t.onload = () => {
107
+ this.initGateway(e), this.initChallenge();
108
+ }, document.head.appendChild(t);
109
+ }
110
+ initGateway(e) {
111
+ this.gateway = window.Gateway.create(e), this.threeDS = this.gateway.get3DSecure(), this.gateway.on("error", (t) => {
112
+ var a;
113
+ this.log(`[${this.getType()}]: gateway error`, t), (a = this.threeDsProcessor) == null || a.onError({ error: t.message }), this.threeDS = null, this.numAttempts = p;
114
+ });
115
+ }
116
+ initChallenge() {
117
+ const { destroy: e } = S({
118
+ el: document.body,
119
+ component: k,
120
+ on: {
121
+ close: () => {
122
+ var t;
123
+ this.closeChallenge(), (t = this.threeDsProcessor) == null || t.onError({ error: "Challenge cancelled" });
124
+ }
125
+ }
126
+ });
127
+ this.threeDSDestroy = e;
128
+ }
129
+ showChallenge() {
130
+ window.postMessage({
131
+ message: "3DS_CHALLENGE_SHOW"
132
+ }, "*");
133
+ }
134
+ closeChallenge() {
135
+ window.postMessage({
136
+ message: "3DS_CHALLENGE_CLOSE"
137
+ }, "*");
138
+ }
139
+ removeChallenge() {
140
+ var e;
141
+ (e = this.threeDSDestroy) == null || e.call(this);
142
+ }
143
+ }
144
+ export {
145
+ K as MetricsGlobalThreeDsProvider
146
+ };
@@ -0,0 +1,12 @@
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-CkIGiDkd-DoLM32Cq.js";
2
+ class t extends e {
3
+ getType() {
4
+ return "NMI";
5
+ }
6
+ getDomain() {
7
+ return "secure.nmi.com";
8
+ }
9
+ }
10
+ export {
11
+ t as NmiThreeDsProvider
12
+ };