@fractalpay/fractalpay-next 0.0.27 → 0.0.28

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",
42
- version: "0.0.27",
42
+ version: "0.0.28",
43
43
  private: false,
44
44
  type: "module",
45
45
  scripts: {
@@ -3247,10 +3247,7 @@ import { useEffect as useEffect6 } from "react";
3247
3247
  var scriptLoaded = false;
3248
3248
  var DataCapScriptLoader = () => {
3249
3249
  useEffect6(() => {
3250
- console.log("\u{1F535} DataCapScriptLoader mounted");
3251
- console.log("\u{1F535} scriptLoaded flag:", scriptLoaded);
3252
3250
  if (scriptLoaded) {
3253
- console.log("\u{1F7E1} Script already marked as loaded. Skipping injection.");
3254
3251
  return;
3255
3252
  }
3256
3253
  const existingScript = document.querySelector(
@@ -3258,25 +3255,19 @@ var DataCapScriptLoader = () => {
3258
3255
  );
3259
3256
  console.log("\u{1F535} existingScript found:", !!existingScript);
3260
3257
  if (!existingScript) {
3261
- console.log("\u{1F7E2} Injecting DataCap hosted script...");
3262
3258
  const script2 = document.createElement("script");
3263
3259
  script2.src = `${datacapUrl}/hosted`;
3264
3260
  script2.async = true;
3265
3261
  script2.onload = () => {
3266
3262
  console.log("\u2705 DataCap script loaded successfully");
3267
3263
  scriptLoaded = true;
3268
- console.log("\u{1F535} scriptLoaded flag updated to:", scriptLoaded);
3269
- console.log("\u{1F535} window.dcap:", window.DatacapHostedWebToken);
3270
3264
  };
3271
3265
  script2.onerror = (err) => {
3272
3266
  console.error("\u274C DataCap script failed to load", err);
3273
3267
  };
3274
3268
  document.head.appendChild(script2);
3275
3269
  } else {
3276
- console.log("\u{1F7E1} Script already exists in DOM.");
3277
3270
  scriptLoaded = true;
3278
- console.log("\u{1F535} scriptLoaded flag updated to:", scriptLoaded);
3279
- console.log("\u{1F535} window.dcap:", window.dcap);
3280
3271
  }
3281
3272
  }, []);
3282
3273
  return null;
@@ -3386,7 +3377,6 @@ var DataCapFields = ({
3386
3377
  }
3387
3378
  `;
3388
3379
  }
3389
- console.log(customCSS, "customcss");
3390
3380
  const initialize = async () => {
3391
3381
  setLoader == null ? void 0 : setLoader(true);
3392
3382
  setIframeReady(false);
@@ -8573,7 +8563,6 @@ function SkyChargewidgetstyles() {
8573
8563
  font-family: 'Inter', sans-serif !important;
8574
8564
  }
8575
8565
  .frac-form .form-group-frac{
8576
- margin:0 !important;
8577
8566
  padding: 5px 0;
8578
8567
  }
8579
8568
  .frac-form .mb-4{
@@ -8897,7 +8886,6 @@ function SkyChargewidgetstyles() {
8897
8886
  .form-control-frac{box-sizing: border-box ;}
8898
8887
  #PaymentForm .form-group-frac{
8899
8888
  padding:5px 0 ;
8900
- matgin: 0 !important
8901
8889
  }
8902
8890
 
8903
8891
  .toggle-label {
@@ -9767,11 +9755,12 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9767
9755
  public_key_pem: ((_b2 = (_a2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.publicKeyPem) || ((_d2 = (_c2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.public_key_pem),
9768
9756
  session_key: (_f2 = (_e2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _e2.data) == null ? void 0 : _f2.session_key
9769
9757
  };
9758
+ let three_ds_data = null;
9770
9759
  if (require3ds) {
9771
9760
  if (typeof window !== "undefined" && typeof navigator !== "undefined") {
9772
9761
  const languages = (_g2 = navigator.languages) != null ? _g2 : [navigator.language];
9773
9762
  const language = Array.isArray(languages) ? languages[0] : languages;
9774
- objtokenize.three_ds_data = {
9763
+ three_ds_data = {
9775
9764
  amount: partialAmount ? Math.round(parseFloat(partialAmount) * 100) : Math.round(parseFloat(amount) * 100),
9776
9765
  // convert dollars → cents
9777
9766
  currency: "usd",
@@ -9791,7 +9780,10 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9791
9780
  }
9792
9781
  let tokenizeData;
9793
9782
  try {
9794
- tokenizeData = await tokenizerRef.current.createToken(objtokenize);
9783
+ tokenizeData = await tokenizerRef.current.createToken(
9784
+ objtokenize,
9785
+ three_ds_data
9786
+ );
9795
9787
  } catch (error2) {
9796
9788
  setErrorIframe(error2);
9797
9789
  hideLoader();
@@ -10120,6 +10112,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10120
10112
  setActive("card");
10121
10113
  setActiveinCard("list");
10122
10114
  setCardList(cardlists);
10115
+ setLoadingIframe(false);
10123
10116
  } else {
10124
10117
  setActive("card");
10125
10118
  setCardList([]);
@@ -10319,7 +10312,12 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10319
10312
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2;
10320
10313
  try {
10321
10314
  showLoader();
10322
- const res = await axios9.get(`${masterBaseUrl}api/v1/gateway/get-payment-details/${session_token}`);
10315
+ const res = await axios9.get(`${masterBaseUrl}api/v1/gateway/get-payment-details/${session_token}`, {
10316
+ params: {
10317
+ require3ds,
10318
+ pass_fee
10319
+ }
10320
+ });
10323
10321
  if ((res == null ? void 0 : res.status) == 200) {
10324
10322
  setIsBankActive((_b2 = (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.isBankActive);
10325
10323
  setProcessingFee(Number((_d2 = (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.fee) || 0);
@@ -10464,6 +10462,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10464
10462
  styles: {}
10465
10463
  });
10466
10464
  }, []);
10465
+ console.log(activeinCard === "list", "activeinCard", activeList);
10467
10466
  return /* @__PURE__ */ jsxs19(Fragment18, { children: [
10468
10467
  initialLoader && /* @__PURE__ */ jsx32(Loader_default, { loading: initialLoader }),
10469
10468
  error && /* @__PURE__ */ jsx32("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx32(ErrorCardMessage_default, { error, onClose: handleClose }) }),
@@ -10669,7 +10668,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10669
10668
  {
10670
10669
  isOpen: show,
10671
10670
  tokenKey: dcToken,
10672
- setLoader: setLoadingIframe
10671
+ setLoader: activeinCard === "form" ? setLoadingIframe : null
10673
10672
  }
10674
10673
  ) }),
10675
10674
  /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
@@ -10745,12 +10744,12 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10745
10744
  minHeight: "444px",
10746
10745
  maxHeight: "444px"
10747
10746
  }, children: [
10748
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac mb-4", children: [
10747
+ /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10749
10748
  /* @__PURE__ */ jsx32("label", { htmlFor: "nameonaccount", children: "Name on account" }),
10750
10749
  /* @__PURE__ */ jsx32("input", { type: "text", id: "nameonaccount", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", name: "name", value: (_l = achData == null ? void 0 : achData.name) != null ? _l : "", onChange: handleChangeAch }),
10751
10750
  (achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
10752
10751
  ] }),
10753
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac mb-4", children: [
10752
+ /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10754
10753
  /* @__PURE__ */ jsx32("label", { htmlFor: "routingnumber", children: "Routing number" }),
10755
10754
  /* @__PURE__ */ jsx32(
10756
10755
  "input",
@@ -10767,7 +10766,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10767
10766
  ),
10768
10767
  (achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.routingNumber })
10769
10768
  ] }),
10770
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac mb-4", children: [
10769
+ /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10771
10770
  /* @__PURE__ */ jsx32("label", { htmlFor: "accountnumber", children: "Account number" }),
10772
10771
  /* @__PURE__ */ jsx32(
10773
10772
  "input",
@@ -10784,7 +10783,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10784
10783
  ),
10785
10784
  (achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.accountNumber })
10786
10785
  ] }),
10787
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac mb-4", children: [
10786
+ /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10788
10787
  /* @__PURE__ */ jsx32("label", { htmlFor: "confirmaccountnumber", children: "Confirm account number" }),
10789
10788
  /* @__PURE__ */ jsx32(
10790
10789
  "input",
@@ -10801,7 +10800,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10801
10800
  ),
10802
10801
  (achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.confirmAccountNumber })
10803
10802
  ] }),
10804
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac mb-4", children: [
10803
+ /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10805
10804
  /* @__PURE__ */ jsx32("label", { htmlFor: "bankname", children: "Bank name" }),
10806
10805
  /* @__PURE__ */ jsx32(
10807
10806
  "input",
@@ -10818,7 +10817,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10818
10817
  ),
10819
10818
  (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.bankName })
10820
10819
  ] }),
10821
- ((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac mb-4", children: [
10820
+ ((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10822
10821
  /* @__PURE__ */ jsx32("label", { htmlFor: "companyName", children: "Company name" }),
10823
10822
  /* @__PURE__ */ jsx32(
10824
10823
  "input",
@@ -10835,18 +10834,18 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10835
10834
  ),
10836
10835
  (achError == null ? void 0 : achError.companyName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.companyName })
10837
10836
  ] }),
10838
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac mb-4", children: [
10837
+ /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10839
10838
  /* @__PURE__ */ jsx32("label", { htmlFor: "accounttype", children: "Select account type" }),
10840
10839
  /* @__PURE__ */ jsxs19("select", { name: "accountType", id: "accounttype", className: "form-control-frac", value: (_r = achData == null ? void 0 : achData.accountType) != null ? _r : "", onChange: handleChangeAch, children: [
10841
10840
  /* @__PURE__ */ jsx32("option", { value: "", children: "Select account" }),
10842
10841
  accountTypes.map((type) => /* @__PURE__ */ jsx32("option", { value: type.value, children: type.label }, type.value))
10843
10842
  ] })
10844
10843
  ] }),
10845
- customerId && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
10844
+ customerId && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
10846
10845
  /* @__PURE__ */ jsx32("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
10847
10846
  /* @__PURE__ */ jsx32("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save ACH" })
10848
10847
  ] }),
10849
- saveACHinfo && /* @__PURE__ */ jsx32("div", { className: "form-group-frac mb-4 saveachtext", children: /* @__PURE__ */ jsxs19("p", { children: [
10848
+ saveACHinfo && /* @__PURE__ */ jsx32("div", { className: "form-group-frac saveachtext", children: /* @__PURE__ */ jsxs19("p", { children: [
10850
10849
  "If checked, I agree to give the ",
10851
10850
  /* @__PURE__ */ jsx32("b", { children: merchantName || "merchant" }),
10852
10851
  " permission to charge this bank account for agreed-upon purchases in the future."