@payfurl/react-plugin 1.3.0 → 1.4.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 (62) hide show
  1. package/dist/ApplePayButtonOptions.type-BvRk9kiK-BzeTPT7u.js +9 -0
  2. package/dist/{DefaultThreeDsProvider-aIZr-d29-34xFFHE7.js → DefaultThreeDsProvider-CzqbXEws-C21Rr7_5.js} +22 -46
  3. package/dist/MetricsGlobalThreeDsProvider-B-EQQsEV-BYhakAA4.js +143 -0
  4. package/dist/{PayWayAppleButton-DESHrVB--dAz40mnI.js → PayWayAppleButton-C-XfcgNS-rgWe-QJM.js} +3 -13
  5. package/dist/components/PayfurlDropin.d.ts +17 -0
  6. package/dist/cxpay-VbaQA3_P-DlS7yCqQ.js +15 -0
  7. package/dist/default-Diji0SXY-ghmIvhgy.js +7 -0
  8. package/dist/ecentric-BlNDCZo_-Bd8Q_3ZG.js +82 -0
  9. package/dist/epna-CxmJ_mqR-D4gbP4NT.js +15 -0
  10. package/dist/flashbanc-BAxvqtBB-DVXrWV0Z.js +15 -0
  11. package/dist/{forterDeviceIntelScript-DdHZ7KLR-Bj5SDir_.js → forter-DXQjpKVH-DaJPhK3m.js} +55 -2
  12. package/dist/forter-R2alfHeE-C5KHGNgt.js +33 -0
  13. package/dist/{GPaymentsThreeDsProvider-COuZ_3w6-LSN7UEC9.js → gpayments-B5KWQV4S-QV7caEyB.js} +21 -29
  14. package/dist/{index-BuqGcTyx.js → index-CL6hUU-f.js} +4757 -5274
  15. package/dist/index.d.ts +3 -6
  16. package/dist/managedOrders-ojoMZ0Ab-B94-Nsp-.js +44 -0
  17. package/dist/metrics_global-HMMDzPlb-CXHJ1NHy.js +7 -0
  18. package/dist/nmi-Ch7qQ6Av-DbPjmA5v.js +15 -0
  19. package/dist/nuvei-DRmlfpTL-ByeKEnae.js +165 -0
  20. package/dist/payabli-CiBJ1-vC-BthvUlRk.js +15 -0
  21. package/dist/payfurl-react.es.js +1 -1
  22. package/dist/payfurl-react.umd.js +19 -18
  23. package/dist/payglocal-uAPlijwL-CvGatUVh.js +109 -0
  24. package/dist/{payway_rest-m9k6k7M0-DRpVLFXx.js → payway_rest-CjgIP42z-7zwBGwnD.js} +1 -1
  25. package/dist/skybank-D7uRF17E-BXng_6yf.js +15 -0
  26. package/package.json +4 -3
  27. package/dist/CxPayThreeDsProvider-lD7RyyaH-CZzCobVO.js +0 -12
  28. package/dist/EcentricThreeDsProvider-B7Hq90Yp-BLFmnpX_.js +0 -78
  29. package/dist/EpnaThreeDsProvider-BAO2GROY-DrXyG7m7.js +0 -12
  30. package/dist/FlashBancThreeDsProvider-CIZpoTAj-mm8iTQlK.js +0 -12
  31. package/dist/MetricsGlobalThreeDsProvider-D3x5hiTk-Otm4rjjf.js +0 -149
  32. package/dist/NmiThreeDsProvider-fLTB46dM-CF2ixVZj.js +0 -12
  33. package/dist/NuveiThreeDsProvider-BpWi_OJA-DpNk-jUR.js +0 -164
  34. package/dist/PayGLocalThreeDsProvider-DvA8Ng4u-CaEbpX2R.js +0 -117
  35. package/dist/PayabliThreeDsProvider-B34Ah8DW-B9F4JRAO.js +0 -12
  36. package/dist/SkyBankThreeDsProvider-0S5UKz-C-BkciCrGp.js +0 -12
  37. package/dist/ThreeDsPostAuthResponse.type-BFN9wqum-CaV_50Qh.js +0 -26
  38. package/dist/cxpay-2tlxyzUF-CXU4oVZi.js +0 -7
  39. package/dist/default-Sih0fC9J-l6oXyAYh.js +0 -7
  40. package/dist/ecentric-CN_DxZw6-CDBzRGVY.js +0 -7
  41. package/dist/epna-CuWMBne4-Co8ZvTur.js +0 -7
  42. package/dist/flashbanc-YdmE24o7-CYnxMwr_.js +0 -7
  43. package/dist/forter-CcQiwntl-Cc86pyZN.js +0 -61
  44. package/dist/fraudProvider.type-Bzd9orn2-D-DU7Fmr.js +0 -7
  45. package/dist/fraudStatus.type-BvRk9kiK-zQpibcxa.js +0 -24
  46. package/dist/gpayments-DVhgcMCp-D1cODCJ9.js +0 -7
  47. package/dist/metrics_global-DshQOuaW-T-FOilvV.js +0 -7
  48. package/dist/nmi-Qo4scfgJ-DVhwpAno.js +0 -7
  49. package/dist/nuvei-BFllJ45f-B-JXn8ur.js +0 -7
  50. package/dist/payabli-eGPashQz-Bx0aWlgU.js +0 -7
  51. package/dist/payglocal-WvM5v5cn-CsqWoNS0.js +0 -7
  52. package/dist/plugins/payfurl/react/src/components/PayfurlDropin.d.ts +0 -16
  53. package/dist/plugins/payfurl/react/src/index.d.ts +0 -6
  54. package/dist/skybank-174OmYCW-CxTyN679.js +0 -7
  55. package/dist/src/click2pay/ClickToPayOptions.type.d.ts +0 -30
  56. package/dist/src/sdk/checkout/checkoutProvider.type.d.ts +0 -66
  57. package/dist/src/sdk/fraud/fraudProvider.type.d.ts +0 -3
  58. package/dist/src/sdk/types/DropInOptions.type.d.ts +0 -80
  59. package/dist/src/sdk/types/GooglePayButtonOptions.type.d.ts +0 -10
  60. package/dist/src/sdk/types/NetworkTokenOptions.type.d.ts +0 -6
  61. package/dist/src/sdk/types/PaymentType.type.d.ts +0 -15
  62. package/dist/src/sdk/types/UpiOptions.type.d.ts +0 -12
