@payfurl/react-plugin 1.3.2 → 1.5.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 (43) hide show
  1. package/README.md +131 -0
  2. package/dist/{DefaultThreeDsProvider-ChnRLzKI-DO_0wVUN.js → DefaultThreeDsProvider-bLoDSnkd-CuWxvLku.js} +28 -44
  3. package/dist/MetricsGlobalThreeDsProvider-C93ttqbB-SRsVMed4.js +143 -0
  4. package/dist/{PayWayAppleButton-7Gi89Gij-aVF9l1aY.js → PayWayAppleButton-BzAwlGS--DB5BVl1o.js} +3 -13
  5. package/dist/components/PayfurlDropin.d.ts +22 -0
  6. package/dist/{cxpay-CGIndAf1-BblBk3-x.js → cxpay-DblHb5vN-C-l0lncv.js} +1 -1
  7. package/dist/{default-CgpOZU3K-CKDCWPRX.js → default-C7f86Fx--2njdEIN4.js} +1 -1
  8. package/dist/ecentric-B3UohyO_-XSxfe46h.js +82 -0
  9. package/dist/{epna-uXpYJKOA-B_n5GhIL.js → epna-DwUg2IlB-60mxqUE4.js} +1 -1
  10. package/dist/{flashbanc-9XKA8Wrl-CbS2P90X.js → flashbanc-LXs8bahL-z2X9avF_.js} +1 -1
  11. package/dist/forter-CLFaJUYa-0_gstIhb.js +36 -0
  12. package/dist/forter-DXQjpKVH-DaJPhK3m.js +57 -0
  13. package/dist/{gpayments-DsXj9xbu-BOBji_fr.js → gpayments-DoZug3PV-r91JBiIn.js} +15 -26
  14. package/dist/index-DxOlzt-Z.js +11576 -0
  15. package/dist/index.d.ts +3 -6
  16. package/dist/managedOrders-ojoMZ0Ab-B94-Nsp-.js +44 -0
  17. package/dist/metrics_global-BM-ooge--CapUrY7a.js +7 -0
  18. package/dist/{nmi-BzHX8wqW-Bq6oBsVL.js → nmi-BA3ZTdQa-DHWaU-52.js} +1 -1
  19. package/dist/nuvei-DIWsLlLz-Dnx1Hmez.js +165 -0
  20. package/dist/{payabli-C4YuB7Sr-BzB8PV73.js → payabli-DgrTI1Et-aNWdpC9M.js} +1 -1
  21. package/dist/payfurl-react.es.js +1 -1
  22. package/dist/payfurl-react.umd.js +19 -19
  23. package/dist/payglocal-ezp0MsaZ-CA7TeuKm.js +109 -0
  24. package/dist/{payway_rest-ZMjPv2si-Dd1VuLdw.js → payway_rest-D8-T-ULx-Dt-XGc-v.js} +1 -1
  25. package/dist/{skybank-C6ZmVyX6-DWxUPtI7.js → skybank-BgDLlFXX-BnauHbzw.js} +1 -1
  26. package/package.json +6 -4
  27. package/dist/MetricsGlobalThreeDsProvider-DW-gsG6q-BYJaEFfc.js +0 -148
  28. package/dist/ecentric-F3nn_MwX-B9dBXDe_.js +0 -81
  29. package/dist/forter-Bm2GJ2Hs-BABaUju5.js +0 -60
  30. package/dist/index-CACzT3Rb.js +0 -11783
  31. package/dist/metrics_global-L-Rm7bcl-DYSYHN2y.js +0 -7
  32. package/dist/nuvei-CS-nW8SB-v_HhomTx.js +0 -167
  33. package/dist/payglocal-Cy6Qd8ve-NfcHP9iv.js +0 -120
  34. package/dist/plugins/payfurl/react/src/components/PayfurlDropin.d.ts +0 -16
  35. package/dist/plugins/payfurl/react/src/index.d.ts +0 -6
  36. package/dist/src/click2pay/ClickToPayOptions.type.d.ts +0 -30
  37. package/dist/src/sdk/checkout/checkoutProvider.type.d.ts +0 -66
  38. package/dist/src/sdk/fraud/fraudProvider.type.d.ts +0 -3
  39. package/dist/src/sdk/types/DropInOptions.type.d.ts +0 -88
  40. package/dist/src/sdk/types/GooglePayButtonOptions.type.d.ts +0 -10
  41. package/dist/src/sdk/types/NetworkTokenOptions.type.d.ts +0 -6
  42. package/dist/src/sdk/types/PaymentType.type.d.ts +0 -15
  43. package/dist/src/sdk/types/UpiOptions.type.d.ts +0 -12
