@fractalpay/fractalpay-next-dev 0.0.305 → 0.0.306

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 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-dev",
42
- version: "0.0.305",
42
+ version: "0.0.306",
43
43
  private: false,
44
44
  type: "module",
45
45
  scripts: {
@@ -287,7 +287,7 @@ if (name === "@fractalpay/fractalpay-next-dev") {
287
287
  applePayMerchantId = "fractal";
288
288
  googlePayMerchantId = "BCR2DN4T6OC2TCQH";
289
289
  googlePayEnvironment = "PRODUCTION";
290
- googlePayGatewayMerchantId = "fractal";
290
+ googlePayGatewayMerchantId = "skysystemz";
291
291
  } else if (name === "@fractalpay/fractalpay-next") {
292
292
  masterBaseUrl = "https://api.fractalpay.com/";
293
293
  baseUrl = "https://widget.fractalpay.com/";
@@ -297,7 +297,7 @@ if (name === "@fractalpay/fractalpay-next-dev") {
297
297
  applePayMerchantId = "fractal";
298
298
  googlePayMerchantId = "BCR2DN4T6OC2TCQH";
299
299
  googlePayEnvironment = "PRODUCTION";
300
- googlePayGatewayMerchantId = "fractal";
300
+ googlePayGatewayMerchantId = "skysystemz";
301
301
  } else {
302
302
  baseUrl = "http://localhost:8082/";
303
303
  masterBaseUrl = "http://localhost:8081/";
@@ -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
- await waitForSDK();
3556
- const sdk = window.DatacapHostedWebToken;
3557
- if (datacapInitializing || datacapInitialized) {
3558
- console.log("\u{1F7E1} Datacap already initializing/initialized");
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
- datacapInitializing = true;
3562
- const initTimeout = setTimeout(() => {
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
- datacapInitializing = false;
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
- clearTimeout(initTimeout);
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
  };
@@ -4993,7 +5020,7 @@ function GetPaymentPage(props) {
4993
5020
  }
4994
5021
  };
4995
5022
  const getPaymentDetails = async () => {
4996
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
5023
+ 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;
4997
5024
  showLoader();
4998
5025
  try {
4999
5026
  const data = {
@@ -5008,12 +5035,14 @@ function GetPaymentPage(props) {
5008
5035
  handleClose();
5009
5036
  setError("Something went wrong.");
5010
5037
  }
5038
+ let willShowCardForm = true;
5011
5039
  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) {
5012
5040
  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");
5013
5041
  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");
5014
5042
  if ((cardlists == null ? void 0 : cardlists.length) > 0 || (banklists == null ? void 0 : banklists.length) > 0) {
5015
5043
  setActiveinCard("list");
5016
5044
  setActiveinBank("list");
5045
+ willShowCardForm = false;
5017
5046
  }
5018
5047
  setCardList(cardlists);
5019
5048
  setBankList(banklists);
@@ -5023,11 +5052,14 @@ function GetPaymentPage(props) {
5023
5052
  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) {
5024
5053
  setSelectedReader((_u = (_t = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _t.data) == null ? void 0 : _u.paymentDeviceList[0]);
5025
5054
  }
5055
+ 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)) {
5056
+ setLoadingIframe(true);
5057
+ }
5026
5058
  hideLoader();
5027
5059
  } catch (err) {
5028
5060
  console.log(err);
5029
5061
  hideLoader();
5030
- setError(((_w = (_v = err == null ? void 0 : err.response) == null ? void 0 : _v.data) == null ? void 0 : _w.message) || (err == null ? void 0 : err.message) || "Something went wrong");
5062
+ 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");
5031
5063
  }
5032
5064
  };
5033
5065
  const handlechargeCustomer = async (e) => {
@@ -5585,7 +5617,7 @@ function GetPaymentPage(props) {
5585
5617
  getSurchargeOptions,
5586
5618
  onSurchargeResult: setSurchargeResult
5587
5619
  }
5588
- ) : /* @__PURE__ */ jsx18(DataCapFields, { isOpen: show, tokenKey: paymentData == null ? void 0 : paymentData.dctoken, setLoader: setLoadingIframe }) }) }),
5620
+ ) : /* @__PURE__ */ jsx18(DataCapFields, { isOpen: show, tokenKey: paymentData == null ? void 0 : paymentData.dctoken, setLoader: setLoadingIframe, onError: (msg) => setError(msg || DcLoadingError) }) }) }),
5589
5621
  /* @__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) }) }),
5590
5622
  (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsxs9(FractalCheckbox, { id: "save_card", checked: saveCardInfo, onChange: (v) => setSaveCardInfo(v), children: [
5591
5623
  "Save this card. ",
@@ -6158,7 +6190,7 @@ function AddCardEasyPay(props) {
6158
6190
  return Object.keys(errors).length > 0;
6159
6191
  };
6160
6192
  const getPaymentDetails = async () => {
6161
- var _a2, _b2, _c;
6193
+ var _a2, _b2, _c, _d, _e, _f, _g;
6162
6194
  showLoader();
6163
6195
  try {
6164
6196
  const data = {
@@ -6172,6 +6204,9 @@ function AddCardEasyPay(props) {
6172
6204
  handleClose();
6173
6205
  setError("Something went wrong.");
6174
6206
  }
6207
+ 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)) {
6208
+ setLoadingIframe(true);
6209
+ }
6175
6210
  hideLoader();
6176
6211
  } catch (err) {
6177
6212
  console.log(err);
@@ -6429,7 +6464,8 @@ function AddCardEasyPay(props) {
6429
6464
  isOpen: true,
6430
6465
  tokenKey: paymentData == null ? void 0 : paymentData.dctoken,
6431
6466
  setLoader: setLoadingIframe,
6432
- isAddCard: true
6467
+ isAddCard: true,
6468
+ onError: (msg) => setError(msg || DcLoadingError)
6433
6469
  }
6434
6470
  ) }),
6435
6471
  /* @__PURE__ */ jsxs11("div", { className: "form-group", style: { marginTop: "0" }, children: [
@@ -7036,21 +7072,24 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
7036
7072
  onCancel();
7037
7073
  };
7038
7074
  const getPaymentDetails = async () => {
7039
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
7075
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
7040
7076
  try {
7041
7077
  showLoader();
7042
7078
  const res = await axios5.get(`${masterBaseUrl}api/v1/gateway/get-payment-details/${session_token}`);
7043
7079
  if ((res == null ? void 0 : res.status) == 200) {
7044
7080
  setPaymentGateway((_b2 = (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.paymentGateway);
7045
7081
  setDCToken((_d = (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.data) == null ? void 0 : _d.dctoken);
7082
+ 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)) {
7083
+ setLoadingIframe(true);
7084
+ }
7046
7085
  hideLoader();
7047
7086
  }
7048
7087
  } catch (error2) {
7049
- console.log((_f = (_e = error2 == null ? void 0 : error2.response) == null ? void 0 : _e.data) == null ? void 0 : _f.result, "error while getting payment details");
7088
+ 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");
7050
7089
  callback({
7051
- error: ((_h = (_g = error2 == null ? void 0 : error2.response) == null ? void 0 : _g.data) == null ? void 0 : _h.message) || "Something went wrong!",
7052
- result: (_j = (_i = error2 == null ? void 0 : error2.response) == null ? void 0 : _i.data) == null ? void 0 : _j.result,
7053
- statusCode: (_k = error2 == null ? void 0 : error2.response) == null ? void 0 : _k.status
7090
+ error: ((_l = (_k = error2 == null ? void 0 : error2.response) == null ? void 0 : _k.data) == null ? void 0 : _l.message) || "Something went wrong!",
7091
+ result: (_n = (_m = error2 == null ? void 0 : error2.response) == null ? void 0 : _m.data) == null ? void 0 : _n.result,
7092
+ statusCode: (_o = error2 == null ? void 0 : error2.response) == null ? void 0 : _o.status
7054
7093
  });
7055
7094
  hideLoader();
7056
7095
  }
@@ -7316,7 +7355,8 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
7316
7355
  tokenKey: dcToken,
7317
7356
  setLoader: setLoadingIframe,
7318
7357
  customCSS,
7319
- height
7358
+ height,
7359
+ onError: (msg) => setError(msg || DcLoadingError)
7320
7360
  }
7321
7361
  ) }),
