@fractalpay/fractalpay-next 0.1.2 → 0.1.4
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/dist/index.js +98 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var require_package = __commonJS({
|
|
|
39
39
|
"package.json"(exports, module) {
|
|
40
40
|
module.exports = {
|
|
41
41
|
name: "@fractalpay/fractalpay-next",
|
|
42
|
-
version: "0.1.
|
|
42
|
+
version: "0.1.4",
|
|
43
43
|
private: false,
|
|
44
44
|
type: "module",
|
|
45
45
|
scripts: {
|
|
@@ -3481,8 +3481,6 @@ var baseCSS = `
|
|
|
3481
3481
|
}
|
|
3482
3482
|
|
|
3483
3483
|
`;
|
|
3484
|
-
var datacapInitializing = false;
|
|
3485
|
-
var datacapInitialized = false;
|
|
3486
3484
|
var DataCapFields = ({
|
|
3487
3485
|
isOpen,
|
|
3488
3486
|
tokenKey,
|
|
@@ -3490,11 +3488,15 @@ var DataCapFields = ({
|
|
|
3490
3488
|
isAddCard,
|
|
3491
3489
|
isEmbedded,
|
|
3492
3490
|
customCSS: extraCss,
|
|
3493
|
-
height
|
|
3491
|
+
height,
|
|
3492
|
+
onError
|
|
3494
3493
|
}) => {
|
|
3495
3494
|
const iframeId = "datacap-iframe";
|
|
3496
3495
|
const resolverRef = useRef2(null);
|
|
3497
3496
|
const [iframeReady, setIframeReady] = useState3(false);
|
|
3497
|
+
const [mountKey, setMountKey] = useState3(0);
|
|
3498
|
+
const initGenRef = useRef2(0);
|
|
3499
|
+
const initTimeoutRef = useRef2(null);
|
|
3498
3500
|
let customCSS = baseCSS;
|
|
3499
3501
|
useEffect7(() => {
|
|
3500
3502
|
if (!isOpen || !tokenKey) return;
|
|
@@ -3534,6 +3536,8 @@ var DataCapFields = ({
|
|
|
3534
3536
|
if (extraCss) {
|
|
3535
3537
|
customCSS += extraCss;
|
|
3536
3538
|
}
|
|
3539
|
+
const myGen = ++initGenRef.current;
|
|
3540
|
+
setMountKey(myGen);
|
|
3537
3541
|
const initialize = async () => {
|
|
3538
3542
|
setLoader == null ? void 0 : setLoader(true);
|
|
3539
3543
|
setIframeReady(false);
|
|
@@ -3552,18 +3556,39 @@ var DataCapFields = ({
|
|
|
3552
3556
|
}
|
|
3553
3557
|
}, 100);
|
|
3554
3558
|
});
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
+
const waitForIframe = () => new Promise((resolve, reject) => {
|
|
3560
|
+
let attempts = 0;
|
|
3561
|
+
const interval = setInterval(() => {
|
|
3562
|
+
attempts++;
|
|
3563
|
+
if (document.getElementById(iframeId)) {
|
|
3564
|
+
clearInterval(interval);
|
|
3565
|
+
resolve();
|
|
3566
|
+
}
|
|
3567
|
+
if (attempts > 100) {
|
|
3568
|
+
clearInterval(interval);
|
|
3569
|
+
reject("Datacap iframe not found");
|
|
3570
|
+
}
|
|
3571
|
+
}, 50);
|
|
3572
|
+
});
|
|
3573
|
+
try {
|
|
3574
|
+
await waitForSDK();
|
|
3575
|
+
await waitForIframe();
|
|
3576
|
+
} catch (err) {
|
|
3577
|
+
if (initGenRef.current !== myGen) return;
|
|
3578
|
+
console.error("\u274C Datacap failed to become ready:", err);
|
|
3579
|
+
setLoader == null ? void 0 : setLoader(false);
|
|
3580
|
+
onError == null ? void 0 : onError("Unable to load payment form. Please try again.");
|
|
3559
3581
|
return;
|
|
3560
3582
|
}
|
|
3561
|
-
|
|
3562
|
-
const
|
|
3583
|
+
if (initGenRef.current !== myGen) return;
|
|
3584
|
+
const sdk = window.DatacapHostedWebToken;
|
|
3585
|
+
initTimeoutRef.current = setTimeout(() => {
|
|
3563
3586
|
var _a, _b;
|
|
3587
|
+
if (initGenRef.current !== myGen) return;
|
|
3564
3588
|
console.error("\u274C Datacap iframe load timeout");
|
|
3565
|
-
|
|
3589
|
+
initTimeoutRef.current = null;
|
|
3566
3590
|
setLoader == null ? void 0 : setLoader(false);
|
|
3591
|
+
onError == null ? void 0 : onError("Unable to load payment form. Please try again.");
|
|
3567
3592
|
(_b = (_a = resolverRef.current) == null ? void 0 : _a.reject) == null ? void 0 : _b.call(
|
|
3568
3593
|
_a,
|
|
3569
3594
|
"Unable to load payment form"
|
|
@@ -3573,9 +3598,7 @@ var DataCapFields = ({
|
|
|
3573
3598
|
tokenKey,
|
|
3574
3599
|
iframeId,
|
|
3575
3600
|
(response) => {
|
|
3576
|
-
|
|
3577
|
-
datacapInitializing = false;
|
|
3578
|
-
datacapInitialized = true;
|
|
3601
|
+
if (initGenRef.current !== myGen) return;
|
|
3579
3602
|
setLoader == null ? void 0 : setLoader(false);
|
|
3580
3603
|
if (!resolverRef.current) return;
|
|
3581
3604
|
if ((response == null ? void 0 : response.Error) || (response == null ? void 0 : response.Errors)) {
|
|
@@ -3615,12 +3638,6 @@ var DataCapFields = ({
|
|
|
3615
3638
|
delete window.requestDcToken;
|
|
3616
3639
|
};
|
|
3617
3640
|
}, []);
|
|
3618
|
-
useEffect7(() => {
|
|
3619
|
-
return () => {
|
|
3620
|
-
datacapInitializing = false;
|
|
3621
|
-
datacapInitialized = false;
|
|
3622
|
-
};
|
|
3623
|
-
}, []);
|
|
3624
3641
|
return (
|
|
3625
3642
|
// <iframe
|
|
3626
3643
|
// id={iframeId}
|
|
@@ -3643,13 +3660,22 @@ var DataCapFields = ({
|
|
|
3643
3660
|
id: iframeId,
|
|
3644
3661
|
onLoad: () => {
|
|
3645
3662
|
console.log("\u{1F7E2} Iframe visually loaded");
|
|
3663
|
+
if (initTimeoutRef.current) {
|
|
3664
|
+
clearTimeout(initTimeoutRef.current);
|
|
3665
|
+
initTimeoutRef.current = null;
|
|
3666
|
+
}
|
|
3646
3667
|
setIframeReady(true);
|
|
3647
3668
|
setLoader == null ? void 0 : setLoader(false);
|
|
3648
3669
|
},
|
|
3649
3670
|
onError: () => {
|
|
3650
3671
|
var _a, _b;
|
|
3651
3672
|
console.error("\u274C iframe failed");
|
|
3673
|
+
if (initTimeoutRef.current) {
|
|
3674
|
+
clearTimeout(initTimeoutRef.current);
|
|
3675
|
+
initTimeoutRef.current = null;
|
|
3676
|
+
}
|
|
3652
3677
|
setLoader == null ? void 0 : setLoader(false);
|
|
3678
|
+
onError == null ? void 0 : onError("Payment form failed to load");
|
|
3653
3679
|
(_b = (_a = resolverRef.current) == null ? void 0 : _a.reject) == null ? void 0 : _b.call(
|
|
3654
3680
|
_a,
|
|
3655
3681
|
"Payment form failed to load"
|
|
@@ -3662,7 +3688,8 @@ var DataCapFields = ({
|
|
|
3662
3688
|
opacity: iframeReady ? 1 : 0,
|
|
3663
3689
|
transition: "opacity 0.3s ease"
|
|
3664
3690
|
}
|
|
3665
|
-
}
|
|
3691
|
+
},
|
|
3692
|
+
mountKey
|
|
3666
3693
|
)
|
|
3667
3694
|
);
|
|
3668
3695
|
};
|
|
@@ -4951,7 +4978,7 @@ function GetPaymentPage(props) {
|
|
|
4951
4978
|
}
|
|
4952
4979
|
};
|
|
4953
4980
|
const getPaymentDetails = async () => {
|
|
4954
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
4981
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
4955
4982
|
showLoader();
|
|
4956
4983
|
try {
|
|
4957
4984
|
const data = {
|
|
@@ -4966,12 +4993,14 @@ function GetPaymentPage(props) {
|
|
|
4966
4993
|
handleClose();
|
|
4967
4994
|
setError("Something went wrong.");
|
|
4968
4995
|
}
|
|
4996
|
+
let willShowCardForm = true;
|
|
4969
4997
|
if (((_e2 = (_d2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _d2.data) == null ? void 0 : _e2.card_list) && ((_h2 = (_g2 = (_f2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _f2.data) == null ? void 0 : _g2.card_list) == null ? void 0 : _h2.length) > 0) {
|
|
4970
4998
|
let banklists = (_k = (_j2 = (_i2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _i2.data) == null ? void 0 : _j2.card_list) == null ? void 0 : _k.filter((card) => (card == null ? void 0 : card.card_type) == "Bank");
|
|
4971
4999
|
let cardlists = (_n = (_m = (_l = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _l.data) == null ? void 0 : _m.card_list) == null ? void 0 : _n.filter((card) => (card == null ? void 0 : card.card_type) !== "Bank");
|
|
4972
5000
|
if ((cardlists == null ? void 0 : cardlists.length) > 0 || (banklists == null ? void 0 : banklists.length) > 0) {
|
|
4973
5001
|
setActiveinCard("list");
|
|
4974
5002
|
setActiveinBank("list");
|
|
5003
|
+
willShowCardForm = false;
|
|
4975
5004
|
}
|
|
4976
5005
|
setCardList(cardlists);
|
|
4977
5006
|
setBankList(banklists);
|
|
@@ -4981,11 +5010,14 @@ function GetPaymentPage(props) {
|
|
|
4981
5010
|
if (((_p = (_o = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _o.data) == null ? void 0 : _p.paymentDeviceList) && ((_s = (_r = (_q = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _q.data) == null ? void 0 : _r.paymentDeviceList) == null ? void 0 : _s.length) > 0) {
|
|
4982
5011
|
setSelectedReader((_u = (_t = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _t.data) == null ? void 0 : _u.paymentDeviceList[0]);
|
|
4983
5012
|
}
|
|
5013
|
+
if (willShowCardForm && ((_w = (_v = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _v.data) == null ? void 0 : _w.paymentGateway) === 31 && ((_y = (_x = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _x.data) == null ? void 0 : _y.dctoken)) {
|
|
5014
|
+
setLoadingIframe(true);
|
|
5015
|
+
}
|
|
4984
5016
|
hideLoader();
|
|
4985
5017
|
} catch (err) {
|
|
4986
5018
|
console.log(err);
|
|
4987
5019
|
hideLoader();
|
|
4988
|
-
setError(((
|
|
5020
|
+
setError(((_A = (_z = err == null ? void 0 : err.response) == null ? void 0 : _z.data) == null ? void 0 : _A.message) || (err == null ? void 0 : err.message) || "Something went wrong");
|
|
4989
5021
|
}
|
|
4990
5022
|
};
|
|
4991
5023
|
const handlechargeCustomer = async (e) => {
|
|
@@ -5537,7 +5569,7 @@ function GetPaymentPage(props) {
|
|
|
5537
5569
|
getSurchargeOptions,
|
|
5538
5570
|
onSurchargeResult: setSurchargeResult
|
|
5539
5571
|
}
|
|
5540
|
-
) : /* @__PURE__ */ jsx18(DataCapFields, { isOpen: show, tokenKey: paymentData == null ? void 0 : paymentData.dctoken, setLoader: setLoadingIframe }) }) }),
|
|
5572
|
+
) : /* @__PURE__ */ jsx18(DataCapFields, { isOpen: show, tokenKey: paymentData == null ? void 0 : paymentData.dctoken, setLoader: setLoadingIframe, onError: (msg) => setError(msg || DcLoadingError) }) }) }),
|
|
5541
5573
|
/* @__PURE__ */ jsx18(FractalField, { label: "Zip", htmlFor: "zip", error: cardError == null ? void 0 : cardError.zipCode, children: /* @__PURE__ */ jsx18("input", { id: "zip", className: "fps-input", maxLength: 100, placeholder: "000000", value: (_j = cardData == null ? void 0 : cardData.zipCode) != null ? _j : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }) }),
|
|
5542
5574
|
(props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsxs9(FractalCheckbox, { id: "save_card", checked: saveCardInfo, onChange: (v) => setSaveCardInfo(v), children: [
|
|
5543
5575
|
"Save this card. ",
|
|
@@ -6110,7 +6142,7 @@ function AddCardEasyPay(props) {
|
|
|
6110
6142
|
return Object.keys(errors).length > 0;
|
|
6111
6143
|
};
|
|
6112
6144
|
const getPaymentDetails = async () => {
|
|
6113
|
-
var _a2, _b2, _c;
|
|
6145
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
6114
6146
|
showLoader();
|
|
6115
6147
|
try {
|
|
6116
6148
|
const data = {
|
|
@@ -6124,6 +6156,9 @@ function AddCardEasyPay(props) {
|
|
|
6124
6156
|
handleClose();
|
|
6125
6157
|
setError("Something went wrong.");
|
|
6126
6158
|
}
|
|
6159
|
+
if (((_e = (_d = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _d.data) == null ? void 0 : _e.paymentGateway) === 31 && ((_g = (_f = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _f.data) == null ? void 0 : _g.dctoken)) {
|
|
6160
|
+
setLoadingIframe(true);
|
|
6161
|
+
}
|
|
6127
6162
|
hideLoader();
|
|
6128
6163
|
} catch (err) {
|
|
6129
6164
|
console.log(err);
|
|
@@ -6381,7 +6416,8 @@ function AddCardEasyPay(props) {
|
|
|
6381
6416
|
isOpen: true,
|
|
6382
6417
|
tokenKey: paymentData == null ? void 0 : paymentData.dctoken,
|
|
6383
6418
|
setLoader: setLoadingIframe,
|
|
6384
|
-
isAddCard: true
|
|
6419
|
+
isAddCard: true,
|
|
6420
|
+
onError: (msg) => setError(msg || DcLoadingError)
|
|
6385
6421
|
}
|
|
6386
6422
|
) }),
|
|
6387
6423
|
/* @__PURE__ */ jsxs11("div", { className: "form-group", style: { marginTop: "0" }, children: [
|
|
@@ -6988,21 +7024,24 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
6988
7024
|
onCancel();
|
|
6989
7025
|
};
|
|
6990
7026
|
const getPaymentDetails = async () => {
|
|
6991
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
7027
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
6992
7028
|
try {
|
|
6993
7029
|
showLoader();
|
|
6994
7030
|
const res = await axios5.get(`${masterBaseUrl}api/v1/gateway/get-payment-details/${session_token}`);
|
|
6995
7031
|
if ((res == null ? void 0 : res.status) == 200) {
|
|
6996
7032
|
setPaymentGateway((_b2 = (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.paymentGateway);
|
|
6997
7033
|
setDCToken((_d = (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.data) == null ? void 0 : _d.dctoken);
|
|
7034
|
+
if (((_f = (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.data) == null ? void 0 : _f.paymentGateway) === 31 && ((_h = (_g = res == null ? void 0 : res.data) == null ? void 0 : _g.data) == null ? void 0 : _h.dctoken)) {
|
|
7035
|
+
setLoadingIframe(true);
|
|
7036
|
+
}
|
|
6998
7037
|
hideLoader();
|
|
6999
7038
|
}
|
|
7000
7039
|
} catch (error2) {
|
|
7001
|
-
console.log((
|
|
7040
|
+
console.log((_j = (_i = error2 == null ? void 0 : error2.response) == null ? void 0 : _i.data) == null ? void 0 : _j.result, "error while getting payment details");
|
|
7002
7041
|
callback({
|
|
7003
|
-
error: ((
|
|
7004
|
-
result: (
|
|
7005
|
-
statusCode: (
|
|
7042
|
+
error: ((_l = (_k = error2 == null ? void 0 : error2.response) == null ? void 0 : _k.data) == null ? void 0 : _l.message) || "Something went wrong!",
|
|
7043
|
+
result: (_n = (_m = error2 == null ? void 0 : error2.response) == null ? void 0 : _m.data) == null ? void 0 : _n.result,
|
|
7044
|
+
statusCode: (_o = error2 == null ? void 0 : error2.response) == null ? void 0 : _o.status
|
|
7006
7045
|
});
|
|
7007
7046
|
hideLoader();
|
|
7008
7047
|
}
|
|
@@ -7268,7 +7307,8 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7268
7307
|
tokenKey: dcToken,
|
|
7269
7308
|
setLoader: setLoadingIframe,
|
|
7270
7309
|
customCSS,
|
|
7271
|
-
height
|
|
7310
|
+
height,
|
|
7311
|
+
onError: (msg) => setError(msg || DcLoadingError)
|
|
7272
7312
|
}
|
|
7273
7313
|
) }),
|
|
7274
7314
|
/* @__PURE__ */ jsxs13("div", { className: "form-group", children: [
|
|
@@ -7958,7 +7998,7 @@ function PartialPayment(props) {
|
|
|
7958
7998
|
}
|
|
7959
7999
|
};
|
|
7960
8000
|
const getPaymentDetails = async () => {
|
|
7961
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2;
|
|
8001
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2, _y2, _z2, _A;
|
|
7962
8002
|
showLoader();
|
|
7963
8003
|
try {
|
|
7964
8004
|
const data = {
|
|
@@ -7973,11 +8013,13 @@ function PartialPayment(props) {
|
|
|
7973
8013
|
handleClose();
|
|
7974
8014
|
setError("Something went wrong.");
|
|
7975
8015
|
}
|
|
8016
|
+
let willShowCardForm = true;
|
|
7976
8017
|
if (((_e2 = (_d2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _d2.data) == null ? void 0 : _e2.card_list) && ((_h2 = (_g2 = (_f2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _f2.data) == null ? void 0 : _g2.card_list) == null ? void 0 : _h2.length) > 0) {
|
|
7977
8018
|
let banklists = (_k2 = (_j2 = (_i2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _i2.data) == null ? void 0 : _j2.card_list) == null ? void 0 : _k2.filter((card) => (card == null ? void 0 : card.card_type) == "Bank");
|
|
7978
8019
|
let cardlists = (_n2 = (_m2 = (_l2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _l2.data) == null ? void 0 : _m2.card_list) == null ? void 0 : _n2.filter((card) => (card == null ? void 0 : card.card_type) !== "Bank");
|
|
7979
8020
|
if ((cardlists == null ? void 0 : cardlists.length) > 0) {
|
|
7980
8021
|
setActiveinCard("list");
|
|
8022
|
+
willShowCardForm = false;
|
|
7981
8023
|
}
|
|
7982
8024
|
if ((banklists == null ? void 0 : banklists.length) > 0) {
|
|
7983
8025
|
setActiveinBank("list");
|
|
@@ -7990,11 +8032,14 @@ function PartialPayment(props) {
|
|
|
7990
8032
|
if (((_p2 = (_o2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _o2.data) == null ? void 0 : _p2.paymentDeviceList) && ((_s2 = (_r2 = (_q2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _q2.data) == null ? void 0 : _r2.paymentDeviceList) == null ? void 0 : _s2.length) > 0) {
|
|
7991
8033
|
setSelectedReader((_u2 = (_t2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _t2.data) == null ? void 0 : _u2.paymentDeviceList[0]);
|
|
7992
8034
|
}
|
|
8035
|
+
if (willShowCardForm && ((_w2 = (_v2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _v2.data) == null ? void 0 : _w2.paymentGateway) === 31 && ((_y2 = (_x2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _x2.data) == null ? void 0 : _y2.dctoken)) {
|
|
8036
|
+
setLoadingIframe(true);
|
|
8037
|
+
}
|
|
7993
8038
|
hideLoader();
|
|
7994
8039
|
} catch (err) {
|
|
7995
8040
|
console.log(err);
|
|
7996
8041
|
hideLoader();
|
|
7997
|
-
setError(((
|
|
8042
|
+
setError(((_A = (_z2 = err == null ? void 0 : err.response) == null ? void 0 : _z2.data) == null ? void 0 : _A.message) || (err == null ? void 0 : err.message) || "Something went wrong");
|
|
7998
8043
|
}
|
|
7999
8044
|
};
|
|
8000
8045
|
const handlechargeCustomer = async (e) => {
|
|
@@ -8568,7 +8613,8 @@ function PartialPayment(props) {
|
|
|
8568
8613
|
{
|
|
8569
8614
|
isOpen: show,
|
|
8570
8615
|
tokenKey: paymentData == null ? void 0 : paymentData.dctoken,
|
|
8571
|
-
setLoader: setLoadingIframe
|
|
8616
|
+
setLoader: setLoadingIframe,
|
|
8617
|
+
onError: (msg) => setError(msg || DcLoadingError)
|
|
8572
8618
|
}
|
|
8573
8619
|
) }),
|
|
8574
8620
|
/* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
|
|
@@ -10118,6 +10164,10 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10118
10164
|
const [errorBankConsent, setErrorBankConsent] = useState9("");
|
|
10119
10165
|
const [errorBankConsentOther, setErrorBankConsentOther] = useState9("");
|
|
10120
10166
|
const [isTokenizerReady, setTokenizerReady] = useState9(false);
|
|
10167
|
+
console.log(loadingIframe, "loadingIframe");
|
|
10168
|
+
console.log(loading, "loader");
|
|
10169
|
+
console.log(loading2, "loading2");
|
|
10170
|
+
console.log(loadingPrev, "loadingPrev");
|
|
10121
10171
|
let mastercard2 = S3Url + "widget/mc-img.svg";
|
|
10122
10172
|
let visa2 = S3Url + "widget/visa-img.svg";
|
|
10123
10173
|
let americanexp2 = S3Url + "widget/ae-img.svg";
|
|
@@ -10326,6 +10376,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10326
10376
|
};
|
|
10327
10377
|
const completeFractalFlow = async (tokenizeData, intentid, typeoftoken) => {
|
|
10328
10378
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
10379
|
+
showLoader();
|
|
10329
10380
|
try {
|
|
10330
10381
|
console.log({
|
|
10331
10382
|
tokenizeData,
|
|
@@ -10951,7 +11002,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10951
11002
|
}
|
|
10952
11003
|
};
|
|
10953
11004
|
const getPaymentDetails = async () => {
|
|
10954
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
|
|
11005
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2;
|
|
10955
11006
|
try {
|
|
10956
11007
|
showLoader();
|
|
10957
11008
|
const res = await axios8.get(`${masterBaseUrl}api/v1/gateway/get-payment-details/${session_token}`, {
|
|
@@ -10965,16 +11016,20 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10965
11016
|
setProcessingFee(Number((_d2 = (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.fee) || 0);
|
|
10966
11017
|
setPaymentGateway((_f2 = (_e2 = res == null ? void 0 : res.data) == null ? void 0 : _e2.data) == null ? void 0 : _f2.paymentGateway);
|
|
10967
11018
|
setDCToken((_h2 = (_g2 = res == null ? void 0 : res.data) == null ? void 0 : _g2.data) == null ? void 0 : _h2.dctoken);
|
|
11019
|
+
debugger;
|
|
11020
|
+
if (((_j2 = (_i2 = res == null ? void 0 : res.data) == null ? void 0 : _i2.data) == null ? void 0 : _j2.paymentGateway) === 31 && ((_l2 = (_k2 = res == null ? void 0 : res.data) == null ? void 0 : _k2.data) == null ? void 0 : _l2.dctoken)) {
|
|
11021
|
+
setLoadingIframe(true);
|
|
11022
|
+
}
|
|
10968
11023
|
hideLoader();
|
|
10969
11024
|
}
|
|
10970
11025
|
} catch (error2) {
|
|
10971
|
-
console.log((
|
|
11026
|
+
console.log((_n2 = (_m2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _m2.data) == null ? void 0 : _n2.result, "error while getting payment details");
|
|
10972
11027
|
callback({
|
|
10973
|
-
error: ((
|
|
10974
|
-
result: (
|
|
10975
|
-
statusCode: (
|
|
11028
|
+
error: ((_p2 = (_o2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _o2.data) == null ? void 0 : _p2.message) || "Something went wrong!",
|
|
11029
|
+
result: (_r2 = (_q2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _q2.data) == null ? void 0 : _r2.result,
|
|
11030
|
+
statusCode: (_s2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _s2.status
|
|
10976
11031
|
});
|
|
10977
|
-
setError(((
|
|
11032
|
+
setError(((_u2 = (_t2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _t2.data) == null ? void 0 : _u2.message) || (error2 == null ? void 0 : error2.message) || "Something went wrong");
|
|
10978
11033
|
hideLoader();
|
|
10979
11034
|
}
|
|
10980
11035
|
};
|
|
@@ -11441,7 +11496,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11441
11496
|
tokenKey: dcToken,
|
|
11442
11497
|
setLoader: activeinCard === "form" ? setLoadingIframe : null,
|
|
11443
11498
|
isEmbedded: onSubmit ? true : false,
|
|
11444
|
-
customCSS
|
|
11499
|
+
customCSS,
|
|
11500
|
+
onError: (msg) => setError(msg || DcLoadingError)
|
|
11445
11501
|
}
|
|
11446
11502
|
) }),
|
|
11447
11503
|
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
|