@fractalpay/fractalpay-next-dev 0.0.245 → 0.0.247

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.245",
42
+ version: "0.0.247",
43
43
  private: false,
44
44
  type: "module",
45
45
  scripts: {
@@ -236,8 +236,8 @@ var Loader_default = Loader;
236
236
  var { name } = require_package();
237
237
  var S3Url = "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/";
238
238
  if (name === "@fractalpay/fractalpay-next-dev") {
239
- masterBaseUrl = "https://dev-sky-node.fractalpay.com/";
240
239
  baseUrl = "https://dev-widget.fractalpay.com/";
240
+ masterBaseUrl = "http://localhost:8081/";
241
241
  fractalGatewayUrl = "https://api-dev.merchant-trends.com/";
242
242
  datacapUrl = "https://token-cert.dcap.com/v1/client";
243
243
  threedsSecurePublicKey = "pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw";
@@ -3537,6 +3537,8 @@ function GetPaymentPage(props) {
3537
3537
  const [activeForm, setActiveForm] = useState4(true);
3538
3538
  const [saveCardInfo, setSaveCardInfo] = useState4(false);
3539
3539
  const [saveACHinfo, setSaveACHinfo] = useState4(false);
3540
+ const [isBankConsentChecked, setIsBankConsentChecked] = useState4(false);
3541
+ const [errorBankConsent, setErrorBankConsent] = useState4("");
3540
3542
  const fractalpayClientKey = props.merchantPublicKey;
3541
3543
  let mastercard2 = S3Url + "widget/mc-img.svg";
3542
3544
  let visa2 = S3Url + "widget/visa-img.svg";
@@ -3656,6 +3658,8 @@ function GetPaymentPage(props) {
3656
3658
  setLoading(false);
3657
3659
  setBankList([]);
3658
3660
  setCardList([]);
3661
+ setIsBankConsentChecked(false);
3662
+ setErrorBankConsent("");
3659
3663
  };
3660
3664
  const handleShow = () => setShow(true);
3661
3665
  const handletabchange = (id) => {
@@ -3755,8 +3759,11 @@ function GetPaymentPage(props) {
3755
3759
  errors.companyName = "Company Name is required for business accounts";
3756
3760
  }
3757
3761
  }
3762
+ if (!isBankConsentChecked) {
3763
+ setErrorBankConsent("Above consent is requied");
3764
+ }
3758
3765
  setAchError(errors);
3759
- return Object.keys(errors).length > 0;
3766
+ return Object.keys(errors).length > 0 || !isBankConsentChecked;
3760
3767
  };
3761
3768
  const submitFunc = async (e) => {
3762
3769
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2;
@@ -4680,9 +4687,15 @@ function GetPaymentPage(props) {
4680
4687
  ] })
4681
4688
  ] }),
4682
4689
  /* @__PURE__ */ jsxs11("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
4683
- /* @__PURE__ */ jsx19("input", { type: "checkbox", id: "achconsent", className: "", maxLength: 100, placeholder: "My Bank" }),
4690
+ /* @__PURE__ */ jsx19("input", { type: "checkbox", id: "achconsent", className: "", checked: isBankConsentChecked, onChange: (e) => {
4691
+ setIsBankConsentChecked(e.target.checked);
4692
+ if (e.target.checked) {
4693
+ setErrorBankConsent("");
4694
+ }
4695
+ } }),
4684
4696
  /* @__PURE__ */ jsx19("label", { htmlFor: "achconsent", children: `By selecting this box, I authorize SkyFi, on behalf of ${(paymentData == null ? void 0 : paymentData.bname) || "merchant"}, to initiate a one-time electronic ACH debit from my bank account for the total amount displayed on this screen, including any applicable processing fee. I confirm that I am authorized to use this account and that the bank account information I provided is correct.` })
4685
4697
  ] }),
