mainstack-payments 1.0.46 → 1.0.47
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/build/mainstack-payments.js +123 -117
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as h, jsxs as M, Fragment as ot } from "react/jsx-runtime";
|
|
2
|
-
import { Colors as Qe, InfoIcon as Xa, Paragraph as by, CountrySelect as L1, NotificationsFilledIcon as si, LockIcon as z1, customSnackbar as
|
|
2
|
+
import { Colors as Qe, InfoIcon as Xa, Paragraph as by, CountrySelect as L1, NotificationsFilledIcon as si, LockIcon as z1, customSnackbar as Ct, SnackbarType as At, CancelFilledIcon as Eu, Button as dr, Loader as V1, ExpandMoreIcon as Kr, ClickTooltip as jh, DiscountIcon as j1, PhoneNumberInput as U1, MainstackProvider as G1, CustomSnackbarContainer as W1 } from "mainstack-design-system";
|
|
3
3
|
import * as L from "react";
|
|
4
4
|
import Ae, { Children as vy, isValidElement as $i, createContext as gn, useContext as nt, useRef as be, useEffect as pe, useCallback as ue, useState as X, useId as so, useLayoutEffect as Fi, useMemo as st, forwardRef as Gt, useReducer as H1, useInsertionEffect as Fd, createElement as Md, cloneElement as Js, memo as Od, useSyncExternalStore as K1, Fragment as Z1, PureComponent as q1, useImperativeHandle as Y1 } from "react";
|
|
5
5
|
import { createPortal as Sy } from "react-dom";
|
|
@@ -357,7 +357,7 @@ Qs.exports;
|
|
|
357
357
|
return y.prototype = void 0, $;
|
|
358
358
|
};
|
|
359
359
|
}();
|
|
360
|
-
function
|
|
360
|
+
function Tt(y) {
|
|
361
361
|
var w = -1, $ = y == null ? 0 : y.length;
|
|
362
362
|
for (this.clear(); ++w < $; ) {
|
|
363
363
|
var V = y[w];
|
|
@@ -387,7 +387,7 @@ Qs.exports;
|
|
|
387
387
|
var $ = this.__data__;
|
|
388
388
|
return this.size += this.has(y) ? 0 : 1, $[y] = da && w === void 0 ? r : w, this;
|
|
389
389
|
}
|
|
390
|
-
|
|
390
|
+
Tt.prototype.clear = Ql, Tt.prototype.delete = ec, Tt.prototype.get = dh, Tt.prototype.has = tc, Tt.prototype.set = nc;
|
|
391
391
|
function un(y) {
|
|
392
392
|
var w = -1, $ = y == null ? 0 : y.length;
|
|
393
393
|
for (this.clear(); ++w < $; ) {
|
|
@@ -426,9 +426,9 @@ Qs.exports;
|
|
|
426
426
|
}
|
|
427
427
|
function sc() {
|
|
428
428
|
this.size = 0, this.__data__ = {
|
|
429
|
-
hash: new
|
|
429
|
+
hash: new Tt(),
|
|
430
430
|
map: new (Wi || un)(),
|
|
431
|
-
string: new
|
|
431
|
+
string: new Tt()
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
434
|
function lc(y) {
|
|
@@ -5827,7 +5827,7 @@ var YT = /* @__PURE__ */ function() {
|
|
|
5827
5827
|
}, e;
|
|
5828
5828
|
}(), Ft = "-ms-", al = "-moz-", Me = "-webkit-", Uy = "comm", jd = "rule", Ud = "decl", XT = "@import", Gy = "@keyframes", JT = "@layer", QT = Math.abs, xl = String.fromCharCode, eE = Object.assign;
|
|
5829
5829
|
function tE(e, t) {
|
|
5830
|
-
return
|
|
5830
|
+
return Pt(e, 0) ^ 45 ? (((t << 2 ^ Pt(e, 0)) << 2 ^ Pt(e, 1)) << 2 ^ Pt(e, 2)) << 2 ^ Pt(e, 3) : 0;
|
|
5831
5831
|
}
|
|
5832
5832
|
function Wy(e) {
|
|
5833
5833
|
return e.trim();
|
|
@@ -5841,7 +5841,7 @@ function Oe(e, t, n) {
|
|
|
5841
5841
|
function Nu(e, t) {
|
|
5842
5842
|
return e.indexOf(t);
|
|
5843
5843
|
}
|
|
5844
|
-
function
|
|
5844
|
+
function Pt(e, t) {
|
|
5845
5845
|
return e.charCodeAt(t) | 0;
|
|
5846
5846
|
}
|
|
5847
5847
|
function fi(e, t, n) {
|
|
@@ -5870,13 +5870,13 @@ function aE() {
|
|
|
5870
5870
|
return dt;
|
|
5871
5871
|
}
|
|
5872
5872
|
function oE() {
|
|
5873
|
-
return dt = Ut > 0 ?
|
|
5873
|
+
return dt = Ut > 0 ? Pt(lo, --Ut) : 0, eo--, dt === 10 && (eo = 1, wl--), dt;
|
|
5874
5874
|
}
|
|
5875
5875
|
function Zt() {
|
|
5876
|
-
return dt = Ut < Hy ?
|
|
5876
|
+
return dt = Ut < Hy ? Pt(lo, Ut++) : 0, eo++, dt === 10 && (eo = 1, wl++), dt;
|
|
5877
5877
|
}
|
|
5878
5878
|
function _n() {
|
|
5879
|
-
return
|
|
5879
|
+
return Pt(lo, Ut);
|
|
5880
5880
|
}
|
|
5881
5881
|
function Vs() {
|
|
5882
5882
|
return Ut;
|
|
@@ -5971,7 +5971,7 @@ function Us(e, t, n, r, a, o, i, s, l) {
|
|
|
5971
5971
|
for (var c = 0, u = 0, d = i, f = 0, p = 0, g = 0, m = 1, b = 1, S = 1, x = 0, v = "", E = a, T = o, P = r, _ = v; b; )
|
|
5972
5972
|
switch (g = x, x = Zt()) {
|
|
5973
5973
|
case 40:
|
|
5974
|
-
if (g != 108 &&
|
|
5974
|
+
if (g != 108 && Pt(_, d - 1) == 58) {
|
|
5975
5975
|
Nu(_ += Oe(js(x), "&", "&\f"), "&\f") != -1 && (S = -1);
|
|
5976
5976
|
break;
|
|
5977
5977
|
}
|
|
@@ -6018,7 +6018,7 @@ function Us(e, t, n, r, a, o, i, s, l) {
|
|
|
6018
6018
|
if (u === 0)
|
|
6019
6019
|
Us(_, t, P, P, E, o, d, s, T);
|
|
6020
6020
|
else
|
|
6021
|
-
switch (f === 99 &&
|
|
6021
|
+
switch (f === 99 && Pt(_, 3) === 110 ? 100 : f) {
|
|
6022
6022
|
case 100:
|
|
6023
6023
|
case 108:
|
|
6024
6024
|
case 109:
|
|
@@ -6239,29 +6239,29 @@ function qy(e, t) {
|
|
|
6239
6239
|
case 5021:
|
|
6240
6240
|
case 4765:
|
|
6241
6241
|
if (Cn(e) - 1 - t > 6)
|
|
6242
|
-
switch (
|
|
6242
|
+
switch (Pt(e, t + 1)) {
|
|
6243
6243
|
case 109:
|
|
6244
|
-
if (
|
|
6244
|
+
if (Pt(e, t + 4) !== 45)
|
|
6245
6245
|
break;
|
|
6246
6246
|
case 102:
|
|
6247
|
-
return Oe(e, /(.+:)(.+)-([^]+)/, "$1" + Me + "$2-$3$1" + al + (
|
|
6247
|
+
return Oe(e, /(.+:)(.+)-([^]+)/, "$1" + Me + "$2-$3$1" + al + (Pt(e, t + 3) == 108 ? "$3" : "$2-$3")) + e;
|
|
6248
6248
|
case 115:
|
|
6249
6249
|
return ~Nu(e, "stretch") ? qy(Oe(e, "stretch", "fill-available"), t) + e : e;
|
|
6250
6250
|
}
|
|
6251
6251
|
break;
|
|
6252
6252
|
case 4949:
|
|
6253
|
-
if (
|
|
6253
|
+
if (Pt(e, t + 1) !== 115)
|
|
6254
6254
|
break;
|
|
6255
6255
|
case 6444:
|
|
6256
|
-
switch (
|
|
6256
|
+
switch (Pt(e, Cn(e) - 3 - (~Nu(e, "!important") && 10))) {
|
|
6257
6257
|
case 107:
|
|
6258
6258
|
return Oe(e, ":", ":" + Me) + e;
|
|
6259
6259
|
case 101:
|
|
6260
|
-
return Oe(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + Me + (
|
|
6260
|
+
return Oe(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + Me + (Pt(e, 14) === 45 ? "inline-" : "") + "box$3$1" + Me + "$2$3$1" + Ft + "$2box$3") + e;
|
|
6261
6261
|
}
|
|
6262
6262
|
break;
|
|
6263
6263
|
case 5936:
|
|
6264
|
-
switch (
|
|
6264
|
+
switch (Pt(e, t + 11)) {
|
|
6265
6265
|
case 114:
|
|
6266
6266
|
return Me + e + Ft + Oe(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
|
|
6267
6267
|
case 108:
|
|
@@ -18290,11 +18290,11 @@ var $I = /* @__PURE__ */ Gt(function(e, t) {
|
|
|
18290
18290
|
}, r));
|
|
18291
18291
|
});
|
|
18292
18292
|
$I.displayName = "Form";
|
|
18293
|
-
var
|
|
18293
|
+
var Et = [];
|
|
18294
18294
|
for (var xu = 0; xu < 256; ++xu)
|
|
18295
|
-
|
|
18295
|
+
Et.push((xu + 256).toString(16).slice(1));
|
|
18296
18296
|
function FI(e, t = 0) {
|
|
18297
|
-
return (
|
|
18297
|
+
return (Et[e[t + 0]] + Et[e[t + 1]] + Et[e[t + 2]] + Et[e[t + 3]] + "-" + Et[e[t + 4]] + Et[e[t + 5]] + "-" + Et[e[t + 6]] + Et[e[t + 7]] + "-" + Et[e[t + 8]] + Et[e[t + 9]] + "-" + Et[e[t + 10]] + Et[e[t + 11]] + Et[e[t + 12]] + Et[e[t + 13]] + Et[e[t + 14]] + Et[e[t + 15]]).toLowerCase();
|
|
18298
18298
|
}
|
|
18299
18299
|
var $s, MI = new Uint8Array(16);
|
|
18300
18300
|
function OI() {
|
|
@@ -21751,80 +21751,86 @@ const qg = /* @__PURE__ */ new Map([
|
|
|
21751
21751
|
(fe) => fe.name === ae
|
|
21752
21752
|
)) == null ? void 0 : Pe.alpha2Code, Q = r.values.street, ce = async (fe) => {
|
|
21753
21753
|
var pt, Bt, mt;
|
|
21754
|
-
if (
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21754
|
+
if (fe.preventDefault(), !v || !E) {
|
|
21755
|
+
Ct(
|
|
21756
|
+
"Couldn't process payment, please reload and try again",
|
|
21757
|
+
At.error
|
|
21758
|
+
), console.log("Stripe or elements is null");
|
|
21759
|
+
return;
|
|
21760
|
+
}
|
|
21761
|
+
if (re(!0), a)
|
|
21762
|
+
c({
|
|
21763
|
+
fullname: r.values.fullname,
|
|
21764
|
+
email: r.values.email,
|
|
21765
|
+
reference: n == null ? void 0 : n.reference,
|
|
21766
|
+
amount: 0
|
|
21767
|
+
});
|
|
21768
|
+
else {
|
|
21769
|
+
const St = E == null ? void 0 : E.getElement(lg);
|
|
21770
|
+
if (!St)
|
|
21771
|
+
return;
|
|
21772
|
+
let _e;
|
|
21773
|
+
if (d === "ips" || g ? _e = await v.createPaymentMethod({
|
|
21774
|
+
type: "card",
|
|
21775
|
+
card: St,
|
|
21776
|
+
billing_details: {
|
|
21777
|
+
name: r.values.fullname,
|
|
21758
21778
|
email: r.values.email,
|
|
21759
|
-
|
|
21760
|
-
|
|
21761
|
-
|
|
21779
|
+
address: {
|
|
21780
|
+
country: K,
|
|
21781
|
+
line1: Q,
|
|
21782
|
+
postal_code: O
|
|
21783
|
+
}
|
|
21784
|
+
}
|
|
21785
|
+
}) : _e = await v.createToken(St, {
|
|
21786
|
+
name: Ve,
|
|
21787
|
+
address_country: K,
|
|
21788
|
+
address_line1: Q,
|
|
21789
|
+
address_zip: O
|
|
21790
|
+
}), _e.error)
|
|
21791
|
+
re(!1), Ct(
|
|
21792
|
+
((pt = _e == null ? void 0 : _e.error) == null ? void 0 : pt.message) ?? "An unexpected error occured",
|
|
21793
|
+
At.error
|
|
21794
|
+
);
|
|
21762
21795
|
else {
|
|
21763
|
-
const
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
|
|
21796
|
+
const gt = {
|
|
21797
|
+
amount: t,
|
|
21798
|
+
currency: e,
|
|
21799
|
+
metadata: {
|
|
21800
|
+
...n,
|
|
21801
|
+
billing_address_line1: Q,
|
|
21802
|
+
billing_address_country: K,
|
|
21803
|
+
billing_address_postal_code: O
|
|
21804
|
+
},
|
|
21805
|
+
...d === "ips" || g ? { payment_method_id: (Bt = _e == null ? void 0 : _e.paymentMethod) == null ? void 0 : Bt.id } : { source: (mt = _e == null ? void 0 : _e.token) == null ? void 0 : mt.id },
|
|
21806
|
+
callback_url: f
|
|
21807
|
+
};
|
|
21808
|
+
he(gt, {
|
|
21809
|
+
onSuccess: (De) => {
|
|
21810
|
+
var k, I;
|
|
21811
|
+
if ((k = De == null ? void 0 : De.data) != null && k.next_action) {
|
|
21812
|
+
p({
|
|
21813
|
+
url: (I = De == null ? void 0 : De.data) == null ? void 0 : I.next_action.redirect_to_url.url,
|
|
21814
|
+
reference: De == null ? void 0 : De.reference
|
|
21815
|
+
});
|
|
21816
|
+
return;
|
|
21777
21817
|
}
|
|
21818
|
+
setTimeout(() => {
|
|
21819
|
+
c({
|
|
21820
|
+
fullname: r.values.fullname,
|
|
21821
|
+
email: r.values.email,
|
|
21822
|
+
reference: De == null ? void 0 : De.reference,
|
|
21823
|
+
...De.data
|
|
21824
|
+
}), re(!1);
|
|
21825
|
+
}, 3e3);
|
|
21826
|
+
},
|
|
21827
|
+
onError: (De) => {
|
|
21828
|
+
var k;
|
|
21829
|
+
re(!1), Ct((k = De == null ? void 0 : De.raw) == null ? void 0 : k.message, At.error);
|
|
21778
21830
|
}
|
|
21779
|
-
})
|
|
21780
|
-
name: Ve,
|
|
21781
|
-
address_country: K,
|
|
21782
|
-
address_line1: Q,
|
|
21783
|
-
address_zip: O
|
|
21784
|
-
}), _e.error)
|
|
21785
|
-
re(!1), Et(
|
|
21786
|
-
((pt = _e == null ? void 0 : _e.error) == null ? void 0 : pt.message) ?? "An unexpected error occured",
|
|
21787
|
-
Pt.error
|
|
21788
|
-
);
|
|
21789
|
-
else {
|
|
21790
|
-
const gt = {
|
|
21791
|
-
amount: t,
|
|
21792
|
-
currency: e,
|
|
21793
|
-
metadata: {
|
|
21794
|
-
...n,
|
|
21795
|
-
billing_address_line1: Q,
|
|
21796
|
-
billing_address_country: K,
|
|
21797
|
-
billing_address_postal_code: O
|
|
21798
|
-
},
|
|
21799
|
-
...d === "ips" || g ? { payment_method_id: (Bt = _e == null ? void 0 : _e.paymentMethod) == null ? void 0 : Bt.id } : { source: (mt = _e == null ? void 0 : _e.token) == null ? void 0 : mt.id },
|
|
21800
|
-
callback_url: f
|
|
21801
|
-
};
|
|
21802
|
-
he(gt, {
|
|
21803
|
-
onSuccess: (De) => {
|
|
21804
|
-
var k, I;
|
|
21805
|
-
if ((k = De == null ? void 0 : De.data) != null && k.next_action) {
|
|
21806
|
-
p({
|
|
21807
|
-
url: (I = De == null ? void 0 : De.data) == null ? void 0 : I.next_action.redirect_to_url.url,
|
|
21808
|
-
reference: De == null ? void 0 : De.reference
|
|
21809
|
-
});
|
|
21810
|
-
return;
|
|
21811
|
-
}
|
|
21812
|
-
setTimeout(() => {
|
|
21813
|
-
c({
|
|
21814
|
-
fullname: r.values.fullname,
|
|
21815
|
-
email: r.values.email,
|
|
21816
|
-
reference: De == null ? void 0 : De.reference,
|
|
21817
|
-
...De.data
|
|
21818
|
-
}), re(!1);
|
|
21819
|
-
}, 3e3);
|
|
21820
|
-
},
|
|
21821
|
-
onError: (De) => {
|
|
21822
|
-
var k;
|
|
21823
|
-
re(!1), Et((k = De == null ? void 0 : De.raw) == null ? void 0 : k.message, Pt.error);
|
|
21824
|
-
}
|
|
21825
|
-
});
|
|
21826
|
-
}
|
|
21831
|
+
});
|
|
21827
21832
|
}
|
|
21833
|
+
}
|
|
21828
21834
|
}, se = {
|
|
21829
21835
|
backgroundColor: "#fff",
|
|
21830
21836
|
iconColor: "#c4f0ff",
|
|
@@ -26766,9 +26772,9 @@ const Xg = "Payment Completed", RR = ({
|
|
|
26766
26772
|
reference: P
|
|
26767
26773
|
});
|
|
26768
26774
|
} catch (ie) {
|
|
26769
|
-
T.complete("fail"),
|
|
26775
|
+
T.complete("fail"), Ct(
|
|
26770
26776
|
((le = ie == null ? void 0 : ie.raw) == null ? void 0 : le.message) ?? "We couldn't initialize your payment",
|
|
26771
|
-
|
|
26777
|
+
At.error
|
|
26772
26778
|
), S(!1);
|
|
26773
26779
|
return;
|
|
26774
26780
|
}
|
|
@@ -26791,18 +26797,18 @@ const Xg = "Payment Completed", RR = ({
|
|
|
26791
26797
|
{ handleActions: !1 }
|
|
26792
26798
|
);
|
|
26793
26799
|
if (R)
|
|
26794
|
-
T.complete("fail"),
|
|
26800
|
+
T.complete("fail"), Ct(
|
|
26795
26801
|
(R == null ? void 0 : R.message) ?? "We couldn't process your payment",
|
|
26796
|
-
|
|
26802
|
+
At.error
|
|
26797
26803
|
), S(!1);
|
|
26798
26804
|
else {
|
|
26799
26805
|
if (T.complete("success"), D.status === "requires_action") {
|
|
26800
26806
|
const { error: ie } = await u.confirmCardPayment(
|
|
26801
26807
|
_
|
|
26802
26808
|
);
|
|
26803
|
-
ie ?
|
|
26809
|
+
ie ? Ct(
|
|
26804
26810
|
"Payment failed, please add a new payment method",
|
|
26805
|
-
|
|
26811
|
+
At.error
|
|
26806
26812
|
) : setTimeout(() => {
|
|
26807
26813
|
o({
|
|
26808
26814
|
fullname: r.values.fullname,
|
|
@@ -26813,7 +26819,7 @@ const Xg = "Payment Completed", RR = ({
|
|
|
26813
26819
|
});
|
|
26814
26820
|
}, 3e3);
|
|
26815
26821
|
}
|
|
26816
|
-
|
|
26822
|
+
Ct("Payment was successful", At.success), setTimeout(() => {
|
|
26817
26823
|
o({
|
|
26818
26824
|
fullname: r.values.fullname,
|
|
26819
26825
|
email: r.values.email,
|
|
@@ -26961,15 +26967,15 @@ const Au = (e) => Math.round((e + Number.EPSILON) * 100) / 100, vn = (e) => {
|
|
|
26961
26967
|
type: (re = F == null ? void 0 : F.data) == null ? void 0 : re.discount_type,
|
|
26962
26968
|
value: (Ve = F == null ? void 0 : F.data) == null ? void 0 : Ve.discount_value,
|
|
26963
26969
|
isFullDiscount: ((je = F == null ? void 0 : F.data) == null ? void 0 : je.amount_to_pay) === 0
|
|
26964
|
-
}), d == null || d(F == null ? void 0 : F.data),
|
|
26970
|
+
}), d == null || d(F == null ? void 0 : F.data), Ct("Discount has been applied", At.success)) : Ct(`${F == null ? void 0 : F.error}`, At.error);
|
|
26965
26971
|
} catch (F) {
|
|
26966
|
-
|
|
26972
|
+
Ct(
|
|
26967
26973
|
`${((O = F == null ? void 0 : F.raw) == null ? void 0 : O.message) ?? (F == null ? void 0 : F.message) ?? "An Error occured applying discount code"}`,
|
|
26968
|
-
|
|
26974
|
+
At.error
|
|
26969
26975
|
);
|
|
26970
26976
|
}
|
|
26971
26977
|
else
|
|
26972
|
-
|
|
26978
|
+
Ct('"Kindly add a discount code"', At.info);
|
|
26973
26979
|
}, H = () => {
|
|
26974
26980
|
i && (l(""), o({
|
|
26975
26981
|
amount: 0,
|
|
@@ -27576,9 +27582,9 @@ const WR = (e) => /* @__PURE__ */ M(cn, { viewBox: "0 0 32 32", ...e, fill: "non
|
|
|
27576
27582
|
throw new Error(v.message ?? "Couldn't load wallet integration");
|
|
27577
27583
|
}
|
|
27578
27584
|
} catch (x) {
|
|
27579
|
-
f(!1),
|
|
27585
|
+
f(!1), Ct(
|
|
27580
27586
|
((S = x == null ? void 0 : x.raw) == null ? void 0 : S.message) ?? x ?? "We couldn't complete your payment",
|
|
27581
|
-
|
|
27587
|
+
At.error
|
|
27582
27588
|
);
|
|
27583
27589
|
}
|
|
27584
27590
|
};
|
|
@@ -28157,9 +28163,9 @@ const WR = (e) => /* @__PURE__ */ M(cn, { viewBox: "0 0 32 32", ...e, fill: "non
|
|
|
28157
28163
|
);
|
|
28158
28164
|
}
|
|
28159
28165
|
} catch (v) {
|
|
28160
|
-
f(!1),
|
|
28166
|
+
f(!1), Ct(
|
|
28161
28167
|
((x = v == null ? void 0 : v.raw) == null ? void 0 : x.message) ?? v ?? "We couldn't complete your payment",
|
|
28162
|
-
|
|
28168
|
+
At.error
|
|
28163
28169
|
);
|
|
28164
28170
|
}
|
|
28165
28171
|
}, [
|
|
@@ -28321,7 +28327,7 @@ const Tu = [
|
|
|
28321
28327
|
),
|
|
28322
28328
|
currency: tn().required("Please select a currency."),
|
|
28323
28329
|
...a
|
|
28324
|
-
}), { getAmount: da, getCountryCurrency: Hi } = IR(v),
|
|
28330
|
+
}), { getAmount: da, getCountryCurrency: Hi } = IR(v), Tt = typeof window < "u" ? JSON.parse(window.localStorage.getItem("userIp")) : "", { mutate: Ql, isLoading: ec } = Ul(fe), { mutate: dh, isLoading: tc } = qf(fe), {
|
|
28325
28331
|
makePaystackPayment: nc,
|
|
28326
28332
|
isInitializingPayment: un,
|
|
28327
28333
|
isChargingCard: rc
|
|
@@ -28400,7 +28406,7 @@ const Tu = [
|
|
|
28400
28406
|
var Eo;
|
|
28401
28407
|
ge(!1);
|
|
28402
28408
|
let Ca = ((Eo = To == null ? void 0 : To.raw) == null ? void 0 : Eo.message) ?? "Error loading payment gateway";
|
|
28403
|
-
Ca.includes("ip_address") && (Ca = "Payment failed: An extension may be blocking us from completing your payment or your browser may be unsupported. Please try again."),
|
|
28409
|
+
Ca.includes("ip_address") && (Ca = "Payment failed: An extension may be blocking us from completing your payment or your browser may be unsupported. Please try again."), Ct(Ca, At.error);
|
|
28404
28410
|
}
|
|
28405
28411
|
});
|
|
28406
28412
|
}
|
|
@@ -28412,7 +28418,7 @@ const Tu = [
|
|
|
28412
28418
|
j.setFieldValue(q, ge);
|
|
28413
28419
|
}
|
|
28414
28420
|
}));
|
|
28415
|
-
const cc = VR((He = j.values) == null ? void 0 : He.zipCode), nr = ae ? !1 : v !== (
|
|
28421
|
+
const cc = VR((He = j.values) == null ? void 0 : He.zipCode), nr = ae ? !1 : v !== (Tt == null ? void 0 : Tt.currency), Ki = j.values.country !== "" ? Hi((Ot = j == null ? void 0 : j.values) == null ? void 0 : Ot.country) : Tt == null ? void 0 : Tt.currency, fo = Hi(e == null ? void 0 : e.merchantCountry), uc = [Ue.USD, Ue.GBP, Ue.CAD, Ue.NGN].includes(
|
|
28416
28422
|
fo
|
|
28417
28423
|
) && fo === v, ho = ae ? !1 : !(uc && fo === Ki), dc = Ki !== v, ha = [Ue.USD].includes(v), qi = Q ? ae ? !1 : dc || !ha : ho, {
|
|
28418
28424
|
data: ee,
|
|
@@ -28426,7 +28432,7 @@ const Tu = [
|
|
|
28426
28432
|
currency: v,
|
|
28427
28433
|
slug: D,
|
|
28428
28434
|
apply_tranche_fee: O,
|
|
28429
|
-
ip: G ? F ?? (
|
|
28435
|
+
ip: G ? F ?? (Tt == null ? void 0 : Tt.ip) : "",
|
|
28430
28436
|
country: G ? ($t = an == null ? void 0 : an.find((q) => q.name === j.values.country)) == null ? void 0 : $t.alpha2Code : "",
|
|
28431
28437
|
postal_code: G ? cc : "",
|
|
28432
28438
|
product_id: (ar = e == null ? void 0 : e.metadata) == null ? void 0 : ar.product_id,
|
|
@@ -28558,7 +28564,7 @@ const Tu = [
|
|
|
28558
28564
|
onError(ge) {
|
|
28559
28565
|
var yt;
|
|
28560
28566
|
let lt = ((yt = ge == null ? void 0 : ge.raw) == null ? void 0 : yt.message) ?? "Error loading payment gateway";
|
|
28561
|
-
lt.includes("ip_address") && (lt = "Payment failed: An extension may be blocking us from completing your payment or your browser may be unsupported. Please try again."),
|
|
28567
|
+
lt.includes("ip_address") && (lt = "Payment failed: An extension may be blocking us from completing your payment or your browser may be unsupported. Please try again."), Ct(lt, At.error);
|
|
28562
28568
|
}
|
|
28563
28569
|
}
|
|
28564
28570
|
);
|
|
@@ -28571,9 +28577,9 @@ const Tu = [
|
|
|
28571
28577
|
} = _a(), rs = async (q) => {
|
|
28572
28578
|
var yt;
|
|
28573
28579
|
if (q.preventDefault(), _t) {
|
|
28574
|
-
|
|
28580
|
+
Ct(
|
|
28575
28581
|
`Error loading transaction information: ${((yt = _t == null ? void 0 : _t.raw) == null ? void 0 : yt.message) ?? _t ?? ""}, please reload or contact us.`,
|
|
28576
|
-
|
|
28582
|
+
At.error
|
|
28577
28583
|
);
|
|
28578
28584
|
return;
|
|
28579
28585
|
}
|
|
@@ -28634,14 +28640,14 @@ const Tu = [
|
|
|
28634
28640
|
email: j.values.email,
|
|
28635
28641
|
reference: I == null ? void 0 : I.reference,
|
|
28636
28642
|
...yt.data
|
|
28637
|
-
}) :
|
|
28643
|
+
}) : Ct(
|
|
28638
28644
|
`${((ge = (q = yt == null ? void 0 : yt.error) == null ? void 0 : q.raw) == null ? void 0 : ge.message) ?? "Error verifying payment"}`,
|
|
28639
|
-
|
|
28645
|
+
At.error
|
|
28640
28646
|
);
|
|
28641
28647
|
} catch (yt) {
|
|
28642
|
-
|
|
28648
|
+
Ct(
|
|
28643
28649
|
`${((lt = yt == null ? void 0 : yt.raw) == null ? void 0 : lt.message) ?? "Failed to complete transaction"}`,
|
|
28644
|
-
|
|
28650
|
+
At.error
|
|
28645
28651
|
), j.setSubmitting(!1), kt(!1);
|
|
28646
28652
|
}
|
|
28647
28653
|
}, rr = be(null), wc = (Bh = rr == null ? void 0 : rr.current) == null ? void 0 : Bh.offsetWidth, So = v === Ue.USD && N !== "ips" && mt > 0, xo = [
|