@payfurl/client 4.6.1 → 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.
Files changed (37) hide show
  1. package/README.md +4 -0
  2. package/dist/sdk/{CxPayThreeDsProvider-068b25ce.mjs → CxPayThreeDsProvider-634589d1.mjs} +3 -3
  3. package/dist/sdk/{DefaultThreeDsProvider-e98c909f.mjs → DefaultThreeDsProvider-e92310c2.mjs} +19 -18
  4. package/dist/sdk/EcentricThreeDsProvider-9bf4643c.mjs +90 -0
  5. package/dist/sdk/{EpnaThreeDsProvider-189e652c.mjs → EpnaThreeDsProvider-f4ab5593.mjs} +3 -3
  6. package/dist/sdk/{FlashBancThreeDsProvider-36e453b8.mjs → FlashBancThreeDsProvider-9a6d418c.mjs} +3 -3
  7. package/dist/sdk/{GPaymentsThreeDsProvider-fe5a9704.mjs → GPaymentsThreeDsProvider-992c1825.mjs} +2 -2
  8. package/dist/sdk/MetricsGlobalThreeDsProvider-fdada4dd.mjs +153 -0
  9. package/dist/sdk/{NmiThreeDsProvider-f7c7a154.mjs → NmiThreeDsProvider-8c8ab0f0.mjs} +3 -3
  10. package/dist/sdk/NuveiThreeDsProvider-cc515d25.mjs +173 -0
  11. package/dist/sdk/{PayabliThreeDsProvider-66b568d3.mjs → PayabliThreeDsProvider-19d2e62a.mjs} +3 -3
  12. package/dist/sdk/{SkyBankThreeDsProvider-fbfe9597.mjs → SkyBankThreeDsProvider-44644ee8.mjs} +3 -3
  13. package/dist/sdk/cxpay-a965ca2f.mjs +10 -0
  14. package/dist/sdk/{default-957c2000.mjs → default-9ec42bc0.mjs} +2 -2
  15. package/dist/sdk/ecentric-fc332878.mjs +9 -0
  16. package/dist/sdk/epna-24e6dd6c.mjs +10 -0
  17. package/dist/sdk/flashbanc-49c4deb2.mjs +10 -0
  18. package/dist/sdk/{gpayments-dce1eccd.mjs → gpayments-c0450b55.mjs} +3 -3
  19. package/dist/sdk/main-6d84dc12.mjs +14068 -0
  20. package/dist/sdk/{metrics_global-5f5b54ee.mjs → metrics_global-3c9bd0de.mjs} +3 -3
  21. package/dist/sdk/nmi-8aabbfd1.mjs +10 -0
  22. package/dist/sdk/nuvei-3774bd45.mjs +9 -0
  23. package/dist/sdk/payabli-d52e0c78.mjs +10 -0
  24. package/dist/sdk/payfurl.es.js +1 -1
  25. package/dist/sdk/payfurl.umd.js +25 -43
  26. package/dist/sdk/skybank-f7d58ed5.mjs +10 -0
  27. package/dist/sdk/style.css +1 -1
  28. package/package.json +4 -2
  29. package/dist/sdk/MetricsGlobalThreeDsProvider-7f36be7b.mjs +0 -147
  30. package/dist/sdk/cxpay-6ff3d8ba.mjs +0 -10
  31. package/dist/sdk/ecentric-7741cdc3.mjs +0 -165
  32. package/dist/sdk/epna-1da33a88.mjs +0 -10
  33. package/dist/sdk/flashbanc-6eb51520.mjs +0 -10
  34. package/dist/sdk/main-eb4bb451.mjs +0 -18753
  35. package/dist/sdk/nmi-d67f1324.mjs +0 -10
  36. package/dist/sdk/payabli-02b4bd3b.mjs +0 -10
  37. package/dist/sdk/skybank-53b51d4e.mjs +0 -10
package/README.md CHANGED
@@ -90,3 +90,7 @@ so ensure that the environment name in the `payfurl.init` method is
90
90
  - enjoy *
91
91
 
92
92
  (* - optional)
