@payfurl/client 4.8.6 → 4.9.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 (76) hide show
  1. package/dist/sdk/ApplePayButton.interface-BvRk9kiK.js +0 -0
  2. package/dist/sdk/ApplePayButtonOptions.type-BvRk9kiK.js +0 -0
  3. package/dist/sdk/CloseIcon-BJgZxU_4.js +3374 -0
  4. package/dist/sdk/CxPayThreeDsProvider-lD7RyyaH.js +12 -0
  5. package/dist/sdk/DefaultThreeDsProvider-aIZr-d29.js +222 -0
  6. package/dist/sdk/EcentricThreeDsProvider-B7Hq90Yp.js +68 -0
  7. package/dist/sdk/EpnaThreeDsProvider-BAO2GROY.js +12 -0
  8. package/dist/sdk/FlashBancThreeDsProvider-CIZpoTAj.js +12 -0
  9. package/dist/sdk/GPaymentsThreeDsProvider-COuZ_3w6.js +89 -0
  10. package/dist/sdk/MetricsGlobalThreeDsProvider-D3x5hiTk.js +133 -0
  11. package/dist/sdk/NmiThreeDsProvider-fLTB46dM.js +12 -0
  12. package/dist/sdk/NuveiThreeDsProvider-BpWi_OJA.js +149 -0
  13. package/dist/sdk/PayGLocalThreeDsProvider-DvA8Ng4u.js +113 -0
  14. package/dist/sdk/PayWayAppleButton-DESHrVB-.js +160 -0
  15. package/dist/sdk/PayabliThreeDsProvider-B34Ah8DW.js +12 -0
  16. package/dist/sdk/SkyBankThreeDsProvider-0S5UKz-C.js +12 -0
  17. package/dist/sdk/ThreeDsAuthResponse.type-BvRk9kiK.js +0 -0
  18. package/dist/sdk/ThreeDsInitResponse.type-BvRk9kiK.js +0 -0
  19. package/dist/sdk/ThreeDsPostAuthResponse.type-BFN9wqum.js +26 -0
  20. package/dist/sdk/ThreeDsProvider.interface-BvRk9kiK.js +0 -0
  21. package/dist/sdk/alerts-Bad_5Z62.js +42 -0
  22. package/dist/sdk/cxpay-2tlxyzUF.js +7 -0
  23. package/dist/sdk/default-Sih0fC9J.js +7 -0
  24. package/dist/sdk/ecentric-CN_DxZw6.js +7 -0
  25. package/dist/sdk/epna-CuWMBne4.js +7 -0
  26. package/dist/sdk/favicon.ico +0 -0
  27. package/dist/sdk/flashbanc-YdmE24o7.js +7 -0
  28. package/dist/sdk/forter-CcQiwntl.js +60 -0
  29. package/dist/sdk/forterDeviceIntelScript-DdHZ7KLR.js +4 -0
  30. package/dist/sdk/fraudCheck.type-BvRk9kiK.js +0 -0
  31. package/dist/sdk/fraudProvider.type-Bzd9orn2.js +7 -0
  32. package/dist/sdk/fraudStatus.type-BvRk9kiK.js +0 -0
  33. package/dist/sdk/gpayments-DVhgcMCp.js +7 -0
  34. package/dist/sdk/metrics_global-DshQOuaW.js +7 -0
  35. package/dist/sdk/nmi-Qo4scfgJ.js +7 -0
  36. package/dist/sdk/nuvei-BFllJ45f.js +7 -0
  37. package/dist/sdk/payabli-eGPashQz.js +7 -0
  38. package/dist/sdk/payfurl.es.js +7047 -3
  39. package/dist/sdk/payfurl.umd.js +17 -29
  40. package/dist/sdk/payglocal-WvM5v5cn.js +7 -0
  41. package/dist/sdk/payway_rest-m9k6k7M0.js +7 -0
  42. package/dist/sdk/screen-D7xBu0cj.js +24 -0
  43. package/dist/sdk/skybank-174OmYCW.js +7 -0
  44. package/dist/sdk/strings-C1wc79_e.js +119 -0
  45. package/dist/sdk/style.css +2 -1
  46. package/package.json +3 -3
  47. package/dist/sdk/CxPayThreeDsProvider-Bz7O7f0F.js +0 -12
  48. package/dist/sdk/DefaultThreeDsProvider-VHq5xoNU.js +0 -243
  49. package/dist/sdk/EcentricThreeDsProvider-CWRQYa9Y.js +0 -89
  50. package/dist/sdk/EpnaThreeDsProvider-C_tojNLc.js +0 -12
  51. package/dist/sdk/FlashBancThreeDsProvider-DvD_hlHn.js +0 -12
  52. package/dist/sdk/GPaymentsThreeDsProvider-DSa9kCKg.js +0 -105
  53. package/dist/sdk/MetricsGlobalThreeDsProvider-C1KPszqD.js +0 -152
  54. package/dist/sdk/NmiThreeDsProvider-CK1dan0G.js +0 -12
  55. package/dist/sdk/NuveiThreeDsProvider-Cu2fB7rt.js +0 -181
  56. package/dist/sdk/PayGLocalThreeDsProvider-Dsi0JOu8.js +0 -127
  57. package/dist/sdk/PayWayAppleButton-DNeVogl8.js +0 -179
  58. package/dist/sdk/PayabliThreeDsProvider-COchAXx2.js +0 -12
  59. package/dist/sdk/SkyBankThreeDsProvider-BETsDyuS.js +0 -12
  60. package/dist/sdk/ThreeDsPostAuthResponse.type-CaV_50Qh.js +0 -26
  61. package/dist/sdk/cxpay-CWoG5bR0.js +0 -7
  62. package/dist/sdk/default-CKovzYoW.js +0 -7
  63. package/dist/sdk/ecentric-RPlS3J2Q.js +0 -7
  64. package/dist/sdk/epna-DIkbQdLV.js +0 -7
  65. package/dist/sdk/flashbanc-DrIG4m7r.js +0 -7
  66. package/dist/sdk/forter-CfW26Mkn.js +0 -46
  67. package/dist/sdk/fraudProvider.type-ewIWghbD.js +0 -7
  68. package/dist/sdk/fraudStatus.type-u9AIbDtQ.js +0 -13704
  69. package/dist/sdk/gpayments-DbPzgcxs.js +0 -7
  70. package/dist/sdk/metrics_global-CEnYLnX-.js +0 -7
  71. package/dist/sdk/nmi-DcUbphxD.js +0 -7
  72. package/dist/sdk/nuvei-HtM7MLjQ.js +0 -7
  73. package/dist/sdk/payabli-BgNx9N_g.js +0 -7
  74. package/dist/sdk/payglocal-DvdtjOZ3.js +0 -7
  75. package/dist/sdk/payway_rest-eM0Wk9-Y.js +0 -7
  76. package/dist/sdk/skybank-BFv-efpg.js +0 -7
