@payfurl/client 4.6.16 → 4.6.18

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 (53) hide show
  1. package/dist/sdk/CxPayThreeDsProvider-DjX3bJAl.js +12 -0
  2. package/dist/sdk/{DefaultThreeDsProvider-bc94590f.mjs → DefaultThreeDsProvider-wZIfgkTX.js} +88 -66
  3. package/dist/sdk/EcentricThreeDsProvider-QH208RqB.js +89 -0
  4. package/dist/sdk/{EpnaThreeDsProvider-ae87f6a8.mjs → EpnaThreeDsProvider-CC0ljizz.js} +3 -5
  5. package/dist/sdk/FlashBancThreeDsProvider-DGctQQhI.js +12 -0
  6. package/dist/sdk/{GPaymentsThreeDsProvider-c32e2ce2.mjs → GPaymentsThreeDsProvider-BzhmeVh4.js} +24 -25
  7. package/dist/sdk/{MetricsGlobalThreeDsProvider-4a1a277b.mjs → MetricsGlobalThreeDsProvider-BUcb67jM.js} +50 -51
  8. package/dist/sdk/{NmiThreeDsProvider-c7eee818.mjs → NmiThreeDsProvider-D-Dpvf8p.js} +3 -5
  9. package/dist/sdk/{NuveiThreeDsProvider-92ec0af3.mjs → NuveiThreeDsProvider-D2XXrq7E.js} +57 -58
  10. package/dist/sdk/PayGLocalThreeDsProvider-CVb2aTHz.js +127 -0
  11. package/dist/sdk/{PayWayAppleButton-8ec95dcc.mjs → PayWayAppleButton-OqZpXDDS.js} +5 -6
  12. package/dist/sdk/{PayabliThreeDsProvider-4c604ca6.mjs → PayabliThreeDsProvider-CNOV1jlN.js} +3 -5
  13. package/dist/sdk/{SkyBankThreeDsProvider-83c74ce4.mjs → SkyBankThreeDsProvider-BqOWk8zg.js} +3 -5
  14. package/dist/sdk/ThreeDsProvider.interface-CV7f0rWx.js +12181 -0
  15. package/dist/sdk/cxpay-CA6OCA10.js +7 -0
  16. package/dist/sdk/default-DyWsYI7w.js +7 -0
  17. package/dist/sdk/ecentric-CV2ZD1BX.js +7 -0
  18. package/dist/sdk/epna-DyukxWCk.js +7 -0
  19. package/dist/sdk/flashbanc-CDYzXOiJ.js +7 -0
  20. package/dist/sdk/{forter-b1affe9e.mjs → forter-CfW26Mkn.js} +2 -2
  21. package/dist/sdk/gpayments-LV9IpyRD.js +7 -0
  22. package/dist/sdk/metrics_global-DqkuRtA0.js +7 -0
  23. package/dist/sdk/nmi-CUjT46uJ.js +7 -0
  24. package/dist/sdk/nuvei-DDTCsZIS.js +7 -0
  25. package/dist/sdk/payabli-CD5hrhZL.js +7 -0
  26. package/dist/sdk/payfurl.es.js +1 -1
  27. package/dist/sdk/payfurl.umd.js +17 -25
  28. package/dist/sdk/payglocal-CJakz8Bw.js +7 -0
  29. package/dist/sdk/payway_rest-BBKp0h1b.js +7 -0
  30. package/dist/sdk/skybank-DWjKkCZu.js +7 -0
  31. package/dist/sdk/style.css +1 -1
  32. package/package.json +26 -20
  33. package/dist/sdk/CxPayThreeDsProvider-fdb9495d.mjs +0 -14
  34. package/dist/sdk/EcentricThreeDsProvider-b4e83ddb.mjs +0 -90
  35. package/dist/sdk/FlashBancThreeDsProvider-1605038d.mjs +0 -14
  36. package/dist/sdk/PayGLocalThreeDsProvider-40375fae.mjs +0 -129
  37. package/dist/sdk/ThreeDsProvider.interface-370c3a6b.mjs +0 -24
  38. package/dist/sdk/cxpay-4cfbabd6.mjs +0 -10
  39. package/dist/sdk/default-ce52738b.mjs +0 -8
  40. package/dist/sdk/ecentric-6f32c4cc.mjs +0 -9
  41. package/dist/sdk/epna-54185dfc.mjs +0 -10
  42. package/dist/sdk/flashbanc-8664c8b8.mjs +0 -10
  43. package/dist/sdk/gpayments-7527af22.mjs +0 -9
  44. package/dist/sdk/main-0d5d595b.mjs +0 -10947
  45. package/dist/sdk/metrics_global-441d4b91.mjs +0 -9
  46. package/dist/sdk/nmi-21be5427.mjs +0 -10
  47. package/dist/sdk/nuvei-6c9de68e.mjs +0 -9
  48. package/dist/sdk/payabli-2128874d.mjs +0 -10
  49. package/dist/sdk/payglocal-10b095e8.mjs +0 -9
  50. package/dist/sdk/payway_rest-3f40376d.mjs +0 -8
  51. package/dist/sdk/skybank-bbf556c6.mjs +0 -10
  52. /package/dist/sdk/{ThreeDsPostAuthResponse.type-3091950f.mjs → ThreeDsPostAuthResponse.type-CaV_50Qh.js} +0 -0
  53. /package/dist/sdk/{fraudProvider.type-c77ee71c.mjs → fraudProvider.type-ewIWghbD.js} +0 -0