4698
+ errorBankConsent && /* @__PURE__ */ jsx19("span", { className: "error-span", children: errorBankConsent }),
4686
4699
  (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsxs11("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
4687
4700
  /* @__PURE__ */ jsx19("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
4688
4701
  /* @__PURE__ */ jsx19("label", { htmlFor: "saveACH", children: "Save Bank" })
@@ -7447,6 +7460,8 @@ function PartialPayment(props) {
7447
7460
  const [aftertaxAmount, setAfterTaxAmount] = useState8(Number(props == null ? void 0 : props.amount));
7448
7461
  const [partialAmount, setPartialAmount] = useState8("");
7449
7462
  const [partialError, setPartialError] = useState8("");
7463
+ const [isBankConsentChecked, setIsBankConsentChecked] = useState8(false);
7464
+ const [errorBankConsent, setErrorBankConsent] = useState8("");
7450
7465
  const tokenizerRef = useRef8(null);
7451
7466
  const fractalStyles = {
7452
7467
  input: {
@@ -7558,6 +7573,8 @@ function PartialPayment(props) {
7558
7573
  setCardList([]);
7559
7574
  setPartialAmount("");
7560
7575
  setPartialError("");
7576
+ setIsBankConsentChecked(false);
7577
+ setErrorBankConsent("");
7561
7578
  };
7562
7579
  const handleShow = () => setShow(true);
7563
7580
  const handletabchange = (id) => {
@@ -7658,8 +7675,11 @@ function PartialPayment(props) {
7658
7675
  errors.companyName = "Company Name is required for business accounts";
7659
7676
  }
7660
7677
  }
7678
+ if (!isBankConsentChecked) {
7679
+ setErrorBankConsent("Above consent is requied");
7680
+ }
7661
7681
  setAchError(errors);
7662
- return Object.keys(errors).length > 0;
7682
+ return Object.keys(errors).length > 0 || !isBankConsentChecked;
7663
7683
  };
7664
7684
  const submitFunc = async (e) => {
7665
7685
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2;
@@ -8607,9 +8627,24 @@ function PartialPayment(props) {
8607
8627
  ] })
8608
8628
  ] }),
8609
8629
  /* @__PURE__ */ jsxs17("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
8610
- /* @__PURE__ */ jsx28("input", { type: "checkbox", id: "achconsent", className: "", maxLength: 100, placeholder: "My Bank" }),
8630
+ /* @__PURE__ */ jsx28(
8631
+ "input",
8632
+ {
8633
+ type: "checkbox",
8634
+ id: "achconsent",
8635
+ className: "",
8636
+ checked: isBankConsentChecked,
8637
+ onChange: (e) => {
8638
+ setIsBankConsentChecked(e.target.checked);
8639
+ if (e.target.checked) {
8640
+ setErrorBankConsent("");
8641
+ }
8642
+ }
8643
+ }
8644
+ ),
8611
8645
  /* @__PURE__ */ jsx28("label", { htmlFor: "achconsent", children: `By selecting this box, I authorize SkyFi, on behalf of ${(paymentData == null ? void 0 : paymentData.bname) || "merchant"}, to initiate a one-time electronic ACH debit from my bank account for the total amount displayed on this screen, including any applicable processing fee. I confirm that I am authorized to use this account and that the bank account information I provided is correct.` })
8612
8646
  ] }),
8647
+ errorBankConsent && /* @__PURE__ */ jsx28("span", { className: "error-span", children: errorBankConsent }),
8613
8648
  (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsxs17("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
8614
8649
  /* @__PURE__ */ jsx28("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
8615
8650
  /* @__PURE__ */ jsx28("label", { htmlFor: "saveACH", children: "Save Bank" })
@@ -9783,6 +9818,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9783
9818
  const [remainingAmount, setRemainingAmount] = useState10("");
9784
9819
  const [paymentGateway, setPaymentGateway] = useState10();
9785
9820
  const [dcToken, setDCToken] = useState10();
9821
+ const [isBankConsentChecked, setIsBankConsentChecked] = useState10(false);
9822
+ const [errorBankConsent, setErrorBankConsent] = useState10("");
9786
9823
  let mastercard2 = S3Url + "widget/mc-img.svg";
9787
9824
  let visa2 = S3Url + "widget/visa-img.svg";
9788
9825
  let americanexp2 = S3Url + "widget/ae-img.svg";
@@ -9974,8 +10011,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9974
10011
  errors.companyName = "Company Name is required for business accounts";
9975
10012
  }
9976
10013
  }
10014
+ if (!isBankConsentChecked) {
10015
+ setErrorBankConsent("Above consent is requied");
10016
+ }
9977
10017
  setAchError(errors);
9978
- return Object.keys(errors).length > 0;
10018
+ return Object.keys(errors).length > 0 || !isBankConsentChecked;
9979
10019
  };