93
+
94
+ ### Analyzing size
95
+ 1. Run `npm run build-sdk`
96
+ 2. Open `stats.html`
@@ -1,6 +1,6 @@
1
- import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
2
- import "./DefaultThreeDsProvider-e98c909f.mjs";
3
- import "./main-eb4bb451.mjs";
1
+ import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
2
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
3
+ import "./main-6d84dc12.mjs";
4
4
  class i extends r {
5
5
  getType() {
6
6
  return "CxPay";
@@ -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
3
  var o = (a, e, s) => (u(a, typeof e != "symbol" ? e + "" : e, s), s);
4
- import { d as S, r as d, o as g, a as p, c as T, b as n, e as _, C as m, u as I, p as f, f as y, _ as A, j as v, T as C, i as c, g as E, F as R } from "./main-eb4bb451.mjs";
5
- const P = (a) => (f("data-v-c82daa22"), a = a(), y(), a), U = { class: "mask" }, $ = { class: "wrapper" }, L = { class: "container" }, b = /* @__PURE__ */ P(() => /* @__PURE__ */ n("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), M = ["action"], w = ["value"], N = /* @__PURE__ */ S({
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,
@@ -17,29 +17,29 @@ const P = (a) => (f("data-v-c82daa22"), a = a(), y(), a), U = { class: "mask" },
17
17
  messageVersion: "2.1.0",
18
18
  messageType: "CReq",
19
19
  challengeWindowSize: "01"
20
- }), i = encodeURI(window.btoa(r).replace(/=*$/, ""));
20
+ }), n = encodeURI(window.btoa(r).replace(/=*$/, ""));
21
21
  return g(() => {
22
22
  var h;
23
23
  (h = t.value) == null || h.submit();
24
24
  }), (h, l) => (p(), T("div", U, [
25
- n("div", $, [
26
- n("div", L, [
25
+ i("div", $, [
26
+ i("div", L, [
27
27
  _(m, {
28
28
  onClick: l[0] || (l[0] = (V) => e("close")),
29
29
  id: "3ds-challenge-close"
30
30
  }),
31
31
  b,
32
- n("form", {
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
- n("input", {
39
+ i("input", {
40
40
  type: "hidden",
41
41
  name: "creq",
42
- value: I(i)
42
+ value: I(n)
43
43
  }, null, 8, w)
44
44
  ], 8, M)
45
45
  ])
@@ -70,10 +70,10 @@ class F {
70
70
  (r = this.threeDsProcessor) == null || r.onError({ error: "3D Secure failed", body: s });
71
71
  });
72
72
  o(this, "onSuccess", (e, s) => {
73
- var r, i;
73
+ var r, n;
74
74
  this.closeChallenge(), c();
75
75
  const t = JSON.parse(s);
76
- ["Y", "A"].includes(t.transStatus) ? (r = this.threeDsProcessor) == null || r.onSuccess(t) : (this.log(`[${this.getType()}]: 3D Secure failed`, t), (i = this.threeDsProcessor) == null || i.onError({ error: "3D Secure failed" }));
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" }));
77
77
  });
78
78
  o(this, "onInitAuthSuccess", (e, s) => {
79
79
  const t = JSON.parse(s);
@@ -96,7 +96,7 @@ class F {
96
96
  this.onError(e, "Invalid Challenge Url");
97
97
  return;
98
98
  }
99
- this.doChallenge(t.acsURL, t.acsTransID);
99
+ this.doChallenge(t.acsURL, t.acsTransID, t.authenticationValue);
100
100
  break;
101
101
  case "N":
102
102
  this.log(`[${this.getType()}][threeDsAuth], 3DS Verification failed, transaction denied`), this.onError(400, "3DS Verification failed, transaction denied");
@@ -178,25 +178,26 @@ class F {
178
178
  const s = JSON.parse(window.atob(e.data.cres));
179
179
  this.log(`[${this.getType()}]: cresData`, s), ["Y", "A"].includes(s.transStatus) ? this.onPostAuth() : ["N", "U", "R"].includes(s.transStatus) && (this.log(`[${this.getType()}]: Failed 3DS Challenge`, e.data), this.onError(400, "Failed 3DS Challenge"));
180
180
  }
181
- doChallenge(e, s) {
181
+ doChallenge(e, s, t) {
182
182
  this.log(`[${this.getType()}][doChallenge]`), c();
183
- const { destroy: t } = E({
183
+ const { destroy: r } = E({
184
184
  el: document.body,
185
185
  component: k,
186
186
  props: {
187
187
  threeDSServerTransID: this.threeDSServerTransID,
188
188
  acsTransID: s,
189
- formAction: e
189
+ formAction: e,
190
+ authenticationValue: t
190
191
  },
191
192
  on: {
192
193
  close: () => {
193
- var r;
194
- t(), this.threeDSDestroy = () => {
195
- }, (r = this.threeDsProcessor) == null || r.onError({ error: "Challenge cancelled" });
194
+ var n;
195
+ r(), this.threeDSDestroy = () => {
196
+ }, (n = this.threeDsProcessor) == null || n.onError({ error: "Challenge cancelled" });
196
197
  }
197
198
  }
198
199
  });
199
- this.threeDSDestroy = t;
200
+ this.threeDSDestroy = r;
200
201
  }
201
202
  closeChallenge() {
202
203
  var e;
@@ -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
+ };
@@ -1,6 +1,6 @@
1
- import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
2
- import "./DefaultThreeDsProvider-e98c909f.mjs";
3
- import "./main-eb4bb451.mjs";
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
2
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
3
+ import "./main-6d84dc12.mjs";
4
4
  class i extends e {
5
5
  getType() {
6
6
  return "EPNA";
@@ -1,6 +1,6 @@
1
- import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
2
- import "./DefaultThreeDsProvider-e98c909f.mjs";
3
- import "./main-eb4bb451.mjs";
1
+ import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
2
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
3
+ import "./main-6d84dc12.mjs";
4
4
  class s extends r {
5
5
  getType() {
6
6
  return "FlashBanc";
@@ -1,8 +1,8 @@
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-e98c909f.mjs";
5
- import { d as u, a as d, c as p, b as a, n as h, _ as g, g as _ } from "./main-eb4bb451.mjs";
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
6
  const m = { class: "mask" }, D = { class: "wrapper" }, S = ["src"], y = /* @__PURE__ */ u({
7
7
  __name: "GPayments",
8
8
  props: {
@@ -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
+ };
@@ -1,6 +1,6 @@
1
- import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
2
- import "./DefaultThreeDsProvider-e98c909f.mjs";
3
- import "./main-eb4bb451.mjs";
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
2
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
3
+ import "./main-6d84dc12.mjs";
4
4
  class m extends e {
5
5
  getType() {
6
6
  return "NMI";
@@ -0,0 +1,173 @@
1
+ var d = Object.defineProperty;
2
+ var p = (n, a, s) => a in n ? d(n, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[a] = s;
3
+ var c = (n, a, s) => (p(n, typeof a != "symbol" ? a + "" : a, s), s);
4
+ import { d as m, o as g, s as S, h as u, a as D, c as _, p as f, f as y, b as h, _ as T, g as N, T as I } from "./main-6d84dc12.mjs";
5
+ import { DefaultThreeDsProvider as P, THREE_DS_METHOD_INVOCATION_COMPLETE as C, THREE_DS_CHALLENGE_COMPLETE as E } from "./DefaultThreeDsProvider-e92310c2.mjs";
6
+ const x = (n) => (f("data-v-e3afa988"), n = n(), y(), n), V = { class: "mask" }, v = /* @__PURE__ */ x(() => /* @__PURE__ */ h("div", { class: "wrapper" }, [
7
+ /* @__PURE__ */ h("div", { class: "container" })
8
+ ], -1)), R = [
9
+ v
10
+ ], b = /* @__PURE__ */ m({
11
+ __name: "nuvei",
12
+ props: {
13
+ threeDSServerTransID: null,
14
+ sessionToken: null,
15
+ env: null,
16
+ merchantId: null,
17
+ merchantSiteId: null,
18
+ cardNumber: null,
19
+ cardHolderName: null,
20
+ expirationMonth: null,
21
+ expirationYear: null,
22
+ CVV: null,
23
+ firstName: null,
24
+ lastName: null,
25
+ email: null,
26
+ country: null
27
+ },
28
+ setup(n) {
29
+ const a = n;
30
+ g(() => {
31
+ S();
32
+ const r = document.createElement("script");
33
+ r.type = "text/javascript", r.src = "https://cdn.safecharge.com/safecharge_resources/v1/websdk/safecharge.js", r.onload = () => {
34
+ const e = new MutationObserver(function() {
35
+ document.getElementsByClassName("sfcModal-dialog")[0] && (u(), e.disconnect());
36
+ }), t = { childList: !0 }, o = document.querySelector("body");
37
+ e.observe(o, t), s();
38
+ }, document.head.appendChild(r);
39
+ });
40
+ function s() {
41
+ var r = SafeCharge({
42
+ env: a.env,
43
+ // Nuvei API environment - 'int' (integration) or 'prod' (production - default if omitted)
44
+ merchantId: a.merchantId,
45
+ //as assigned by Nuvei
46
+ merchantSiteId: a.merchantSiteId
47
+ // your Merchant Site ID provided by Nuvei
48
+ });
49
+ r.fields({
50
+ fonts: [
51
+ {
52
+ cssUrl: "https://fonts.googleapis.com/css?family=Source+Code+Pro"
53
+ }
54
+ // include your custom fonts
55
+ ],
56
+ locale: "en"
57
+ // You can set your users preferred locale. If not provided, we try to auto-detect.
58
+ }), r.authenticate3d({
59
+ sessionToken: a.sessionToken,
60
+ // received from openOrder API
61
+ paymentOption: {
62
+ card: {
63
+ cardNumber: a.cardNumber,
64
+ cardHolderName: a.cardHolderName,
65
+ expirationMonth: a.expirationMonth,
66
+ expirationYear: a.expirationYear,
67
+ CVV: a.CVV
68
+ }
69
+ },
70
+ billingAddress: {
71
+ firstName: a.firstName,
72
+ lastName: a.lastName,
73
+ email: a.email,
74
+ country: a.country
75
+ }
76
+ }, function(e) {
77
+ window.postMessage({ status: "3ds_challenge_complete", cres: e }, "*");
78
+ });
79
+ }
80
+ return (r, e) => (D(), _("div", V, R));
81
+ }
82
+ });
83
+ const A = /* @__PURE__ */ T(b, [["__scopeId", "data-v-e3afa988"]]);
84
+ class k extends P {
85
+ constructor() {
86
+ super(...arguments);
87
+ c(this, "_paResPayload", null);
88
+ c(this, "onSuccess", (s, r) => {
89
+ var t, o;
90
+ this.closeChallenge(), u();
91
+ const e = JSON.parse(r);
92
+ e.authenticationValue ? (t = this.threeDsProcessor) == null || t.onSuccess(e) : (this.log(`[${this.getType()}][_onSuccess] 3D Secure failed`, e), (o = this.threeDsProcessor) == null || o.onError({ error: "3D Secure failed" }));
93
+ });
94
+ c(this, "onDoAuthSuccess", (s, r) => {
95
+ var t, o, i;
96
+ const e = JSON.parse(r);
97
+ if (this.log(`[${this.getType()}][onDoAuthSuccess]`, e), !e.transStatus || !e.authenticationValue) {
98
+ this.onError(s, "No transStatus specified");
99
+ return;
100
+ }
101
+ switch (e.transStatus) {
102
+ case "C":
103
+ this.doNuveiChallenge(e.authenticationValue, (t = this.threeDsProcessor) == null ? void 0 : t.getAddressInfo(), (o = this.threeDsProcessor) == null ? void 0 : o.getPaymentInfo());
104
+ break;
105
+ default:
106
+ this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ` + e.transStatus), (i = this.threeDsProcessor) == null || i.onSuccess({
107
+ threeDSServerTransID: e.threeDSServerTransID,
108
+ threeDSRequestorTransID: "",
109
+ acsRenderingType: e.acsRenderingType,
110
+ acsTransID: e.acsTransID,
111
+ authenticationType: e.authenticationType,
112
+ authenticationValue: e.authenticationValue,
113
+ challengeCancel: "",
114
+ dsTransID: e.dsTransID,
115
+ eci: e.eci,
116
+ interactionCounter: "",
117
+ messageCategory: "",
118
+ messageExtension: e.messageExtension,
119
+ messageType: e.messageType,
120
+ messageVersion: e.messageVersion,
121
+ transStatus: e.transStatus,
122
+ transStatusReason: e.transStatusReason
123
+ });
124
+ break;
125
+ }
126
+ });
127
+ }
128
+ getType() {
129
+ return "Nuvei";
130
+ }
131
+ onPostAuth() {
132
+ var s;
133
+ this.log(`[${this.getType()}][onAuth] Do Post Authentication for transId`, this.threeDSServerTransID, this._paResPayload), (s = this.threeDsProcessor) == null || s.onPostAuth({
134
+ threeDSServerTransID: this.threeDSServerTransID,
135
+ authenticationValue: this._paResPayload.cavv,
136
+ eci: this._paResPayload.eci,
137
+ dsTransID: this._paResPayload.dsTransID,
138
+ threeDsVersion: this._paResPayload.threeDVersion,
139
+ xid: this._paResPayload.xid
140
+ }, this.onSuccess, this.onError);
141
+ }
142
+ doNuveiChallenge(s, r, e) {
143
+ var i;
144
+ const t = JSON.parse(s);
145
+ (t === null || !t.merchantId || !t.merchantSiteId) && ((i = this.threeDsProcessor) == null || i.onError({ error: "3D Secure failed" })), r && (t.firstName = r.firstName, t.lastName = r.lastName, t.email = r.email, t.country = r.country), e && (t.cardNumber = e.cardNumber, t.cardHolderName = e.cardholder, t.expirationMonth = e.expiryDate.substring(2, 4), t.expirationYear = e.expiryDate.substring(0, 2), t.CVV = e.ccv);
146
+ const { destroy: o } = N({
147
+ el: document.body,
148
+ component: A,
149
+ props: t,
150
+ on: {
151
+ close: () => {
152
+ var l;
153
+ o(), this.threeDSDestroy = () => {
154
+ }, (l = this.threeDsProcessor) == null || l.onError({ error: "Challenge cancelled" });
155
+ }
156
+ }
157
+ });
158
+ this.threeDSDestroy = o;
159
+ }
160
+ messageHandler(s) {
161
+ var r, e, t, o;
162
+ if (!(!((r = s == null ? void 0 : s.data) != null && r.status) || ((e = s == null ? void 0 : s.data) == null ? void 0 : e.status) === I)) {
163
+ if (s.data.status === C) {
164
+ this.log(`[${this.getType()}][messageHandler] 3Ds Method invocation complete`), s.stopPropagation(), this.onAuth(!0, "");
165
+ return;
166
+ }
167
+ s.data.status === E && (this.log(`[${this.getType()}][messageHandler] 3Ds Challenge complete`, s.data), s.stopPropagation(), this.closeChallenge(), s.data.cres && ((t = s.data.cres) == null ? void 0 : t.result) === "APPROVED" && ((o = s.data.cres) == null ? void 0 : o.errCode) === "0" ? (this._paResPayload = s.data.cres, this.onPostAuth()) : (this.log(`[${this.getType()}][messageHandler] Failed 3DS Challenge`, s.data), this.onError(400, "Failed 3DS Challenge")));
168
+ }
169
+ }
170
+ }
171
+ export {
172
+ k as NuveiThreeDsProvider
173
+ };
@@ -1,6 +1,6 @@
1
- import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
2
- import "./DefaultThreeDsProvider-e98c909f.mjs";
3
- import "./main-eb4bb451.mjs";
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
2
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
3
+ import "./main-6d84dc12.mjs";
4
4
  class i extends e {
5
5
  getType() {
6
6
  return "Payabli";
@@ -1,6 +1,6 @@
1
- import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7f36be7b.mjs";
2
- import "./DefaultThreeDsProvider-e98c909f.mjs";
3
- import "./main-eb4bb451.mjs";
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
2
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
3
+ import "./main-6d84dc12.mjs";
4
4
  class s extends e {
5
5
  getType() {
6
6
  return "SkyBank";
@@ -0,0 +1,10 @@
1
+ import { CxPayThreeDsProvider as e } from "./CxPayThreeDsProvider-634589d1.mjs";
2
+ import "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
3
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
4
+ import "./main-6d84dc12.mjs";
5
+ function n(r, o, t) {
6
+ return new e(r, o, t);
7
+ }
8
+ export {
9
+ n as default
10
+ };
@@ -1,5 +1,5 @@
1
- import { DefaultThreeDsProvider as o } from "./DefaultThreeDsProvider-e98c909f.mjs";
2
- import "./main-eb4bb451.mjs";
1
+ import { DefaultThreeDsProvider as o } from "./DefaultThreeDsProvider-e92310c2.mjs";
2
+ import "./main-6d84dc12.mjs";
3
3
  function a(e, r, t) {
4
4
  return new o(e, r, t);
5
5
  }
@@ -0,0 +1,9 @@
1
+ import { EcentricThreeDsProvider as i } from "./EcentricThreeDsProvider-9bf4643c.mjs";
2
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
3
+ import "./main-6d84dc12.mjs";
4
+ function m(r, e, t) {
5
+ return new i(r, e, t);
6
+ }
7
+ export {
8
+ m as default
9
+ };
@@ -0,0 +1,10 @@
1
+ import { EpnaThreeDsProvider as t } from "./EpnaThreeDsProvider-f4ab5593.mjs";
2
+ import "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
3
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
4
+ import "./main-6d84dc12.mjs";
5
+ function a(r, e, o) {
6
+ return new t(r, e, o);
7
+ }
8
+ export {
9
+ a as default
10
+ };
@@ -0,0 +1,10 @@
1
+ import { FlashBancThreeDsProvider as e } from "./FlashBancThreeDsProvider-9a6d418c.mjs";
2
+ import "./MetricsGlobalThreeDsProvider-fdada4dd.mjs";
3
+ import "./DefaultThreeDsProvider-e92310c2.mjs";
4
+ import "./main-6d84dc12.mjs";
5
+ function p(r, o, t) {
6
+ return new e(r, o, t);
7
+ }
8
+ export {
9
+ p as default
10
+ };