@@ -0,0 +1,109 @@
1
+ import { O as C } from "./DefaultThreeDsProvider-CzqbXEws-C21Rr7_5.js";
2
+ import { h as g, H as f, t as E, a as S, Z as k, g as p, B as I, b as D, j as v, c as L, X as d, P as b, k as u, K as R, i as A } from "./index-CL6hUU-f.js";
3
+ var l = p(!1);
4
+ function U(e, ...t) {
5
+ l.value && console.log(u(e), u(t));
6
+ }
7
+ function m(e) {
8
+ var t, s;
9
+ (t = e == null ? void 0 : e.data) != null && t.status && e.data.status === "init-card-form" && (l.value = !!((s = e == null ? void 0 : e.data) != null && s.debug));
10
+ }
11
+ function _() {
12
+ return D(() => {
13
+ window.addEventListener("message", m);
14
+ }), v(() => {
15
+ window.removeEventListener("message", m);
16
+ }), {
17
+ debug: l,
18
+ logMessage: U
19
+ };
20
+ }
21
+ var x = { class: "modal-mask" }, M = { class: "modal-wrapper" }, Z = ["src"], G = /* @__PURE__ */ S(/* @__PURE__ */ k({
22
+ __name: "PayGLocalThreeDsChallenge",
23
+ props: { url: {} },
24
+ emits: ["close"],
25
+ setup(e, { emit: t }) {
26
+ let { logMessage: s } = _(), a = e, n = t, o = p(a.url), y = b(() => A(o.value) ? o.value : "");
27
+ I(() => a.url, (r) => {
28
+ o.value = r;
29
+ }), D(() => {
30
+ window.addEventListener("message", h);
31
+ }), v(() => {
32
+ window.removeEventListener("message", h);
33
+ });
34
+ function h(r) {
35
+ var c;
36
+ if (s("PayGLocalThreeDsChallenge: Message received", r.data), !((c = r == null ? void 0 : r.data) != null && c["payglocal-token"])) return;
37
+ let i = r.data["payglocal-token"];
38
+ s("Token received", i);
39
+ let T = i.split(".")[1], w = window.atob(T), P = JSON.parse(w);
40
+ n("close", P);
41
+ }
42
+ return (r, i) => (R(), L("div", x, [d("div", M, [d("iframe", {
43
+ src: y.value,
44
+ sandbox: "allow-same-origin allow-scripts allow-popups allow-forms"
45
+ }, null, 8, Z)])]));
46
+ }
47
+ }), [["__scopeId", "data-v-9fa1282d"]]), O = class extends C {
48
+ getType() {
49
+ return "PayGLocal";
50
+ }
51
+ onPreAuth() {
52
+ var e, t;
53
+ this.log(`[${this.getType()}]: onPreAuth`), (e = this.threeDsProcessor) != null && e.getTokenId() ? this.threeDsProcessor.getGatewayData(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (s) => {
54
+ var a;
55
+ return this.initChallenge(((a = s.gatewayMetadata) == null ? void 0 : a.RedirectUrl) || "");
56
+ }, () => {
57
+ var s;
58
+ return (s = this.threeDsProcessor) == null ? void 0 : s.onError({ error: "Unable to get card information" });
59
+ }) : (t = this.threeDsProcessor) == null || t.tokeniseCard(this.threeDsProcessor.getProviderId(), (s) => {
60
+ this.log(`[${this.getType()}]: tokeniseCard`, s), this.initChallenge(s.gatewayTokenData.RedirectUrl);
61
+ }, (s) => {
62
+ g(this.container, s);
63
+ });
64
+ }
65
+ onAuth(e, t) {
66
+ }
67
+ onPostAuth() {
68
+ }
69
+ initChallenge(e) {
70
+ if (this.log(`[${this.getType()}]: initChallenge`, e), !e) {
71
+ g(this.container, "3D Secure URL is missing");
72
+ return;
73
+ }
74
+ this.setChallengeFrameVisible(!0);
75
+ let { destroy: t } = f({
76
+ el: document.body,
77
+ component: G,
78
+ props: { url: e },
79
+ on: { close: (s) => {
80
+ var a, n, o;
81
+ this.closeChallenge(), this.log(`[${this.getType()}]: Challenge Results`, s), s.status === "AUTHORIZED" ? (a = this.threeDsProcessor) == null || a.onSuccess({
82
+ acsRenderingType: {},
83
+ acsTransID: "",
84
+ authenticationType: "",
85
+ authenticationValue: "",
86
+ challengeCancel: "",
87
+ dsTransID: "",
88
+ eci: "",
89
+ interactionCounter: "",
90
+ messageCategory: "",
91
+ messageExtension: [],
92
+ messageType: "",
93
+ messageVersion: "",
94
+ threeDSRequestorTransID: "",
95
+ threeDSServerTransID: "",
96
+ transStatusReason: "",
97
+ transStatus: "Y"
98
+ }) : s.status === "CUSTOMER_CANCELLED" ? (n = this.threeDsProcessor) == null || n.onError({ error: "Challenge cancelled" }) : (o = this.threeDsProcessor) == null || o.onError({ error: E });
99
+ } }
100
+ });
101
+ this.threeDSDestroy = t;
102
+ }
103
+ };
104
+ function V(e, t, s) {
105
+ return new O(e, t, s);
106
+ }
107
+ export {
108
+ V as default
109
+ };
@@ -1,4 +1,4 @@
1
- import { PayWayAppleButton as p } from "./PayWayAppleButton-DESHrVB--dAz40mnI.js";
1
+ import { PayWayAppleButton as p } from "./PayWayAppleButton-C-XfcgNS-rgWe-QJM.js";
2
2
  function f(t, a, e, n, o, r) {
3
3
  return new p(t, a, e, n, o, r);
4
4
  }
@@ -0,0 +1,15 @@
1
+ import { w as r } from "./MetricsGlobalThreeDsProvider-B-EQQsEV-BYhakAA4.js";
2
+ var a = class extends r {
3
+ getType() {
4
+ return "SkyBank";
5
+ }
6
+ getDomain() {
7
+ return "secure.skybankgateway.com";
8
+ }
9
+ };
10
+ function s(e, t, n) {
11
+ return new a(e, t, n);
12
+ }
13
+ export {
14
+ s as default
15
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@payfurl/react-plugin",
3
3
  "private": false,
4
- "version": "1.3.0",
4
+ "version": "1.4.0",
5
5
  "description": "PayFURL React Plugin",
6
6
  "type": "module",
7
7
  "files": [
@@ -25,7 +25,7 @@
25
25
  "preview": "vite preview"
26
26
  },
27
27
  "dependencies": {
28
- "@payfurl/client": "^4.9.0"
28
+ "@payfurl/client": "^4.10.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": "^18.3.1",
@@ -44,6 +44,7 @@
44
44
  "typescript-eslint": "^8.11.0",
45
45
  "vite": "^5.4.10",
46
46
  "vite-plugin-css-injected-by-js": "^3.5.2",
47
- "vite-plugin-dts": "^4.3.0"
47
+ "vite-plugin-dts": "^4.3.0",
48
+ "vue-tsc": "^2.2.12"
48
49
  }
49
50
  }
@@ -1,12 +0,0 @@
1
- import { t as a } from "./MetricsGlobalThreeDsProvider-D3x5hiTk-Otm4rjjf.js";
2
- var r = class extends a {
3
- getType() {
4
- return "CxPay";
5
- }
6
- getDomain() {
7
- return "cxpay.transactiongateway.com";
8
- }
9
- };
10
- export {
11
- r as CxPayThreeDsProvider
12
- };
@@ -1,78 +0,0 @@
1
- var h = Object.defineProperty;
2
- var c = (t, e, a) => e in t ? h(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
3
- var n = (t, e, a) => c(t, typeof e != "symbol" ? e + "" : e, a);
4
- import { N as D, X as d, U as u, i as p, R as m, a as g, b as o, Z as v, t as S, e as y, D as T, Y as C, J as f } from "./index-BuqGcTyx.js";
5
- import { t as I } from "./DefaultThreeDsProvider-aIZr-d29-34xFFHE7.js";
6
- var P = { class: "mask" }, A = { class: "wrapper" }, b = { class: "container" }, R = ["action"], V = ["value"], F = /* @__PURE__ */ d(/* @__PURE__ */ u({
7
- __name: "ecentric",
8
- props: {
9
- threeDSServerTransID: {},
10
- acsTransID: {},
11
- formAction: {},
12
- authenticationValue: {}
13
- },
14
- setup(t) {
15
- let e = t, a = T(() => C(e.formAction) ? e.formAction : ""), i = f(null), l = e.authenticationValue;
16
- return p(() => {
17
- var s;
18
- a.value && ((s = i.value) == null || s.submit());
19
- }), (s, r) => (m(), g("div", P, [o("div", A, [o("div", b, [
20
- v(S, { onClick: r[0] || (r[0] = (_) => s.emit("close")) }),
21
- r[1] || (r[1] = o("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)),
22
- o("form", {
23
- action: a.value,
24
- target: "ThreeDsChallengeIFrame",
25
- method: "post",
26
- ref_key: "form",
27
- ref: i
28
- }, [o("input", {
29
- type: "hidden",
30
- name: "PaReq",
31
- value: y(l)
32
- }, null, 8, V)], 8, R)
33
- ])])]));
34
- }
35
- }), [["__scopeId", "data-v-8ededb9d"]]), U = class extends I {
36
- constructor() {
37
- super(...arguments);
38
- n(this, "paResPayload", "");
39
- }
40
- getType() {
41
- return "Ecentric";
42
- }
43
- onPostAuth() {
44
- var e;
45
- this.log(`[${this.getType()}][onPostAuth]`, {
46
- threeDSServerTransID: this.threeDSServerTransID,
47
- authenticationValue: this.paResPayload
48
- }), (e = this.threeDsProcessor) == null || e.onPostAuth({
49
- threeDSServerTransID: this.threeDSServerTransID,
50
- authenticationValue: this.paResPayload
51
- }, this.onSuccess, this.onError);
52
- }
53
- doChallenge(e, a, i) {
54
- this.log(`[${this.getType()}][doChallenge]`), this.setChallengeFrameVisible(!0);
55
- let { destroy: l } = D({
56
- el: document.body,
57
- component: F,
58
- props: {
59
- threeDSServerTransID: this.threeDSServerTransID,
60
- acsTransID: a,
61
- formAction: e,
62
- authenticationValue: i
63
- },
64
- on: { close: () => {
65
- var s;
66
- l(), this.setChallengeFrameVisible(!1), this.threeDSDestroy = () => {
67
- }, (s = this.threeDsProcessor) == null || s.onError({ error: "Challenge cancelled" });
68
- } }
69
- });
70
- this.threeDSDestroy = l;
71
- }
72
- challengeComplete(e) {
73
- 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"));
74
- }
75
- };
76
- export {
77
- U as EcentricThreeDsProvider
78
- };
@@ -1,12 +0,0 @@
1
- import { t as e } from "./MetricsGlobalThreeDsProvider-D3x5hiTk-Otm4rjjf.js";
2
- var t = class extends e {
3
- getType() {
4
- return "EPNA";
5
- }
6
- getDomain() {
7
- return "epna.transactiongateway.com";
8
- }
9
- };
10
- export {
11
- t as EpnaThreeDsProvider
12
- };
@@ -1,12 +0,0 @@
1
- import { t as a } from "./MetricsGlobalThreeDsProvider-D3x5hiTk-Otm4rjjf.js";
2
- var r = class extends a {
3
- getType() {
4
- return "FlashBanc";
5
- }
6
- getDomain() {
7
- return "flashbanc.transactiongateway.com";
8
- }
9
- };
10
- export {
11
- r as FlashBancThreeDsProvider
12
- };
@@ -1,149 +0,0 @@
1
- var A = Object.defineProperty;
2
- var f = (n, t, e) => t in n ? A(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var g = (n, t, e) => f(n, typeof t != "symbol" ? t + "" : t, e);
4
- import { s as T, h as d, k as L, N as x, f as N, X as _, U as G, i as I, j as $, l as H, V as F, R as M, a as U, b as m, Z as k, t as O, J as j } from "./index-BuqGcTyx.js";
5
- import { t as J } from "./DefaultThreeDsProvider-aIZr-d29-34xFFHE7.js";
6
- var R = { class: "mask" }, V = { class: "wrapper" }, W = { class: "container" }, X = /* @__PURE__ */ _(/* @__PURE__ */ G({
7
- __name: "MetricsGlobalThreeDsChallenge",
8
- emits: ["close", "submit"],
9
- setup(n, { emit: t }) {
10
- let e = t, s = j(!1);
11
- function r(l) {
12
- var a;
13
- ["3DS_CHALLENGE_SHOW", "3DS_CHALLENGE_CLOSE"].includes((a = l.data) == null ? void 0 : a.message) && (s.value = l.data.message === "3DS_CHALLENGE_SHOW");
14
- }
15
- return I(() => {
16
- window.addEventListener("message", r);
17
- }), $(() => {
18
- window.removeEventListener("message", r);
19
- }), (l, a) => H((M(), U("div", R, [m("div", V, [m("div", W, [k(O, {
20
- onClick: a[0] || (a[0] = (p) => e("close")),
21
- id: "3ds-challenge-close"
22
- }), a[1] || (a[1] = m("div", { id: "ThreeDsChallengeIFrame" }, null, -1))])])], 512)), [[F, s.value]]);
23
- }
24
- }), [["__scopeId", "data-v-8a0b6dcb"]]), B = /* @__PURE__ */ T({ MetricsGlobalThreeDsProvider: () => z }), { hideSpinner: h, showSpinner: Z } = N(), u = 5, z = class extends J {
25
- constructor(t, e, s) {
26
- var r;
27
- super(t, e, s);
28
- g(this, "gateway");
29
- g(this, "threeDS");
30
- g(this, "numAttempts", 0);
31
- this.initScript(((r = s.clientParameters) == null ? void 0 : r.PublicKey) || "");
32
- }
33
- getType() {
34
- return "MetricsGlobal";
35
- }
36
- getDomain() {
37
- return "secure.metricsglobalgateway.com";
38
- }
39
- onPreAuth() {
40
- var t, e;
41
- if (this.log(`[${this.getType()}]: onPreAuth`), !this.threeDS && this.numAttempts >= u) {
42
- h(), d(this.container, "Error loading 3D Secure");
43
- return;
44
- }
45
- if (!this.threeDS && this.numAttempts < u) {
46
- this.numAttempts++, this.log(`[${this.getType()}]: 3DS not ready, retrying in 1s`), setTimeout(() => this.onPreAuth(), 1e3);
47
- return;
48
- }
49
- (t = this.threeDsProcessor) != null && t.getTokenId() ? (e = this.threeDsProcessor) == null || e.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (s) => {
50
- var r;
51
- (r = this.threeDsProcessor) == null || r.setPaymentInfo(s), this.startAuth();
52
- }, () => {
53
- d(this.container, "Unable to get card information");
54
- }) : this.startAuth();
55
- }
56
- onAuth(t, e) {
57
- }
58
- onPostAuth() {
59
- }
60
- startAuth() {
61
- var D, y, w, C, S, E, P;
62
- this.log(`[${this.getType()}]: startAuth`);
63
- let t = (D = this.threeDsProcessor) == null ? void 0 : D.getPaymentInfo();
64
- if (!t) {
65
- h(), d(this.container, "Payment information is missing");
66
- return;
67
- }
68
- Z();
69
- let e = (y = this.threeDsProcessor) == null ? void 0 : y.getAddressInfo(), s = t.expiryDate.length === 4 ? t.expiryDate.slice(2, 4) : "", r = t.expiryDate.length === 4 ? t.expiryDate.slice(0, 2) : "", [l = "", a = ""] = ((w = t.cardholder) == null ? void 0 : w.split(/\s+/)) || [], p = ((C = this.threeDsProcessor) == null ? void 0 : C.getCurrency()) || "", b = ((S = this.threeDsProcessor) == null ? void 0 : S.getAmount()) || 0;
70
- if (!s || !r) {
71
- h(), d(this.container, "Card expiry date is invalid"), (E = this.threeDsProcessor) == null || E.onError({ error: "Card expiry date is invalid" });
72
- return;
73
- }
74
- let v = {
75
- cardNumber: t.cardNumber,
76
- cardExpMonth: s,
77
- cardExpYear: String(parseInt(r, 10) + 2e3),
78
- currency: p,
79
- amount: b.toFixed(2),
80
- email: (P = this.threeDsProcessor) == null ? void 0 : P.getEmail(),
81
- phone: e == null ? void 0 : e.phoneNumber,
82
- city: e == null ? void 0 : e.city,
83
- state: e == null ? void 0 : e.state,
84
- address1: e == null ? void 0 : e.streetAddress,
85
- country: e == null ? void 0 : e.country,
86
- firstName: (e == null ? void 0 : e.firstName) || l || "payFURL",
87
- lastName: (e == null ? void 0 : e.lastName) || a || "payFURL",
88
- postalCode: e == null ? void 0 : e.postalCode,
89
- deviceChannel: "02",
90
- browserJavascriptEnabled: !0,
91
- browserJavaEnabled: !1,
92
- browserLanguage: window.navigator.language,
93
- browserColorDepth: String(L()),
94
- browserScreenHeight: String(screen.height),
95
- browserScreenWidth: String(screen.width),
96
- browserTimeZone: String(Math.round((/* @__PURE__ */ new Date()).getTimezoneOffset() / 60)),
97
- userAgent: navigator.userAgent
98
- }, c = this.threeDS.createUI(v);
99
- c.start("#ThreeDsChallengeIFrame"), c.on("challenge", (i) => {
100
- this.log(`[${this.getType()}][onChallenge]`, i), h(), this.showChallenge();
101
- }), c.on("complete", (i) => {
102
- var o;
103
- this.log(`[${this.getType()}][onComplete]`, i), this.removeChallenge(), (o = this.threeDsProcessor) == null || o.onSuccess({ externalThreeDsData: i });
104
- }), c.on("failure", (i) => {
105
- var o;
106
- this.log(`[${this.getType()}][onFailure]`, i), h(), this.closeChallenge(), (o = this.threeDsProcessor) == null || o.onError({ error: i.message });
107
- }), c.on("error", (i) => {
108
- var o;
109
- this.log(`[${this.getType()}][error]`, i), h(), this.closeChallenge(), (o = this.threeDsProcessor) == null || o.onError({ error: i.message });
110
- });
111
- }
112
- initScript(t) {
113
- let e = document.createElement("script");
114
- e.type = "text/javascript", e.src = `https://${this.getDomain()}/js/v1/Gateway.js`, e.onload = () => {
115
- this.initGateway(t), this.initChallenge();
116
- }, document.head.appendChild(e);
117
- }
118
- initGateway(t) {
119
- this.gateway = window.Gateway.create(t), this.threeDS = this.gateway.get3DSecure(), this.gateway.on("error", (e) => {
120
- var s;
121
- this.log(`[${this.getType()}]: gateway error`, e), (s = this.threeDsProcessor) == null || s.onError({ error: e.message }), this.threeDS = null, this.numAttempts = u;
122
- });
123
- }
124
- initChallenge() {
125
- let { destroy: t } = x({
126
- el: document.body,
127
- component: X,
128
- on: { close: () => {
129
- var e;
130
- this.closeChallenge(), (e = this.threeDsProcessor) == null || e.onError({ error: "Challenge cancelled" });
131
- } }
132
- });
133
- this.threeDSDestroy = t;
134
- }
135
- showChallenge() {
136
- this.setChallengeFrameVisible(!0), window.postMessage({ message: "3DS_CHALLENGE_SHOW" }, "*");
137
- }
138
- closeChallenge() {
139
- this.setChallengeFrameVisible(!1), window.postMessage({ message: "3DS_CHALLENGE_CLOSE" }, "*");
140
- }
141
- removeChallenge() {
142
- var t;
143
- (t = this.threeDSDestroy) == null || t.call(this);
144
- }
145
- };
146
- export {
147
- B as n,
148
- z as t
149
- };
@@ -1,12 +0,0 @@
1
- import { t as e } from "./MetricsGlobalThreeDsProvider-D3x5hiTk-Otm4rjjf.js";
2
- var t = class extends e {
3
- getType() {
4
- return "NMI";
5
- }
6
- getDomain() {
7
- return "secure.nmi.com";
8
- }
9
- };
10
- export {
11
- t as NmiThreeDsProvider
12
- };
@@ -1,164 +0,0 @@
1
- var p = Object.defineProperty;
2
- var m = (n, s, a) => s in n ? p(n, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[s] = a;
3
- var h = (n, s, a) => m(n, typeof s != "symbol" ? s + "" : s, a);
4
- import { h as g, K as c, N as D, f as d, X as S, U as y, i as P, R as T, a as f, b as l } from "./index-BuqGcTyx.js";
5
- import { t as v } from "./DefaultThreeDsProvider-aIZr-d29-34xFFHE7.js";
6
- var N = { class: "mask" }, I = /* @__PURE__ */ S(/* @__PURE__ */ y({
7
- __name: "nuvei",
8
- props: {
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: {}
23
- },
24
- setup(n) {
25
- let { hideSpinner: s, showSpinner: a } = d(), e = n;
26
- P(() => {
27
- a();
28
- let r = document.createElement("script");
29
- r.type = "text/javascript", r.src = "https://cdn.safecharge.com/safecharge_resources/v1/websdk/safecharge.js", r.onload = () => {
30
- let o = new MutationObserver(function() {
31
- document.getElementsByClassName("sfcModal-dialog")[0] && (s(), o.disconnect());
32
- }), i = { childList: !0 }, u = document.querySelector("body");
33
- o.observe(u, i), t();
34
- }, document.head.appendChild(r);
35
- });
36
- function t() {
37
- var r = SafeCharge({
38
- env: e.env,
39
- merchantId: e.merchantId,
40
- merchantSiteId: e.merchantSiteId
41
- });
42
- r.fields({
43
- fonts: [{ cssUrl: "https://fonts.googleapis.com/css?family=Source+Code+Pro" }],
44
- locale: "en"
45
- }), r.authenticate3d({
46
- sessionToken: e.sessionToken,
47
- paymentOption: { card: {
48
- cardNumber: e.cardNumber,
49
- cardHolderName: e.cardHolderName,
50
- expirationMonth: e.expirationMonth,
51
- expirationYear: e.expirationYear,
52
- CVV: e.CVV
53
- } },
54
- billingAddress: {
55
- firstName: e.firstName,
56
- lastName: e.lastName,
57
- email: e.email,
58
- country: e.country
59
- }
60
- }, function(o) {
61
- window.postMessage({
62
- status: "3ds_challenge_complete",
63
- cres: o
64
- }, "*");
65
- });
66
- }
67
- return (r, o) => (T(), f("div", N, [...o[0] || (o[0] = [l("div", { class: "wrapper" }, [l("div", { class: "container" })], -1)])]));
68
- }
69
- }), [["__scopeId", "data-v-3b52be97"]]), { hideSpinner: C } = d(), x = class extends v {
70
- constructor() {
71
- super(...arguments);
72
- h(this, "_paResPayload", null);
73
- h(this, "onSuccess", (s, a) => {
74
- var t, r;
75
- this.closeChallenge(), C();
76
- let e = JSON.parse(a);
77
- e.authenticationValue ? (t = this.threeDsProcessor) == null || t.onSuccess(e) : (this.log(`[${this.getType()}][_onSuccess] ${c}`, e), (r = this.threeDsProcessor) == null || r.onError({ error: c }));
78
- });
79
- h(this, "onDoAuthSuccess", (s, a) => {
80
- var t, r, o;
81
- let e = JSON.parse(a);
82
- if (this.log(`[${this.getType()}][onDoAuthSuccess]`, e), !e.transStatus || !e.authenticationValue) {
83
- this.onError(s, "No transStatus specified");
84
- return;
85
- }
86
- switch (e.transStatus) {
87
- case "C":
88
- this.doNuveiChallenge(e.authenticationValue, (t = this.threeDsProcessor) == null ? void 0 : t.getAddressInfo(), (r = this.threeDsProcessor) == null ? void 0 : r.getPaymentInfo());
89
- break;
90
- default:
91
- this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ` + e.transStatus), (o = this.threeDsProcessor) == null || o.onSuccess({
92
- threeDSServerTransID: e.threeDSServerTransID,
93
- threeDSRequestorTransID: "",
94
- acsRenderingType: e.acsRenderingType,
95
- acsTransID: e.acsTransID,
96
- authenticationType: e.authenticationType,
97
- authenticationValue: e.authenticationValue,
98
- challengeCancel: "",
99
- dsTransID: e.dsTransID,
100
- eci: e.eci,
101
- interactionCounter: "",
102
- messageCategory: "",
103
- messageExtension: e.messageExtension,
104
- messageType: e.messageType,
105
- messageVersion: e.messageVersion,
106
- transStatus: e.transStatus,
107
- transStatusReason: e.transStatusReason
108
- });
109
- }
110
- });
111
- }
112
- getType() {
113
- return "Nuvei";
114
- }
115
- onPreAuth() {
116
- var s, a;
117
- this.log(`[${this.getType()}]: onPreAuth`), (s = this.threeDsProcessor) != null && s.getTokenId() ? (a = this.threeDsProcessor) == null || a.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (e) => {
118
- var t;
119
- (t = this.threeDsProcessor) == null || t.setPaymentInfo(e), super.onPreAuth();
120
- }, () => {
121
- g(this.container, "Unable to get card information");
122
- }) : super.onPreAuth();
123
- }
124
- onPostAuth() {
125
- var s;
126
- this.log(`[${this.getType()}][onAuth] Do Post Authentication for transId`, this.threeDSServerTransID, this._paResPayload), (s = this.threeDsProcessor) == null || s.onPostAuth({
127
- threeDSServerTransID: this.threeDSServerTransID,
128
- authenticationValue: this._paResPayload.cavv,
129
- eci: this._paResPayload.eci,
130
- dsTransID: this._paResPayload.dsTransID,
131
- threeDsVersion: this._paResPayload.threeDVersion,
132
- xid: this._paResPayload.xid
133
- }, this.onSuccess, this.onError);
134
- }
135
- doNuveiChallenge(s, a, e) {
136
- var o;
137
- let t = JSON.parse(s);
138
- (t === null || !t.merchantId || !t.merchantSiteId) && ((o = this.threeDsProcessor) == null || o.onError({ error: c })), a && (t.firstName = a.firstName, t.lastName = a.lastName, t.email = a.email, t.country = a.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), this.setChallengeFrameVisible(!0);
139
- let { destroy: r } = D({
140
- el: document.body,
141
- component: I,
142
- props: t,
143
- on: { close: () => {
144
- var i;
145
- r(), this.setChallengeFrameVisible(!1), this.threeDSDestroy = () => {
146
- }, (i = this.threeDsProcessor) == null || i.onError({ error: "Challenge cancelled" });
147
- } }
148
- });
149
- this.threeDSDestroy = r;
150
- }
151
- messageHandler(s) {
152
- var a, e, t;
153
- if ((a = s == null ? void 0 : s.data) != null && a.status) {
154
- if (s.data.status === "3ds_method_invocation_complete") {
155
- this.log(`[${this.getType()}][messageHandler] 3Ds Method invocation complete`), s.stopPropagation(), this.onAuth(!0, "");
156
- return;
157
- }
158
- s.data.status === "3ds_challenge_complete" && (this.log(`[${this.getType()}][messageHandler] 3Ds Challenge complete`, s.data), s.stopPropagation(), this.closeChallenge(), s.data.cres && ((e = s.data.cres) == null ? void 0 : e.result) === "APPROVED" && ((t = s.data.cres) == null ? void 0 : t.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")));
159
- }
160
- }
161
- };
162
- export {
163
- x as NuveiThreeDsProvider
164
- };