@fractalpay/fractalpay-next 0.1.6 → 0.1.7

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.1.6",
42
+ version: "0.1.7",
43
43
  private: false,
44
44
  type: "module",
45
45
  scripts: {
@@ -3614,6 +3614,10 @@ var DataCapFields = ({
3614
3614
  initialize();
3615
3615
  return () => {
3616
3616
  resolverRef.current = null;
3617
+ if (initTimeoutRef.current) {
3618
+ clearTimeout(initTimeoutRef.current);
3619
+ initTimeoutRef.current = null;
3620
+ }
3617
3621
  };
3618
3622
  }, [isOpen, tokenKey]);
3619
3623
  useEffect7(() => {
@@ -4106,7 +4110,8 @@ function FractalOrderSummary({
4106
4110
  cardIcons,
4107
4111
  note,
4108
4112
  secureIcon,
4109
- secureText = "Secure payment powered by Fractal"
4113
+ secureText = "Secure payment powered by Fractal",
4114
+ extra
4110
4115
  }) {
4111
4116
  return /* @__PURE__ */ jsxs8("aside", { className: "fps-summary", children: [
4112
4117
  /* @__PURE__ */ jsx17("div", { className: "fps-logo", children: logo && /* @__PURE__ */ jsx17("img", { src: logo, alt: "" }) }),
@@ -4121,6 +4126,7 @@ function FractalOrderSummary({
4121
4126
  /* @__PURE__ */ jsx17("div", { className: "fps-total-label", children: totalLabel }),
4122
4127
  /* @__PURE__ */ jsx17("div", { className: "fps-total", children: total })
4123
4128
  ] }),
4129
+ extra,
4124
4130
  cardIcons && /* @__PURE__ */ jsxs8("div", { className: "fps-cards", children: [
4125
4131
  /* @__PURE__ */ jsx17("img", { src: cardIcons.visa, alt: "Visa" }),
4126
4132
  /* @__PURE__ */ jsx17("img", { src: cardIcons.mastercard, alt: "Mastercard" }),
@@ -4326,6 +4332,7 @@ function GetPaymentPage(props) {
4326
4332
  const [cashDiscount, setCashDiscount] = useState4(Number(props == null ? void 0 : props.amount));
4327
4333
  const [bankAmount, setBankAmount] = useState4(Number(props == null ? void 0 : props.amount));
4328
4334
  const [bankFeeAmount, setBankFeeAmount] = useState4(0);
4335
+ const [bankSavingsAmount, setBankSavingsAmount] = useState4(0);
4329
4336
  const [paymentData, setPaymentData] = useState4();
4330
4337
  let [tranId, setTranId] = useState4("");
4331
4338
  let [isDebitAdjusted, setIsDebitAdjusted] = useState4(false);
@@ -4434,16 +4441,18 @@ function GetPaymentPage(props) {
4434
4441
  setCashDiscount(cash_discount);
4435
4442
  const cardFeeAmount = Number((Number(props == null ? void 0 : props.amount) - Number(cash_discount || 0)).toFixed(2));
4436
4443
  const bankFeeAmount2 = Number((props == null ? void 0 : props.bankFeeAmount) || 0);
4437
- const bankSavingsAmount = Math.max(bankFeeAmount2 > 0 ? cardFeeAmount - bankFeeAmount2 : cardFeeAmount, 0);
4438
- const bankSavingsText = bankSavingsAmount > 0 ? `Save ${formatUSD(bankSavingsAmount.toFixed(2))}` : "";
4444
+ const bankSavingsAmount2 = Math.max(bankFeeAmount2 > 0 ? cardFeeAmount - bankFeeAmount2 : cardFeeAmount, 0);
4445
+ const bankSavingsText = bankSavingsAmount2 > 0 ? `Save ${formatUSD(bankSavingsAmount2.toFixed(2))}` : "";
4439
4446
  setBankFeeAmount(bankFeeAmount2);
4447
+ setBankSavingsAmount(bankSavingsAmount2);
4440
4448
  console.log({
4441
4449
  cash_discount,
4442
4450
  bankAmount: bankAmount2,
4443
4451
  cardFeeAmount,
4444
4452
  bankFeeAmount: bankFeeAmount2,
4445
- bankSavingsAmount,
4446
- bankSavingsText
4453
+ bankSavingsAmount: bankSavingsAmount2,
4454
+ bankSavingsText,
4455
+ amount: props == null ? void 0 : props.amount
4447
4456
  });
4448
4457
  }
4449
4458
  }, [show, props == null ? void 0 : props.pass_fee, props == null ? void 0 : props.amount, props == null ? void 0 : props.surcharge]);
@@ -4454,6 +4463,8 @@ function GetPaymentPage(props) {
4454
4463
  setSuccess(false);
4455
4464
  setTranId("");
4456
4465
  setSurchargeResult(null);
4466
+ setPaymentData(void 0);
4467
+ setLoadingIframe(false);
4457
4468
  setAchData({
4458
4469
  name: "",
4459
4470
  routingNumber: "",
@@ -5304,7 +5315,7 @@ function GetPaymentPage(props) {
5304
5315
  cardTotal = Number((props == null ? void 0 : props.amount) || 0);
5305
5316
  }
5306
5317
  const surchargeFee = Math.max(cardTotal - baseAmount, 0);
5307
- const isBankView = activetab === "ach";
5318
+ const isBankView = activetab !== "reader" && activeinCard === "list" && !!(selectedCard == null ? void 0 : selectedCard.id) ? (selectedCard == null ? void 0 : selectedCard.card_type) === "Bank" : activetab === "ach";
5308
5319
  const discountNum = Number((props == null ? void 0 : props.discount) || 0);
5309
5320
  const taxNum = Number((props == null ? void 0 : props.tax) || 0);
5310
5321
  const leftTotal = isBankView ? Number(bankAmount || 0) : cardTotal;
@@ -5361,11 +5372,16 @@ function GetPaymentPage(props) {
5361
5372
  { label: "Tax", value: fmtNum(taxNum), muted: true },
5362
5373
  ...showSurchargeLine ? [{ label: "Surcharge", value: formatUSD(surchargeFee.toFixed(2)) }] : []
5363
5374
  ];
5364
- const summaryNote = !hasFee ? null : isBankView ? /* @__PURE__ */ jsx18(FractalSavingsNote, { label: isSurchargeProgram ? "Savings" : "Cash discount savings", amount: formatUSD(surchargeFee.toFixed(2)) }) : isSurchargeProgram ? /* @__PURE__ */ jsxs9("div", { className: "fps-note", children: [
5375
+ const summaryNote = isBankView ? bankSavingsAmount > 0 ? /* @__PURE__ */ jsx18(FractalSavingsNote, { label: isSurchargeProgram ? "Savings" : "Cash discount savings", amount: formatUSD(bankSavingsAmount.toFixed(2)) }) : null : !hasFee ? null : isSurchargeProgram ? bankFeeAmount > 0 ? /* @__PURE__ */ jsxs9("div", { className: "fps-note", children: [
5365
5376
  /* @__PURE__ */ jsx18("b", { children: formatUSD(baseAmount.toFixed(2)) }),
5366
- " if customer pays with debit or by bank (no surcharge)."
5377
+ " if customer pays with debit (no surcharge), or ",
5378
+ /* @__PURE__ */ jsx18("b", { children: formatUSD(Number(bankAmount || 0).toFixed(2)) }),
5379
+ " if by bank."
5367
5380
  ] }) : /* @__PURE__ */ jsxs9("div", { className: "fps-note", children: [
5368
5381
  /* @__PURE__ */ jsx18("b", { children: formatUSD(baseAmount.toFixed(2)) }),
5382
+ " if customer pays with debit or by bank (no surcharge)."
5383
+ ] }) : /* @__PURE__ */ jsxs9("div", { className: "fps-note", children: [
5384
+ /* @__PURE__ */ jsx18("b", { children: formatUSD(Number(bankAmount || 0).toFixed(2)) }),
5369
5385
  " if customer pays by bank (cash discount price)."
5370
5386
  ] });
5371
5387
  const LeftSummary = /* @__PURE__ */ jsx18(
@@ -7475,103 +7491,10 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
7475
7491
  import { useEffect as useEffect12, useRef as useRef7, useState as useState7 } from "react";
7476
7492
  import axios6 from "axios";
7477
7493
  import Swal3 from "sweetalert2";
7478
-
7479
- // src/app/components/Atoms/CardBankRadio/CardBankRadio.tsx
7480
- import { Fragment as Fragment14, jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
7481
- var CardBankRadio = (_a) => {
7482
- var _b = _a, { skydesign = false, savingsText } = _b, props = __objRest(_b, ["skydesign", "savingsText"]);
7483
- const savingsBadgeClass = `frac-saving-badge ${skydesign ? "frac-saving-badge-corner" : "frac-saving-badge-corner frac-saving-badge-with-radio"}`;
7484
- return /* @__PURE__ */ jsx27(Fragment14, { children: /* @__PURE__ */ jsx27(
7485
- "div",
7486
- {
7487
- className: `frac-card-bank-radio ${props.activetab === props.value ? "frac-active" : ""}`,
7488
- onClick: () => props.onChange(props.value),
7489
- role: "radio",
7490
- children: skydesign ? /* @__PURE__ */ jsxs14(Fragment14, { children: [
7491
- /* @__PURE__ */ jsxs14("div", { className: "frac-card-title-main", children: [
7492
- /* @__PURE__ */ jsxs14("div", { className: "box-inner-card-text", children: [
7493
- /* @__PURE__ */ jsx27("img", { src: props.label.toLowerCase() === "card" ? defaultcard : props.label.toLowerCase() === "reader" ? pax : bankNew, className: "frac-payment-type-logo", alt: "" }),
7494
- /* @__PURE__ */ jsx27("div", { className: "frac-card-label-text", children: props.label })
7495
- ] }),
7496
- /* @__PURE__ */ jsx27("div", { className: "frac-card-label", children: /* @__PURE__ */ jsx27("div", { className: "frac-card-label-amount", children: formatUSD(props.amount) }) })
7497
- ] }),
7498
- /* @__PURE__ */ jsx27("div", { children: /* @__PURE__ */ jsx27("input", { name: "paymenttype", checked: props.activetab === props.value, type: "hidden", value: props.value, onChange: (e) => {
7499
- props.onChange(e.target.value);
7500
- } }) })
7501
- ] }) : /* @__PURE__ */ jsxs14(Fragment14, { children: [
7502
- /* @__PURE__ */ jsxs14("div", { className: "frac-card-title-main", children: [
7503
- /* @__PURE__ */ jsx27("img", { src: props.label.toLowerCase() === "card" ? defaultcard : props.label.toLowerCase() === "reader" ? pax : bankNew, className: "frac-payment-type-logo", alt: "" }),
7504
- /* @__PURE__ */ jsxs14("div", { className: "frac-card-label", children: [
7505
- /* @__PURE__ */ jsx27("div", { className: "frac-card-label-text", children: props.label }),
7506
- /* @__PURE__ */ jsx27("div", { className: "frac-card-label-amount", children: formatUSD(props.amount) })
7507
- ] })
7508
- ] }),
7509
- /* @__PURE__ */ jsx27("div", { children: /* @__PURE__ */ jsx27("input", { name: "paymenttype", checked: props.activetab === props.value, type: "radio", value: props.value, onChange: (e) => {
7510
- props.onChange(e.target.value);
7511
- } }) })
7512
- ] })
7513
- }
7514
- ) });
7515
- };
7516
-
7517
- // src/app/components/PartialPayment/PartialPayment.tsx
7518
- import { IoArrowBack } from "react-icons/io5";
7519
-
7520
- // src/app/components/Atoms/CardList/CardList.tsx
7521
- import { Fragment as Fragment15, jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
7522
- var CardList = ({ listHeading = "Card", ListItems, selectedCard, setSelectedCard, paymentGateway, handleDeleteCard, otherButtonAction, otherButtonLabel, headingClass }) => {
7523
- let trash2 = S3Url + "widget/Trash.svg";
7524
- return /* @__PURE__ */ jsxs15(Fragment15, { children: [
7525
- /* @__PURE__ */ jsx28("h6", { className: headingClass || "card-ach-heading", style: { marginBottom: "10px !important" }, children: listHeading }),
7526
- /* @__PURE__ */ jsxs15("div", { className: "card-lint-div-in", children: [
7527
- /* @__PURE__ */ jsx28("div", { className: "card-list-div", children: ListItems && (ListItems == null ? void 0 : ListItems.length) > 0 && (ListItems == null ? void 0 : ListItems.map((card, index) => {
7528
- let isDisabled = false;
7529
- if (paymentGateway) {
7530
- isDisabled = paymentGateway != (card == null ? void 0 : card.payment_method_type) && (card == null ? void 0 : card.card_type) != "Bank";
7531
- }
7532
- return /* @__PURE__ */ jsxs15("div", { className: "card-list-single-div", children: [
7533
- /* @__PURE__ */ jsxs15("div", { className: "card-number-radio", children: [
7534
- /* @__PURE__ */ jsx28(
7535
- "input",
7536
- {
7537
- disabled: isDisabled,
7538
- type: "radio",
7539
- className: "cardRadio",
7540
- name: "selected_card",
7541
- id: "",
7542
- checked: (selectedCard == null ? void 0 : selectedCard.id) === (card == null ? void 0 : card.id),
7543
- onChange: (e) => setSelectedCard(card)
7544
- }
7545
- ),
7546
- /* @__PURE__ */ jsxs15("label", { htmlFor: "", className: "card-number-last-four", children: [
7547
- "**** ",
7548
- card == null ? void 0 : card.cardlastfourdigit
7549
- ] }),
7550
- (card == null ? void 0 : card.card_type) != "Bank" && /* @__PURE__ */ jsxs15("h6", { className: "card-expiry-date", children: [
7551
- card == null ? void 0 : card.expmonth,
7552
- "/",
7553
- card == null ? void 0 : card.expyear
7554
- ] })
7555
- ] }),
7556
- /* @__PURE__ */ jsxs15("div", { className: "card-number-radio", children: [
7557
- /* @__PURE__ */ jsx28("span", { className: "visa-card", children: /* @__PURE__ */ jsx28("img", { src: getCardType(card == null ? void 0 : card.card_type), alt: "" }) }),
7558
- /* @__PURE__ */ jsx28("span", { className: "visa-card", style: { cursor: "pointer" }, onClick: () => handleDeleteCard(card == null ? void 0 : card.id), children: /* @__PURE__ */ jsx28("img", { src: trash2, alt: "" }) })
7559
- ] })
7560
- ] }, card == null ? void 0 : card.id);
7561
- })) }),
7562
- /* @__PURE__ */ jsxs15("div", { className: "pay-with-other-card", onClick: otherButtonAction, children: [
7563
- otherButtonLabel,
7564
- /* @__PURE__ */ jsx28("img", { src: defaultcard, alt: "" })
7565
- ] })
7566
- ] })
7567
- ] });
7568
- };
7569
-
7570
- // src/app/components/PartialPayment/PartialPayment.tsx
7571
7494
  import { NumericFormat } from "react-number-format";
7572
- import { Fragment as Fragment16, jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
7495
+ import { Fragment as Fragment14, jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
7573
7496
  function PartialPayment(props) {
7574
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
7497
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
7575
7498
  const buttonRef = useRef7(null);
7576
7499
  useEffect12(() => {
7577
7500
  if (props.onTriggerPay) {
@@ -7593,15 +7516,14 @@ function PartialPayment(props) {
7593
7516
  const [loading, setLoading] = useState7(false);
7594
7517
  const [loading2, setLoading2] = useState7(false);
7595
7518
  const [loadingIframe, setLoadingIframe] = useState7(false);
7519
+ const [surchargeLookupLoading, setSurchargeLookupLoading] = useState7(false);
7596
7520
  const [errorIframe, setErrorIframe] = useState7("");
7597
7521
  const [error, setError] = useState7("");
7598
7522
  const [success, setSuccess] = useState7(false);
7599
7523
  const [show, setShow] = useState7(false);
7600
7524
  const [activetab, setActive] = useState7("card");
7601
- const [activeList, setActiveList] = useState7("card");
7602
7525
  const [activeinCard, setActiveinCard] = useState7("form");
7603
7526
  const [activeinBank, setActiveinBank] = useState7("form");
7604
- const [activeForm, setActiveForm] = useState7(true);
7605
7527
  const [saveCardInfo, setSaveCardInfo] = useState7(false);
7606
7528
  const [saveACHinfo, setSaveACHinfo] = useState7(false);
7607
7529
  const fractalpayClientKey = props.merchantPublicKey;
@@ -7648,6 +7570,11 @@ function PartialPayment(props) {
7648
7570
  };
7649
7571
  const [paymentData, setPaymentData] = useState7();
7650
7572
  let [tranId, setTranId] = useState7("");
7573
+ const [surchargeResult, setSurchargeResult] = useState7(null);
7574
+ const isSurchargeProgram = Number(paymentData == null ? void 0 : paymentData.surchargeProgram) === 1;
7575
+ const fundingType = (_a = surchargeResult == null ? void 0 : surchargeResult.card_issue_type) == null ? void 0 : _a.toLowerCase();
7576
+ const feeExempt = fundingType === "debit" || fundingType === "prepaid";
7577
+ const cardTotal = isSurchargeProgram && feeExempt ? Number((_b = cashDiscount != null ? cashDiscount : props == null ? void 0 : props.amount) != null ? _b : 0) : Number(aftertaxAmount);
7651
7578
  const showLoader = () => setLoading(true);
7652
7579
  const hideLoader = () => setLoading(false);
7653
7580
  const CalculateCashDiscount = (amount, surcharge) => {
@@ -7660,6 +7587,69 @@ function PartialPayment(props) {
7660
7587
  const originalAmount = +amount + +(amount * surchargeVal);
7661
7588
  return originalAmount;
7662
7589
  };
7590
+ const createSurchargeSession = async () => {
7591
+ var _a2;
7592
+ try {
7593
+ const requestOptions = { method: "POST", redirect: "follow" };
7594
+ const res = await axios6.post(`${masterBaseUrl}api/v1/widget/generate-session`, requestOptions);
7595
+ const data = (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data;
7596
+ const public_key_pem = (data == null ? void 0 : data.publicKeyPem) || (data == null ? void 0 : data.public_key_pem);
7597
+ const session_key = data == null ? void 0 : data.session_key;
7598
+ if (!public_key_pem || !session_key) return null;
7599
+ return { session_key, public_key_pem };
7600
+ } catch (err) {
7601
+ console.error("Surcharge session error", err);
7602
+ return null;
7603
+ }
7604
+ };
7605
+ const getSurchargeOptions = () => {
7606
+ var _a2;
7607
+ return {
7608
+ amount: Math.round((partialAmount && !partialError ? Number(partialAmount) : Number((_a2 = cashDiscount != null ? cashDiscount : props == null ? void 0 : props.amount) != null ? _a2 : 0)) * 100),
7609
+ cardholder_billing_zip: (cardData == null ? void 0 : cardData.zipCode) || void 0
7610
+ };
7611
+ };
7612
+ const runCofSurchargeLookup = async (cardId) => {
7613
+ var _a2, _b2;
7614
+ try {
7615
+ const res = await axios6.post(`${baseUrl}surcharge-lookup-cof`, {
7616
+ fractalpayPublicKey: fractalpayClientKey,
7617
+ customer_id: props == null ? void 0 : props.customerId,
7618
+ card_id: cardId,
7619
+ amount: partialAmount && !partialError ? Number(partialAmount) : Number((_a2 = cashDiscount != null ? cashDiscount : props == null ? void 0 : props.amount) != null ? _a2 : 0),
7620
+ cardholder_billing_zip: (cardData == null ? void 0 : cardData.zipCode) || void 0
7621
+ });
7622
+ const data = (_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.data;
7623
+ if (!data) return null;
7624
+ return {
7625
+ card_brand: data.card_brand,
7626
+ card_issue_type: data.card_issue_type,
7627
+ surcharge_allowed: data.surcharge_allowed,
7628
+ max_surcharge_percent: data.max_surcharge_percent,
7629
+ max_surcharge_amount: data.max_surcharge_amount
7630
+ };
7631
+ } catch (err) {
7632
+ console.error("COF surcharge lookup failed", err);
7633
+ return null;
7634
+ }
7635
+ };
7636
+ useEffect12(() => {
7637
+ const surchargingOn = Number(paymentData == null ? void 0 : paymentData.surchargeProgram) === 1 && !!(props == null ? void 0 : props.pass_fee);
7638
+ if (!surchargingOn || !(selectedCard == null ? void 0 : selectedCard.id) || selectedCard.card_type === "Bank") {
7639
+ setSurchargeResult(null);
7640
+ return;
7641
+ }
7642
+ let cancelled = false;
7643
+ setSurchargeLookupLoading(true);
7644
+ runCofSurchargeLookup(selectedCard.id).then((result) => {
7645
+ if (cancelled) return;
7646
+ setSurchargeResult(result);
7647
+ setSurchargeLookupLoading(false);
7648
+ });
7649
+ return () => {
7650
+ cancelled = true;
7651
+ };
7652
+ }, [selectedCard == null ? void 0 : selectedCard.id, selectedCard == null ? void 0 : selectedCard.card_type, paymentData == null ? void 0 : paymentData.surchargeProgram, props == null ? void 0 : props.pass_fee]);
7663
7653
  useEffect12(() => {
7664
7654
  if (show) {
7665
7655
  if (props == null ? void 0 : props.pass_fee) {
@@ -7677,6 +7667,9 @@ function PartialPayment(props) {
7677
7667
  setError("");
7678
7668
  setSuccess(false);
7679
7669
  setTranId("");
7670
+ setSurchargeResult(null);
7671
+ setPaymentData(void 0);
7672
+ setLoadingIframe(false);
7680
7673
  setAchData({
7681
7674
  name: "",
7682
7675
  routingNumber: "",
@@ -7725,8 +7718,6 @@ function PartialPayment(props) {
7725
7718
  });
7726
7719
  setSelectedReader({});
7727
7720
  setCashDiscount(0);
7728
- setActiveList("card");
7729
- setActiveForm(true);
7730
7721
  setActiveinBank("form");
7731
7722
  setActiveinCard("form");
7732
7723
  setLoading2(false);
@@ -7742,9 +7733,6 @@ function PartialPayment(props) {
7742
7733
  setLoderText("");
7743
7734
  };
7744
7735
  const handleShow = () => setShow(true);
7745
- const handletabchange = (id) => {
7746
- setActive(id);
7747
- };
7748
7736
  const handleCardChange = (field, value) => {
7749
7737
  const name2 = field;
7750
7738
  const numericFields = ["expiryMonth", "expiryYear", "zipCode", "cvv"];
@@ -7850,7 +7838,7 @@ function PartialPayment(props) {
7850
7838
  return Object.keys(errors).length > 0;
7851
7839
  };
7852
7840
  const submitFunc = async (e) => {
7853
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2;
7841
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l, _m, _n;
7854
7842
  e.preventDefault();
7855
7843
  const el = document.activeElement;
7856
7844
  if (el instanceof HTMLElement) {
@@ -7883,7 +7871,7 @@ function PartialPayment(props) {
7883
7871
  response.isCardSave = `${saveCardInfo}`;
7884
7872
  response.isCharge = true;
7885
7873
  response.posSalesIdEncode = (_a3 = paymentData == null ? void 0 : paymentData.orderDetails) == null ? void 0 : _a3.orderId;
7886
- response.partial_amount = partialAmount && !partialError ? partialAmount : aftertaxAmount;
7874
+ response.partial_amount = partialAmount && !partialError ? partialAmount : cardTotal;
7887
7875
  socketClient_default.emit("sendMessage", response);
7888
7876
  let eventName = (_b3 = paymentData == null ? void 0 : paymentData.orderDetails) == null ? void 0 : _b3.orderId;
7889
7877
  socketClient_default.on(eventName, (data) => {
@@ -7926,15 +7914,16 @@ function PartialPayment(props) {
7926
7914
  session_key: (_f2 = (_e2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _e2.data) == null ? void 0 : _f2.session_key
7927
7915
  });
7928
7916
  const card_issue_type = ((_g2 = tokenizeData == null ? void 0 : tokenizeData.bin_lookup_result) == null ? void 0 : _g2.card_issue_type) || null;
7929
- if (card_issue_type === "Debit" && (props == null ? void 0 : props.pass_fee) && (paymentData == null ? void 0 : paymentData.surchargeProgram) == 1) {
7930
- setLoderText("Processing Debit card without fee");
7917
+ const feeExemptCard = ["debit", "prepaid"].includes(String(card_issue_type || "").toLowerCase());
7918
+ if (feeExemptCard && (props == null ? void 0 : props.pass_fee) && (paymentData == null ? void 0 : paymentData.surchargeProgram) == 1) {
7919
+ setLoderText(`Processing ${card_issue_type} card without fee`);
7931
7920
  }
7932
7921
  const reqData = JSON.stringify(__spreadProps(__spreadValues({}, tokenizeData), {
7933
7922
  isSaveCardChecked: saveCardInfo,
7934
7923
  name: cardData == null ? void 0 : cardData.cardName,
7935
7924
  postal_code: cardData == null ? void 0 : cardData.zipCode,
7936
7925
  customer_id: props == null ? void 0 : props.customerId,
7937
- partial_amount: partialAmount && !partialError ? partialAmount : aftertaxAmount,
7926
+ partial_amount: partialAmount && !partialError ? partialAmount : cardTotal,
7938
7927
  card_issue_type
7939
7928
  }));
7940
7929
  const reqData2 = JSON.stringify({
@@ -7975,7 +7964,7 @@ function PartialPayment(props) {
7975
7964
  }
7976
7965
  } catch (err) {
7977
7966
  setLoading2(false);
7978
- setError(((_l2 = (_k2 = err == null ? void 0 : err.response) == null ? void 0 : _k2.data) == null ? void 0 : _l2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
7967
+ setError(((_l = (_k2 = err == null ? void 0 : err.response) == null ? void 0 : _k2.data) == null ? void 0 : _l.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
7979
7968
  }
7980
7969
  } else {
7981
7970
  try {
@@ -7992,7 +7981,7 @@ function PartialPayment(props) {
7992
7981
  }
7993
7982
  } catch (err) {
7994
7983
  setLoading2(false);
7995
- setError(((_n2 = (_m2 = err == null ? void 0 : err.response) == null ? void 0 : _m2.data) == null ? void 0 : _n2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
7984
+ setError(((_n = (_m = err == null ? void 0 : err.response) == null ? void 0 : _m.data) == null ? void 0 : _n.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
7996
7985
  }
7997
7986
  }
7998
7987
  }
@@ -8046,7 +8035,7 @@ function PartialPayment(props) {
8046
8035
  }
8047
8036
  };
8048
8037
  const getPaymentDetails = async () => {
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;
8038
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
8050
8039
  showLoader();
8051
8040
  try {
8052
8041
  const data = {
@@ -8064,7 +8053,7 @@ function PartialPayment(props) {
8064
8053
  let willShowCardForm = true;
8065
8054
  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) {
8066
8055
  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");
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");
8056
+ 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");
8068
8057
  if ((cardlists == null ? void 0 : cardlists.length) > 0) {
8069
8058
  setActiveinCard("list");
8070
8059
  willShowCardForm = false;
@@ -8077,17 +8066,17 @@ function PartialPayment(props) {
8077
8066
  } else {
8078
8067
  setActive("card");
8079
8068
  }
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) {
8081
- setSelectedReader((_u2 = (_t2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _t2.data) == null ? void 0 : _u2.paymentDeviceList[0]);
8069
+ 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) {
8070
+ setSelectedReader((_u = (_t = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _t.data) == null ? void 0 : _u.paymentDeviceList[0]);
8082
8071
  }
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)) {
8072
+ 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)) {
8084
8073
  setLoadingIframe(true);
8085
8074
  }
8086
8075
  hideLoader();
8087
8076
  } catch (err) {
8088
8077
  console.log(err);
8089
8078
  hideLoader();
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");
8079
+ 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");
8091
8080
  }
8092
8081
  };
8093
8082
  const handlechargeCustomer = async (e) => {
@@ -8115,7 +8104,7 @@ function PartialPayment(props) {
8115
8104
  } else if (card_type === "Bank") {
8116
8105
  amount2 = cashDiscount;
8117
8106
  } else {
8118
- amount2 = aftertaxAmount;
8107
+ amount2 = cardTotal;
8119
8108
  }
8120
8109
  let chargeobj = {
8121
8110
  amount: amount2,
@@ -8141,8 +8130,9 @@ function PartialPayment(props) {
8141
8130
  "Content-Type": "application/json"
8142
8131
  };
8143
8132
  setLoading2(true);
8144
- if (card_issue_type == "Debit" && (props == null ? void 0 : props.pass_fee) && (paymentData == null ? void 0 : paymentData.surchargeProgram) == 1) {
8145
- setLoderText("Processing Debit card without fee");
8133
+ const feeExemptCard = ["debit", "prepaid"].includes(String(card_issue_type || "").toLowerCase());
8134
+ if (feeExemptCard && (props == null ? void 0 : props.pass_fee) && (paymentData == null ? void 0 : paymentData.surchargeProgram) == 1) {
8135
+ setLoderText(`Processing ${card_issue_type} card without fee`);
8146
8136
  }
8147
8137
  socketClient_default.emit("sendMessage", { url: chargeurl, body: card_type == "Bank" ? rest : chargeobj, isChargebycard: true });
8148
8138
  socketClient_default.on("charge-by-card", (response) => {
@@ -8205,13 +8195,6 @@ function PartialPayment(props) {
8205
8195
  setError("Something went wrong.");
8206
8196
  }
8207
8197
  };
8208
- const handlepayment = (e) => {
8209
- if (activeList === "card") {
8210
- handlechargeCustomer(e);
8211
- } else if (activeList === "reader") {
8212
- handleChargewithEMV(e);
8213
- }
8214
- };
8215
8198
  useEffect12(() => {
8216
8199
  if (show && fractalpayClientKey) {
8217
8200
  getPaymentDetails();
@@ -8251,7 +8234,6 @@ function PartialPayment(props) {
8251
8234
  confirmButtonText: "OK",
8252
8235
  showConfirmButton: true,
8253
8236
  timer: 1e3,
8254
- // auto-close after 1 second
8255
8237
  timerProgressBar: true,
8256
8238
  customClass: {
8257
8239
  confirmButton: "btn btn-dark"
@@ -8305,11 +8287,6 @@ function PartialPayment(props) {
8305
8287
  return card;
8306
8288
  }
8307
8289
  };
8308
- const getCashDiscount = () => {
8309
- let cashDiscountNew = cashDiscount || 0;
8310
- let diff = Number(aftertaxAmount) - cashDiscountNew;
8311
- return diff.toFixed(0);
8312
- };
8313
8290
  const handlePartialChange = (values) => {
8314
8291
  var _a2, _b2, _c2, _d2;
8315
8292
  if (activetab === "ach") {
@@ -8321,9 +8298,9 @@ function PartialPayment(props) {
8321
8298
  setPartialError("");
8322
8299
  }
8323
8300
  } else {
8324
- if (((_c2 = Number(aftertaxAmount)) == null ? void 0 : _c2.toFixed(2)) < (values == null ? void 0 : values.floatValue) || (values == null ? void 0 : values.floatValue) <= 0) {
8301
+ if (((_c2 = Number(cardTotal)) == null ? void 0 : _c2.toFixed(2)) < (values == null ? void 0 : values.floatValue) || (values == null ? void 0 : values.floatValue) <= 0) {
8325
8302
  setPartialAmount(values == null ? void 0 : values.value);
8326
- setPartialError(`Partial amount cannot exceed ${formatUSD((_d2 = Number(aftertaxAmount)) == null ? void 0 : _d2.toFixed(2))}`);
8303
+ setPartialError(`Partial amount cannot exceed ${formatUSD((_d2 = Number(cardTotal)) == null ? void 0 : _d2.toFixed(2))}`);
8327
8304
  } else {
8328
8305
  setPartialAmount(values == null ? void 0 : values.value);
8329
8306
  setPartialError("");
@@ -8331,30 +8308,136 @@ function PartialPayment(props) {
8331
8308
  }
8332
8309
  };
8333
8310
  useEffect12(() => {
8334
- const baseAmount = activetab === "ach" ? Number(cashDiscount) : Number(aftertaxAmount);
8311
+ const baseAmount2 = activetab === "ach" ? Number(cashDiscount) : Number(cardTotal);
8335
8312
  const partial = Number(partialAmount);
8336
8313
  if (partialAmount) {
8337
- if (partial <= 0 || partial > baseAmount) {
8338
- setPartialError(`Partial amount cannot exceed ${formatUSD(baseAmount.toFixed(2))}`);
8314
+ if (partial <= 0 || partial > baseAmount2) {
8315
+ setPartialError(`Partial amount cannot exceed ${formatUSD(baseAmount2.toFixed(2))}`);
8339
8316
  } else {
8340
8317
  setPartialError("");
8341
8318
  }
8342
8319
  } else {
8343
8320
  setPartialError("");
8344
8321
  }
8345
- }, [activetab, partialAmount, cashDiscount, aftertaxAmount]);
8322
+ }, [activetab, partialAmount, cashDiscount, cardTotal]);
8346
8323
  useEffect12(() => {
8347
8324
  if (typeof FractalTokenizer === "undefined") return;
8348
8325
  const tokenizer = new FractalTokenizer({
8349
8326
  styles: {}
8350
8327
  });
8351
8328
  }, []);
8352
- return /* @__PURE__ */ jsxs16(Fragment16, { children: [
8353
- /* @__PURE__ */ jsx29(DataScript, {}),
8354
- /* @__PURE__ */ jsx29(Chargewidgetstyles, {}),
8355
- /* @__PURE__ */ jsx29(CardBankRadioStyles, {}),
8356
- (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx29(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
8357
- (paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx29(
8329
+ const merchantName = (paymentData == null ? void 0 : paymentData.bname) || (paymentData == null ? void 0 : paymentData.customer_name) || "the merchant";
8330
+ const invoiceNo = String((props == null ? void 0 : props.orderID) || "").replace(/^\s*invoice\s*#?\s*/i, "").trim();
8331
+ const invoiceLabel = invoiceNo ? `Invoice #${invoiceNo}` : "Invoice";
8332
+ const baseAmount = Number((_c = cashDiscount != null ? cashDiscount : props == null ? void 0 : props.amount) != null ? _c : 0);
8333
+ const surchargeFee = Math.max(cardTotal - baseAmount, 0);
8334
+ const isBankView = activetab !== "reader" && activeinCard === "list" && !!(selectedCard == null ? void 0 : selectedCard.id) ? (selectedCard == null ? void 0 : selectedCard.card_type) === "Bank" : activetab === "ach";
8335
+ const discountNum = Number((props == null ? void 0 : props.discount) || 0);
8336
+ const taxNum = Number((props == null ? void 0 : props.tax) || 0);
8337
+ const hasFee = surchargeFee > 0 && !!(props == null ? void 0 : props.pass_fee);
8338
+ const showSurchargeLine = isSurchargeProgram && !isBankView && hasFee;
8339
+ const summarySubtotal = isSurchargeProgram || isBankView ? baseAmount : cardTotal;
8340
+ const fmtNum = (n) => Number(n).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
8341
+ const partialOverride = partialAmount && !partialError ? Number(partialAmount) : null;
8342
+ const methodTotal = isBankView ? Number(cashDiscount || 0) : cardTotal;
8343
+ const effectiveTotal = partialOverride != null ? partialOverride : methodTotal;
8344
+ const hideBank = true;
8345
+ const savedMethods = [...cardList || [], ...hideBank ? [] : bankList || []];
8346
+ const hasSaved = savedMethods.length > 0;
8347
+ const showList = hasSaved && activetab !== "reader" && activeinCard === "list";
8348
+ const availableMethods = [
8349
+ "card",
8350
+ ...!hideBank && (paymentData == null ? void 0 : paymentData.isSkyFiAccount) ? ["ach"] : [],
8351
+ ...(paymentData == null ? void 0 : paymentData.paymentDeviceList) && paymentData.paymentDeviceList.length > 0 ? ["reader"] : []
8352
+ ];
8353
+ const goToList = () => {
8354
+ setActive("card");
8355
+ setActiveinCard("list");
8356
+ setActiveinBank("list");
8357
+ setError("");
8358
+ };
8359
+ const payWithOther = () => {
8360
+ setActive("card");
8361
+ setActiveinCard("form");
8362
+ setActiveinBank("form");
8363
+ setError("");
8364
+ };
8365
+ const switchMethod = (m) => {
8366
+ setActive(m);
8367
+ if (m === "card" || m === "ach") {
8368
+ setActiveinCard("form");
8369
+ setActiveinBank("form");
8370
+ }
8371
+ setError("");
8372
+ };
8373
+ const rightTitle = showList ? "Payment methods" : activetab === "reader" ? "Reader payment" : activetab === "ach" ? "Bank payment" : "Card payment";
8374
+ const showBack = hasSaved && !showList;
8375
+ const MethodToggle = /* @__PURE__ */ jsx27(
8376
+ FractalMethodToggle,
8377
+ {
8378
+ methods: [
8379
+ { value: "card", label: "Card" },
8380
+ ...availableMethods.includes("ach") ? [{ value: "ach", label: "Bank" }] : [],
8381
+ ...availableMethods.includes("reader") ? [{ value: "reader", label: "Reader" }] : []
8382
+ ],
8383
+ active: activetab,
8384
+ onChange: switchMethod
8385
+ }
8386
+ );
8387
+ const summaryLines = [
8388
+ { label: "Subtotal", value: fmtNum(summarySubtotal) },
8389
+ { label: "Discount", value: fmtNum(discountNum), muted: true },
8390
+ { label: "Tax", value: fmtNum(taxNum), muted: true },
8391
+ ...showSurchargeLine ? [{ label: "Surcharge", value: formatUSD(surchargeFee.toFixed(2)) }] : []
8392
+ ];
8393
+ const summaryNote = isBankView ? null : !hasFee ? null : /* @__PURE__ */ jsxs14("div", { className: "fps-note", children: [
8394
+ /* @__PURE__ */ jsx27("b", { children: formatUSD(baseAmount.toFixed(2)) }),
8395
+ " if customer pays with debit or by bank (no surcharge)."
8396
+ ] });
8397
+ const partialInput = (props == null ? void 0 : props.allowPartial) ? /* @__PURE__ */ jsx27(FractalField, { label: "Partial payment", htmlFor: "partialpayment", error: partialError, children: /* @__PURE__ */ jsx27(
8398
+ NumericFormat,
8399
+ {
8400
+ id: "partialpayment",
8401
+ className: "fps-input",
8402
+ prefix: "$",
8403
+ thousandSeparator: true,
8404
+ allowNegative: false,
8405
+ allowLeadingZeros: false,
8406
+ decimalScale: 2,
8407
+ fixedDecimalScale: true,
8408
+ placeholder: "Enter partial amount",
8409
+ value: partialAmount,
8410
+ onValueChange: handlePartialChange
8411
+ }
8412
+ ) }) : null;
8413
+ const LeftSummary = /* @__PURE__ */ jsx27(
8414
+ FractalOrderSummary,
8415
+ {
8416
+ logo: paymentData == null ? void 0 : paymentData.logo,
8417
+ invoiceLabel,
8418
+ lines: summaryLines,
8419
+ total: formatUSD(effectiveTotal.toFixed(2)),
8420
+ cardIcons: isBankView ? null : { visa: visa2, mastercard: mastercard2, amex: americanexp2, discover: discover2 },
8421
+ note: summaryNote,
8422
+ secureIcon: secure2,
8423
+ extra: partialInput
8424
+ }
8425
+ );
8426
+ const AuthText = /* @__PURE__ */ jsxs14("p", { className: "fps-auth", children: [
8427
+ "By paying, you authorize ",
8428
+ merchantName,
8429
+ " to charge ",
8430
+ formatUSD(effectiveTotal.toFixed(2)),
8431
+ " to your ",
8432
+ isBankView ? "account" : "card",
8433
+ ". ",
8434
+ /* @__PURE__ */ jsx27("u", { children: "Refund policy" }),
8435
+ "."
8436
+ ] });
8437
+ return /* @__PURE__ */ jsxs14(Fragment14, { children: [
8438
+ /* @__PURE__ */ jsx27(DataScript, {}),
8439
+ (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx27(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
8440
+ (paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx27(
8358
8441
  DataCapScriptLoader,
8359
8442
  {
8360
8443
  onReady: () => {
@@ -8367,521 +8450,233 @@ function PartialPayment(props) {
8367
8450
  }
8368
8451
  }
8369
8452
  ),
8370
- /* @__PURE__ */ jsxs16(Fragment16, { children: [
8371
- /* @__PURE__ */ jsx29("button", { ref: buttonRef, style: { display: "none" }, className: "paymentBtn", onClick: handleShow, children: "Pay" }),
8372
- /* @__PURE__ */ jsxs16(
8453
+ /* @__PURE__ */ jsx27(Chargewidgetstyles, {}),
8454
+ /* @__PURE__ */ jsx27(CardBankRadioStyles, {}),
8455
+ /* @__PURE__ */ jsx27(FractalWidgetStyles, {}),
8456
+ /* @__PURE__ */ jsxs14(Fragment14, { children: [
8457
+ /* @__PURE__ */ jsx27("button", { ref: buttonRef, style: { display: "none" }, className: "paymentBtn", onClick: handleShow, children: "Pay" }),
8458
+ /* @__PURE__ */ jsxs14(
8373
8459
  CustomModal2_default,
8374
8460
  {
8375
8461
  open: show,
8376
8462
  onClose: handleClose,
8463
+ maxWidth: "760px",
8377
8464
  children: [
8378
- error && /* @__PURE__ */ jsx29("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx29(ErrorCardMessage_default, { error, onClose: handleClose }) }),
8379
- errorIframe && /* @__PURE__ */ jsx29("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx29(ErrorCardMessage_default, { error: errorIframe, onClose: () => {
8465
+ error && /* @__PURE__ */ jsx27("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx27(ErrorCardMessage_default, { error, onClose: handleClose }) }),
8466
+ errorIframe && /* @__PURE__ */ jsx27("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx27(ErrorCardMessage_default, { error: errorIframe, onClose: () => {
8380
8467
  setErrorIframe("");
8381
8468
  } }) }),
8382
- success && /* @__PURE__ */ jsx29(SuccessMsz, { onClose: handleClose, tranId, isDebitAdjusted }),
8383
- !error && !success && !errorIframe && /* @__PURE__ */ jsxs16(Fragment16, { children: [
8384
- (loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx29(Loader_default, { loading: loading || loading2 || loadingIframe, loaderText }),
8385
- /* @__PURE__ */ jsx29("div", { className: "frac-card-payment-page frac-form", children: /* @__PURE__ */ jsxs16("div", { className: "parent-pay-container", children: [
8386
- /* @__PURE__ */ jsx29("span", { className: "request-payment-close-popup", onClick: handleClose, children: /* @__PURE__ */ jsxs16("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
8387
- /* @__PURE__ */ jsx29("g", { clipPath: "url(#clip0_12425_52336)", children: /* @__PURE__ */ jsx29("path", { d: "M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z", fill: "#727272" }) }),
8388
- /* @__PURE__ */ jsx29("defs", { children: /* @__PURE__ */ jsx29("clipPath", { id: "clip0_12425_52336", children: /* @__PURE__ */ jsx29("rect", { width: "16", height: "16", fill: "white" }) }) })
8389
- ] }) }),
8390
- /* @__PURE__ */ jsx29("div", { className: "pay-main-logo-res", children: /* @__PURE__ */ jsx29("img", { src: paymentData == null ? void 0 : paymentData.logo, id: "pay-logos" }) }),
8391
- /* @__PURE__ */ jsxs16("div", { className: "pay-container", children: [
8392
- /* @__PURE__ */ jsxs16("div", { className: "pay-header pay-conatiner-one frac-pay-conatiner-one", children: [
8393
- /* @__PURE__ */ jsxs16("div", { className: "pay-conatiner-one-first", children: [
8394
- /* @__PURE__ */ jsxs16("div", { className: "pay-logo-container", children: [
8395
- /* @__PURE__ */ jsx29("div", { className: "pay-main-logo", children: /* @__PURE__ */ jsx29("img", { src: paymentData == null ? void 0 : paymentData.logo, id: "pay-logos" }) }),
8396
- (cardList == null ? void 0 : cardList.length) > 0 && activetab !== "cardList" && /* @__PURE__ */ jsxs16("button", { className: "res-charge-payment-back-btn ", onClick: () => setActive("cardList"), children: [
8397
- " ",
8398
- /* @__PURE__ */ jsx29(IoArrowBack, {}),
8399
- " Back"
8400
- ] })
8401
- ] }),
8402
- /* @__PURE__ */ jsxs16("div", { className: "amt-pay-con", children: [
8403
- /* @__PURE__ */ jsx29("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx29("small", { className: "pay-payment-amount", children: "Select payment type" }) }),
8404
- /* @__PURE__ */ jsx29("div", { className: "frac-card-bank-radio-main", children: /* @__PURE__ */ jsx29(CardBankRadio, { label: "Card", amount: (_a = Number(aftertaxAmount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }) }),
8405
- !loading && (activetab === "card" || activetab === "reader") && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs16("div", { className: "frac-cash-discount-fee", children: [
8406
- /* @__PURE__ */ jsx29("small", { children: (paymentData == null ? void 0 : paymentData.surchargeProgram) == 1 ? "Surcharge" : (paymentData == null ? void 0 : paymentData.showSurcharge) ? "3% Card Fee" : "Cash Discount" }),
8407
- /* @__PURE__ */ jsx29("p", { children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) })
8408
- ] }),
8409
- !loading && (props == null ? void 0 : props.pass_fee) && /* @__PURE__ */ jsx29("div", { className: "", children: (activetab === "card" || activetab === "reader") && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs16(
8410
- "div",
8411
- {
8412
- id: "surcharge-program-notice",
8413
- className: "surcharge-program-notice-text",
8414
- children: [
8415
- "A 3% processing surcharge is applied to all credit card transactions. Debit card payments are processed for",
8416
- " ",
8417
- /* @__PURE__ */ jsxs16("span", { className: "surcharge-program-notice-text-att", children: [
8418
- "$",
8419
- Number(cashDiscount).toLocaleString("en-US", {
8420
- minimumFractionDigits: 2,
8421
- maximumFractionDigits: 2
8422
- })
8423
- ] })
8424
- ]
8469
+ success && /* @__PURE__ */ jsx27(SuccessMsz, { onClose: handleClose, tranId, isDebitAdjusted }),
8470
+ !error && !success && !errorIframe && /* @__PURE__ */ jsxs14(Fragment14, { children: [
8471
+ (loading || loading2 || loadingIframe || surchargeLookupLoading) && /* @__PURE__ */ jsx27(Loader_default, { loading: loading || loading2 || loadingIframe || surchargeLookupLoading, loaderText }),
8472
+ /* @__PURE__ */ jsxs14("div", { className: "fps-modal", children: [
8473
+ LeftSummary,
8474
+ /* @__PURE__ */ jsxs14("section", { className: "fps-content", children: [
8475
+ /* @__PURE__ */ jsx27(FractalModalHeader, { title: rightTitle, onBack: showBack ? goToList : void 0, onClose: handleClose }),
8476
+ showList ? /* @__PURE__ */ jsxs14(Fragment14, { children: [
8477
+ /* @__PURE__ */ jsx27(
8478
+ FractalSavedMethods,
8479
+ {
8480
+ sectionLabel: "Cards / bank accounts",
8481
+ items: savedMethods.map((card) => {
8482
+ const isBankCard = (card == null ? void 0 : card.card_type) === "Bank";
8483
+ let isDisabled = false;
8484
+ if (paymentData == null ? void 0 : paymentData.paymentGateway) {
8485
+ isDisabled = (paymentData == null ? void 0 : paymentData.paymentGateway) != (card == null ? void 0 : card.payment_method_type) && !isBankCard;
8425
8486
  }
8426
- ) }),
8427
- (props == null ? void 0 : props.allowPartial) && /* @__PURE__ */ jsxs16("div", { className: "frac-partial-payment-input", children: [
8428
- /* @__PURE__ */ jsx29("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
8429
- /* @__PURE__ */ jsx29(
8430
- NumericFormat,
8431
- {
8432
- prefix: "$",
8433
- className: "form-control",
8434
- value: partialAmount,
8435
- onValueChange: (values) => {
8436
- handlePartialChange(values);
8437
- },
8438
- thousandSeparator: true,
8439
- placeholder: "Enter partial amount",
8440
- allowNegative: false,
8441
- allowLeadingZeros: false,
8442
- decimalScale: 2,
8443
- fixedDecimalScale: true
8444
- }
8445
- ),
8446
- partialError && /* @__PURE__ */ jsx29("span", { className: "error-span", children: partialError })
8447
- ] })
8448
- ] })
8449
- ] }),
8450
- /* @__PURE__ */ jsxs16("div", { className: "pay-conatiner-one-last", children: [
8451
- /* @__PURE__ */ jsx29("img", { src: secure2, alt: "" }),
8452
- /* @__PURE__ */ jsx29("img", { src: pov2, alt: "" }),
8453
- "Secure payments powered by Fractal"
8454
- ] })
8455
- ] }),
8456
- /* @__PURE__ */ jsx29("div", { className: "pay-tab pay-conatiner-two", children: !loading && /* @__PURE__ */ jsx29("div", { className: "col-md-12", children: /* @__PURE__ */ jsxs16("div", { id: "payment-form-div", children: [
8457
- activetab !== "cardList" ? /* @__PURE__ */ jsxs16("div", { className: "frac-charge-payment-back-btn-wrap ", children: [
8458
- (cardList == null ? void 0 : cardList.length) > 0 && /* @__PURE__ */ jsxs16("button", { className: "charge-payment-back-btn ", onClick: () => setActive("cardList"), children: [
8459
- " ",
8460
- /* @__PURE__ */ jsx29(IoArrowBack, {}),
8461
- " Back"
8462
- ] }),
8463
- (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && /* @__PURE__ */ jsxs16("div", { className: "tab", children: [
8464
- /* @__PURE__ */ jsxs16("button", { className: "tablinks", onClick: (e) => {
8465
- handletabchange("card");
8466
- }, style: { border: activetab === "card" ? "1px solid" : "" }, children: [
8467
- /* @__PURE__ */ jsx29("i", { className: "fas fa-credit-card me-2", style: { marginRight: "8px", fontSize: "15px" } }),
8468
- "Card"
8469
- ] }),
8470
- /* @__PURE__ */ jsxs16("button", { className: "tablinks", onClick: (e) => {
8471
- handletabchange("ach");
8472
- }, style: { border: activetab === "ach" ? "1px solid" : "" }, children: [
8473
- /* @__PURE__ */ jsx29("i", { className: "fas fa-university me-2", style: { marginRight: "8px", fontSize: "15px" } }),
8474
- "Bank"
8475
- ] })
8476
- ] }),
8477
- /* @__PURE__ */ jsxs16("div", { className: "res-pay-con", children: [
8478
- /* @__PURE__ */ jsxs16("div", { className: "pay-amount-conatiner", style: { margin: 0 }, children: [
8479
- /* @__PURE__ */ jsx29("small", { className: "pay-payment-amount", children: "Payment Amount" }),
8480
- /* @__PURE__ */ jsxs16("strong", { className: "pay-amount", children: [
8481
- "$",
8482
- (_b = Number(aftertaxAmount)) == null ? void 0 : _b.toFixed(2)
8483
- ] })
8484
- ] }),
8485
- activetab != "ach" && /* @__PURE__ */ jsxs16("div", { children: [
8486
- /* @__PURE__ */ jsxs16("div", { children: [
8487
- /* @__PURE__ */ jsx29("img", { src: visa2, alt: "", width: 35, style: { paddingRight: "5px" } }),
8488
- /* @__PURE__ */ jsx29("img", { src: mastercard2, width: 35, alt: "" })
8489
- ] }),
8490
- /* @__PURE__ */ jsxs16("div", { children: [
8491
- /* @__PURE__ */ jsx29("img", { src: americanexp2, alt: "", width: 35, style: { paddingRight: "5px" } }),
8492
- /* @__PURE__ */ jsx29("img", { src: discover2, width: 35, alt: "" })
8493
- ] })
8494
- ] })
8495
- ] }),
8496
- !loading && numberToBoolean(paymentData == null ? void 0 : paymentData.showSurcharge) ? cashDiscount && cashDiscount > 0 && (props == null ? void 0 : props.pass_fee) ? /* @__PURE__ */ jsxs16("div", { className: "frac-cash-discount-fee", children: [
8497
- /* @__PURE__ */ jsxs16("small", { children: [
8498
- activetab === "card" ? "Cash Discount" : "Cash Discount Savings",
8499
- " "
8500
- ] }),
8501
- /* @__PURE__ */ jsx29("p", { children: formatUSD((Number(aftertaxAmount) - cashDiscount).toFixed(2)) })
8502
- ] }) : null : cashDiscount && cashDiscount > 0 && (props == null ? void 0 : props.pass_fee) && activetab === "card" ? /* @__PURE__ */ jsxs16("div", { className: "frac-cash-discount-fee", children: [
8503
- /* @__PURE__ */ jsxs16("small", { children: [
8504
- activetab === "card" ? "Surcharge" : null,
8505
- " "
8506
- ] }),
8507
- /* @__PURE__ */ jsx29("p", { children: formatUSD((Number(aftertaxAmount) - cashDiscount).toFixed(2)) })
8508
- ] }) : null
8509
- ] }) : /* @__PURE__ */ jsxs16("div", { children: [
8510
- /* @__PURE__ */ jsxs16("h6", { className: "charge-customer-name", style: { marginBottom: "16px !important" }, children: [
8511
- " Charge ",
8512
- paymentData == null ? void 0 : paymentData.customer_name
8513
- ] }),
8514
- /* @__PURE__ */ jsxs16("h6", { className: "card-ach-heading", style: { marginBottom: "10px !important" }, children: [
8515
- " ",
8516
- activeList === "card" ? "Cards/Banks" : "Readers",
8517
- " "
8518
- ] }),
8519
- /* @__PURE__ */ jsxs16("div", { className: "res-pay-con", children: [
8520
- /* @__PURE__ */ jsxs16("div", { className: "pay-amount-conatiner", style: { margin: 0 }, children: [
8521
- /* @__PURE__ */ jsx29("small", { className: "pay-payment-amount", children: "Payment Amount" }),
8522
- /* @__PURE__ */ jsxs16("strong", { className: "pay-amount", children: [
8523
- "$",
8524
- (_c = Number(aftertaxAmount)) == null ? void 0 : _c.toFixed(2)
8525
- ] })
8526
- ] }),
8527
- /* @__PURE__ */ jsxs16("div", { children: [
8528
- /* @__PURE__ */ jsxs16("div", { children: [
8529
- /* @__PURE__ */ jsx29("img", { src: visa2, alt: "", width: 35, style: { paddingRight: "5px" } }),
8530
- /* @__PURE__ */ jsx29("img", { src: mastercard2, width: 35, alt: "" })
8531
- ] }),
8532
- /* @__PURE__ */ jsxs16("div", { children: [
8533
- /* @__PURE__ */ jsx29("img", { src: americanexp2, alt: "", width: 35, style: { paddingRight: "5px" } }),
8534
- /* @__PURE__ */ jsx29("img", { src: discover2, width: 35, alt: "" })
8535
- ] })
8536
- ] })
8537
- ] })
8538
- ] }),
8539
- /* @__PURE__ */ jsxs16("div", { id: "card", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent", children: [
8540
- /* @__PURE__ */ jsxs16("div", { className: "frac-card-payment", children: [
8541
- /* @__PURE__ */ jsxs16("div", { className: "frac-heading-card-wrap", children: [
8542
- /* @__PURE__ */ jsx29("div", { className: "frac-backarrow", children: (cardList == null ? void 0 : cardList.length) > 0 && activeinCard === "form" && /* @__PURE__ */ jsxs16("button", { className: "charge-payment-back-btn ", onClick: () => setActiveinCard("list"), children: [
8543
- " ",
8544
- /* @__PURE__ */ jsx29(IoArrowBack, {})
8545
- ] }) }),
8546
- /* @__PURE__ */ jsx29("h6", { className: "frac-card-payment-heading", children: "Card Payment" })
8547
- ] }),
8548
- activetab != "ach" && /* @__PURE__ */ jsxs16("div", { style: { display: "flex", gap: "8px", margin: "8px 0px 19px 0px" }, children: [
8549
- /* @__PURE__ */ jsx29("img", { src: visa2, alt: "", width: 33 }),
8550
- /* @__PURE__ */ jsx29("img", { src: mastercard2, width: 33, alt: "" }),
8551
- /* @__PURE__ */ jsx29("img", { src: americanexp2, alt: "", width: 33 }),
8552
- /* @__PURE__ */ jsx29("img", { src: discover2, width: 33, alt: "" })
8553
- ] })
8554
- ] }),
8555
- activeinCard === "list" ? /* @__PURE__ */ jsxs16(Fragment16, { children: [
8556
- /* @__PURE__ */ jsx29(CardList, { listHeading: "Cards", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: cardList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Card", otherButtonAction: () => {
8557
- setActiveinCard("form");
8558
- } }),
8559
- /* @__PURE__ */ jsx29("div", { className: "form-group", style: { padding: "0" }, children: /* @__PURE__ */ jsx29("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlepayment, children: partialAmount && !partialError ? formatUSD((_d = Number(partialAmount)) == null ? void 0 : _d.toFixed(2)) : formatUSD((_e = Number(aftertaxAmount)) == null ? void 0 : _e.toFixed(2)) }) })
8560
- ] }) : (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 ? /* @__PURE__ */ jsxs16(
8561
- "form",
8487
+ return {
8488
+ id: card == null ? void 0 : card.id,
8489
+ primaryText: `**** ${card == null ? void 0 : card.cardlastfourdigit}`,
8490
+ secondaryText: isBankCard ? void 0 : `${card == null ? void 0 : card.expmonth}/${card == null ? void 0 : card.expyear}`,
8491
+ badge: isBankCard ? "BANK" : (card == null ? void 0 : card.card_issue_type) || "CARD",
8492
+ brandLogo: isBankCard ? void 0 : getCardType2(card == null ? void 0 : card.card_type),
8493
+ disabled: isDisabled
8494
+ };
8495
+ }),
8496
+ selectedId: selectedCard == null ? void 0 : selectedCard.id,
8497
+ onSelect: (id) => setSelectedCard(savedMethods.find((c) => (c == null ? void 0 : c.id) === id)),
8498
+ onRemove: (id) => handleDeleteCard(id),
8499
+ removeIcon: trash2,
8500
+ otherLabel: "Pay with other method",
8501
+ onOther: payWithOther,
8502
+ otherIcon: defaultcard2
8503
+ }
8504
+ ),
8505
+ /* @__PURE__ */ jsx27(
8506
+ FractalFooter,
8507
+ {
8508
+ authText: AuthText,
8509
+ disabled: loading2 || !(selectedCard == null ? void 0 : selectedCard.id) || surchargeLookupLoading,
8510
+ onPay: handlechargeCustomer,
8511
+ buttonLabel: `Pay ${formatUSD(effectiveTotal.toFixed(2))} to ${merchantName}`
8512
+ }
8513
+ )
8514
+ ] }) : activetab === "reader" ? (
8515
+ /* ---------- Reader ---------- */
8516
+ /* @__PURE__ */ jsxs14(Fragment14, { children: [
8517
+ MethodToggle,
8518
+ /* @__PURE__ */ jsx27(
8519
+ FractalReaderList,
8562
8520
  {
8563
- id: "paymentForm",
8564
- onSubmit: submitFunc,
8565
- onKeyDown: (e) => {
8566
- if (e.key === "Enter" && loading2) {
8567
- e.preventDefault();
8568
- e.stopPropagation();
8569
- }
8570
- },
8571
- children: [
8572
- /* @__PURE__ */ jsxs16("div", { className: "ach-scrl", style: { minHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "444px" : (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) == 0 ? "456px" : (cardList == null ? void 0 : cardList.length) > 0 ? "462px" : "520px", overflow: "auto", marginRight: "5px" }, children: [
8573
- /* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
8574
- /* @__PURE__ */ jsx29("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
8575
- /* @__PURE__ */ jsx29("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
8576
- const value = e.target.value;
8577
- if (/^[a-zA-Z\s]*$/.test(value)) {
8578
- handleCardChange("cardName", value);
8579
- }
8580
- } }),
8581
- (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
8582
- ] }),
8583
- /* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
8584
- /* @__PURE__ */ jsx29("label", { children: "CARD NUMBER" }),
8585
- /* @__PURE__ */ jsx29("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx29(
8586
- FractalFields_default,
8587
- {
8588
- fractalStyles,
8589
- tokenizerRef
8590
- }
8591
- ) })
8592
- ] }),
8593
- /* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
8594
- /* @__PURE__ */ jsx29("label", { htmlFor: "OrderId", children: "Order ID / Description" }),
8595
- /* @__PURE__ */ jsx29(
8596
- "input",
8597
- {
8598
- type: "text",
8599
- className: "form-control",
8600
- maxLength: 100,
8601
- placeholder: "Order Id",
8602
- disabled: true,
8603
- value: (_f = props == null ? void 0 : props.orderID) != null ? _f : "",
8604
- style: { background: "#F6F6F7", color: "#727272" }
8605
- }
8606
- )
8607
- ] }),
8608
- /* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
8609
- /* @__PURE__ */ jsx29("label", { htmlFor: "zip", children: "ZIP" }),
8610
- /* @__PURE__ */ jsx29("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (_g = cardData == null ? void 0 : cardData.zipCode) != null ? _g : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
8611
- (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
8612
- ] }),
8613
- (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsx29("div", { className: "form-group", children: /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
8614
- /* @__PURE__ */ jsx29(
8615
- "input",
8616
- {
8617
- type: "checkbox",
8618
- id: "save_card",
8619
- className: "toggle-checkbox",
8620
- checked: saveCardInfo,
8621
- onChange: (e) => setSaveCardInfo(e.target.checked)
8622
- }
8623
- ),
8624
- /* @__PURE__ */ jsx29("label", { htmlFor: "save_card", className: "toggle-label" }),
8625
- /* @__PURE__ */ jsx29("label", { htmlFor: "save_card", children: "Save card for future payments " }),
8626
- /* @__PURE__ */ jsxs16("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
8627
- /* @__PURE__ */ jsxs16("g", { clipPath: "url(#clip0_12420_50192)", children: [
8628
- /* @__PURE__ */ jsx29("rect", { width: "20", height: "20", fill: "white" }),
8629
- /* @__PURE__ */ jsx29("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
8630
- /* @__PURE__ */ jsx29("path", { d: "M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z", fill: "#161616" })
8631
- ] }),
8632
- /* @__PURE__ */ jsx29("defs", { children: /* @__PURE__ */ jsx29("clipPath", { id: "clip0_12420_50192", children: /* @__PURE__ */ jsx29("rect", { width: "20", height: "20", fill: "white" }) }) })
8633
- ] })
8634
- ] }) })
8635
- ] }),
8636
- /* @__PURE__ */ jsxs16("div", { className: "form-group", style: { marginTop: "20px", padding: "0" }, children: [
8637
- (paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((_h = paymentData == null ? void 0 : paymentData.paymentDeviceList) == null ? void 0 : _h.length) > 0 && /* @__PURE__ */ jsx29("button", { type: "button", style: { marginBottom: "10px" }, className: "pay-button", onClick: () => setActiveForm(!activeForm), children: activeForm ? "Pay With Reader" : "Pay With Card" }),
8638
- /* @__PURE__ */ jsx29("button", { type: "submit", style: { margin: 0 }, className: "pay-button", children: partialAmount && !partialError ? formatUSD((_i = Number(partialAmount)) == null ? void 0 : _i.toFixed(2)) : formatUSD((_j = Number(aftertaxAmount)) == null ? void 0 : _j.toFixed(2)) })
8639
- ] })
8640
- ]
8521
+ sectionLabel: "Readers",
8522
+ items: ((paymentData == null ? void 0 : paymentData.paymentDeviceList) || []).map((r) => ({ id: String(r == null ? void 0 : r.id), name: r == null ? void 0 : r.device_name })),
8523
+ selectedId: (selectedReader == null ? void 0 : selectedReader.id) != null ? String(selectedReader == null ? void 0 : selectedReader.id) : void 0,
8524
+ onSelect: (id) => setSelectedReader(((paymentData == null ? void 0 : paymentData.paymentDeviceList) || []).find((r) => String(r == null ? void 0 : r.id) === id)),
8525
+ icon: pax2
8641
8526
  }
8642
- ) : /* @__PURE__ */ jsxs16("form", { id: "PaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, onKeyDown: (e) => {
8643
- if (e.key === "Enter" && loading2) {
8644
- e.preventDefault();
8645
- e.stopPropagation();
8527
+ ),
8528
+ /* @__PURE__ */ jsx27(
8529
+ FractalFooter,
8530
+ {
8531
+ authText: AuthText,
8532
+ disabled: loading2,
8533
+ onPay: handleChargewithEMV,
8534
+ buttonLabel: `Pay ${formatUSD(effectiveTotal.toFixed(2))} to ${merchantName}`
8646
8535
  }
8647
- }, children: [
8648
- /* @__PURE__ */ jsxs16("div", { className: "ach-scrl", style: { minHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "444px" : (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) == 0 ? "456px" : (cardList == null ? void 0 : cardList.length) > 0 ? "462px" : "520px", overflow: "auto", marginRight: "5px" }, children: [
8649
- /* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
8650
- /* @__PURE__ */ jsx29("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
8651
- /* @__PURE__ */ jsx29("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
8652
- const value = e.target.value;
8653
- if (/^[a-zA-Z\s]*$/.test(value)) {
8654
- handleCardChange("cardName", value);
8655
- }
8656
- } }),
8657
- (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
8658
- ] }),
8659
- /* @__PURE__ */ jsx29("div", { className: "form-group", children: /* @__PURE__ */ jsx29(
8660
- DataCapFields,
8661
- {
8662
- isOpen: show,
8663
- tokenKey: paymentData == null ? void 0 : paymentData.dctoken,
8664
- setLoader: setLoadingIframe,
8665
- onError: (msg) => setError(msg || DcLoadingError)
8666
- }
8667
- ) }),
8668
- /* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
8669
- /* @__PURE__ */ jsx29("label", { htmlFor: "OrderId", children: "Order ID / Description" }),
8670
- /* @__PURE__ */ jsx29(
8671
- "input",
8672
- {
8673
- type: "text",
8674
- className: "form-control",
8675
- maxLength: 100,
8676
- placeholder: "Order Id",
8677
- disabled: true,
8678
- value: (_k = props == null ? void 0 : props.orderID) != null ? _k : "",
8679
- style: { background: "#F6F6F7", color: "#727272" }
8680
- }
8681
- )
8682
- ] }),
8683
- /* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
8684
- /* @__PURE__ */ jsx29("label", { htmlFor: "zip", children: "ZIP" }),
8685
- /* @__PURE__ */ jsx29("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (_l = cardData == null ? void 0 : cardData.zipCode) != null ? _l : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
8686
- (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
8687
- ] }),
8688
- (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsx29("div", { className: "form-group", children: /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
8689
- /* @__PURE__ */ jsx29(
8690
- "input",
8691
- {
8692
- type: "checkbox",
8693
- id: "save_card",
8694
- className: "toggle-checkbox",
8695
- checked: saveCardInfo,
8696
- onChange: (e) => setSaveCardInfo(e.target.checked)
8536
+ )
8537
+ ] })
8538
+ ) : activetab === "ach" ? (
8539
+ /* ---------- Bank form ---------- */
8540
+ /* @__PURE__ */ jsxs14(
8541
+ "form",
8542
+ {
8543
+ id: "ACHPaymentForm",
8544
+ autoComplete: "off",
8545
+ onSubmit: submitFunc,
8546
+ onKeyDown: (e) => {
8547
+ if (e.key === "Enter" && loading2) {
8548
+ e.preventDefault();
8549
+ e.stopPropagation();
8550
+ }
8551
+ },
8552
+ style: { display: "flex", flexDirection: "column", gap: "20px", flex: "1 1 auto", minHeight: 0, width: "100%" },
8553
+ children: [
8554
+ MethodToggle,
8555
+ /* @__PURE__ */ jsxs14("div", { className: "fps-scroll", children: [
8556
+ /* @__PURE__ */ jsx27(FractalField, { label: "Name on account", htmlFor: "nameonaccount", error: achError == null ? void 0 : achError.name, children: /* @__PURE__ */ jsx27("input", { id: "nameonaccount", className: "fps-input", maxLength: 100, placeholder: "John Doe", name: "name", value: (_d = achData == null ? void 0 : achData.name) != null ? _d : "", onChange: handleChangeAch }) }),
8557
+ /* @__PURE__ */ jsx27(FractalField, { label: "Routing number", htmlFor: "routingnumber", error: achError == null ? void 0 : achError.routingNumber, children: /* @__PURE__ */ jsx27("input", { id: "routingnumber", className: "fps-input", maxLength: 9, placeholder: "000000000", name: "routingNumber", value: (_e = achData == null ? void 0 : achData.routingNumber) != null ? _e : "", onChange: handleChangeAch }) }),
8558
+ /* @__PURE__ */ jsx27(FractalField, { label: "Account number", htmlFor: "accountnumber", error: achError == null ? void 0 : achError.accountNumber, children: /* @__PURE__ */ jsx27("input", { id: "accountnumber", className: "fps-input", maxLength: 16, placeholder: "0000000000", name: "accountNumber", value: (_f = achData == null ? void 0 : achData.accountNumber) != null ? _f : "", onChange: handleChangeAch }) }),
8559
+ /* @__PURE__ */ jsx27(FractalField, { label: "Confirm account number", htmlFor: "confirmaccountnumber", error: achError == null ? void 0 : achError.confirmAccountNumber, children: /* @__PURE__ */ jsx27("input", { id: "confirmaccountnumber", className: "fps-input", maxLength: 16, placeholder: "0000000000", name: "confirmAccountNumber", value: (_g = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _g : "", onChange: handleChangeAch }) }),
8560
+ /* @__PURE__ */ jsx27(FractalField, { label: "Bank name", htmlFor: "bankname", error: achError == null ? void 0 : achError.bankName, children: /* @__PURE__ */ jsx27("input", { id: "bankname", className: "fps-input", maxLength: 100, placeholder: "My Bank", name: "bankName", value: (_h = achData == null ? void 0 : achData.bankName) != null ? _h : "", onChange: handleChangeAch }) }),
8561
+ ((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsx27(FractalField, { label: "Company name", htmlFor: "companyName", error: achError == null ? void 0 : achError.companyName, children: /* @__PURE__ */ jsx27("input", { id: "companyName", className: "fps-input", maxLength: 100, placeholder: "My Company", name: "companyName", value: (_i = achData == null ? void 0 : achData.companyName) != null ? _i : "", onChange: handleChangeAch }) }),
8562
+ /* @__PURE__ */ jsx27(FractalField, { label: "Account type", htmlFor: "accounttype", children: /* @__PURE__ */ jsxs14("select", { id: "accounttype", name: "accountType", className: "fps-input", value: (_j = achData == null ? void 0 : achData.accountType) != null ? _j : "", onChange: handleChangeAch, children: [
8563
+ /* @__PURE__ */ jsx27("option", { value: "", children: "Select" }),
8564
+ accountTypes.map((type) => /* @__PURE__ */ jsx27("option", { value: type.value, children: type.label }, type.value))
8565
+ ] }) }),
8566
+ (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsxs14(FractalCheckbox, { id: "saveACH", checked: saveACHinfo, onChange: (v) => {
8567
+ setSaveACHinfo(v);
8568
+ if (!v) {
8569
+ setSaveACHConsent1(false);
8570
+ setErrorBankConsentOther("");
8697
8571
  }
8698
- ),
8699
- /* @__PURE__ */ jsx29("label", { htmlFor: "save_card", className: "toggle-label" }),
8700
- /* @__PURE__ */ jsx29("label", { htmlFor: "save_card", children: "Save card for future payments " }),
8701
- /* @__PURE__ */ jsxs16("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
8702
- /* @__PURE__ */ jsxs16("g", { clipPath: "url(#clip0_12420_50192)", children: [
8703
- /* @__PURE__ */ jsx29("rect", { width: "20", height: "20", fill: "white" }),
8704
- /* @__PURE__ */ jsx29("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
8705
- /* @__PURE__ */ jsx29("path", { d: "M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z", fill: "#161616" })
8572
+ }, children: [
8573
+ "Save this bank account. ",
8574
+ merchantName,
8575
+ " may charge it for future invoices. ",
8576
+ /* @__PURE__ */ jsx27("u", { children: "See terms" }),
8577
+ "."
8578
+ ] }),
8579
+ saveACHinfo && /* @__PURE__ */ jsxs14(Fragment14, { children: [
8580
+ /* @__PURE__ */ jsxs14(FractalCheckbox, { id: "saveACHConsent1", checked: saveACHConsent1, onChange: (v) => {
8581
+ setSaveACHConsent1(v);
8582
+ if (v) setErrorBankConsentOther("");
8583
+ }, children: [
8584
+ "By providing my bank account information and selecting \u2018Save for future payments\u2019, I authorize ",
8585
+ merchantName,
8586
+ " to store my bank account details for future ACH payments. I understand that future payments may be initiated using this saved account in accordance with my instructions. I confirm I am authorized to use this bank account."
8706
8587
  ] }),
8707
- /* @__PURE__ */ jsx29("defs", { children: /* @__PURE__ */ jsx29("clipPath", { id: "clip0_12420_50192", children: /* @__PURE__ */ jsx29("rect", { width: "20", height: "20", fill: "white" }) }) })
8588
+ errorBankConsentOther && /* @__PURE__ */ jsx27("span", { className: "fps-error", children: errorBankConsentOther })
8589
+ ] }),
8590
+ !saveACHinfo && /* @__PURE__ */ jsxs14(Fragment14, { children: [
8591
+ /* @__PURE__ */ jsxs14(FractalCheckbox, { id: "achconsent", checked: isBankConsentChecked, onChange: (v) => {
8592
+ setIsBankConsentChecked(v);
8593
+ if (v) setErrorBankConsent("");
8594
+ }, children: [
8595
+ "By selecting this box, I authorize ",
8596
+ merchantName,
8597
+ " 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."
8598
+ ] }),
8599
+ errorBankConsent && /* @__PURE__ */ jsx27("span", { className: "fps-error", children: errorBankConsent })
8708
8600
  ] })
8709
- ] }) })
8710
- ] }),
8711
- /* @__PURE__ */ jsxs16("div", { className: "form-group", style: { marginTop: "20px", padding: "0" }, children: [
8712
- (paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((_m = paymentData == null ? void 0 : paymentData.paymentDeviceList) == null ? void 0 : _m.length) > 0 && /* @__PURE__ */ jsx29("button", { type: "button", style: { marginBottom: "10px" }, className: "pay-button", onClick: () => setActiveForm(!activeForm), children: activeForm ? "Pay With Reader" : "Pay With Card" }),
8713
- /* @__PURE__ */ jsx29("button", { type: "submit", style: { margin: 0 }, className: "pay-button", children: partialAmount && !partialError ? formatUSD((_n = Number(partialAmount)) == null ? void 0 : _n.toFixed(2)) : formatUSD((_o = Number(aftertaxAmount)) == null ? void 0 : _o.toFixed(2)) })
8714
- ] })
8715
- ] })
8716
- ] }),
8717
- /* @__PURE__ */ jsxs16("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent", children: [
8718
- /* @__PURE__ */ jsx29("div", { className: "frac-card-payment", children: /* @__PURE__ */ jsxs16("div", { className: "frac-heading-card-wrap", children: [
8719
- /* @__PURE__ */ jsx29("div", { className: "frac-backarrow", children: (bankList == null ? void 0 : bankList.length) > 0 && activeinBank === "form" && /* @__PURE__ */ jsxs16("button", { className: "charge-payment-back-btn ", onClick: () => setActiveinBank("list"), children: [
8720
- " ",
8721
- /* @__PURE__ */ jsx29(IoArrowBack, {})
8722
- ] }) }),
8723
- /* @__PURE__ */ jsx29("h6", { className: "frac-card-payment-heading", children: "Bank Payment" })
8724
- ] }) }),
8725
- activeinBank === "list" ? /* @__PURE__ */ jsxs16(Fragment16, { children: [
8726
- /* @__PURE__ */ jsx29(CardList, { listHeading: "Banks", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
8727
- setActiveinBank("form");
8728
- } }),
8729
- /* @__PURE__ */ jsx29("div", { className: "form-group", style: { padding: "0" }, children: /* @__PURE__ */ jsx29("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlepayment, children: partialAmount && !partialError ? formatUSD((_p = Number(partialAmount)) == null ? void 0 : _p.toFixed(2)) : formatUSD((_q = Number(cashDiscount)) == null ? void 0 : _q.toFixed(2)) }) })
8730
- ] }) : /* @__PURE__ */ jsxs16("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
8731
- if (e.key === "Enter" && loading2) {
8732
- e.preventDefault();
8733
- e.stopPropagation();
8734
- }
8735
- }, children: [
8736
- /* @__PURE__ */ jsxs16("div", { className: "ach-scrl", style: {
8737
- minHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "444px" : (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) == 0 ? "436px" : (cardList == null ? void 0 : cardList.length) > 0 ? "462px" : "520px",
8738
- maxHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "444px" : (cardList == null ? void 0 : cardList.length) > 0 ? "380px" : "380px"
8739
- }, children: [
8740
- /* @__PURE__ */ jsxs16("div", { className: "form-group mb-4", children: [
8741
- /* @__PURE__ */ jsx29("label", { htmlFor: "nameonaccount", children: "Name on account" }),
8742
- /* @__PURE__ */ jsx29("input", { type: "text", id: "nameonaccount", className: "form-control", maxLength: 100, placeholder: "John Doe", name: "name", value: (_r = achData == null ? void 0 : achData.name) != null ? _r : "", onChange: handleChangeAch }),
8743
- (achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
8744
- ] }),
8745
- /* @__PURE__ */ jsxs16("div", { className: "form-group mb-4", children: [
8746
- /* @__PURE__ */ jsx29("label", { htmlFor: "routingnumber", children: "Routing number" }),
8747
- /* @__PURE__ */ jsx29(
8748
- "input",
8749
- {
8750
- type: "text",
8751
- id: "routingnumber",
8752
- className: "form-control",
8753
- maxLength: 9,
8754
- placeholder: "000000000",
8755
- name: "routingNumber",
8756
- value: (_s = achData == null ? void 0 : achData.routingNumber) != null ? _s : "",
8757
- onChange: handleChangeAch
8758
- }
8759
- ),
8760
- (achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: achError == null ? void 0 : achError.routingNumber })
8761
8601
  ] }),
8762
- /* @__PURE__ */ jsxs16("div", { className: "form-group mb-4", children: [
8763
- /* @__PURE__ */ jsx29("label", { htmlFor: "accountnumber", children: "Account number" }),
8764
- /* @__PURE__ */ jsx29(
8765
- "input",
8766
- {
8767
- type: "text",
8768
- id: "accountnumber",
8769
- className: "form-control",
8770
- maxLength: 16,
8771
- placeholder: "0000000000",
8772
- name: "accountNumber",
8773
- value: (_t = achData == null ? void 0 : achData.accountNumber) != null ? _t : "",
8774
- onChange: handleChangeAch
8775
- }
8776
- ),
8777
- (achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: achError == null ? void 0 : achError.accountNumber })
8778
- ] }),
8779
- /* @__PURE__ */ jsxs16("div", { className: "form-group mb-4", children: [
8780
- /* @__PURE__ */ jsx29("label", { htmlFor: "confirmaccountnumber", children: "Confirm account number" }),
8781
- /* @__PURE__ */ jsx29(
8782
- "input",
8783
- {
8784
- type: "text",
8785
- id: "confirmaccountnumber",
8786
- className: "form-control",
8787
- maxLength: 16,
8788
- placeholder: "0000000000",
8789
- name: "confirmAccountNumber",
8790
- value: (_u = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _u : "",
8791
- onChange: handleChangeAch
8792
- }
8793
- ),
8794
- (achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: achError == null ? void 0 : achError.confirmAccountNumber })
8795
- ] }),
8796
- /* @__PURE__ */ jsxs16("div", { className: "form-group mb-4", children: [
8797
- /* @__PURE__ */ jsx29("label", { htmlFor: "bankname", children: "Bank name" }),
8798
- /* @__PURE__ */ jsx29(
8602
+ /* @__PURE__ */ jsx27(
8603
+ FractalFooter,
8604
+ {
8605
+ authText: AuthText,
8606
+ submit: true,
8607
+ disabled: loading2,
8608
+ buttonLabel: `Pay ${formatUSD(effectiveTotal.toFixed(2))} to ${merchantName}`
8609
+ }
8610
+ )
8611
+ ]
8612
+ }
8613
+ )
8614
+ ) : (
8615
+ /* ---------- Card form ---------- */
8616
+ /* @__PURE__ */ jsxs14(
8617
+ "form",
8618
+ {
8619
+ id: (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 ? "paymentForm" : "PaymentForm",
8620
+ onSubmit: submitFunc,
8621
+ onKeyDown: (e) => {
8622
+ if (e.key === "Enter" && loading2) {
8623
+ e.preventDefault();
8624
+ e.stopPropagation();
8625
+ }
8626
+ },
8627
+ style: { display: "flex", flexDirection: "column", gap: "20px", flex: "1 1 auto", minHeight: 0, width: "100%" },
8628
+ children: [
8629
+ MethodToggle,
8630
+ /* @__PURE__ */ jsxs14("div", { className: "fps-scroll", children: [
8631
+ /* @__PURE__ */ jsx27(FractalField, { label: "Name on card", htmlFor: "cardHolderName", error: cardError == null ? void 0 : cardError.cardName, children: /* @__PURE__ */ jsx27(
8799
8632
  "input",
8800
8633
  {
8801
- type: "text",
8802
- id: "bankname",
8803
- className: "form-control",
8634
+ id: "cardHolderName",
8635
+ className: "fps-input",
8804
8636
  maxLength: 100,
8805
- placeholder: "My Bank",
8806
- name: "bankName",
8807
- value: (_v = achData == null ? void 0 : achData.bankName) != null ? _v : "",
8808
- onChange: handleChangeAch
8637
+ placeholder: "John Doe",
8638
+ value: (cardData == null ? void 0 : cardData.cardName) || "",
8639
+ onChange: (e) => {
8640
+ const value = e.target.value;
8641
+ if (/^[a-zA-Z\s]*$/.test(value)) handleCardChange("cardName", value);
8642
+ }
8809
8643
  }
8810
- ),
8811
- (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: achError == null ? void 0 : achError.bankName })
8812
- ] }),
8813
- ((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs16("div", { className: "form-group mb-4", children: [
8814
- /* @__PURE__ */ jsx29("label", { htmlFor: "companyName", children: "Company name" }),
8815
- /* @__PURE__ */ jsx29(
8816
- "input",
8644
+ ) }),
8645
+ /* @__PURE__ */ jsx27(FractalField, { label: (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 ? "Card number" : "", error: cardError == null ? void 0 : cardError.cardNumber, children: /* @__PURE__ */ jsx27("div", { className: `fps-tokenizer ${(paymentData == null ? void 0 : paymentData.paymentGateway) !== 32 ? "dc-tokenizer" : ""}`, children: (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 ? show && isTokenizerReady && /* @__PURE__ */ jsx27(
8646
+ FractalFields_default,
8817
8647
  {
8818
- type: "text",
8819
- id: "companyName",
8820
- className: "form-control",
8821
- maxLength: 100,
8822
- placeholder: "My Company",
8823
- name: "companyName",
8824
- value: (_w = achData == null ? void 0 : achData.companyName) != null ? _w : "",
8825
- onChange: handleChangeAch
8648
+ fractalStyles,
8649
+ tokenizerRef,
8650
+ surchargeEnabled: Number(paymentData == null ? void 0 : paymentData.surchargeProgram) === 1 && !!(props == null ? void 0 : props.pass_fee),
8651
+ createSurchargeSession,
8652
+ getSurchargeOptions,
8653
+ onSurchargeResult: setSurchargeResult
8826
8654
  }
8827
- ),
8828
- (achError == null ? void 0 : achError.companyName) && /* @__PURE__ */ jsx29("span", { className: "error-span", children: achError == null ? void 0 : achError.companyName })
8829
- ] }),
8830
- /* @__PURE__ */ jsxs16("div", { className: "form-group mb-4", children: [
8831
- /* @__PURE__ */ jsx29("label", { htmlFor: "accounttype", children: "Select account type" }),
8832
- /* @__PURE__ */ jsxs16("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_x = achData == null ? void 0 : achData.accountType) != null ? _x : "", onChange: handleChangeAch, children: [
8833
- /* @__PURE__ */ jsx29("option", { value: "", children: "Select account" }),
8834
- accountTypes.map((type) => /* @__PURE__ */ jsx29("option", { value: type.value, children: type.label }, type.value))
8655
+ ) : /* @__PURE__ */ jsx27(DataCapFields, { isOpen: show, tokenKey: paymentData == null ? void 0 : paymentData.dctoken, setLoader: setLoadingIframe, onError: (msg) => setError(msg || DcLoadingError) }) }) }),
8656
+ /* @__PURE__ */ jsx27(FractalField, { label: "Zip", htmlFor: "zip", error: cardError == null ? void 0 : cardError.zipCode, children: /* @__PURE__ */ jsx27("input", { id: "zip", className: "fps-input", maxLength: 100, placeholder: "000000", value: (_k = cardData == null ? void 0 : cardData.zipCode) != null ? _k : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }) }),
8657
+ (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsxs14(FractalCheckbox, { id: "save_card", checked: saveCardInfo, onChange: (v) => setSaveCardInfo(v), children: [
8658
+ "Save this card. ",
8659
+ merchantName,
8660
+ " may charge it for future invoices. ",
8661
+ /* @__PURE__ */ jsx27("u", { children: "See terms" }),
8662
+ "."
8835
8663
  ] })
8836
8664
  ] }),
8837
- !saveACHinfo && /* @__PURE__ */ jsxs16(Fragment16, { children: [
8838
- /* @__PURE__ */ jsxs16("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
8839
- /* @__PURE__ */ jsx29(
8840
- "input",
8841
- {
8842
- type: "checkbox",
8843
- id: "achconsent",
8844
- className: "",
8845
- checked: isBankConsentChecked,
8846
- onChange: (e) => {
8847
- setIsBankConsentChecked(e.target.checked);
8848
- if (e.target.checked) {
8849
- setErrorBankConsent("");
8850
- }
8851
- }
8852
- }
8853
- ),
8854
- /* @__PURE__ */ jsx29("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.` })
8855
- ] }),
8856
- errorBankConsent && /* @__PURE__ */ jsx29("span", { className: "error-span", children: errorBankConsent })
8857
- ] }),
8858
- (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsxs16("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
8859
- /* @__PURE__ */ jsx29("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
8860
- /* @__PURE__ */ jsx29("label", { htmlFor: "saveACH", children: "Save for future use" })
8861
- ] }),
8862
- saveACHinfo && /* @__PURE__ */ jsxs16(Fragment16, { children: [
8863
- /* @__PURE__ */ jsxs16("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
8864
- /* @__PURE__ */ jsx29("input", { type: "checkbox", id: "saveACHConsent1", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHConsent1, onChange: (e) => {
8865
- setSaveACHConsent1(e.target.checked);
8866
- if (e.target.checked) {
8867
- setErrorBankConsentOther("");
8868
- }
8869
- } }),
8870
- /* @__PURE__ */ jsxs16("label", { className: "saveachlabel", htmlFor: "saveACHConsent1", children: [
8871
- "By providing my bank account information and selecting \u2018Save for future payments\u2019, I authorize ",
8872
- (paymentData == null ? void 0 : paymentData.bname) || "merchant",
8873
- " to store my bank account details for future ACH payments. I understand that future payments may be initiated using this saved account in accordance with my instructions. I confirm I am authorized to use this bank account."
8874
- ] })
8875
- ] }),
8876
- errorBankConsentOther && /* @__PURE__ */ jsx29("span", { className: "error-span", children: errorBankConsentOther })
8877
- ] })
8878
- ] }),
8879
- /* @__PURE__ */ jsx29("div", { className: "form-group ", children: /* @__PURE__ */ jsx29("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit", children: partialAmount && !partialError ? formatUSD((_y = Number(partialAmount)) == null ? void 0 : _y.toFixed(2)) : formatUSD((_z = Number(cashDiscount)) == null ? void 0 : _z.toFixed(2)) }) })
8880
- ] })
8881
- ] })
8882
- ] }) }) })
8665
+ /* @__PURE__ */ jsx27(
8666
+ FractalFooter,
8667
+ {
8668
+ authText: AuthText,
8669
+ submit: true,
8670
+ disabled: loading2 || surchargeLookupLoading,
8671
+ buttonLabel: `Pay ${formatUSD(effectiveTotal.toFixed(2))} to ${merchantName}`
8672
+ }
8673
+ )
8674
+ ]
8675
+ }
8676
+ )
8677
+ )
8883
8678
  ] })
8884
- ] }) })
8679
+ ] })
8885
8680
  ] })
8886
8681
  ]
8887
8682
  }
@@ -8894,13 +8689,13 @@ function PartialPayment(props) {
8894
8689
  import { useEffect as useEffect16, useState as useState10, useMemo } from "react";
8895
8690
 
8896
8691
  // src/app/components/Skysystemz/SkyChargewidgetstyles.tsx
8897
- import { jsx as jsx30 } from "react/jsx-runtime";
8692
+ import { jsx as jsx28 } from "react/jsx-runtime";
8898
8693
  function SkyChargewidgetstyles() {
8899
8694
  const primarycolor = "#000";
8900
8695
  const primarybgcolor = "#fff";
8901
8696
  const primarybodycolor = "#212529";
8902
8697
  const primarybordercolor = "#dee2e6";
8903
- return /* @__PURE__ */ jsx30("style", { children: `
8698
+ return /* @__PURE__ */ jsx28("style", { children: `
8904
8699
  @import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
8905
8700
  body
8906
8701
  {
@@ -9786,6 +9581,44 @@ function ThreeDSChallenge({
9786
9581
  return null;
9787
9582
  }
9788
9583
 
9584
+ // src/app/components/Atoms/CardBankRadio/CardBankRadio.tsx
9585
+ import { Fragment as Fragment15, jsx as jsx29, jsxs as jsxs15 } from "react/jsx-runtime";
9586
+ var CardBankRadio = (_a) => {
9587
+ var _b = _a, { skydesign = false, savingsText } = _b, props = __objRest(_b, ["skydesign", "savingsText"]);
9588
+ const savingsBadgeClass = `frac-saving-badge ${skydesign ? "frac-saving-badge-corner" : "frac-saving-badge-corner frac-saving-badge-with-radio"}`;
9589
+ return /* @__PURE__ */ jsx29(Fragment15, { children: /* @__PURE__ */ jsx29(
9590
+ "div",
9591
+ {
9592
+ className: `frac-card-bank-radio ${props.activetab === props.value ? "frac-active" : ""}`,
9593
+ onClick: () => props.onChange(props.value),
9594
+ role: "radio",
9595
+ children: skydesign ? /* @__PURE__ */ jsxs15(Fragment15, { children: [
9596
+ /* @__PURE__ */ jsxs15("div", { className: "frac-card-title-main", children: [
9597
+ /* @__PURE__ */ jsxs15("div", { className: "box-inner-card-text", children: [
9598
+ /* @__PURE__ */ jsx29("img", { src: props.label.toLowerCase() === "card" ? defaultcard : props.label.toLowerCase() === "reader" ? pax : bankNew, className: "frac-payment-type-logo", alt: "" }),
9599
+ /* @__PURE__ */ jsx29("div", { className: "frac-card-label-text", children: props.label })
9600
+ ] }),
9601
+ /* @__PURE__ */ jsx29("div", { className: "frac-card-label", children: /* @__PURE__ */ jsx29("div", { className: "frac-card-label-amount", children: formatUSD(props.amount) }) })
9602
+ ] }),
9603
+ /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29("input", { name: "paymenttype", checked: props.activetab === props.value, type: "hidden", value: props.value, onChange: (e) => {
9604
+ props.onChange(e.target.value);
9605
+ } }) })
9606
+ ] }) : /* @__PURE__ */ jsxs15(Fragment15, { children: [
9607
+ /* @__PURE__ */ jsxs15("div", { className: "frac-card-title-main", children: [
9608
+ /* @__PURE__ */ jsx29("img", { src: props.label.toLowerCase() === "card" ? defaultcard : props.label.toLowerCase() === "reader" ? pax : bankNew, className: "frac-payment-type-logo", alt: "" }),
9609
+ /* @__PURE__ */ jsxs15("div", { className: "frac-card-label", children: [
9610
+ /* @__PURE__ */ jsx29("div", { className: "frac-card-label-text", children: props.label }),
9611
+ /* @__PURE__ */ jsx29("div", { className: "frac-card-label-amount", children: formatUSD(props.amount) })
9612
+ ] })
9613
+ ] }),
9614
+ /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29("input", { name: "paymenttype", checked: props.activetab === props.value, type: "radio", value: props.value, onChange: (e) => {
9615
+ props.onChange(e.target.value);
9616
+ } }) })
9617
+ ] })
9618
+ }
9619
+ ) });
9620
+ };
9621
+
9789
9622
  // src/app/components/Atoms/ThreedsCheckout/ThreedsCheckout.tsx
9790
9623
  import { Elements } from "@stripe/react-stripe-js";
9791
9624
  import { loadStripe } from "@stripe/stripe-js";
@@ -9794,7 +9627,7 @@ import { loadStripe } from "@stripe/stripe-js";
9794
9627
  import { PaymentElement, useElements, useStripe } from "@stripe/react-stripe-js";
9795
9628
  import axios7 from "axios";
9796
9629
  import { useState as useState8 } from "react";
9797
- import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
9630
+ import { jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
9798
9631
  var CheckoutForm = ({ onSuccess, showLoader, setError, session_token, callback, hideLoader, handleClose, amount, isPreAuth }) => {
9799
9632
  var _a;
9800
9633
  const stripe = useStripe();
@@ -9859,24 +9692,76 @@ var CheckoutForm = ({ onSuccess, showLoader, setError, session_token, callback,
9859
9692
  hideLoader();
9860
9693
  }
9861
9694
  };
9862
- return /* @__PURE__ */ jsxs17("form", { onSubmit: handleSubmit, children: [
9863
- /* @__PURE__ */ jsx31(PaymentElement, {}),
9864
- /* @__PURE__ */ jsx31("button", { className: "pay-button", disabled: loading || !stripe, children: loading ? "Processing..." : `${formatUSD((_a = Number(amount)) == null ? void 0 : _a.toFixed(2))}` })
9695
+ return /* @__PURE__ */ jsxs16("form", { onSubmit: handleSubmit, children: [
9696
+ /* @__PURE__ */ jsx30(PaymentElement, {}),
9697
+ /* @__PURE__ */ jsx30("button", { className: "pay-button", disabled: loading || !stripe, children: loading ? "Processing..." : `${formatUSD((_a = Number(amount)) == null ? void 0 : _a.toFixed(2))}` })
9865
9698
  ] });
9866
9699
  };
9867
9700
 
9868
9701
  // src/app/components/Atoms/ThreedsCheckout/ThreedsCheckout.tsx
9869
- import { jsx as jsx32 } from "react/jsx-runtime";
9702
+ import { jsx as jsx31 } from "react/jsx-runtime";
9870
9703
  var stripePromise = loadStripe(
9871
9704
  threedsSecurePublicKey
9872
9705
  );
9873
9706
  function CheckoutWrapper({ clientSecret, onSuccess, showLoader, setError, session_token, callback, hideLoader, handleClose, amount, isPreAuth }) {
9874
9707
  if (!clientSecret) return null;
9875
- return /* @__PURE__ */ jsx32(Elements, { stripe: stripePromise, options: { clientSecret }, children: /* @__PURE__ */ jsx32(CheckoutForm, { onSuccess, showLoader, hideLoader, setError, session_token, callback, handleClose, amount, isPreAuth }) });
9708
+ return /* @__PURE__ */ jsx31(Elements, { stripe: stripePromise, options: { clientSecret }, children: /* @__PURE__ */ jsx31(CheckoutForm, { onSuccess, showLoader, hideLoader, setError, session_token, callback, handleClose, amount, isPreAuth }) });
9876
9709
  }
9877
9710
 
9878
9711
  // src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
9879
- import { IoArrowBack as IoArrowBack2 } from "react-icons/io5";
9712
+ import { IoArrowBack } from "react-icons/io5";
9713
+
9714
+ // src/app/components/Atoms/CardList/CardList.tsx
9715
+ import { Fragment as Fragment16, jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
9716
+ var CardList = ({ listHeading = "Card", ListItems, selectedCard, setSelectedCard, paymentGateway, handleDeleteCard, otherButtonAction, otherButtonLabel, headingClass }) => {
9717
+ let trash2 = S3Url + "widget/Trash.svg";
9718
+ return /* @__PURE__ */ jsxs17(Fragment16, { children: [
9719
+ /* @__PURE__ */ jsx32("h6", { className: headingClass || "card-ach-heading", style: { marginBottom: "10px !important" }, children: listHeading }),
9720
+ /* @__PURE__ */ jsxs17("div", { className: "card-lint-div-in", children: [
9721
+ /* @__PURE__ */ jsx32("div", { className: "card-list-div", children: ListItems && (ListItems == null ? void 0 : ListItems.length) > 0 && (ListItems == null ? void 0 : ListItems.map((card, index) => {
9722
+ let isDisabled = false;
9723
+ if (paymentGateway) {
9724
+ isDisabled = paymentGateway != (card == null ? void 0 : card.payment_method_type) && (card == null ? void 0 : card.card_type) != "Bank";
9725
+ }
9726
+ return /* @__PURE__ */ jsxs17("div", { className: "card-list-single-div", children: [
9727
+ /* @__PURE__ */ jsxs17("div", { className: "card-number-radio", children: [
9728
+ /* @__PURE__ */ jsx32(
9729
+ "input",
9730
+ {
9731
+ disabled: isDisabled,
9732
+ type: "radio",
9733
+ className: "cardRadio",
9734
+ name: "selected_card",
9735
+ id: "",
9736
+ checked: (selectedCard == null ? void 0 : selectedCard.id) === (card == null ? void 0 : card.id),
9737
+ onChange: (e) => setSelectedCard(card)
9738
+ }
9739
+ ),
9740
+ /* @__PURE__ */ jsxs17("label", { htmlFor: "", className: "card-number-last-four", children: [
9741
+ "**** ",
9742
+ card == null ? void 0 : card.cardlastfourdigit
9743
+ ] }),
9744
+ (card == null ? void 0 : card.card_type) != "Bank" && /* @__PURE__ */ jsxs17("h6", { className: "card-expiry-date", children: [
9745
+ card == null ? void 0 : card.expmonth,
9746
+ "/",
9747
+ card == null ? void 0 : card.expyear
9748
+ ] })
9749
+ ] }),
9750
+ /* @__PURE__ */ jsxs17("div", { className: "card-number-radio", children: [
9751
+ /* @__PURE__ */ jsx32("span", { className: "visa-card", children: /* @__PURE__ */ jsx32("img", { src: getCardType(card == null ? void 0 : card.card_type), alt: "" }) }),
9752
+ /* @__PURE__ */ jsx32("span", { className: "visa-card", style: { cursor: "pointer" }, onClick: () => handleDeleteCard(card == null ? void 0 : card.id), children: /* @__PURE__ */ jsx32("img", { src: trash2, alt: "" }) })
9753
+ ] })
9754
+ ] }, card == null ? void 0 : card.id);
9755
+ })) }),
9756
+ /* @__PURE__ */ jsxs17("div", { className: "pay-with-other-card", onClick: otherButtonAction, children: [
9757
+ otherButtonLabel,
9758
+ /* @__PURE__ */ jsx32("img", { src: defaultcard, alt: "" })
9759
+ ] })
9760
+ ] })
9761
+ ] });
9762
+ };
9763
+
9764
+ // src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
9880
9765
  import { NumericFormat as NumericFormat2 } from "react-number-format";
9881
9766
 
9882
9767
  // src/app/components/ErrorCardMessage/ErrorCardOverlaystyle.tsx
@@ -11327,7 +11212,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
11327
11212
  /* @__PURE__ */ jsx36("h1", { className: "pay-heading", children: "Pay" }),
11328
11213
  (cardList == null ? void 0 : cardList.length) > 0 && activetab !== "cardList" && /* @__PURE__ */ jsxs19("button", { className: "res-charge-payment-back-btn ", onClick: () => setActive("cardList"), children: [
11329
11214
  " ",
11330
- /* @__PURE__ */ jsx36(IoArrowBack2, {}),
11215
+ /* @__PURE__ */ jsx36(IoArrowBack, {}),
11331
11216
  " Back"
11332
11217
  ] })
11333
11218
  ] }),
@@ -11407,7 +11292,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
11407
11292
  /* @__PURE__ */ jsxs19("div", { className: "frac-heading-card-wrap", children: [
11408
11293
  /* @__PURE__ */ jsx36("div", { className: "frac-backarrow", children: (cardList == null ? void 0 : cardList.length) > 0 && activeinCard === "form" && /* @__PURE__ */ jsxs19("button", { className: "charge-payment-back-btn ", onClick: () => setActiveinCard("list"), children: [
11409
11294
  " ",
11410
- /* @__PURE__ */ jsx36(IoArrowBack2, {})
11295
+ /* @__PURE__ */ jsx36(IoArrowBack, {})
11411
11296
  ] }) }),
11412
11297
  /* @__PURE__ */ jsx36("h6", { className: "frac-card-payment-heading", children: "Card Payment" })
11413
11298
  ] }),
@@ -11606,7 +11491,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
11606
11491
  !onSubmit && /* @__PURE__ */ jsxs19("div", { className: "frac-heading-card-wrap", children: [
11607
11492
  /* @__PURE__ */ jsx36("div", { className: "frac-backarrow", children: (bankList == null ? void 0 : bankList.length) > 0 && activeinBank === "form" && /* @__PURE__ */ jsxs19("button", { className: "charge-payment-back-btn ", onClick: () => setActiveinBank("list"), children: [
11608
11493
  " ",
11609
- /* @__PURE__ */ jsx36(IoArrowBack2, {})
11494
+ /* @__PURE__ */ jsx36(IoArrowBack, {})
11610
11495
  ] }) }),
11611
11496
  /* @__PURE__ */ jsx36("h6", { className: "frac-card-payment-heading", children: "Bank Payment" })
11612
11497
  ] }),