@payfurl/client 4.8.5 → 4.8.7

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 (73) 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-_3X2kvPG.js +3371 -0
  4. package/dist/sdk/CxPayThreeDsProvider-DAAmw4ya.js +12 -0
  5. package/dist/sdk/DefaultThreeDsProvider-JPe2W_JG.js +221 -0
  6. package/dist/sdk/EcentricThreeDsProvider-Ddy0Fn5h.js +68 -0
  7. package/dist/sdk/EpnaThreeDsProvider-Ng4Pmq0D.js +12 -0
  8. package/dist/sdk/FlashBancThreeDsProvider-DFZG4u44.js +12 -0
  9. package/dist/sdk/GPaymentsThreeDsProvider-BIku3bZP.js +91 -0
  10. package/dist/sdk/MetricsGlobalThreeDsProvider-BMeP5IWW.js +118 -0
  11. package/dist/sdk/NmiThreeDsProvider-CzRH7vrp.js +12 -0
  12. package/dist/sdk/NuveiThreeDsProvider-DMO_bgOI.js +151 -0
  13. package/dist/sdk/PayGLocalThreeDsProvider-DDqJz4iC.js +112 -0
  14. package/dist/sdk/PayWayAppleButton-DVoTz5Nn.js +160 -0
  15. package/dist/sdk/PayabliThreeDsProvider-BWStZH6E.js +12 -0
  16. package/dist/sdk/SkyBankThreeDsProvider-U6pzbMJY.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-D474JL4D.js +42 -0
  22. package/dist/sdk/cxpay-BnpH4Q1F.js +7 -0
  23. package/dist/sdk/default-B8ZcE4ja.js +7 -0
  24. package/dist/sdk/ecentric-DwR-gEaW.js +7 -0
  25. package/dist/sdk/epna-BtQr8Mlq.js +7 -0
  26. package/dist/sdk/flashbanc-BNEJGUff.js +7 -0
  27. package/dist/sdk/forter-D0-GGAlC.js +41 -0
  28. package/dist/sdk/fraudCheck.type-BvRk9kiK.js +0 -0
  29. package/dist/sdk/fraudProvider.type-Bzd9orn2.js +7 -0
  30. package/dist/sdk/fraudStatus.type-BvRk9kiK.js +0 -0
  31. package/dist/sdk/gpayments-QZCq0_0y.js +7 -0
  32. package/dist/sdk/metrics_global--mOHedmQ.js +7 -0
  33. package/dist/sdk/nmi-BtKpUtad.js +7 -0
  34. package/dist/sdk/nuvei-BOfZN_Em.js +7 -0
  35. package/dist/sdk/payabli-BfZ7IhDq.js +7 -0
  36. package/dist/sdk/payfurl.es.js +6977 -3
  37. package/dist/sdk/payfurl.umd.js +17 -29
  38. package/dist/sdk/payglocal-CpEbJSpn.js +7 -0
  39. package/dist/sdk/payway_rest-CIjvQwcK.js +7 -0
  40. package/dist/sdk/skybank-DWPrfoAb.js +7 -0
  41. package/dist/sdk/strings-JNmtxeev.js +119 -0
  42. package/dist/sdk/style.css +2 -1
  43. package/package.json +3 -3
  44. package/dist/sdk/CxPayThreeDsProvider-BljTEbxB.js +0 -12
  45. package/dist/sdk/DefaultThreeDsProvider-DbKbN6Le.js +0 -243
  46. package/dist/sdk/EcentricThreeDsProvider-DjBTwEnR.js +0 -89
  47. package/dist/sdk/EpnaThreeDsProvider-KyUTPiU6.js +0 -12
  48. package/dist/sdk/FlashBancThreeDsProvider-DLWmBAJq.js +0 -12
  49. package/dist/sdk/GPaymentsThreeDsProvider-Bq63V0gC.js +0 -105
  50. package/dist/sdk/MetricsGlobalThreeDsProvider-Ctsa_ZKe.js +0 -152
  51. package/dist/sdk/NmiThreeDsProvider-Cc9uoPqm.js +0 -12
  52. package/dist/sdk/NuveiThreeDsProvider-BdJW8InS.js +0 -181
  53. package/dist/sdk/PayGLocalThreeDsProvider-CiKRmfOe.js +0 -127
  54. package/dist/sdk/PayWayAppleButton-D6R2TDKl.js +0 -179
  55. package/dist/sdk/PayabliThreeDsProvider-DEvztVTU.js +0 -12
  56. package/dist/sdk/SkyBankThreeDsProvider-R4NN8r-j.js +0 -12
  57. package/dist/sdk/ThreeDsPostAuthResponse.type-CaV_50Qh.js +0 -26
  58. package/dist/sdk/cxpay-C-GgzidJ.js +0 -7
  59. package/dist/sdk/default-BoeX8PJ8.js +0 -7
  60. package/dist/sdk/ecentric-CyZDsJgo.js +0 -7
  61. package/dist/sdk/epna-D57kaC8G.js +0 -7
  62. package/dist/sdk/flashbanc-orqI9uWg.js +0 -7
  63. package/dist/sdk/forter-CfW26Mkn.js +0 -46
  64. package/dist/sdk/fraudProvider.type-ewIWghbD.js +0 -7
  65. package/dist/sdk/fraudStatus.type-Bto5o7lY.js +0 -13771
  66. package/dist/sdk/gpayments-ZSCifuNl.js +0 -7
  67. package/dist/sdk/metrics_global-CQH6PsUd.js +0 -7
  68. package/dist/sdk/nmi-BZF7ZLQM.js +0 -7
  69. package/dist/sdk/nuvei-C3bePsCN.js +0 -7
  70. package/dist/sdk/payabli-DP-dvidH.js +0 -7
  71. package/dist/sdk/payglocal-3JSRI28a.js +0 -7
  72. package/dist/sdk/payway_rest-rG6pY8D4.js +0 -7
  73. package/dist/sdk/skybank-xXIyqCCk.js +0 -7