@@ -1,44 +1,43 @@
1
1
  var S = Object.defineProperty;
2
- var w = (o, n, t) => n in o ? S(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
3
- var l = (o, n, t) => (w(o, typeof n != "symbol" ? n + "" : n, t), t);
4
- import { DefaultThreeDsProvider as P } from "./DefaultThreeDsProvider-bc94590f.mjs";
5
- import { d as f, r as v, o as E, j 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 $, i as H, s as g, h as k } from "./main-0d5d595b.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({
2
+ var P = (h, o, t) => o in h ? S(h, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[o] = t;
3
+ var m = (h, o, t) => P(h, typeof o != "symbol" ? o + "" : o, t);
4
+ import { DefaultThreeDsProvider as f } from "./DefaultThreeDsProvider-wZIfgkTX.js";
5
+ import { d as E, r as _, o as A, i as v, w as T, v as b, a as x, c as I, b as g, e as L, C as N, _ as G, h as $, s as p, f as H } from "./ThreeDsProvider.interface-CV7f0rWx.js";
6
+ const M = { class: "mask" }, k = { class: "wrapper" }, O = { class: "container" }, j = /* @__PURE__ */ E({
7
7
  __name: "MetricsGlobalThreeDsChallenge",
8
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");
9
+ setup(h, { emit: o }) {
10
+ const t = o, e = _(!1);
11
+ function s(r) {
12
+ var i;
13
+ ["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes((i = r.data) == null ? void 0 : i.message) && (e.value = r.data.message === "3DS_CHALLENGE_SHOW");
14
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")),
15
+ return A(() => {
16
+ window.addEventListener("message", s);
17
+ }), v(() => {
18
+ window.removeEventListener("message", s);
19
+ }), (r, i) => T((x(), I("div", M, [
20
+ g("div", k, [
21
+ g("div", O, [
22
+ L(N, {
23
+ onClick: i[0] || (i[0] = (l) => t("close")),
24
24
  id: "3ds-challenge-close"
25
25
  }),
26
- U
26
+ i[1] || (i[1] = g("div", { id: "ThreeDsChallengeIFrame" }, null, -1))
27
27
  ])
28
28
  ])
29
29
  ], 512)), [
30
- [T, t.value]
30
+ [b, e.value]
31
31
  ]);
32
32
  }
33
- });
34
- const V = /* @__PURE__ */ $(W, [["__scopeId", "data-v-8a0b6dcb"]]), { hideSpinner: c, showSpinner: K } = H(), m = 5;
35
- class J extends P {
33
+ }), B = /* @__PURE__ */ G(j, [["__scopeId", "data-v-8a0b6dcb"]]), { hideSpinner: c, showSpinner: F } = $(), u = 5;
34
+ class K extends f {
36
35
  constructor(t, e, s) {
37
36
  var r;
38
37
  super(t, e, s);
39
- l(this, "gateway");
40
- l(this, "threeDS");
41
- l(this, "numAttempts", 0);
38
+ m(this, "gateway");
39
+ m(this, "threeDS");
40
+ m(this, "numAttempts", 0);
42
41
  this.initScript(((r = s.clientParameters) == null ? void 0 : r.PublicKey) || "");
43
42
  }
44
43
  getType() {
@@ -49,11 +48,11 @@ class J extends P {
49
48
  }
50
49
  onPreAuth() {
51
50
  var t, e;
52
- if (this.log(`[${this.getType()}]: onPreAuth`), !this.threeDS && this.numAttempts >= m) {
53
- c(), g(this.container, "Error loading 3D Secure");
51
+ if (this.log(`[${this.getType()}]: onPreAuth`), !this.threeDS && this.numAttempts >= u) {
52
+ c(), p(this.container, "Error loading 3D Secure");
54
53
  return;
55
54
  }
56
- if (!this.threeDS && this.numAttempts < m) {
55
+ if (!this.threeDS && this.numAttempts < u) {
57
56
  this.numAttempts++, this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`), setTimeout(() => this.onPreAuth(), 1e3);
58
57
  return;
59
58
  }
@@ -61,7 +60,7 @@ class J extends P {
61
60
  var r;
62
61
  (r = this.threeDsProcessor) == null || r.setPaymentInfo(s), this.startAuth();
63
62
  }, () => {
64
- g(this.container, "Unable to get card information");
63
+ p(this.container, "Unable to get card information");
65
64
  }) : this.startAuth();
66
65
  }
67
66
  onAuth(t, e) {
@@ -69,21 +68,21 @@ class J extends P {
69
68
  onPostAuth() {
70
69
  }
71
70
  startAuth() {
72
- var D, y, d, _, C;
71
+ var D, y, d, C, w;
73
72
  this.log(`[${this.getType()}]: startAuth`);
74
73
  const t = (D = this.threeDsProcessor) == null ? void 0 : D.getPaymentInfo();
75
74
  if (!t) {
76
- c(), g(this.container, "Payment information is missing");
75
+ c(), p(this.container, "Payment information is missing");
77
76
  return;
78
77
  }
79
- K();
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 = {
78
+ F();
79
+ 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] : "", i = {
81
80
  cardNumber: t.cardNumber,
82
81
  cardExpMonth: s,
83
82
  cardExpYear: parseInt(r) + 2e3,
84
83
  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(),
84
+ amount: (C = this.threeDsProcessor) == null ? void 0 : C.getAmount(),
85
+ email: (w = this.threeDsProcessor) == null ? void 0 : w.getEmail(),
87
86
  phone: e == null ? void 0 : e.phoneNumber,
88
87
  city: e == null ? void 0 : e.city,
89
88
  state: e == null ? void 0 : e.state,
@@ -92,20 +91,20 @@ class J extends P {
92
91
  firstName: e == null ? void 0 : e.firstName,
93
92
  lastName: e == null ? void 0 : e.lastName,
94
93
  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) => {
94
+ }, l = this.threeDS.createUI(i);
95
+ l.start("#ThreeDsChallengeIFrame"), l.on("challenge", (n) => {
96
+ this.log(`[${this.getType()}][onChallenge]`, n), c(), this.showChallenge();
97
+ }), l.on("complete", (n) => {
99
98
  var a;
100
- this.log(`[${this.getType()}][onComplete]`, i), this.removeChallenge(), (a = this.threeDsProcessor) == null || a.onSuccess({
101
- externalThreeDsData: i
99
+ this.log(`[${this.getType()}][onComplete]`, n), this.removeChallenge(), (a = this.threeDsProcessor) == null || a.onSuccess({
100
+ externalThreeDsData: n
102
101
  });
103
- }), h.on("failure", (i) => {
102
+ }), l.on("failure", (n) => {
104
103
  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) => {
104
+ this.log(`[${this.getType()}][onFailure]`, n), c(), this.closeChallenge(), (a = this.threeDsProcessor) == null || a.onError({ error: n.message });
105
+ }), l.on("error", (n) => {
107
106
  var a;
108
- this.log(`[${this.getType()}][error]`, i), c(), this.closeChallenge(), (a = this.threeDsProcessor) == null || a.onError({ error: i.message });
107
+ this.log(`[${this.getType()}][error]`, n), c(), this.closeChallenge(), (a = this.threeDsProcessor) == null || a.onError({ error: n.message });
109
108
  });
110
109
  }
111
110
  initScript(t) {
@@ -117,13 +116,13 @@ class J extends P {
117
116
  initGateway(t) {
118
117
  this.gateway = window.Gateway.create(t), this.threeDS = this.gateway.get3DSecure(), this.gateway.on("error", (e) => {
119
118
  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;
119
+ this.log(`[${this.getType()}]: gateway error`, e), (s = this.threeDsProcessor) == null || s.onError({ error: e.message }), this.threeDS = null, this.numAttempts = u;
121
120
  });
122
121
  }
123
122
  initChallenge() {
124
- const { destroy: t } = k({
123
+ const { destroy: t } = H({
125
124
  el: document.body,
126
- component: V,
125
+ component: B,
127
126
  on: {
128
127
  close: () => {
129
128
  var e;
@@ -149,5 +148,5 @@ class J extends P {
149
148
  }
150
149
  }
151
150
  export {
152
- J as MetricsGlobalThreeDsProvider
151
+ K as MetricsGlobalThreeDsProvider
153
152
  };
@@ -1,7 +1,5 @@
1
- import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-4a1a277b.mjs";
2
- import "./DefaultThreeDsProvider-bc94590f.mjs";
3
- import "./main-0d5d595b.mjs";
4
- class m extends e {
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-BUcb67jM.js";
2
+ class t extends e {
5
3
  getType() {
6
4
  return "NMI";
7
5
  }
@@ -10,5 +8,5 @@ class m extends e {
10
8
  }
11
9
  }
12
10
  export {
13
- m as NmiThreeDsProvider
11
+ t as NmiThreeDsProvider
14
12
  };
@@ -1,40 +1,36 @@
1
- var d = Object.defineProperty;
2
- var p = (n, r, t) => r in n ? d(n, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[r] = t;
3
- var l = (n, r, t) => (p(n, typeof r != "symbol" ? r + "" : r, t), t);
4
- import { d as m, i as u, o as g, a as D, c as S, p as _, f, b as h, _ as y, s as P, h as T } from "./main-0d5d595b.mjs";
5
- import { DefaultThreeDsProvider as I, THREE_DS_METHOD_INVOCATION_COMPLETE as N, THREE_DS_CHALLENGE_COMPLETE as C } from "./DefaultThreeDsProvider-bc94590f.mjs";
6
- const b = (n) => (_("data-v-3b52be97"), n = n(), f(), n), v = { class: "mask" }, E = /* @__PURE__ */ b(() => /* @__PURE__ */ h("div", { class: "wrapper" }, [
7
- /* @__PURE__ */ h("div", { class: "container" })
8
- ], -1)), x = [
9
- E
10
- ], V = /* @__PURE__ */ m({
1
+ var u = Object.defineProperty;
2
+ var p = (n, o, t) => o in n ? u(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
3
+ var h = (n, o, t) => p(n, typeof o != "symbol" ? o + "" : o, t);
4
+ import { d as m, h as d, o as g, a as D, c as S, b as l, _ as f, s as y, f as P } from "./ThreeDsProvider.interface-CV7f0rWx.js";
5
+ import { DefaultThreeDsProvider as T, THREE_DS_METHOD_INVOCATION_COMPLETE as N, THREE_DS_CHALLENGE_COMPLETE as I } from "./DefaultThreeDsProvider-wZIfgkTX.js";
6
+ const C = { class: "mask" }, _ = /* @__PURE__ */ m({
11
7
  __name: "nuvei",
12
8
  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
9
+ threeDSServerTransID: {},
10
+ sessionToken: {},
11
+ env: {},
12
+ merchantId: {},
13
+ merchantSiteId: {},
14
+ cardNumber: {},
15
+ cardHolderName: {},
16
+ expirationMonth: {},
17
+ expirationYear: {},
18
+ CVV: {},
19
+ firstName: {},
20
+ lastName: {},
21
+ email: {},
22
+ country: {}
27
23
  },
28
24
  setup(n) {
29
- const r = n, { hideSpinner: t, showSpinner: a } = u();
25
+ const { hideSpinner: o, showSpinner: t } = d(), r = n;
30
26
  g(() => {
31
- a();
27
+ t();
32
28
  const s = document.createElement("script");
33
29
  s.type = "text/javascript", s.src = "https://cdn.safecharge.com/safecharge_resources/v1/websdk/safecharge.js", s.onload = () => {
34
- const o = new MutationObserver(function() {
35
- document.getElementsByClassName("sfcModal-dialog")[0] && (t(), o.disconnect());
30
+ const a = new MutationObserver(function() {
31
+ document.getElementsByClassName("sfcModal-dialog")[0] && (o(), a.disconnect());
36
32
  }), i = { childList: !0 }, c = document.querySelector("body");
37
- o.observe(c, i), e();
33
+ a.observe(c, i), e();
38
34
  }, document.head.appendChild(s);
39
35
  });
40
36
  function e() {
@@ -73,34 +69,37 @@ const b = (n) => (_("data-v-3b52be97"), n = n(), f(), n), v = { class: "mask" },
73
69
  email: r.email,
74
70
  country: r.country
75
71
  }
76
- }, function(o) {
77
- window.postMessage({ status: "3ds_challenge_complete", cres: o }, "*");
72
+ }, function(a) {
73
+ window.postMessage({ status: "3ds_challenge_complete", cres: a }, "*");
78
74
  });
79
75
  }
80
- return (s, o) => (D(), S("div", v, x));
76
+ return (s, a) => (D(), S("div", C, a[0] || (a[0] = [
77
+ l("div", { class: "wrapper" }, [
78
+ l("div", { class: "container" })
79
+ ], -1)
80
+ ])));
81
81
  }
82
- });
83
- const A = /* @__PURE__ */ y(V, [["__scopeId", "data-v-3b52be97"]]), { hideSpinner: R } = u();
84
- class O extends I {
82
+ }), E = /* @__PURE__ */ f(_, [["__scopeId", "data-v-6293d147"]]), { hideSpinner: V } = d();
83
+ class A extends T {
85
84
  constructor() {
86
85
  super(...arguments);
87
- l(this, "_paResPayload", null);
88
- l(this, "onSuccess", (t, a) => {
89
- var s, o;
90
- this.closeChallenge(), R();
91
- const e = JSON.parse(a);
92
- e.authenticationValue ? (s = this.threeDsProcessor) == null || s.onSuccess(e) : (this.log(`[${this.getType()}][_onSuccess] 3D Secure failed`, e), (o = this.threeDsProcessor) == null || o.onError({ error: "3D Secure failed" }));
86
+ h(this, "_paResPayload", null);
87
+ h(this, "onSuccess", (t, r) => {
88
+ var s, a;
89
+ this.closeChallenge(), V();
90
+ const e = JSON.parse(r);
91
+ e.authenticationValue ? (s = this.threeDsProcessor) == null || s.onSuccess(e) : (this.log(`[${this.getType()}][_onSuccess] 3D Secure failed`, e), (a = this.threeDsProcessor) == null || a.onError({ error: "3D Secure failed" }));
93
92
  });
94
- l(this, "onDoAuthSuccess", (t, a) => {
95
- var s, o, i;
96
- const e = JSON.parse(a);
93
+ h(this, "onDoAuthSuccess", (t, r) => {
94
+ var s, a, i;
95
+ const e = JSON.parse(r);
97
96
  if (this.log(`[${this.getType()}][onDoAuthSuccess]`, e), !e.transStatus || !e.authenticationValue) {
98
97
  this.onError(t, "No transStatus specified");
99
98
  return;
100
99
  }
101
100
  switch (e.transStatus) {
102
101
  case "C":
103
- this.doNuveiChallenge(e.authenticationValue, (s = this.threeDsProcessor) == null ? void 0 : s.getAddressInfo(), (o = this.threeDsProcessor) == null ? void 0 : o.getPaymentInfo());
102
+ this.doNuveiChallenge(e.authenticationValue, (s = this.threeDsProcessor) == null ? void 0 : s.getAddressInfo(), (a = this.threeDsProcessor) == null ? void 0 : a.getPaymentInfo());
104
103
  break;
105
104
  default:
106
105
  this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ` + e.transStatus), (i = this.threeDsProcessor) == null || i.onSuccess({
@@ -129,12 +128,12 @@ class O extends I {
129
128
  return "Nuvei";
130
129
  }
131
130
  onPreAuth() {
132
- var t, a;
133
- this.log(`[${this.getType()}]: onPreAuth`), (t = this.threeDsProcessor) != null && t.getTokenId() ? (a = this.threeDsProcessor) == null || a.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (e) => {
131
+ var t, r;
132
+ this.log(`[${this.getType()}]: onPreAuth`), (t = this.threeDsProcessor) != null && t.getTokenId() ? (r = this.threeDsProcessor) == null || r.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (e) => {
134
133
  var s;
135
134
  (s = this.threeDsProcessor) == null || s.setPaymentInfo(e), super.onPreAuth();
136
135
  }, () => {
137
- P(this.container, "Unable to get card information");
136
+ y(this.container, "Unable to get card information");
138
137
  }) : super.onPreAuth();
139
138
  }
140
139
  onPostAuth() {
@@ -148,35 +147,35 @@ class O extends I {
148
147
  xid: this._paResPayload.xid
149
148
  }, this.onSuccess, this.onError);
150
149
  }
151
- doNuveiChallenge(t, a, e) {
150
+ doNuveiChallenge(t, r, e) {
152
151
  var i;
153
152
  const s = JSON.parse(t);
154
- (s === null || !s.merchantId || !s.merchantSiteId) && ((i = this.threeDsProcessor) == null || i.onError({ error: "3D Secure failed" })), a && (s.firstName = a.firstName, s.lastName = a.lastName, s.email = a.email, s.country = a.country), e && (s.cardNumber = e.cardNumber, s.cardHolderName = e.cardholder, s.expirationMonth = e.expiryDate.substring(2, 4), s.expirationYear = e.expiryDate.substring(0, 2), s.CVV = e.ccv);
155
- const { destroy: o } = T({
153
+ (s === null || !s.merchantId || !s.merchantSiteId) && ((i = this.threeDsProcessor) == null || i.onError({ error: "3D Secure failed" })), r && (s.firstName = r.firstName, s.lastName = r.lastName, s.email = r.email, s.country = r.country), e && (s.cardNumber = e.cardNumber, s.cardHolderName = e.cardholder, s.expirationMonth = e.expiryDate.substring(2, 4), s.expirationYear = e.expiryDate.substring(0, 2), s.CVV = e.ccv);
154
+ const { destroy: a } = P({
156
155
  el: document.body,
157
- component: A,
156
+ component: E,
158
157
  props: s,
159
158
  on: {
160
159
  close: () => {
161
160
  var c;
162
- o(), this.threeDSDestroy = () => {
161
+ a(), this.threeDSDestroy = () => {
163
162
  }, (c = this.threeDsProcessor) == null || c.onError({ error: "Challenge cancelled" });
164
163
  }
165
164
  }
166
165
  });
167
- this.threeDSDestroy = o;
166
+ this.threeDSDestroy = a;
168
167
  }
169
168
  messageHandler(t) {
170
- var a, e, s;
171
- if ((a = t == null ? void 0 : t.data) != null && a.status) {
169
+ var r, e, s;
170
+ if ((r = t == null ? void 0 : t.data) != null && r.status) {
172
171
  if (t.data.status === N) {
173
172
  this.log(`[${this.getType()}][messageHandler] 3Ds Method invocation complete`), t.stopPropagation(), this.onAuth(!0, "");
174
173
  return;
175
174
  }
176
- t.data.status === C && (this.log(`[${this.getType()}][messageHandler] 3Ds Challenge complete`, t.data), t.stopPropagation(), this.closeChallenge(), t.data.cres && ((e = t.data.cres) == null ? void 0 : e.result) === "APPROVED" && ((s = t.data.cres) == null ? void 0 : s.errCode) === "0" ? (this._paResPayload = t.data.cres, this.onPostAuth()) : (this.log(`[${this.getType()}][messageHandler] Failed 3DS Challenge`, t.data), this.onError(400, "Failed 3DS Challenge")));
175
+ t.data.status === I && (this.log(`[${this.getType()}][messageHandler] 3Ds Challenge complete`, t.data), t.stopPropagation(), this.closeChallenge(), t.data.cres && ((e = t.data.cres) == null ? void 0 : e.result) === "APPROVED" && ((s = t.data.cres) == null ? void 0 : s.errCode) === "0" ? (this._paResPayload = t.data.cres, this.onPostAuth()) : (this.log(`[${this.getType()}][messageHandler] Failed 3DS Challenge`, t.data), this.onError(400, "Failed 3DS Challenge")));
177
176
  }
178
177
  }
179
178
  }
180
179
  export {
181
- O as NuveiThreeDsProvider
180
+ A as NuveiThreeDsProvider
182
181
  };
@@ -0,0 +1,127 @@
1
+ import { DefaultThreeDsProvider as C } from "./DefaultThreeDsProvider-wZIfgkTX.js";
2
+ import { r as h, o as p, i as D, I as y, d as _, j as w, a as E, c as I, b as u, _ as L, s as c, f as S } from "./ThreeDsProvider.interface-CV7f0rWx.js";
3
+ const d = h(!1);
4
+ function R(s, ...e) {
5
+ d.value && console.log(s, e);
6
+ }
7
+ function m(s) {
8
+ var e, o;
9
+ (e = s == null ? void 0 : s.data) != null && e.status && s.data.status === y && (d.value = !!((o = s == null ? void 0 : s.data) != null && o.debug));
10
+ }
11
+ function k() {
12
+ return p(() => {
13
+ window.addEventListener("message", m);
14
+ }), D(() => {
15
+ window.removeEventListener("message", m);
16
+ }), {
17
+ debug: d,
18
+ logMessage: R
19
+ };
20
+ }
21
+ const b = { class: "modal-mask" }, A = { class: "modal-wrapper" }, M = ["src"], U = /* @__PURE__ */ _({
22
+ __name: "PayGLocalThreeDsChallenge",
23
+ props: {
24
+ url: {}
25
+ },
26
+ emits: ["close"],
27
+ setup(s, { emit: e }) {
28
+ const { logMessage: o } = k(), r = s, t = e, a = h(r.url);
29
+ h(null), w(() => r.url, (i) => {
30
+ a.value = i;
31
+ }), p(() => {
32
+ window.addEventListener("message", n);
33
+ }), D(() => {
34
+ window.removeEventListener("message", n);
35
+ });
36
+ function n(i) {
37
+ var g;
38
+ if (o("PayGLocalThreeDsChallenge: Message received", i.data), !((g = i == null ? void 0 : i.data) != null && g["payglocal-token"])) return;
39
+ const l = i.data["payglocal-token"];
40
+ o("Token received", l);
41
+ const f = l.split(".")[1], P = window.atob(f), T = JSON.parse(P);
42
+ t("close", T);
43
+ }
44
+ return (i, l) => (E(), I("div", b, [
45
+ u("div", A, [
46
+ u("iframe", {
47
+ src: a.value,
48
+ sandbox: "allow-same-origin allow-scripts allow-popups allow-forms"
49
+ }, null, 8, M)
50
+ ])
51
+ ]));
52
+ }
53
+ }), x = /* @__PURE__ */ L(U, [["__scopeId", "data-v-6f042298"]]);
54
+ class v extends C {
55
+ getType() {
56
+ return "PayGLocal";
57
+ }
58
+ onPreAuth() {
59
+ var e, o, r;
60
+ if (this.log(`[${this.getType()}]: onPreAuth`), (e = this.threeDsProcessor) != null && e.getTokenId()) {
61
+ (o = this.threeDsProcessor) == null || o.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (t, a) => {
62
+ var n;
63
+ this.log(`[${this.getType()}]: getCardDetails`, t, a), (n = this.threeDsProcessor) == null || n.setPaymentInfo(t), this.initChallenge(a.RedirectUrl);
64
+ }, () => {
65
+ c(this.container, "Unable to get card information");
66
+ });
67
+ return;
68
+ }
69
+ (r = this.threeDsProcessor) == null || r.tokeniseCard(this.threeDsProcessor.getProviderId(), (t) => {
70
+ this.log(`[${this.getType()}]: tokeniseCard`, t), this.initChallenge(t.gatewayTokenData.RedirectUrl);
71
+ }, (t) => {
72
+ c(this.container, t);
73
+ });
74
+ }
75
+ onAuth(e, o) {
76
+ }
77
+ onPostAuth() {
78
+ }
79
+ initChallenge(e) {
80
+ if (this.log(`[${this.getType()}]: initChallenge`, e), !e) {
81
+ c(this.container, "3D Secure URL is missing");
82
+ return;
83
+ }
84
+ const { destroy: o } = S({
85
+ el: document.body,
86
+ component: x,
87
+ props: {
88
+ url: e
89
+ },
90
+ on: {
91
+ close: (r) => {
92
+ var t, a, n;
93
+ if (this.closeChallenge(), this.log(`[${this.getType()}]: Challenge Results`, r), r.status === "AUTHORIZED") {
94
+ (t = this.threeDsProcessor) == null || t.onSuccess({
95
+ acsRenderingType: {},
96
+ acsTransID: "",
97
+ authenticationType: "",
98
+ authenticationValue: "",
99
+ challengeCancel: "",
100
+ dsTransID: "",
101
+ eci: "",
102
+ interactionCounter: "",
103
+ messageCategory: "",
104
+ messageExtension: [],
105
+ messageType: "",
106
+ messageVersion: "",
107
+ threeDSRequestorTransID: "",
108
+ threeDSServerTransID: "",
109
+ transStatusReason: "",
110
+ transStatus: "Y"
111
+ });
112
+ return;
113
+ }
114
+ if (r.status === "CUSTOMER_CANCELLED") {
115
+ (a = this.threeDsProcessor) == null || a.onError({ error: "Challenge cancelled" });
116
+ return;
117
+ }
118
+ (n = this.threeDsProcessor) == null || n.onError({ error: "3D Secure failed" });
119
+ }
120
+ }
121
+ });
122
+ this.threeDSDestroy = o;
123
+ }
124
+ }
125
+ export {
126
+ v as PayGLocalThreeDsProvider
127
+ };
@@ -1,7 +1,7 @@
1
1
  var g = Object.defineProperty;
2
2
  var A = (a, t, i) => t in a ? g(a, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[t] = i;
3
- var s = (a, t, i) => (A(a, typeof t != "symbol" ? t + "" : t, i), i);
4
- import { R as b, g as C, H as P } from "./main-0d5d595b.mjs";
3
+ var s = (a, t, i) => A(a, typeof t != "symbol" ? t + "" : t, i);
4
+ import { R as b, g as C, H as P } from "./ThreeDsProvider.interface-CV7f0rWx.js";
5
5
  const h = {
6
6
  CHECKOUT: "CHECKOUT",
7
7
  CHARGE: "CHARGE"
@@ -24,7 +24,6 @@ class I {
24
24
  s(this, "apiUrl");
25
25
  s(this, "amount");
26
26
  s(this, "currency");
27
- s(this, "options");
28
27
  s(this, "clientParameters");
29
28
  s(this, "billingAddress", null);
30
29
  s(this, "customer", null);
@@ -35,7 +34,7 @@ class I {
35
34
  s(this, "onSuccess");
36
35
  s(this, "onFailure");
37
36
  s(this, "httpInvoker", null);
38
- this.log = t, this.apiUrl = e.apiUrl, this.container = i || document.body, this.options = e.options, this.clientParameters = e.clientParameters, this.providerId = e.providerId, this.amount = Number(r), this.currency = n, this.providerId = o, this.onSuccess = e.onSuccess || null, this.onFailure = e.onFailure || null;
37
+ this.log = t, this.apiUrl = e.apiUrl, this.container = i || document.body, this.clientParameters = e.clientParameters, this.providerId = e.providerId, this.amount = Number(r), this.currency = n, this.providerId = o, this.onSuccess = e.onSuccess || null, this.onFailure = e.onFailure || null;
39
38
  const d = new b(e.environment, C(e.publicKey));
40
39
  this.httpInvoker = new P(e.publicKey, e.version, d), this.init();
41
40
  }
@@ -105,8 +104,8 @@ class I {
105
104
  items: this.order && this.order.orderItems.map((l) => ({
106
105
  name: l.name,
107
106
  reference: l.sku,
108
- quantity: l.quantity,
109
- amount: l.totalAmount
107
+ quantity: Number(l.quantity),
108
+ amount: Number(l.unitPrice)
110
109
  })) || []
111
110
  };
112
111
  this.log("[PayWayAppleButton][checkout]", i), (m = this.httpInvoker) == null || m.invoke(p(this.apiUrl)[h.CHECKOUT].url, p(this.apiUrl)[h.CHECKOUT].method, JSON.stringify(i), (l, u) => {
@@ -1,7 +1,5 @@
1
- import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-4a1a277b.mjs";
2
- import "./DefaultThreeDsProvider-bc94590f.mjs";
3
- import "./main-0d5d595b.mjs";
4
- class i extends e {
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-BUcb67jM.js";
2
+ class t extends e {
5
3
  getType() {
6
4
  return "Payabli";
7
5
  }
@@ -10,5 +8,5 @@ class i extends e {
10
8
  }
11
9
  }
12
10
  export {
13
- i as PayabliThreeDsProvider
11
+ t as PayabliThreeDsProvider
14
12
  };
@@ -1,7 +1,5 @@
1
- import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-4a1a277b.mjs";
2
- import "./DefaultThreeDsProvider-bc94590f.mjs";
3
- import "./main-0d5d595b.mjs";
4
- class s extends e {
1
+ import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-BUcb67jM.js";
2
+ class a extends e {
5
3
  getType() {
6
4
  return "SkyBank";
7
5
  }
@@ -10,5 +8,5 @@ class s extends e {
10
8
  }
11
9
  }
12
10
  export {
13
- s as SkyBankThreeDsProvider
11
+ a as SkyBankThreeDsProvider
14
12
  };