7322
7362
  /* @__PURE__ */ jsxs13("div", { className: "form-group", children: [
@@ -8006,7 +8046,7 @@ function PartialPayment(props) {
8006
8046
  }
8007
8047
  };
8008
8048
  const getPaymentDetails = async () => {
8009
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2;
8049
+ 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;
8010
8050
  showLoader();
8011
8051
  try {
8012
8052
  const data = {
@@ -8021,11 +8061,13 @@ function PartialPayment(props) {
8021
8061
  handleClose();
8022
8062
  setError("Something went wrong.");
8023
8063
  }
8064
+ let willShowCardForm = true;
8024
8065
  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) {
8025
8066
  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");
8026
8067
  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");
8027
8068
  if ((cardlists == null ? void 0 : cardlists.length) > 0) {
8028
8069
  setActiveinCard("list");
8070
+ willShowCardForm = false;
8029
8071
  }
8030
8072
  if ((banklists == null ? void 0 : banklists.length) > 0) {
8031
8073
  setActiveinBank("list");
@@ -8038,11 +8080,14 @@ function PartialPayment(props) {
8038
8080
  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) {
8039
8081
  setSelectedReader((_u2 = (_t2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _t2.data) == null ? void 0 : _u2.paymentDeviceList[0]);
8040
8082
  }
8083
+ 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)) {
8084
+ setLoadingIframe(true);
8085
+ }
8041
8086
  hideLoader();
8042
8087
  } catch (err) {
8043
8088
  console.log(err);
8044
8089
  hideLoader();
8045
- setError(((_w2 = (_v2 = err == null ? void 0 : err.response) == null ? void 0 : _v2.data) == null ? void 0 : _w2.message) || (err == null ? void 0 : err.message) || "Something went wrong");
8090
+ 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");
8046
8091
  }
8047
8092
  };
8048
8093
  const handlechargeCustomer = async (e) => {
@@ -8616,7 +8661,8 @@ function PartialPayment(props) {
8616
8661
  {
8617
8662
  isOpen: show,
8618
8663
  tokenKey: paymentData == null ? void 0 : paymentData.dctoken,
8619
- setLoader: setLoadingIframe
8664
+ setLoader: setLoadingIframe,
8665
+ onError: (msg) => setError(msg || DcLoadingError)
8620
8666
  }
8621
8667
  ) }),
8622
8668
  /* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
@@ -10166,6 +10212,10 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10166
10212
  const [errorBankConsent, setErrorBankConsent] = useState9("");
10167
10213
  const [errorBankConsentOther, setErrorBankConsentOther] = useState9("");
10168
10214
  const [isTokenizerReady, setTokenizerReady] = useState9(false);
10215
+ console.log(loadingIframe, "loadingIframe");
10216
+ console.log(loading, "loader");
10217
+ console.log(loading2, "loading2");
10218
+ console.log(loadingPrev, "loadingPrev");
10169
10219
  let mastercard2 = S3Url + "widget/mc-img.svg";
10170
10220
  let visa2 = S3Url + "widget/visa-img.svg";
10171
10221
  let americanexp2 = S3Url + "widget/ae-img.svg";
@@ -10374,6 +10424,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10374
10424
  };
10375
10425
  const completeFractalFlow = async (tokenizeData, intentid, typeoftoken) => {
10376
10426
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
10427
+ showLoader();
10377
10428
  try {
10378
10429
  console.log({
10379
10430
  tokenizeData,
@@ -10999,7 +11050,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10999
11050
  }
11000
11051
  };
11001
11052
  const getPaymentDetails = async () => {
11002
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
11053
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2;
11003
11054
  try {
11004
11055
  showLoader();
11005
11056
  const res = await axios8.get(`${masterBaseUrl}api/v1/gateway/get-payment-details/${session_token}`, {
@@ -11013,16 +11064,19 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
11013
11064
  setProcessingFee(Number((_d2 = (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.fee) || 0);
11014
11065
  setPaymentGateway((_f2 = (_e2 = res == null ? void 0 : res.data) == null ? void 0 : _e2.data) == null ? void 0 : _f2.paymentGateway);
11015
11066
  setDCToken((_h2 = (_g2 = res == null ? void 0 : res.data) == null ? void 0 : _g2.data) == null ? void 0 : _h2.dctoken);
11067
+ 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)) {
11068
+ setLoadingIframe(true);
11069
+ }
11016
11070
  hideLoader();
11017
11071
  }
11018
11072
  } catch (error2) {
11019
- console.log((_j2 = (_i2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _i2.data) == null ? void 0 : _j2.result, "error while getting payment details");
11073
+ 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");
11020
11074
  callback({
11021
- error: ((_l2 = (_k2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _k2.data) == null ? void 0 : _l2.message) || "Something went wrong!",
11022
- result: (_n2 = (_m2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _m2.data) == null ? void 0 : _n2.result,
11023
- statusCode: (_o2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _o2.status
11075
+ error: ((_p2 = (_o2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _o2.data) == null ? void 0 : _p2.message) || "Something went wrong!",
11076
+ result: (_r2 = (_q2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _q2.data) == null ? void 0 : _r2.result,
11077
+ statusCode: (_s2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _s2.status
11024
11078
  });
11025
- setError(((_q2 = (_p2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _p2.data) == null ? void 0 : _q2.message) || (error2 == null ? void 0 : error2.message) || "Something went wrong");
11079
+ 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");
11026
11080
  hideLoader();
11027
11081
  }
11028
11082
  };
@@ -11489,7 +11543,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
11489
11543
  tokenKey: dcToken,
11490
11544
  setLoader: activeinCard === "form" ? setLoadingIframe : null,
11491
11545
  isEmbedded: onSubmit ? true : false,
11492
- customCSS
11546
+ customCSS,
11547
+ onError: (msg) => setError(msg || DcLoadingError)
11493
11548
  }
11494
11549
  ) }),
11495
11550
  /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [