@payfurl/client 4.5.5 → 4.5.6

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.
package/README.md CHANGED
@@ -1,27 +1,89 @@
1
1
  # payFURL client SDK
2
2
 
3
- Welcome to the payFURL client SDK.
3
+ The Client SDK is used to securely collect payment details in the browser.
4
+
5
+ The Client SDK will seamlessly plug into your existing payment page.
6
+ When it's initialised, it will securely load an iframe hosted by payFURL.
7
+ The iframe will collect the payment details, which will then be submitted to payFURL and converted to a payment token.
8
+ The payment token will be added as a hidden input to the form.
9
+ In case of PayPal or Buy Now Pay Later payments the payment details will be converted to a transactionId.
10
+ The transactionId will be added as a hidden input to the form.
11
+ Collecting the payment details is triggered when the form is submitted.
4
12
 
5
13
  ## Usage
6
14
 
7
15
  Read here:
8
16
  https://docs.payfurl.com/client_sdk/
9
17
 
18
+ Your `readme.md` file looks fine, but I can provide some improvements in formatting and clarity. Here's a revised version:
19
+
20
+
10
21
  ## Test Environment
11
22
 
12
- - create a file `src/sdk/config.local.ts` with the following content:
13
- ```
14
- export default {
15
- baseUrl: "http://localhost:3001",
16
- cssUrl: "http://localhost:3001/dist/sdk/",
17
- url: "http://localhost:3001/dist/iframe/",
18
- apiUrl: "https://localhost:5001",
19
- };
20
- ```
21
- - run `npm install`
22
- - run `npm run server`
23
- - run `npm run build-iframe`
24
- - run `npm run build-sdk`
23
+ ### Preparation
24
+
25
+ 1. Create a file `src/sdk/config.local.ts` with the following content:
26
+
27
+ ```typescript
28
+ export default {
29
+ baseUrl: "http://localhost:3001",
30
+ cssUrl: "http://localhost:3001/dist/sdk/",
31
+ url: "http://localhost:3001/dist/iframe/",
32
+ apiUrl: "https://localhost:5001",
33
+ redirectUrl: "http://localhost:3001/checkout/redirect.html"
34
+ };
35
+ ```
36
+
37
+ 2. Run the following commands in your project directory:
38
+
39
+ - `npm install`
40
+ - `npm run server`
41
+ - `npm run build-iframe`
42
+ - `npm run build-sdk`
43
+
44
+ ### Initialization
45
+
46
+ `sdk.html` is a simple page that loads the SDK and displays the result of the payment. To initialize the SDK, locate the following method in the `sdk.html` file:
47
+
48
+ ```javascript
49
+ const pf = payfurl.init(
50
+ "local", // environment name
51
+ "pubtestd8d074aceb5defec8f2d0b806292bf2b5f4179c69d-au", // public key
52
+ true // enable debug mode
53
+ );
54
+ ```
55
+
56
+ To run the SDK on your local machine, you need to have the corresponding API running in the local environment.
57
+
58
+ ### Switching between Environments
59
+
60
+ To switch between different environments, follow these steps:
61
+
62
+ 1. Update all parameters in the file `src/sdk/config.{environment}.ts` with the proper values.
63
+ 2. Run `npm run build-iframe`
64
+ 3. Run `npm run build-sdk`
65
+ 4. Change the environment name in the `payfurl.init` method.
66
+ 5. Run the API in the corresponding environment.
67
+
68
+ ### Using an External SDK
69
+
70
+ If you want to use an external SDK, replace this line in your `sdk.html`:
71
+
72
+ ```html
73
+ <script type="text/javascript" src="dist/sdk/payfurl.umd.js?v=4975"></script>
74
+ ```
75
+
76
+ with the desired version of the external SDK, for example:
77
+
78
+ ```html
79
+ <script type="text/javascript" src="https://assets.payfurl.com/v4.5.3.294/js/payfurl.js?v=4959"></script>
80
+ ```
81
+
82
+ Please note that <span style="color:red">**the external SDK cannot work with the local environment**</span>,
83
+ so ensure that the environment name in the `payfurl.init` method is
84
+ <span style="color:red">**NOT**</span> set to "local."
85
+
86
+ ### Running
25
87
  - open `http://localhost:3001/sdk.html` in your favorite browser
26
88
  - enjoy *
27
89
 
@@ -1,5 +1,5 @@
1
- import { d as v, r as A, o as C, a as y, c as R, b as c, e as b, C as U, u as w, p as k, f as N, _ as E, F as L, g as V } from "./main-fabca762.mjs";
2
- const M = (t) => (k("data-v-fa2e3c62"), t = t(), N(), t), q = { class: "mask" }, x = { class: "wrapper" }, O = { class: "container" }, F = /* @__PURE__ */ M(() => /* @__PURE__ */ c("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), J = ["action"], B = ["value"], $ = /* @__PURE__ */ v({
1
+ import { d as v, r as A, o as C, a as R, c as y, b as c, e as b, C as U, u as w, p as E, f as k, _ as N, F as L, T as M, g as V } from "./main-51eb0a17.mjs";
2
+ const O = (t) => (E("data-v-fa2e3c62"), t = t(), k(), t), q = { class: "mask" }, x = { class: "wrapper" }, F = { class: "container" }, J = /* @__PURE__ */ O(() => /* @__PURE__ */ c("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), B = ["action"], $ = ["value"], j = /* @__PURE__ */ v({
3
3
  __name: "ThreeDsChallenge",
4
4
  props: {
5
5
  threeDSServerTransID: null,
@@ -18,14 +18,14 @@ const M = (t) => (k("data-v-fa2e3c62"), t = t(), N(), t), q = { class: "mask" },
18
18
  return C(() => {
19
19
  var d;
20
20
  (d = o.value) == null || d.submit();
21
- }), (d, p) => (y(), R("div", q, [
21
+ }), (d, p) => (R(), y("div", q, [
22
22
  c("div", x, [
23
- c("div", O, [
23
+ c("div", F, [
24
24
  b(U, {
25
- onClick: p[0] || (p[0] = (Z) => n("close")),
25
+ onClick: p[0] || (p[0] = (P) => n("close")),
26
26
  id: "3ds-challenge-close"
27
27
  }),
28
- F,
28
+ J,
29
29
  c("form", {
30
30
  action: e.formAction,
31
31
  target: "ThreeDsChallengeIFrame",
@@ -37,31 +37,31 @@ const M = (t) => (k("data-v-fa2e3c62"), t = t(), N(), t), q = { class: "mask" },
37
37
  type: "hidden",
38
38
  name: "creq",
39
39
  value: w(T)
40
- }, null, 8, B)
41
- ], 8, J)
40
+ }, null, 8, $)
41
+ ], 8, B)
42
42
  ])
43
43
  ])
44
44
  ]));
45
45
  }
46
46
  });
47
- const j = /* @__PURE__ */ E($, [["__scopeId", "data-v-fa2e3c62"]]);
48
- let h = null, D, Y = null, a = null, m = "", i = "", g = "", z, l = null;
47
+ const Y = /* @__PURE__ */ N(j, [["__scopeId", "data-v-fa2e3c62"]]);
48
+ let h = null, D, z = null, a = null, m = "", i = "", _ = "", G, l = null;
49
49
  function s(t, ...n) {
50
50
  h && h(t, n);
51
51
  }
52
52
  function H() {
53
- s("init authentication"), a == null || a.onPreAuth(K, r), window.addEventListener("message", I);
53
+ s("init authentication"), a == null || a.onPreAuth(Q, r), window.addEventListener("message", I);
54
54
  }
55
55
  function S(t) {
56
- s("Do Authentication for transId", i, t), a == null || a.onAuth(g, m, i, t, Q, r);
56
+ s("Do Authentication for transId", i, t), a == null || a.onAuth(_, m, i, t, X, r);
57
57
  }