@@ -0,0 +1,12 @@
1
+ import { t as e } from "./MetricsGlobalThreeDsProvider-D3x5hiTk.js";
2
+ //#region src/sdk/3ds/CxPayThreeDsProvider.ts
3
+ var t = class extends e {
4
+ getType() {
5
+ return "CxPay";
6
+ }
7
+ getDomain() {
8
+ return "cxpay.transactiongateway.com";
9
+ }
10
+ };
11
+ //#endregion
12
+ export { t as CxPayThreeDsProvider };
@@ -0,0 +1,222 @@
1
+ import { A as e, Et as t, Ht as n, It as r, Lt as i, O as a, Ot as o, Tt as s, Z as c, _t as l, ct as u, dt as d, h as f, n as p, t as m, vt as h, wt as g, xt as _ } from "./CloseIcon-BJgZxU_4.js";
2
+ //#region src/sdk/3ds/ThreeDsChallenge.vue?vue&type=script&setup=true&lang.ts
3
+ var v = { class: "mask" }, y = { class: "wrapper" }, b = { class: "container" }, x = ["action"], S = ["value"], C = /*#__PURE__*/ c(/* @__PURE__ */ s({
4
+ __name: "ThreeDsChallenge",
5
+ props: {
6
+ threeDSServerTransID: {},
7
+ acsTransID: {},
8
+ formAction: {}
9
+ },
10
+ emits: ["close", "submit"],
11
+ setup(e, { emit: n }) {
12
+ let a = e, s = n, c = l(() => u(a.formAction) ? a.formAction : ""), d = r(null), f = JSON.stringify({
13
+ threeDSServerTransID: a.threeDSServerTransID,
14
+ acsTransID: a.acsTransID,
15
+ messageVersion: "2.2.0",
16
+ messageType: "CReq",
17
+ challengeWindowSize: "01"
18
+ }), p = encodeURI(window.btoa(f).replace(/=*$/, ""));
19
+ return t(() => {
20
+ c.value && d.value?.submit();
21
+ }), (e, t) => (o(), _("div", v, [h("div", y, [h("div", b, [
22
+ g(m, {
23
+ onClick: t[0] ||= (e) => s("close"),
24
+ id: "3ds-challenge-close"
25
+ }),
26
+ t[1] ||= h("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1),
27
+ h("form", {
28
+ action: c.value,
29
+ target: "ThreeDsChallengeIFrame",
30
+ method: "post",
31
+ ref_key: "form",
32
+ ref: d
33
+ }, [h("input", {
34
+ type: "hidden",
35
+ name: "creq",
36
+ value: i(p)
37
+ }, null, 8, S)], 8, x)
38
+ ])])]));
39
+ }
40
+ }), [["__scopeId", "data-v-07081e85"]]), w = class {
41
+ iframeId = "threeDsIframeMethod";
42
+ containerId = "payfurlContainerFormInvoker";
43
+ iframe = null;
44
+ container = null;
45
+ createIFrame() {
46
+ 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));
47
+ }
48
+ invoke(e, t, n, r, i) {
49
+ this.createIFrame();
50
+ let a = document.createElement("form");
51
+ a.action = e, a.target = this.iframeId, a.method = "post", this.container?.appendChild(a);
52
+ for (let e in n) {
53
+ let t = document.createElement("input");
54
+ t.type = "hidden", t.name = e, t.value = n[e], a.appendChild(t);
55
+ }
56
+ a.submit();
57
+ }
58
+ }, T = /* @__PURE__ */ n({
59
+ DefaultThreeDsProvider: () => A,
60
+ THREE_DS_CHALLENGE_COMPLETE: () => k,
61
+ THREE_DS_METHOD_INVOCATION_COMPLETE: () => O
62
+ }), { hideSpinner: E, showSpinner: D } = p(), O = "3ds_method_invocation_complete", k = "3ds_challenge_complete", A = class {
63
+ log;
64
+ container;
65
+ options;
66
+ threeDsProcessor = null;
67
+ threeDSDestroy = () => {};
68
+ threeDSServerTransID = "";
69
+ threeDSAuthURL = "";
70
+ threeDSRequestorTransID = "";
71
+ threeDSMonitorURL = "";
72
+ internalMessageHandler = this.messageHandler.bind(this);
73
+ constructor(e, t, n) {
74
+ this.log = e, this.container = t, this.options = n;
75
+ }
76
+ getType() {
77
+ return "Default";
78
+ }
79
+ getDomain() {
80
+ return "";
81
+ }
82
+ onPreAuth() {
83
+ this.log(`[${this.getType()}][onPreAuth]`), this.threeDsProcessor && (D(), this.threeDsProcessor.onPreAuth(this.onInitAuthSuccess, this.onError), window.addEventListener("message", this.internalMessageHandler));
84
+ }
85
+ onAuth(e, t) {
86
+ this.log(`[${this.getType()}][onAuth]`, {
87
+ threeDSAuthURL: this.threeDSAuthURL,
88
+ threeDSRequestorTransID: this.threeDSRequestorTransID,
89
+ threeDSServerTransID: this.threeDSServerTransID,
90
+ isMethodPerformed: e
91
+ }), this.threeDsProcessor?.onAuth(this.threeDSAuthURL, this.threeDSRequestorTransID, this.threeDSServerTransID, e, t, this.onDoAuthSuccess, this.onError);
92
+ }
93
+ onPostAuth() {
94
+ this.log(`[${this.getType()}][onPostAuth]`, { threeDSServerTransID: this.threeDSServerTransID }), this.threeDsProcessor?.onPostAuth({ threeDSServerTransID: this.threeDSServerTransID }, this.onSuccess, this.onError);
95
+ }
96
+ setThreeDsProcessor(e) {
97
+ this.log(`[${this.getType()}][setThreeDsProcessor]`), this.threeDsProcessor = e;
98
+ }
99
+ messageHandler(e) {
100
+ if (!(!e?.data?.status || e?.data?.status === "tokenise-card-failure")) {
101
+ if (e.data.status === "3ds_method_invocation_complete") {
102
+ e.stopPropagation(), this.invocationComplete(e);
103
+ return;
104
+ }
105
+ e.data.status === "3ds_challenge_complete" && (e.stopPropagation(), this.challengeComplete(e));
106
+ }
107
+ }
108
+ invocationComplete(e) {
109
+ this.log(`[${this.getType()}]: 3Ds Method invocation complete`), this.onAuth(!0, "");
110
+ }
111
+ challengeComplete(e) {
112
+ this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge();
113
+ let t = JSON.parse(window.atob(e.data.cres));
114
+ this.log(`[${this.getType()}]: cresData`, t), ["Y", "A"].includes(t.transStatus) ? this.onPostAuth() : [
115
+ "N",
116
+ "U",
117
+ "R"
118
+ ].includes(t.transStatus) && (this.log(`[${this.getType()}]: Failed 3DS Challenge`, e.data), this.onError(400, "Failed 3DS Challenge"));
119
+ }
120
+ setChallengeFrameVisible(t) {
121
+ window.self !== window.top && window.parent.postMessage({ status: t ? e : a }, "*");
122
+ }
123
+ doChallenge(e, t, n) {
124
+ this.log(`[${this.getType()}][doChallenge]`), E(), this.setChallengeFrameVisible(!0);
125
+ let { destroy: r } = d({
126
+ el: document.body,
127
+ component: C,
128
+ props: {
129
+ threeDSServerTransID: this.threeDSServerTransID,
130
+ acsTransID: t,
131
+ formAction: e,
132
+ authenticationValue: n
133
+ },
134
+ on: { close: () => {
135
+ r(), this.threeDSDestroy = () => {}, this.threeDsProcessor?.onError({ error: "Challenge cancelled" });
136
+ } }
137
+ });
138
+ this.threeDSDestroy = r;
139
+ }
140
+ closeChallenge() {
141
+ this.threeDSDestroy?.(), this.setChallengeFrameVisible(!1), window.removeEventListener("message", this.internalMessageHandler);
142
+ }
143
+ onError = (e, t) => {
144
+ if (this.closeChallenge(), E(), e === 404) {
145
+ this.threeDsProcessor?.onError({ error: "This feature is only supported by ActiveServer v1.1.2+" });
146
+ return;
147
+ }
148
+ this.threeDsProcessor?.onError({
149
+ error: f,
150
+ body: t
151
+ });
152
+ };
153
+ onSuccess = (e, t) => {
154
+ this.closeChallenge(), E();
155
+ let n = JSON.parse(t);
156
+ ["Y", "A"].includes(n.transStatus) ? this.threeDsProcessor?.onSuccess(n) : (this.log(`[${this.getType()}]: ${f}`, n), this.threeDsProcessor?.onError({ error: f }));
157
+ };
158
+ threeDsMethodInvoke(e, t) {
159
+ this.log(`[${this.getType()}][threeDsMethodInvoke]`, {
160
+ threeDSServerTransID: e,
161
+ threeDSMethodURL: t
162
+ });
163
+ let n = {
164
+ threeDSServerTransID: e,
165
+ threeDSMethodNotificationURL: this.options.apiUrl + "/3ds/method_invocation"
166
+ }, r = encodeURI(window.btoa(JSON.stringify(n)).replace(/=*$/, ""));
167
+ new w().invoke(t, "POST", { threeDSMethodData: r });
168
+ }
169
+ onInitAuthSuccess = (e, t) => {
170
+ let n = JSON.parse(t);
171
+ if (this.log(`[${this.getType()}][onInitAuthSuccess]`, n), this.threeDSRequestorTransID = n.threeDSRequestorTransID, this.threeDSServerTransID = n.threeDSServerTransID, this.threeDSMonitorURL = n.threeDSMonitorURL, this.threeDSAuthURL = n.threeDSAuthURL, n.threeDSMethodURL) {
172
+ this.threeDsMethodInvoke(n.threeDSServerTransID, n.threeDSMethodURL);
173
+ return;
174
+ }
175
+ this.onAuth(!1, "");
176
+ };
177
+ onDoAuthSuccess = (e, t) => {
178
+ let n = JSON.parse(t);
179
+ if (this.log(`[${this.getType()}][onDoAuthSuccess]`, n), !n.transStatus) {
180
+ this.onError(e, "No transStatus specified");
181
+ return;
182
+ }
183
+ switch (n.transStatus) {
184
+ case "C":
185
+ if (!n.acsURL) {
186
+ this.onError(e, "Invalid Challenge Url");
187
+ return;
188
+ }
189
+ this.doChallenge(n.acsURL, n.acsTransID, n.authenticationValue);
190
+ break;
191
+ case "N":
192
+ this.log(`[${this.getType()}][threeDsAuth], 3DS Verification failed, transaction denied`), this.onError(400, "3DS Verification failed, transaction denied");
193
+ break;
194
+ case "U":
195
+ this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification`), this.onError(400, "Unable to perform 3DS verification");
196
+ break;
197
+ case "R":
198
+ this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification, rejected at issuer`), this.onError(400, "Unable to perform 3DS verification, rejected at issuer");
199
+ break;
200
+ default: this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${n.transStatus}`), this.threeDsProcessor?.onSuccess({
201
+ threeDSServerTransID: n.threeDSServerTransID,
202
+ threeDSRequestorTransID: "",
203
+ acsRenderingType: n.acsRenderingType,
204
+ acsTransID: n.acsTransID,
205
+ authenticationType: n.authenticationType,
206
+ authenticationValue: n.authenticationValue,
207
+ challengeCancel: "",
208
+ dsTransID: n.dsTransID,
209
+ eci: n.eci,
210
+ interactionCounter: "",
211
+ messageCategory: "",
212
+ messageExtension: n.messageExtension,
213
+ messageType: n.messageType,
214
+ messageVersion: n.messageVersion,
215
+ transStatus: n.transStatus,
216
+ transStatusReason: n.transStatusReason
217
+ });
218
+ }
219
+ };
220
+ };
221
+ //#endregion
222
+ export { O as i, T as n, k as r, A as t };
@@ -0,0 +1,68 @@
1
+ import { Et as e, It as t, Lt as n, Ot as r, Tt as i, Z as a, _t as o, ct as s, dt as c, t as l, vt as u, wt as d, xt as f } from "./CloseIcon-BJgZxU_4.js";
2
+ import { t as p } from "./DefaultThreeDsProvider-aIZr-d29.js";
3
+ //#region src/sdk/3ds/ecentric.vue?vue&type=script&setup=true&lang.ts
4
+ var m = { class: "mask" }, h = { class: "wrapper" }, g = { class: "container" }, _ = ["action"], v = ["value"], y = /*#__PURE__*/ a(/* @__PURE__ */ i({
5
+ __name: "ecentric",
6
+ props: {
7
+ threeDSServerTransID: {},
8
+ acsTransID: {},
9
+ formAction: {},
10
+ authenticationValue: {}
11
+ },
12
+ setup(i) {
13
+ let a = i, c = o(() => s(a.formAction) ? a.formAction : ""), p = t(null), y = a.authenticationValue;
14
+ return e(() => {
15
+ c.value && p.value?.submit();
16
+ }), (e, t) => (r(), f("div", m, [u("div", h, [u("div", g, [
17
+ d(l, { onClick: t[0] ||= (t) => e.emit("close") }),
18
+ t[1] ||= u("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1),
19
+ u("form", {
20
+ action: c.value,
21
+ target: "ThreeDsChallengeIFrame",
22
+ method: "post",
23
+ ref_key: "form",
24
+ ref: p
25
+ }, [u("input", {
26
+ type: "hidden",
27
+ name: "PaReq",
28
+ value: n(y)
29
+ }, null, 8, v)], 8, _)
30
+ ])])]));
31
+ }
32
+ }), [["__scopeId", "data-v-8ededb9d"]]), b = class extends p {
33
+ paResPayload = "";
34
+ getType() {
35
+ return "Ecentric";
36
+ }
37
+ onPostAuth() {
38
+ this.log(`[${this.getType()}][onPostAuth]`, {
39
+ threeDSServerTransID: this.threeDSServerTransID,
40
+ authenticationValue: this.paResPayload
41
+ }), this.threeDsProcessor?.onPostAuth({
42
+ threeDSServerTransID: this.threeDSServerTransID,
43
+ authenticationValue: this.paResPayload
44
+ }, this.onSuccess, this.onError);
45
+ }
46
+ doChallenge(e, t, n) {
47
+ this.log(`[${this.getType()}][doChallenge]`), this.setChallengeFrameVisible(!0);
48
+ let { destroy: r } = c({
49
+ el: document.body,
50
+ component: y,
51
+ props: {
52
+ threeDSServerTransID: this.threeDSServerTransID,
53
+ acsTransID: t,
54
+ formAction: e,
55
+ authenticationValue: n
56
+ },
57
+ on: { close: () => {
58
+ r(), this.setChallengeFrameVisible(!1), this.threeDSDestroy = () => {}, this.threeDsProcessor?.onError({ error: "Challenge cancelled" });
59
+ } }
60
+ });
61
+ this.threeDSDestroy = r;
62
+ }
63
+ challengeComplete(e) {
64
+ 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"));
65
+ }
66
+ };
67
+ //#endregion
68
+ export { b as EcentricThreeDsProvider };
@@ -0,0 +1,12 @@
1
+ import { t as e } from "./MetricsGlobalThreeDsProvider-D3x5hiTk.js";
2
+ //#region src/sdk/3ds/EpnaThreeDsProvider.ts
3
+ var t = class extends e {
4
+ getType() {
5
+ return "EPNA";
6
+ }
7
+ getDomain() {
8
+ return "epna.transactiongateway.com";
9
+ }
10
+ };
11
+ //#endregion
12
+ export { t as EpnaThreeDsProvider };
@@ -0,0 +1,12 @@
1
+ import { t as e } from "./MetricsGlobalThreeDsProvider-D3x5hiTk.js";
2
+ //#region src/sdk/3ds/FlashBancThreeDsProvider.ts
3
+ var t = class extends e {
4
+ getType() {
5
+ return "FlashBanc";
6
+ }
7
+ getDomain() {
8
+ return "flashbanc.transactiongateway.com";
9
+ }
10
+ };
11
+ //#endregion
12
+ export { t as FlashBancThreeDsProvider };
@@ -0,0 +1,89 @@
1
+ import { Ot as e, Tt as t, Z as n, _t as r, ct as i, dt as a, n as o, vt as s, xt as c, zt as l } from "./CloseIcon-BJgZxU_4.js";
2
+ import { t as u } from "./DefaultThreeDsProvider-aIZr-d29.js";
3
+ //#region src/sdk/3ds/GPayments.vue?vue&type=script&setup=true&lang.ts
4
+ var d = { class: "mask" }, f = { class: "wrapper" }, p = ["src"], m = /*#__PURE__*/ n(/* @__PURE__ */ t({
5
+ __name: "GPayments",
6
+ props: {
7
+ url: {},
8
+ width: {},
9
+ height: {}
10
+ },
11
+ setup(t) {
12
+ let n = t, a = r(() => i(n.url) ? n.url : "");
13
+ function o() {
14
+ return {
15
+ width: `${n.width || 650}px`,
16
+ height: `${n.height || 400}px`
17
+ };
18
+ }
19
+ return (t, n) => (e(), c("div", d, [s("div", f, [s("div", {
20
+ class: "container",
21
+ style: l([o(), {
22
+ padding: "0",
23
+ margin: "0"
24
+ }])
25
+ }, [s("iframe", {
26
+ src: a.value,
27
+ style: l(o())
28
+ }, null, 12, p)], 4)])]));
29
+ }
30
+ }), [["__scopeId", "data-v-cf5aa816"]]), { hideSpinner: h } = o(), g = class extends u {
31
+ getType() {
32
+ return "GPayments";
33
+ }
34
+ doChallenge(e) {
35
+ this.log(`[${this.getType()}][doChallenge]`), h(), this.setChallengeFrameVisible(!0);
36
+ let { destroy: t } = a({
37
+ el: document.body,
38
+ component: m,
39
+ props: {
40
+ url: e,
41
+ width: 390,
42
+ height: 400
43
+ },
44
+ on: { close: () => {
45
+ t(), this.threeDSDestroy = () => {};
46
+ } }
47
+ });
48
+ this.threeDSDestroy = t;
49
+ }
50
+ challengeComplete(e) {
51
+ this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge(), this.onPostAuth();
52
+ }
53
+ onDoAuthSuccess = (e, t) => {
54
+ let n = JSON.parse(t);
55
+ if (this.log(`[${this.getType()}][onDoAuthSuccess]`, n), !n.transStatus) {
56
+ this.onError(e, "No transStatus specified");
57
+ return;
58
+ }
59
+ switch (n.transStatus) {
60
+ case "C":
61
+ if (!n.acsURL) {
62
+ this.onError(e, "Invalid Challenge Url");
63
+ return;
64
+ }
65
+ this.doChallenge(n.acsURL);
66
+ break;
67
+ default: this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${n.transStatus}`), this.onPostAuth();
68
+ }
69
+ };
70
+ onInitAuthSuccess = (e, t) => {
71
+ let n = JSON.parse(t);
72
+ if (this.log(`[${this.getType()}][onInitAuthSuccess]`, n), !n.threeDSAuthURL) {
73
+ this.onError(e, "No AuthUrl specified");
74
+ return;
75
+ }
76
+ if (this.threeDSRequestorTransID = n.threeDSRequestorTransID, this.threeDSServerTransID = n.threeDSServerTransID, this.threeDSMonitorURL = n.threeDSMonitorURL, this.threeDSAuthURL = n.threeDSAuthURL, n.threeDsServerCallbackUrl) {
77
+ this.initFrame(n.threeDsServerCallbackUrl);
78
+ return;
79
+ }
80
+ this.onAuth(!1, "");
81
+ };
82
+ initFrame(e) {
83
+ if (this.log(`[${this.getType()}][init3DSFrame]`, e), !i(e)) return;
84
+ let t = document.createElement("iframe");
85
+ t.src = e, t.style.width = "1px", t.style.height = "1px", t.style.border = "0", document.body.appendChild(t);
86
+ }
87
+ };
88
+ //#endregion
89
+ export { g as GPaymentsThreeDsProvider };
@@ -0,0 +1,133 @@
1
+ import { Dt as e, Et as t, Ft as n, Ht as r, It as i, Ot as a, Tt as o, Z as s, dt as c, mt as l, n as u, t as d, vt as f, wt as p, xt as m } from "./CloseIcon-BJgZxU_4.js";
2
+ import { t as h } from "./screen-D7xBu0cj.js";
3
+ import { t as g } from "./alerts-Bad_5Z62.js";
4
+ import { t as _ } from "./DefaultThreeDsProvider-aIZr-d29.js";
5
+ //#region src/sdk/3ds/MetricsGlobalThreeDsChallenge.vue?vue&type=script&setup=true&lang.ts
6
+ var v = { class: "mask" }, y = { class: "wrapper" }, b = { class: "container" }, x = /*#__PURE__*/ s(/* @__PURE__ */ o({
7
+ __name: "MetricsGlobalThreeDsChallenge",
8
+ emits: ["close", "submit"],
9
+ setup(r, { emit: o }) {
10
+ let s = o, c = i(!1);
11
+ function u(e) {
12
+ ["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes(e.data?.message) && (c.value = e.data.message === "3DS_CHALLENGE_SHOW");
13
+ }
14
+ return t(() => {
15
+ window.addEventListener("message", u);
16
+ }), e(() => {
17
+ window.removeEventListener("message", u);
18
+ }), (e, t) => n((a(), m("div", v, [f("div", y, [f("div", b, [p(d, {
19
+ onClick: t[0] ||= (e) => s("close"),
20
+ id: "3ds-challenge-close"
21
+ }), t[1] ||= f("div", { id: "ThreeDsChallengeIFrame" }, null, -1)])])], 512)), [[l, c.value]]);
22
+ }
23
+ }), [["__scopeId", "data-v-8a0b6dcb"]]), S = /* @__PURE__ */ r({ MetricsGlobalThreeDsProvider: () => E }), { hideSpinner: C, showSpinner: w } = u(), T = 5, E = class extends _ {
24
+ gateway;
25
+ threeDS;
26
+ numAttempts = 0;
27
+ constructor(e, t, n) {
28
+ super(e, t, n), this.initScript(n.clientParameters?.PublicKey || "");
29
+ }
30
+ getType() {
31
+ return "MetricsGlobal";
32
+ }
33
+ getDomain() {
34
+ return "secure.metricsglobalgateway.com";
35
+ }
36
+ onPreAuth() {
37
+ if (this.log(`[${this.getType()}]: onPreAuth`), !this.threeDS && this.numAttempts >= T) {
38
+ C(), g(this.container, "Error loading 3D Secure");
39
+ return;
40
+ }
41
+ if (!this.threeDS && this.numAttempts < T) {
42
+ this.numAttempts++, this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`), setTimeout(() => this.onPreAuth(), 1e3);
43
+ return;
44
+ }
45
+ this.threeDsProcessor?.getTokenId() ? this.threeDsProcessor?.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (e) => {
46
+ this.threeDsProcessor?.setPaymentInfo(e), this.startAuth();
47
+ }, () => {
48
+ g(this.container, "Unable to get card information");
49
+ }) : this.startAuth();
50
+ }
51
+ onAuth(e, t) {}
52
+ onPostAuth() {}
53
+ startAuth() {
54
+ this.log(`[${this.getType()}]: startAuth`);
55
+ let e = this.threeDsProcessor?.getPaymentInfo();
56
+ if (!e) {
57
+ C(), g(this.container, "Payment information is missing");
58
+ return;
59
+ }
60
+ w();
61
+ let t = this.threeDsProcessor?.getAddressInfo(), n = e.expiryDate.length === 4 ? e.expiryDate.slice(2, 4) : "", r = e.expiryDate.length === 4 ? e.expiryDate.slice(0, 2) : "", [i = "", a = ""] = e.cardholder?.split(/\s+/) || [], o = this.threeDsProcessor?.getCurrency() || "", s = this.threeDsProcessor?.getAmount() || 0;
62
+ if (!n || !r) {
63
+ C(), g(this.container, "Card expiry date is invalid"), this.threeDsProcessor?.onError({ error: "Card expiry date is invalid" });
64
+ return;
65
+ }
66
+ let c = {
67
+ cardNumber: e.cardNumber,
68
+ cardExpMonth: n,
69
+ cardExpYear: String(parseInt(r, 10) + 2e3),
70
+ currency: o,
71
+ amount: s.toFixed(2),
72
+ email: this.threeDsProcessor?.getEmail(),
73
+ phone: t?.phoneNumber,
74
+ city: t?.city,
75
+ state: t?.state,
76
+ address1: t?.streetAddress,
77
+ country: t?.country,
78
+ firstName: t?.firstName || i || "payFURL",
79
+ lastName: t?.lastName || a || "payFURL",
80
+ postalCode: t?.postalCode,
81
+ deviceChannel: "02",
82
+ browserJavascriptEnabled: !0,
83
+ browserJavaEnabled: !1,
84
+ browserLanguage: window.navigator.language,
85
+ browserColorDepth: String(h()),
86
+ browserScreenHeight: String(screen.height),
87
+ browserScreenWidth: String(screen.width),
88
+ browserTimeZone: String(Math.round((/* @__PURE__ */ new Date()).getTimezoneOffset() / 60)),
89
+ userAgent: navigator.userAgent
90
+ }, l = this.threeDS.createUI(c);
91
+ l.start("#ThreeDsChallengeIFrame"), l.on("challenge", (e) => {
92
+ this.log(`[${this.getType()}][onChallenge]`, e), C(), this.showChallenge();
93
+ }), l.on("complete", (e) => {
94
+ this.log(`[${this.getType()}][onComplete]`, e), this.removeChallenge(), this.threeDsProcessor?.onSuccess({ externalThreeDsData: e });
95
+ }), l.on("failure", (e) => {
96
+ this.log(`[${this.getType()}][onFailure]`, e), C(), this.closeChallenge(), this.threeDsProcessor?.onError({ error: e.message });
97
+ }), l.on("error", (e) => {
98
+ this.log(`[${this.getType()}][error]`, e), C(), this.closeChallenge(), this.threeDsProcessor?.onError({ error: e.message });
99
+ });
100
+ }
101
+ initScript(e) {
102
+ let t = document.createElement("script");
103
+ t.type = "text/javascript", t.src = `https://${this.getDomain()}/js/v1/Gateway.js`, t.onload = () => {
104
+ this.initGateway(e), this.initChallenge();
105
+ }, document.head.appendChild(t);
106
+ }
107
+ initGateway(e) {
108
+ this.gateway = window.Gateway.create(e), this.threeDS = this.gateway.get3DSecure(), this.gateway.on("error", (e) => {
109
+ this.log(`[${this.getType()}]: gateway error`, e), this.threeDsProcessor?.onError({ error: e.message }), this.threeDS = null, this.numAttempts = T;
110
+ });
111
+ }
112
+ initChallenge() {
113
+ let { destroy: e } = c({
114
+ el: document.body,
115
+ component: x,
116
+ on: { close: () => {
117
+ this.closeChallenge(), this.threeDsProcessor?.onError({ error: "Challenge cancelled" });
118
+ } }
119
+ });
120
+ this.threeDSDestroy = e;
121
+ }
122
+ showChallenge() {
123
+ this.setChallengeFrameVisible(!0), window.postMessage({ message: "3DS_CHALLENGE_SHOW" }, "*");
124
+ }
125
+ closeChallenge() {
126
+ this.setChallengeFrameVisible(!1), window.postMessage({ message: "3DS_CHALLENGE_CLOSE" }, "*");
127
+ }
128
+ removeChallenge() {
129
+ this.threeDSDestroy?.();
130
+ }
131
+ };
132
+ //#endregion
133
+ export { S as n, E as t };
@@ -0,0 +1,12 @@
1
+ import { t as e } from "./MetricsGlobalThreeDsProvider-D3x5hiTk.js";
2
+ //#region src/sdk/3ds/NmiThreeDsProvider.ts
3
+ var t = class extends e {
4
+ getType() {
5
+ return "NMI";
6
+ }
7
+ getDomain() {
8
+ return "secure.nmi.com";
9
+ }
10
+ };
11
+ //#endregion
12
+ export { t as NmiThreeDsProvider };