@@ -0,0 +1,12 @@
1
+ import { t as e } from "./MetricsGlobalThreeDsProvider-BMeP5IWW.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,221 @@
1
+ import { Mt as e, Nt as t, Rt as n, St as r, _t as i, bt as a, it as o, mt as s, n as c, pt as l, q as u, st as d, t as f, wt as p, xt as m } from "./CloseIcon-_3X2kvPG.js";
2
+ //#region src/sdk/3ds/ThreeDsChallenge.vue?vue&type=script&setup=true&lang.ts
3
+ var h = { class: "mask" }, g = { class: "wrapper" }, _ = { class: "container" }, v = ["action"], y = ["value"], b = /*#__PURE__*/ u(/* @__PURE__ */ m({
4
+ __name: "ThreeDsChallenge",
5
+ props: {
6
+ threeDSServerTransID: {},
7
+ acsTransID: {},
8
+ formAction: {}
9
+ },
10
+ emits: ["close", "submit"],
11
+ setup(n, { emit: c }) {
12
+ let u = n, d = c, m = l(() => o(u.formAction) ? u.formAction : ""), b = e(null), x = JSON.stringify({
13
+ threeDSServerTransID: u.threeDSServerTransID,
14
+ acsTransID: u.acsTransID,
15
+ messageVersion: "2.2.0",
16
+ messageType: "CReq",
17
+ challengeWindowSize: "01"
18
+ }), S = encodeURI(window.btoa(x).replace(/=*$/, ""));
19
+ return r(() => {
20
+ m.value && b.value?.submit();
21
+ }), (e, n) => (p(), i("div", h, [s("div", g, [s("div", _, [
22
+ a(f, {
23
+ onClick: n[0] ||= (e) => d("close"),
24
+ id: "3ds-challenge-close"
25
+ }),
26
+ n[1] ||= s("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1),
27
+ s("form", {
28
+ action: m.value,
29
+ target: "ThreeDsChallengeIFrame",
30
+ method: "post",
31
+ ref_key: "form",
32
+ ref: b
33
+ }, [s("input", {
34
+ type: "hidden",
35
+ name: "creq",
36
+ value: t(S)
37
+ }, null, 8, y)], 8, v)
38
+ ])])]));
39
+ }
40
+ }), [["__scopeId", "data-v-07081e85"]]), x = 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
+ }, S = /* @__PURE__ */ n({
59
+ DefaultThreeDsProvider: () => D,
60
+ THREE_DS_CHALLENGE_COMPLETE: () => E,
61
+ THREE_DS_METHOD_INVOCATION_COMPLETE: () => T
62
+ }), { hideSpinner: C, showSpinner: w } = c(), T = "3ds_method_invocation_complete", E = "3ds_challenge_complete", D = 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 && (w(), 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
+ doChallenge(e, t, n) {
121
+ this.log(`[${this.getType()}][doChallenge]`), C();
122
+ let { destroy: r } = d({
123
+ el: document.body,
124
+ component: b,
125
+ props: {
126
+ threeDSServerTransID: this.threeDSServerTransID,
127
+ acsTransID: t,
128
+ formAction: e,
129
+ authenticationValue: n
130
+ },
131
+ on: { close: () => {
132
+ r(), this.threeDSDestroy = () => {}, this.threeDsProcessor?.onError({ error: "Challenge cancelled" });
133
+ } }
134
+ });
135
+ this.threeDSDestroy = r;
136
+ }
137
+ closeChallenge() {
138
+ this.threeDSDestroy?.(), window.removeEventListener("message", this.internalMessageHandler);
139
+ }
140
+ onError = (e, t) => {
141
+ if (this.closeChallenge(), C(), e === 404) {
142
+ this.threeDsProcessor?.onError({ error: "This feature is only supported by ActiveServer v1.1.2+" });
143
+ return;
144
+ }
145
+ this.threeDsProcessor?.onError({
146
+ error: "3D Secure failed",
147
+ body: t
148
+ });
149
+ };
150
+ onSuccess = (e, t) => {
151
+ this.closeChallenge(), C();
152
+ let n = JSON.parse(t);
153
+ ["Y", "A"].includes(n.transStatus) ? this.threeDsProcessor?.onSuccess(n) : (this.log(`[${this.getType()}]: 3D Secure failed`, n), this.threeDsProcessor?.onError({ error: "3D Secure failed" }));
154
+ };
155
+ threeDsMethodInvoke(e, t) {
156
+ this.log(`[${this.getType()}][threeDsMethodInvoke]`, {
157
+ threeDSServerTransID: e,
158
+ threeDSMethodURL: t
159
+ });
160
+ let n = {
161
+ threeDSServerTransID: e,
162
+ threeDSMethodNotificationURL: this.options.apiUrl + "/3ds/method_invocation"
163
+ }, r = encodeURI(window.btoa(JSON.stringify(n)).replace(/=*$/, ""));
164
+ new x().invoke(t, "POST", { threeDSMethodData: r });
165
+ }
166
+ onInitAuthSuccess = (e, t) => {
167
+ let n = JSON.parse(t);
168
+ 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) {
169
+ this.threeDsMethodInvoke(n.threeDSServerTransID, n.threeDSMethodURL);
170
+ return;
171
+ }
172
+ this.onAuth(!1, "");
173
+ };
174
+ onDoAuthSuccess = (e, t) => {
175
+ let n = JSON.parse(t);
176
+ if (this.log(`[${this.getType()}][onDoAuthSuccess]`, n), !n.transStatus) {
177
+ this.onError(e, "No transStatus specified");
178
+ return;
179
+ }
180
+ switch (n.transStatus) {
181
+ case "C":
182
+ if (!n.acsURL) {
183
+ this.onError(e, "Invalid Challenge Url");
184
+ return;
185
+ }
186
+ this.doChallenge(n.acsURL, n.acsTransID, n.authenticationValue);
187
+ break;
188
+ case "N":
189
+ this.log(`[${this.getType()}][threeDsAuth], 3DS Verification failed, transaction denied`), this.onError(400, "3DS Verification failed, transaction denied");
190
+ break;
191
+ case "U":
192
+ this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification`), this.onError(400, "Unable to perform 3DS verification");
193
+ break;
194
+ case "R":
195
+ this.log(`[${this.getType()}][threeDsAuth], Unable to perform 3DS verification, rejected at issuer`), this.onError(400, "Unable to perform 3DS verification, rejected at issuer");
196
+ break;
197
+ default:
198
+ this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${n.transStatus}`), this.threeDsProcessor?.onSuccess({
199
+ threeDSServerTransID: n.threeDSServerTransID,
200
+ threeDSRequestorTransID: "",
201
+ acsRenderingType: n.acsRenderingType,
202
+ acsTransID: n.acsTransID,
203
+ authenticationType: n.authenticationType,
204
+ authenticationValue: n.authenticationValue,
205
+ challengeCancel: "",
206
+ dsTransID: n.dsTransID,
207
+ eci: n.eci,
208
+ interactionCounter: "",
209
+ messageCategory: "",
210
+ messageExtension: n.messageExtension,
211
+ messageType: n.messageType,
212
+ messageVersion: n.messageVersion,
213
+ transStatus: n.transStatus,
214
+ transStatusReason: n.transStatusReason
215
+ });
216
+ break;
217
+ }
218
+ };
219
+ };
220
+ //#endregion
221
+ export { T as i, S as n, E as r, D as t };
@@ -0,0 +1,68 @@
1
+ import { Mt as e, Nt as t, St as n, _t as r, bt as i, it as a, mt as o, pt as s, q as c, st as l, t as u, wt as d, xt as f } from "./CloseIcon-_3X2kvPG.js";
2
+ import { t as p } from "./DefaultThreeDsProvider-JPe2W_JG.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__*/ c(/* @__PURE__ */ f({
5
+ __name: "ecentric",
6
+ props: {
7
+ threeDSServerTransID: {},
8
+ acsTransID: {},
9
+ formAction: {},
10
+ authenticationValue: {}
11
+ },
12
+ setup(c) {
13
+ let l = c, f = s(() => a(l.formAction) ? l.formAction : ""), p = e(null), y = l.authenticationValue;
14
+ return n(() => {
15
+ f.value && p.value?.submit();
16
+ }), (e, n) => (d(), r("div", m, [o("div", h, [o("div", g, [
17
+ i(u, { onClick: n[0] ||= (t) => e.emit("close") }),
18
+ n[1] ||= o("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1),
19
+ o("form", {
20
+ action: f.value,
21
+ target: "ThreeDsChallengeIFrame",
22
+ method: "post",
23
+ ref_key: "form",
24
+ ref: p
25
+ }, [o("input", {
26
+ type: "hidden",
27
+ name: "PaReq",
28
+ value: t(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]`);
48
+ let { destroy: r } = l({
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.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-BMeP5IWW.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-BMeP5IWW.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,91 @@
1
+ import { Ft as e, _t as t, it as n, mt as r, pt as i, q as a, st as o, wt as s, xt as c } from "./CloseIcon-_3X2kvPG.js";
2
+ import { t as l } from "./DefaultThreeDsProvider-JPe2W_JG.js";
3
+ //#region src/sdk/3ds/GPayments.vue?vue&type=script&setup=true&lang.ts
4
+ var u = { class: "mask" }, d = { class: "wrapper" }, f = ["src"], p = /*#__PURE__*/ a(/* @__PURE__ */ c({
5
+ __name: "GPayments",
6
+ props: {
7
+ url: {},
8
+ width: {},
9
+ height: {}
10
+ },
11
+ setup(a) {
12
+ let o = a, c = i(() => n(o.url) ? o.url : "");
13
+ function l() {
14
+ return {
15
+ width: `${o.width || 650}px`,
16
+ height: `${o.height || 400}px`
17
+ };
18
+ }
19
+ return (n, i) => (s(), t("div", u, [r("div", d, [r("div", {
20
+ class: "container",
21
+ style: e([l(), {
22
+ padding: "0",
23
+ margin: "0"
24
+ }])
25
+ }, [r("iframe", {
26
+ src: c.value,
27
+ style: e(l())
28
+ }, null, 12, f)], 4)])]));
29
+ }
30
+ }), [["__scopeId", "data-v-cf5aa816"]]), m = class extends l {
31
+ getType() {
32
+ return "GPayments";
33
+ }
34
+ doChallenge(e) {
35
+ this.log(`[${this.getType()}][doChallenge]`);
36
+ let { destroy: t } = o({
37
+ el: document.body,
38
+ component: p,
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:
68
+ this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${n.transStatus}`), this.onPostAuth();
69
+ break;
70
+ }
71
+ };
72
+ onInitAuthSuccess = (e, t) => {
73
+ let n = JSON.parse(t);
74
+ if (this.log(`[${this.getType()}][onInitAuthSuccess]`, n), !n.threeDSAuthURL) {
75
+ this.onError(e, "No AuthUrl specified");
76
+ return;
77
+ }
78
+ if (this.threeDSRequestorTransID = n.threeDSRequestorTransID, this.threeDSServerTransID = n.threeDSServerTransID, this.threeDSMonitorURL = n.threeDSMonitorURL, this.threeDSAuthURL = n.threeDSAuthURL, n.threeDsServerCallbackUrl) {
79
+ this.initFrame(n.threeDsServerCallbackUrl);
80
+ return;
81
+ }
82
+ this.onAuth(!1, "");
83
+ };
84
+ initFrame(e) {
85
+ if (this.log(`[${this.getType()}][init3DSFrame]`, e), !n(e)) return;
86
+ let t = document.createElement("iframe");
87
+ t.src = e, t.style.width = "1px", t.style.height = "1px", t.style.border = "0", document.body.appendChild(t);
88
+ }
89
+ };
90
+ //#endregion
91
+ export { m as GPaymentsThreeDsProvider };
@@ -0,0 +1,118 @@
1
+ import { Ct as e, Mt as t, Rt as n, St as r, _t as i, bt as a, jt as o, mt as s, n as c, q as l, st as u, t as d, ut as f, wt as p, xt as m } from "./CloseIcon-_3X2kvPG.js";
2
+ import { t as h } from "./alerts-D474JL4D.js";
3
+ import { t as g } from "./DefaultThreeDsProvider-JPe2W_JG.js";
4
+ //#region src/sdk/3ds/MetricsGlobalThreeDsChallenge.vue?vue&type=script&setup=true&lang.ts
5
+ var _ = { class: "mask" }, v = { class: "wrapper" }, y = { class: "container" }, b = /*#__PURE__*/ l(/* @__PURE__ */ m({
6
+ __name: "MetricsGlobalThreeDsChallenge",
7
+ emits: ["close", "submit"],
8
+ setup(n, { emit: c }) {
9
+ let l = c, u = t(!1);
10
+ function m(e) {
11
+ ["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes(e.data?.message) && (u.value = e.data.message === "3DS_CHALLENGE_SHOW");
12
+ }
13
+ return r(() => {
14
+ window.addEventListener("message", m);
15
+ }), e(() => {
16
+ window.removeEventListener("message", m);
17
+ }), (e, t) => o((p(), i("div", _, [s("div", v, [s("div", y, [a(d, {
18
+ onClick: t[0] ||= (e) => l("close"),
19
+ id: "3ds-challenge-close"
20
+ }), t[1] ||= s("div", { id: "ThreeDsChallengeIFrame" }, null, -1)])])], 512)), [[f, u.value]]);
21
+ }
22
+ }), [["__scopeId", "data-v-8a0b6dcb"]]), x = /* @__PURE__ */ n({ MetricsGlobalThreeDsProvider: () => T }), { hideSpinner: S, showSpinner: C } = c(), w = 5, T = class extends g {
23
+ gateway;
24
+ threeDS;
25
+ numAttempts = 0;
26
+ constructor(e, t, n) {
27
+ super(e, t, n), this.initScript(n.clientParameters?.PublicKey || "");
28
+ }
29
+ getType() {
30
+ return "MetricsGlobal";
31
+ }
32
+ getDomain() {
33
+ return "secure.metricsglobalgateway.com";
34
+ }
35
+ onPreAuth() {
36
+ if (this.log(`[${this.getType()}]: onPreAuth`), !this.threeDS && this.numAttempts >= w) {
37
+ S(), h(this.container, "Error loading 3D Secure");
38
+ return;
39
+ }
40
+ if (!this.threeDS && this.numAttempts < w) {
41
+ this.numAttempts++, this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`), setTimeout(() => this.onPreAuth(), 1e3);
42
+ return;
43
+ }
44
+ this.threeDsProcessor?.getTokenId() ? this.threeDsProcessor?.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (e) => {
45
+ this.threeDsProcessor?.setPaymentInfo(e), this.startAuth();
46
+ }, () => {
47
+ h(this.container, "Unable to get card information");
48
+ }) : this.startAuth();
49
+ }
50
+ onAuth(e, t) {}
51
+ onPostAuth() {}
52
+ startAuth() {
53
+ this.log(`[${this.getType()}]: startAuth`);
54
+ let e = this.threeDsProcessor?.getPaymentInfo();
55
+ if (!e) {
56
+ S(), h(this.container, "Payment information is missing");
57
+ return;
58
+ }
59
+ C();
60
+ let t = this.threeDsProcessor?.getAddressInfo(), n = e.expiryDate.length === 4 ? e.expiryDate[2] + e.expiryDate[3] : "", r = e.expiryDate.length === 4 ? e.expiryDate[0] + e.expiryDate[1] : "", [i = "", a = ""] = e.cardholder?.split(/\s+/) || [], o = {
61
+ cardNumber: e.cardNumber,
62
+ cardExpMonth: n,
63
+ cardExpYear: parseInt(r) + 2e3,
64
+ currency: this.threeDsProcessor?.getCurrency(),
65
+ amount: this.threeDsProcessor?.getAmount(),
66
+ email: this.threeDsProcessor?.getEmail(),
67
+ phone: t?.phoneNumber,
68
+ city: t?.city,
69
+ state: t?.state,
70
+ address1: t?.streetAddress,
71
+ country: t?.country,
72
+ firstName: t?.firstName || i || "payFURL",
73
+ lastName: t?.lastName || a || "payFURL",
74
+ postalCode: t?.postalCode
75
+ }, s = this.threeDS.createUI(o);
76
+ s.start("#ThreeDsChallengeIFrame"), s.on("challenge", (e) => {
77
+ this.log(`[${this.getType()}][onChallenge]`, e), S(), this.showChallenge();
78
+ }), s.on("complete", (e) => {
79
+ this.log(`[${this.getType()}][onComplete]`, e), this.removeChallenge(), this.threeDsProcessor?.onSuccess({ externalThreeDsData: e });
80
+ }), s.on("failure", (e) => {
81
+ this.log(`[${this.getType()}][onFailure]`, e), S(), this.closeChallenge(), this.threeDsProcessor?.onError({ error: e.message });
82
+ }), s.on("error", (e) => {
83
+ this.log(`[${this.getType()}][error]`, e), S(), this.closeChallenge(), this.threeDsProcessor?.onError({ error: e.message });
84
+ });
85
+ }
86
+ initScript(e) {
87
+ let t = document.createElement("script");
88
+ t.type = "text/javascript", t.src = `https://${this.getDomain()}/js/v1/Gateway.js`, t.onload = () => {
89
+ this.initGateway(e), this.initChallenge();
90
+ }, document.head.appendChild(t);
91
+ }
92
+ initGateway(e) {
93
+ this.gateway = window.Gateway.create(e), this.threeDS = this.gateway.get3DSecure(), this.gateway.on("error", (e) => {
94
+ this.log(`[${this.getType()}]: gateway error`, e), this.threeDsProcessor?.onError({ error: e.message }), this.threeDS = null, this.numAttempts = w;
95
+ });
96
+ }
97
+ initChallenge() {
98
+ let { destroy: e } = u({
99
+ el: document.body,
100
+ component: b,
101
+ on: { close: () => {
102
+ this.closeChallenge(), this.threeDsProcessor?.onError({ error: "Challenge cancelled" });
103
+ } }
104
+ });
105
+ this.threeDSDestroy = e;
106
+ }
107
+ showChallenge() {
108
+ window.postMessage({ message: "3DS_CHALLENGE_SHOW" }, "*");
109
+ }
110
+ closeChallenge() {
111
+ window.postMessage({ message: "3DS_CHALLENGE_CLOSE" }, "*");
112
+ }
113
+ removeChallenge() {
114
+ this.threeDSDestroy?.();
115
+ }
116
+ };
117
+ //#endregion
118
+ export { x as n, T as t };
@@ -0,0 +1,12 @@
1
+ import { t as e } from "./MetricsGlobalThreeDsProvider-BMeP5IWW.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 };