9980
10020
  const completeFractalFlow = async (tokenizeData, intentid) => {
9981
10021
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
@@ -10379,6 +10419,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10379
10419
  setPartialAmount("");
10380
10420
  setPartialError("");
10381
10421
  setRemainingAmount("");
10422
+ setIsBankConsentChecked(false);
10423
+ setErrorBankConsent("");
10382
10424
  };
10383
10425
  const getCardList = async () => {
10384
10426
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
@@ -11233,21 +11275,27 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
11233
11275
  "There is a processing fee of ",
11234
11276
  /* @__PURE__ */ jsx34("span", { className: "frac-fee-amount", children: formatUSD(bankFeeAmount.toFixed(2)) }),
11235
11277
  "."
11236
- ] })
11237
- ] }),
11238
- /* @__PURE__ */ jsxs20("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
11239
- /* @__PURE__ */ jsx34("input", { type: "checkbox", id: "achconsent", className: "", maxLength: 100, placeholder: "My Bank" }),
11240
- /* @__PURE__ */ jsx34("label", { className: "saveachlabel", htmlFor: "achconsent", children: `By selecting this box, I authorize SkyFi, on behalf of ${merchantName || "merchant"}, to initiate a one-time electronic ACH debit from my bank account for the total amount displayed on this screen, including any applicable processing fee. I confirm that I am authorized to use this account and that the bank account information I provided is correct.` })
11241
- ] }),
11242
- customerId && /* @__PURE__ */ jsxs20("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
11243
- /* @__PURE__ */ jsx34("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
11244
- /* @__PURE__ */ jsx34("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save Bank" })
11245
- ] }),
11246
- saveACHinfo && /* @__PURE__ */ jsx34("div", { className: "form-group-frac saveachtext", children: /* @__PURE__ */ jsxs20("p", { children: [
11247
- "If checked, I agree to give the ",
11248
- /* @__PURE__ */ jsx34("b", { children: merchantName || "merchant" }),
11249
- " permission to charge this bank account for agreed-upon purchases in the future."
11250
- ] }) })
11278
+ ] }),
11279
+ /* @__PURE__ */ jsxs20("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
11280
+ /* @__PURE__ */ jsx34("input", { type: "checkbox", id: "achconsent", className: "", checked: isBankConsentChecked, onChange: (e) => {
11281
+ setIsBankConsentChecked(e.target.checked);
11282
+ if (e.target.checked) {
11283
+ setErrorBankConsent("");
11284
+ }
11285
+ } }),
11286
+ /* @__PURE__ */ jsx34("label", { className: "saveachlabel", htmlFor: "achconsent", children: `By selecting this box, I authorize SkyFi, on behalf of ${merchantName || "merchant"}, to initiate a one-time electronic ACH debit from my bank account for the total amount displayed on this screen, including any applicable processing fee. I confirm that I am authorized to use this account and that the bank account information I provided is correct.` })
11287
+ ] }),
11288
+ errorBankConsent && /* @__PURE__ */ jsx34("span", { className: "error-span", children: errorBankConsent }),
11289
+ customerId && /* @__PURE__ */ jsxs20("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
11290
+ /* @__PURE__ */ jsx34("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
11291
+ /* @__PURE__ */ jsx34("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save Bank" })
11292
+ ] }),
11293
+ saveACHinfo && /* @__PURE__ */ jsx34("div", { className: "form-group-frac saveachtext", children: /* @__PURE__ */ jsxs20("p", { children: [
11294
+ "If checked, I agree to give the ",
11295
+ /* @__PURE__ */ jsx34("b", { children: merchantName || "merchant" }),
11296
+ " permission to charge this bank account for agreed-upon purchases in the future."
11297
+ ] }) })
11298
+ ] })
11251
11299
  ] }),
11252
11300
  /* @__PURE__ */ jsx34("div", { className: "form-group-frac ", children: /* @__PURE__ */ jsx34("button", { className: "pay-button", style: { margin: "20px 0 0", display: onSubmit ? "none" : "block" }, type: "submit", children: formatUSD((_u = Number(bankAmount)) == null ? void 0 : _u.toFixed(2)) }) })
11253
11301
  ] })