58
- function _() {
59
- s("Do Post Authentication for transId", i), a == null || a.onPostAuth({ threeDSServerTransID: i }, G, r);
58
+ function g() {
59
+ s("Do Post Authentication for transId", i), a == null || a.onPostAuth({ threeDSServerTransID: i }, W, r);
60
60
  }
61
- function W(t, n) {
61
+ function K(t, n) {
62
62
  const { destroy: e } = V({
63
63
  el: document.body,
64
- component: j,
64
+ component: Y,
65
65
  props: {
66
66
  threeDSServerTransID: i,
67
67
  acsTransID: n,
@@ -84,18 +84,18 @@ const r = (t, n) => {
84
84
  return;
85
85
  }
86
86
  a == null || a.onError({ error: "3D Secure failed", body: n });
87
- }, G = (t, n) => {
87
+ }, W = (t, n) => {
88
88
  f();
89
89
  const e = JSON.parse(n);
90
90
  ["Y", "A"].includes(e.transStatus) ? a == null || a.onSuccess(e) : (s("3D Secure failed", e), a == null || a.onError({ error: "3D Secure failed" }));
91
- }, K = (t, n) => {
91
+ }, Q = (t, n) => {
92
92
  const e = JSON.parse(n);
93
- if (s("[onInitAuthSuccess]", e), m = e.threeDSRequestorTransID, i = e.threeDSServerTransID, e.threeDSMonitorURL, g = e.threeDSAuthURL, e.threeDSMethodURL) {
94
- X(e.threeDSServerTransID, e.threeDSMethodURL);
93
+ if (s("[onInitAuthSuccess]", e), m = e.threeDSRequestorTransID, i = e.threeDSServerTransID, e.threeDSMonitorURL, _ = e.threeDSAuthURL, e.threeDSMethodURL) {
94
+ Z(e.threeDSServerTransID, e.threeDSMethodURL);
95
95
  return;
96
96
  }
97
97
  S(!1);
98
- }, Q = (t, n) => {
98
+ }, X = (t, n) => {
99
99
  const e = JSON.parse(n);
100
100
  if (s("[onDoAuthSuccess]", e), !e.transStatus) {
101
101
  r(t, "No transStatus specified");
@@ -107,7 +107,7 @@ const r = (t, n) => {
107
107
  r(t, "Invalid Challenge Url");
108
108
  return;
109
109
  }
110
- W(e.acsURL, e.acsTransID);
110
+ K(e.acsURL, e.acsTransID);
111
111
  break;
112
112
  case "N":
113
113
  s("[threeDsAuth], 3DS Verification failed, transaction denied"), r(400, "3DS Verification failed, transaction denied");
@@ -140,7 +140,7 @@ const r = (t, n) => {
140
140
  break;
141
141
  }
142
142
  };
143
- function X(t, n) {
143
+ function Z(t, n) {
144
144
  s("[threeDsMethodInvoke]", { threeDSServerTransID: t, threeDSMethodURL: n });
145
145
  const e = {
146
146
  threeDSServerTransID: t,
@@ -152,7 +152,7 @@ function X(t, n) {
152
152
  }
153
153
  function I(t) {
154
154
  var n, e;
155
- if (!(!((n = t == null ? void 0 : t.data) != null && n.status) || ((e = t == null ? void 0 : t.data) == null ? void 0 : e.status) === "failure")) {
155
+ if (!(!((n = t == null ? void 0 : t.data) != null && n.status) || ((e = t == null ? void 0 : t.data) == null ? void 0 : e.status) === M)) {
156
156
  if (t.data.status === "3ds_method_invocation_complete") {
157
157
  s("3Ds Method invocation complete"), t.stopPropagation(), S(!0);
158
158
  return;
@@ -160,20 +160,20 @@ function I(t) {
160
160
  if (t.data.status === "3ds_challenge_complete") {
161
161
  s("3Ds Challenge complete", t.data), t.stopPropagation(), f();
162
162
  const o = JSON.parse(window.atob(t.data.cres));
163
- s("cresData", o), ["Y", "A"].includes(o.transStatus) ? _() : ["N", "U", "R"].includes(o.transStatus) && (s("Failed 3DS Challenge", t.data), r(400, "Failed 3DS Challenge"));
163
+ s("cresData", o), ["Y", "A"].includes(o.transStatus) ? g() : ["N", "U", "R"].includes(o.transStatus) && (s("Failed 3DS Challenge", t.data), r(400, "Failed 3DS Challenge"));
164
164
  }
165
165
  }
166
166
  }
167
- function ee(t, n, e, o) {
168
- return h = t, Y = n, z = e || document.body, D = o, {
167
+ function te(t, n, e, o) {
168
+ return h = t, z = n, G = e || document.body, D = o, {
169
169
  onPreAuth: H,
170
170
  onAuth: S,
171
- onPostAuth: _,
171
+ onPostAuth: g,
172
172
  setThreeDsProcessor: (u) => {
173
173
  a = u;
174
174
  }
175
175
  };
176
176
  }
177
177
  export {
178
- ee as default
178
+ te as default
179
179
  };
@@ -1,5 +1,5 @@
1
- import { d as A, r as v, o as C, a as R, c as y, b as c, e as b, C as U, u as k, p as V, f as w, _ as E, F as L, g as N } from "./main-fabca762.mjs";
2
- const M = (t) => (V("data-v-a55c9c23"), t = t(), w(), t), x = { class: "mask" }, F = { class: "wrapper" }, q = { class: "container" }, O = /* @__PURE__ */ M(() => /* @__PURE__ */ c("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), J = ["action"], B = ["value"], j = /* @__PURE__ */ A({
1
+ import { d as T, r as A, o as R, a as v, c as C, b as u, e as y, C as U, u as b, p as k, f as E, _ as V, F as w, T as L, g as N } from "./main-51eb0a17.mjs";
2
+ const M = (t) => (k("data-v-40c9c2c1"), t = t(), E(), t), F = { class: "mask" }, x = { class: "wrapper" }, O = { class: "container" }, q = /* @__PURE__ */ M(() => /* @__PURE__ */ u("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), J = ["action"], B = ["value"], j = /* @__PURE__ */ T({
3
3
  __name: "ecentric",
4
4
  props: {
5
5
  threeDSServerTransID: null,
@@ -7,30 +7,29 @@ const M = (t) => (V("data-v-a55c9c23"), t = t(), w(), t), x = { class: "mask" },
7
7
  formAction: null,
8
8
  authenticationValue: null
9
9
  },
10
- emits: ["close", "submit"],
11
- setup(t, { emit: n }) {
12
- const e = t, s = v(null), l = e.authenticationValue;
13
- return C(() => {
14
- var d;
15
- (d = s.value) == null || d.submit();
16
- }), (d, m) => (R(), y("div", x, [
17
- c("div", F, [
18
- c("div", q, [
19
- b(U, {
20
- onClick: m[0] || (m[0] = (Z) => n("close"))
10
+ setup(t) {
11
+ const n = t, e = A(null), r = n.authenticationValue;
12
+ return R(() => {
13
+ var i;
14
+ (i = e.value) == null || i.submit();
15
+ }), (i, p) => (v(), C("div", F, [
16
+ u("div", x, [
17
+ u("div", O, [
18
+ y(U, {
19
+ onClick: p[0] || (p[0] = (Z) => i.emit("close"))
21
20
  }),
22
- O,
23
- c("form", {
24
- action: e.formAction,
21
+ q,
22
+ u("form", {
23
+ action: n.formAction,
25
24
  target: "ThreeDsChallengeIFrame",
26
25
  method: "post",
27
26
  ref_key: "form",
28
- ref: s
27
+ ref: e
29
28
  }, [
30
- c("input", {
29
+ u("input", {
31
30
  type: "hidden",
32
31
  name: "PaReq",
33
- value: k(l)
32
+ value: b(r)
34
33
  }, null, 8, B)
35
34
  ], 8, J)
36
35
  ])
@@ -38,76 +37,76 @@ const M = (t) => (V("data-v-a55c9c23"), t = t(), w(), t), x = { class: "mask" },
38
37
  ]));
39
38
  }
40
39
  });
41
- const $ = /* @__PURE__ */ E(j, [["__scopeId", "data-v-a55c9c23"]]);
42
- let h = null, D, H = null, a = null, _ = "", i = "", g = "", Y, u = null, S = "";
40
+ const $ = /* @__PURE__ */ V(j, [["__scopeId", "data-v-40c9c2c1"]]);
41
+ let d = null, m, G = null, a = null, D = "", c = "", _ = "", H, l = null, h = "";
43
42
  function o(t, ...n) {
44
- h && h(t, n);
43
+ d && d(t, n);
45
44
  }
46
- function z() {
47
- o("init authentication"), a == null || a.onPreAuth(Q, r), window.addEventListener("message", T);
45
+ function K() {
46
+ o("init authentication"), a == null || a.onPreAuth(Q, s), window.addEventListener("message", g);
48
47
  }
49
- function f(t) {
50
- o("Do Authentication for transId", i, t), a == null || a.onAuth(g, _, i, t, W, r);
48
+ function S(t) {
49
+ o("Do Authentication for transId", c, t), a == null || a.onAuth(_, D, c, t, W, s);
51
50
  }
52
51
  function I() {
53
- o("Do Post Authentication for transId", i, S), a == null || a.onPostAuth({ threeDSServerTransID: i, authenticationValue: S }, K, r);
52
+ o("Do Post Authentication for transId", c, h), a == null || a.onPostAuth({ threeDSServerTransID: c, authenticationValue: h }, z, s);
54
53
  }
55
- function G(t, n, e) {
56
- const { destroy: s } = N({
54
+ function Y(t, n, e) {
55
+ const { destroy: r } = N({
57
56
  el: document.body,
58
57
  component: $,
59
58
  props: {
60
- threeDSServerTransID: i,
59
+ threeDSServerTransID: c,
61
60
  acsTransID: n,
62
61
  formAction: t,
63
62
  authenticationValue: e
64
63
  },
65
64
  on: {
66
65
  close: () => {
67
- s(), u = null, a == null || a.onError({ error: "Challenge cancelled" });
66
+ r(), l = null, a == null || a.onError({ error: "Challenge cancelled" });
68
67
  }
69
68
  }
70
69
  });
71
- u = s;
70
+ l = r;
72
71
  }
73
- function p() {
74
- u == null || u(), window.removeEventListener("message", T);
72
+ function f() {
73
+ l == null || l(), window.removeEventListener("message", g);
75
74
  }
76
- const r = (t, n) => {
77
- p(), a == null || a.onError({ error: "3D Secure failed", body: n });
78
- }, K = (t, n) => {
79
- p();
75
+ const s = (t, n) => {
76
+ f(), a == null || a.onError({ error: "3D Secure failed", body: n });
77
+ }, z = (t, n) => {
78
+ f();
80
79
  const e = JSON.parse(n);
81
80
  ["Y", "A"].includes(e.transStatus) ? a == null || a.onSuccess(e) : (o("3D Secure failed", e), a == null || a.onError({ error: "3D Secure failed" }));
82
81
  }, Q = (t, n) => {
83
82
  const e = JSON.parse(n);
84
- if (o("[onInitAuthSuccess]", e), _ = e.threeDSRequestorTransID, i = e.threeDSServerTransID, e.threeDSMonitorURL, g = e.threeDSAuthURL, e.threeDSMethodURL) {
83
+ if (o("[onInitAuthSuccess]", e), D = e.threeDSRequestorTransID, c = e.threeDSServerTransID, e.threeDSMonitorURL, _ = e.threeDSAuthURL, e.threeDSMethodURL) {
85
84
  X(e.threeDSServerTransID, e.threeDSMethodURL);
86
85
  return;
87
86
  }
88
- f(!1);
87
+ S(!1);
89
88
  }, W = (t, n) => {
90
89
  const e = JSON.parse(n);
91
90
  if (o("[onDoAuthSuccess]", e), !e.transStatus) {
92
- r(t, "No transStatus specified");
91
+ s(t, "No transStatus specified");
93
92
  return;
94
93
  }
95
94
  switch (e.transStatus) {
96
95
  case "C":
97
96
  if (!e.acsURL) {
98
- r(t, "Invalid Challenge Url");
97
+ s(t, "Invalid Challenge Url");
99
98
  return;
100
99
  }
101
- G(e.acsURL, e.acsTransID, e.authenticationValue);
100
+ Y(e.acsURL, e.acsTransID, e.authenticationValue);
102
101
  break;
103
102
  case "N":
104
- o("[threeDsAuth], 3DS Verification failed, transaction denied"), r(400, "3DS Verification failed, transaction denied");
103
+ o("[threeDsAuth], 3DS Verification failed, transaction denied"), s(400, "3DS Verification failed, transaction denied");
105
104
  break;
106
105
  case "U":
107
- o("[threeDsAuth], Unable to perform 3DS verification"), r(400, "Unable to perform 3DS verification");
106
+ o("[threeDsAuth], Unable to perform 3DS verification"), s(400, "Unable to perform 3DS verification");
108
107
  break;
109
108
  case "R":
110
- o("[threeDsAuth], Unable to perform 3DS verification, rejected at issuer"), r(400, "Unable to perform 3DS verification, rejected at issuer");
109
+ o("[threeDsAuth], Unable to perform 3DS verification, rejected at issuer"), s(400, "Unable to perform 3DS verification, rejected at issuer");
111
110
  break;
112
111
  default:
113
112
  o("[threeDsAuth], 3DS challenge not required, tranStatus: " + e.transStatus), a == null || a.onSuccess({
@@ -135,29 +134,29 @@ function X(t, n) {
135
134
  o("[threeDsMethodInvoke]", { threeDSServerTransID: t, threeDSMethodURL: n });
136
135
  const e = {
137
136
  threeDSServerTransID: t,
138
- threeDSMethodNotificationURL: D + "/3ds/method_invocation"
139
- }, s = encodeURI(window.btoa(JSON.stringify(e)).replace(/=*$/, ""));
140
- new L().invoke(n, "POST", {
141
- threeDSMethodData: s
137
+ threeDSMethodNotificationURL: m + "/3ds/method_invocation"
138
+ }, r = encodeURI(window.btoa(JSON.stringify(e)).replace(/=*$/, ""));
139
+ new w().invoke(n, "POST", {
140
+ threeDSMethodData: r
142
141
  });
143
142
  }
144
- function T(t) {
143
+ function g(t) {
145
144
  var n, e;
146
- if (!(!((n = t == null ? void 0 : t.data) != null && n.status) || ((e = t == null ? void 0 : t.data) == null ? void 0 : e.status) === "failure")) {
145
+ if (!(!((n = t == null ? void 0 : t.data) != null && n.status) || ((e = t == null ? void 0 : t.data) == null ? void 0 : e.status) === L)) {
147
146
  if (t.data.status === "3ds_method_invocation_complete") {
148
- o("3Ds Method invocation complete"), t.stopPropagation(), f(!0);
147
+ o("3Ds Method invocation complete"), t.stopPropagation(), S(!0);
149
148
  return;
150
149
  }
151
- t.data.status === "3ds_challenge_complete" && (o("3Ds Challenge complete", t.data), t.stopPropagation(), p(), o("cresData", t.data.cres), t.data.cres ? (S = t.data.cres, I()) : (o("Failed 3DS Challenge", t.data), r(400, "Failed 3DS Challenge")));
150
+ t.data.status === "3ds_challenge_complete" && (o("3Ds Challenge complete", t.data), t.stopPropagation(), f(), o("cresData", t.data.cres), t.data.cres ? (h = t.data.cres, I()) : (o("Failed 3DS Challenge", t.data), s(400, "Failed 3DS Challenge")));
152
151
  }
153
152
  }
154
- function ee(t, n, e, s) {
155
- return h = t, H = n, Y = e || document.body, D = s, {
156
- onPreAuth: z,
157
- onAuth: f,
153
+ function ee(t, n, e, r) {
154
+ return d = t, G = n, H = e || document.body, m = r, {
155
+ onPreAuth: K,
156
+ onAuth: S,
158
157
  onPostAuth: I,
159
- setThreeDsProcessor: (l) => {
160
- a = l;
158
+ setThreeDsProcessor: (i) => {
159
+ a = i;
161
160
  }
162
161
  };
163
162
  }
@@ -0,0 +1,141 @@
1
+ import { d as v, a as I, c as R, b as f, _ as g, g as y, H as D, T as E } from "./main-51eb0a17.mjs";
2
+ import { getEmptySuccessThreeDsPostAuthResponse as T } from "./ThreeDsPostAuthResponse.type-3091950f.mjs";
3
+ const U = { class: "mask" }, L = { class: "wrapper" }, N = { class: "container" }, k = ["src"], b = /* @__PURE__ */ v({
4
+ __name: "GPayments",
5
+ props: {
6
+ url: null
7
+ },
8
+ setup(t) {
9
+ const a = t;
10
+ return (e, u) => (I(), R("div", U, [
11
+ f("div", L, [
12
+ f("div", N, [
13
+ f("iframe", {
14
+ src: a.url
15
+ }, null, 8, k)
16
+ ])
17
+ ])
18
+ ]));
19
+ }
20
+ });
21
+ const C = /* @__PURE__ */ g(b, [["__scopeId", "data-v-7e1050e4"]]);
22
+ let p = null, w, M = null, n = null, _ = "", c = "", h = "", O, i = null;
23
+ function r(t, ...a) {
24
+ p && p(t, a);
25
+ }
26
+ function x() {
27
+ r("init authentication"), n == null || n.onPreAuth(J, o);
28
+ }
29
+ function m() {
30
+ r("Do Authentication for transId", c), n == null || n.onAuth(h, _, c, !0, B, o);
31
+ }
32
+ function d() {
33
+ r("Do Post Authentication for transId", c), n == null || n.onPostAuth({ threeDSServerTransID: c }, H, o);
34
+ }
35
+ function G(t) {
36
+ const { destroy: a } = y({
37
+ el: document.body,
38
+ component: C,
39
+ props: {
40
+ url: t
41
+ },
42
+ on: {
43
+ close: () => {
44
+ a(), i = null;
45
+ }
46
+ }
47
+ });
48
+ i = a, window.addEventListener("message", A);
49
+ }
50
+ function S() {
51
+ i == null || i(), window.removeEventListener("message", A);
52
+ }
53
+ const o = (t, a) => {
54
+ if (S(), t === 404) {
55
+ n == null || n.onError({ error: "This feature is only supported by ActiveServer v1.1.2+" });
56
+ return;
57
+ }
58
+ n == null || n.onError({ error: "3D Secure failed", body: a });
59
+ }, H = (t, a) => {
60
+ S();
61
+ const e = JSON.parse(a);
62
+ ["Y", "A"].includes(e.transStatus) ? n == null || n.onSuccess(e) : (r("3D Secure failed", e), n == null || n.onError({ error: "3D Secure failed" }));
63
+ }, J = (t, a) => {
64
+ const e = JSON.parse(a);
65
+ if (r("[onInitAuthSuccess]", e), !e.threeDSMethodAvailable) {
66
+ r("3DS Check is NOT available"), n == null || n.onSuccess(T());
67
+ return;
68
+ }
69
+ if (!e.threeDSAuthURL) {
70
+ o(t, "No AuthUrl specified");
71
+ return;
72
+ }
73
+ _ = e.threeDSRequestorTransID, c = e.threeDSServerTransID, e.threeDSMonitorURL, h = e.threeDSAuthURL, m();
74
+ }, B = (t, a) => {
75
+ const e = JSON.parse(a);
76
+ if (r("[onDoAuthSuccess]", e), !e.transStatus) {
77
+ o(t, "No transStatus specified");
78
+ return;
79
+ }
80
+ switch (e.transStatus) {
81
+ case "C":
82
+ if (!e.acsURL) {
83
+ o(t, "Invalid Challenge Url");
84
+ return;
85
+ }
86
+ G(e.acsURL);
87
+ break;
88
+ case "D":
89
+ if (!e.threeDSMonitorURL) {
90
+ o(t, "Invalid Result Mon Url");
91
+ return;
92
+ }
93
+ q(e.threeDSMonitorURL);
94
+ break;
95
+ default:
96
+ d();
97
+ break;
98
+ }
99
+ };
100
+ let l = null;
101
+ function q(t) {
102
+ if (l)
103
+ return;
104
+ const a = new D("", "", null);
105
+ l = setInterval(() => {
106
+ a.invoke(t, "GET", {}, (e, u) => {
107
+ const s = JSON.parse(u);
108
+ if (!s.event) {
109
+ r("Invalid mon url result", u);
110
+ return;
111
+ }
112
+ if (s.event === "AuthResultNotReady") {
113
+ r("AuthResultNotReady, retry in 2 seconds");
114
+ return;
115
+ } else
116
+ s.event === "AuthResultReady" ? (r("AuthResultReady", s), d()) : r("Invalid mon url result", s);
117
+ }, (e, u) => {
118
+ l && (clearInterval(l), l = null), o(e, "Invalid mon url result");
119
+ });
120
+ }, 2e3);
121
+ }
122
+ function A(t) {
123
+ var a, e;
124
+ if (!(!((a = t == null ? void 0 : t.data) != null && a.status) || ((e = t == null ? void 0 : t.data) == null ? void 0 : e.status) === E) && t.data.status === "3ds_challenge_complete") {
125
+ t.stopPropagation(), S(), r("3Ds Challenge complete", t.data), d();
126
+ return;
127
+ }
128
+ }
129
+ function V(t, a, e, u) {
130
+ return p = t, M = a, O = e || document.body, w = u, {
131
+ onPreAuth: x,
132
+ onAuth: m,
133
+ onPostAuth: d,
134
+ setThreeDsProcessor: (s) => {
135
+ n = s;
136
+ }
137
+ };
138
+ }
139
+ export {
140
+ V as default
141
+ };
@@ -0,0 +1,11 @@
1
+ <svg viewBox="0 0 480 127" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill="#ea001b"
3
+ d=" M 334.52 0.00 L 342.76 0.00 Q 362.22 1.68 377.33 13.35 Q 377.23 14.27 376.93 14.14 C 345.14 40.75 345.88 87.18 377.60 113.50 Q 362.22 125.32 342.84 127.00 L 334.23 127.00 C 281.45 122.47 256.08 60.31 291.58 20.82 Q 308.26 2.26 334.52 0.00 Z" />
4
+ <path fill="#f79f1a"
5
+ d=" M 412.58 0.00 L 421.00 0.00 C 453.20 3.09 477.40 27.07 480.00 59.34 L 480.00 67.73 C 477.03 99.97 453.02 124.53 420.61 127.00 L 412.67 127.00 Q 393.22 125.46 377.71 113.59 Q 402.46 92.35 401.68 61.47 C 401.19 41.80 392.26 26.17 377.65 13.48 Q 393.20 1.57 412.58 0.00 Z" />
6
+ <path fill="#000000"
7
+ d=" M 0.00 103.74 L 0.00 23.26 Q 2.71 9.47 14.47 5.49 Q 18.21 4.22 25.63 4.29 Q 36.12 4.39 46.57 4.28 Q 49.98 4.25 51.32 4.95 C 54.47 6.62 54.71 12.27 51.60 14.18 Q 50.30 14.99 47.25 15.02 Q 35.25 15.14 23.26 15.04 Q 14.82 14.97 12.04 21.22 Q 10.75 24.12 10.75 32.47 Q 10.77 64.65 10.78 96.84 C 10.79 108.05 13.62 112.09 24.83 112.11 Q 44.80 112.15 64.75 112.07 C 68.72 112.05 71.55 109.52 74.24 106.26 Q 91.06 85.85 108.91 64.44 A 0.86 0.86 0.0 0 0 108.91 63.34 Q 88.54 38.50 67.91 13.34 C 65.75 10.71 65.99 7.28 68.57 5.40 Q 70.05 4.32 73.59 4.32 Q 88.43 4.31 103.25 4.33 Q 105.90 4.33 107.17 5.80 Q 130.58 32.79 153.94 59.81 C 156.70 63.00 155.25 65.90 152.73 68.88 Q 134.57 90.29 116.24 111.71 A 0.35 0.35 0.0 0 0 116.51 112.29 L 132.44 112.24 A 1.43 1.43 0.0 0 0 133.55 111.71 L 172.96 63.93 A 0.83 0.83 0.0 0 0 172.96 62.87 Q 152.96 38.50 132.93 14.07 Q 131.33 12.10 131.02 10.69 C 130.23 7.08 133.94 3.44 137.37 4.33 Q 139.27 4.83 141.51 7.48 Q 163.74 33.77 186.06 59.98 Q 189.13 63.58 185.65 67.66 Q 162.44 94.91 139.34 121.71 A 3.12 3.10 20.2 0 1 137.01 122.78 Q 120.84 122.82 104.23 122.76 C 97.72 122.74 97.24 117.14 100.66 112.96 Q 120.69 88.51 140.71 64.30 A 0.99 0.99 0.0 0 0 140.71 63.04 L 101.46 15.56 A 1.23 1.23 0.0 0 0 100.51 15.11 L 84.28 15.01 A 0.39 0.39 0.0 0 0 83.98 15.65 Q 102.93 37.75 121.70 59.56 C 125.42 63.89 122.26 66.94 118.90 70.92 Q 99.67 93.66 80.30 116.30 Q 77.34 119.77 72.30 121.55 Q 68.93 122.74 63.06 122.75 Q 42.72 122.77 22.39 122.77 C 10.50 122.77 2.31 115.51 0.00 103.74 Z" />
8
+ <rect fill="#000000" x="228.78" y="4.23" width="4.98" height="118.76" rx="2.41" />
9
+ <path fill="#ff5f01"
10
+ d=" M 377.33 13.35 Q 378.26 13.56 377.65 13.48 C 392.26 26.17 401.19 41.80 401.68 61.47 Q 402.46 92.35 377.71 113.59 Q 378.27 113.54 377.60 113.50 C 345.88 87.18 345.14 40.75 376.93 14.14 Q 377.23 14.27 377.33 13.35 Z" />
11
+ </svg>