package/dist/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
- import PayfurlDropin from "./components/PayfurlDropin.tsx";
2
- import type { DropInOptionsType, DropInGooglePayOptionsType, DropInApplePayOptionsType } from "../../../../src/sdk/types/DropInOptions.type.ts";
3
- import type { UpiOptionsType } from "../../../../src/sdk/types/UpiOptions.type.ts";
4
- import type { ClickToPayOptionsType } from "../../../../src/click2pay/ClickToPayOptions.type.ts";
5
- import type { NetworkTokenOptionsType } from "../../../../src/sdk/types/NetworkTokenOptions.type.ts";
6
- export { PayfurlDropin, DropInOptionsType, UpiOptionsType, DropInGooglePayOptionsType, DropInApplePayOptionsType, ClickToPayOptionsType, NetworkTokenOptionsType };
1
+ import PayfurlDropin from "./components/PayfurlDropin";
2
+ export { PayfurlDropin };
3
+ export type { DropInOptionsType, UpiOptionsType, DropInGooglePayOptionsType, DropInApplePayOptionsType, ClickToPayOptionsType, NetworkTokenOptionsType, SuccessResponseType, FailureResponseType, PaymentMethodStatusType, ThreeDsProgressType, CustomerInfoType, AddressInfoType, OrderInfoType } from "@payfurl/client";
@@ -0,0 +1,44 @@
1
+ var E = /^[A-Za-z0-9]+$/, u = "v1.2", l = "checkoutTools__script", m = `https://sdk.checkouttools.com/${u}/managedOrders.js`;
2
+ function a() {
3
+ var r, e;
4
+ return typeof ((e = (r = window.checkoutTools) == null ? void 0 : r.managedOrders) == null ? void 0 : e.manageOrder) == "function";
5
+ }
6
+ function p(r) {
7
+ if (a()) return Promise.resolve();
8
+ let e = document.getElementById("checkoutTools__script") ?? g(r);
9
+ return new Promise((t, d) => {
10
+ e.addEventListener("load", () => t()), e.addEventListener("error", () => {
11
+ e.remove(), d(/* @__PURE__ */ Error("Forter managedOrders script failed to load"));
12
+ });
13
+ });
14
+ }
15
+ function g(r) {
16
+ let e = document.createElement("script");
17
+ return e.type = "text/javascript", e.id = l, e.setAttribute("data-site-id", r), e.src = m, e.addEventListener("load", () => {
18
+ e.dataset.loaded = "true";
19
+ }, { once: !0 }), document.getElementsByTagName("body")[0].appendChild(e), e;
20
+ }
21
+ function v(r, e, t) {
22
+ let d = () => {
23
+ };
24
+ if (a()) return c(r, e, t), d;
25
+ let o = document.getElementById(l);
26
+ if (!o) return t(/* @__PURE__ */ Error("Forter managedOrders script is not loaded")), d;
27
+ if (o.dataset.loaded) return t(/* @__PURE__ */ Error("Forter managedOrders script loaded without checkoutTools.managedOrders")), d;
28
+ let s = () => {
29
+ n(), a() ? c(r, e, t) : t(/* @__PURE__ */ Error("Forter managedOrders script loaded without checkoutTools.managedOrders"));
30
+ }, i = () => {
31
+ n(), t(/* @__PURE__ */ Error("Forter managedOrders script failed to load"));
32
+ }, n = () => {
33
+ o.removeEventListener("load", s), o.removeEventListener("error", i);
34
+ };
35
+ return o.addEventListener("load", s), o.addEventListener("error", i), n;
36
+ }
37
+ function c(r, e, t) {
38
+ window.checkoutTools.managedOrders.manageOrder(r, { challengeContainer: e ?? null }, t);
39
+ }
40
+ export {
41
+ p as a,
42
+ E as e,
43
+ v as s
44
+ };
@@ -0,0 +1,7 @@
1
+ import { w as n } from "./MetricsGlobalThreeDsProvider-C93ttqbB-SRsVMed4.js";
2
+ function f(t, r, e) {
3
+ return new n(t, r, e);
4
+ }
5
+ export {
6
+ f as default
7
+ };
@@ -1,4 +1,4 @@
1
- import { w as n } from "./MetricsGlobalThreeDsProvider-DW-gsG6q-BYJaEFfc.js";
1
+ import { w as n } from "./MetricsGlobalThreeDsProvider-C93ttqbB-SRsVMed4.js";
2
2
  var o = class extends n {
3
3
  getType() {
4
4
  return "NMI";
@@ -0,0 +1,165 @@
1
+ var m = Object.defineProperty;
2
+ var g = (n, t, a) => t in n ? m(n, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[t] = a;
3
+ var h = (n, t, a) => g(n, typeof t != "symbol" ? t + "" : t, a);
4
+ import { i as l, W as D, s as S, Z as y, h as p, a as I, Q as T, X as u, q as f } from "./index-DxOlzt-Z.js";
5
+ import { O as P } from "./DefaultThreeDsProvider-bLoDSnkd-CuWxvLku.js";
6
+ var v = { class: "mask" }, N = /* @__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
+ userPaymentOptionId: {},
20
+ userTokenId: {},
21
+ firstName: {},
22
+ lastName: {},
23
+ email: {},
24
+ country: {}
25
+ },
26
+ setup(n) {
27
+ let { hideSpinner: t, showSpinner: a } = p(), e = n;
28
+ I(() => {
29
+ a();
30
+ let r = document.createElement("script");
31
+ r.type = "text/javascript", r.src = "https://cdn.safecharge.com/safecharge_resources/v1/websdk/safecharge.js", r.onload = () => {
32
+ let o = new MutationObserver(function() {
33
+ document.getElementsByClassName("sfcModal-dialog")[0] && (t(), o.disconnect());
34
+ }), i = { childList: !0 }, c = document.querySelector("body");
35
+ o.observe(c, i), s();
36
+ }, document.head.appendChild(r);
37
+ });
38
+ function s() {
39
+ let r = window.SafeCharge({
40
+ env: e.env,
41
+ merchantId: e.merchantId,
42
+ merchantSiteId: e.merchantSiteId
43
+ });
44
+ r.fields({
45
+ fonts: [{ cssUrl: "https://fonts.googleapis.com/css?family=Source+Code+Pro" }],
46
+ locale: "en"
47
+ });
48
+ let o = e.userPaymentOptionId ? {
49
+ userPaymentOptionId: e.userPaymentOptionId,
50
+ ...e.CVV ? { card: { CVV: e.CVV } } : {}
51
+ } : { card: {
52
+ cardNumber: e.cardNumber,
53
+ cardHolderName: e.cardHolderName,
54
+ expirationMonth: e.expirationMonth,
55
+ expirationYear: e.expirationYear,
56
+ CVV: e.CVV
57
+ } };
58
+ r.authenticate3d({
59
+ sessionToken: e.sessionToken,
60
+ ...e.userTokenId ? { userTokenId: e.userTokenId } : {},
61
+ paymentOption: o,
62
+ billingAddress: {
63
+ firstName: e.firstName,
64
+ lastName: e.lastName,
65
+ email: e.email,
66
+ country: e.country
67
+ }
68
+ }, function(i) {
69
+ window.postMessage({
70
+ status: "3ds_challenge_complete",
71
+ cres: i
72
+ }, "*");
73
+ });
74
+ }
75
+ return (r, o) => (f(), T("div", v, [...o[0] || (o[0] = [u("div", { class: "wrapper" }, [u("div", { class: "container" })], -1)])]));
76
+ }
77
+ }), [["__scopeId", "data-v-299db412"]]), { hideSpinner: V } = p(), C = class extends P {
78
+ constructor() {
79
+ super(...arguments);
80
+ h(this, "_paResPayload", null);
81
+ h(this, "onSuccess", (t, a) => {
82
+ var s, r;
83
+ this.closeChallenge(), V();
84
+ let e = JSON.parse(a);
85
+ e.authenticationValue ? (s = this.threeDsProcessor) == null || s.onSuccess(e) : (this.log(`[${this.getType()}][_onSuccess] ${l}`, e), (r = this.threeDsProcessor) == null || r.onError({ error: l }));
86
+ });
87
+ h(this, "onDoAuthSuccess", (t, a) => {
88
+ var s, r, o;
89
+ let e = JSON.parse(a);
90
+ if (this.log(`[${this.getType()}][onDoAuthSuccess]`, e), !e.transStatus || !e.authenticationValue) this.onError(t, "No transStatus specified");
91
+ else switch (e.transStatus) {
92
+ case "C":
93
+ this.doNuveiChallenge(e.authenticationValue, (s = this.threeDsProcessor) == null ? void 0 : s.getAddressInfo(), (r = this.threeDsProcessor) == null ? void 0 : r.getPaymentInfo());
94
+ break;
95
+ default:
96
+ this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ` + e.transStatus), (o = this.threeDsProcessor) == null || o.onSuccess({
97
+ threeDSServerTransID: e.threeDSServerTransID,
98
+ threeDSRequestorTransID: "",
99
+ acsRenderingType: e.acsRenderingType,
100
+ acsTransID: e.acsTransID,
101
+ authenticationType: e.authenticationType,
102
+ authenticationValue: e.authenticationValue,
103
+ challengeCancel: "",
104
+ dsTransID: e.dsTransID,
105
+ eci: e.eci,
106
+ interactionCounter: "",
107
+ messageCategory: "",
108
+ messageExtension: e.messageExtension,
109
+ messageType: e.messageType,
110
+ messageVersion: e.messageVersion,
111
+ transStatus: e.transStatus,
112
+ transStatusReason: e.transStatusReason
113
+ });
114
+ }
115
+ });
116
+ }
117
+ getType() {
118
+ return "Nuvei";
119
+ }
120
+ onPostAuth() {
121
+ var t;
122
+ this.log(`[${this.getType()}][onAuth] Do Post Authentication for transId`, this.threeDSServerTransID, this._paResPayload), (t = this.threeDsProcessor) == null || t.onPostAuth({
123
+ threeDSServerTransID: this.threeDSServerTransID,
124
+ authenticationValue: this._paResPayload.cavv,
125
+ eci: this._paResPayload.eci,
126
+ dsTransID: this._paResPayload.dsTransID,
127
+ threeDsVersion: this._paResPayload.threeDVersion,
128
+ xid: this._paResPayload.xid
129
+ }, this.onSuccess, this.onError);
130
+ }
131
+ doNuveiChallenge(t, a, e) {
132
+ var o, i, c;
133
+ let s = JSON.parse(t);
134
+ if (s === null || !s.merchantId || !s.merchantSiteId) {
135
+ (o = this.threeDsProcessor) == null || o.onError({ error: l });
136
+ return;
137
+ }
138
+ if ((i = this.threeDsProcessor) != null && i.getTokenId() && !(s != null && s.userPaymentOptionId)) {
139
+ (c = this.threeDsProcessor) == null || c.onError({ error: "3D Secure with a token needs a token created on this Nuvei provider" });
140
+ return;
141
+ }
142
+ 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), this.setChallengeFrameVisible(!0);
143
+ let { destroy: r } = D({
144
+ el: document.body,
145
+ component: N,
146
+ props: s,
147
+ on: { close: () => {
148
+ var d;
149
+ r(), this.setChallengeFrameVisible(!1), this.threeDSDestroy = () => {
150
+ }, (d = this.threeDsProcessor) == null || d.onError({ error: "Challenge cancelled" });
151
+ } }
152
+ });
153
+ this.threeDSDestroy = r;
154
+ }
155
+ messageHandler(t) {
156
+ var a, e, s;
157
+ (a = t == null ? void 0 : t.data) != null && a.status && (t.data.status === "3ds_method_invocation_complete" ? (this.log(`[${this.getType()}][messageHandler] 3Ds Method invocation complete`), t.stopPropagation(), this.onAuth(!0, "")) : t.data.status === "3ds_challenge_complete" && (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"))));
158
+ }
159
+ };
160
+ function R(n, t, a) {
161
+ return new C(n, t, a);
162
+ }
163
+ export {
164
+ R as default
165
+ };
@@ -1,4 +1,4 @@
1
- import { w as n } from "./MetricsGlobalThreeDsProvider-DW-gsG6q-BYJaEFfc.js";
1
+ import { w as n } from "./MetricsGlobalThreeDsProvider-C93ttqbB-SRsVMed4.js";
2
2
  var r = class extends n {
3
3
  getType() {
4
4
  return "Payabli";
@@ -1,4 +1,4 @@
1
- import { P as a } from "./index-CACzT3Rb.js";
1
+ import { u as a } from "./index-DxOlzt-Z.js";
2
2
  export {
3
3
  a as PayfurlDropin
4
4
  };