@fractalpay/fractalpay-next-dev 0.0.249 → 0.0.251

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.d.ts CHANGED
@@ -50,6 +50,7 @@ type Props$5 = {
50
50
  pass_fee?: boolean;
51
51
  isReader?: boolean;
52
52
  sessionToken?: string;
53
+ bankFeeAmount?: string;
53
54
  };
54
55
  declare function GetPaymentPage(props: Props$5): React.JSX.Element;
55
56
 
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  "package.json"(exports, module) {
40
40
  module.exports = {
41
41
  name: "@fractalpay/fractalpay-next-dev",
42
- version: "0.0.249",
42
+ version: "0.0.251",
43
43
  private: false,
44
44
  type: "module",
45
45
  scripts: {
@@ -218,8 +218,8 @@ var Loader_default = Loader;
218
218
  var { name } = require_package();
219
219
  var S3Url = "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/";
220
220
  if (name === "@fractalpay/fractalpay-next-dev") {
221
- masterBaseUrl = "https://dev-sky-node.fractalpay.com/";
222
- baseUrl = "https://dev-widget.fractalpay.com/";
221
+ baseUrl = "http://localhost:8082/";
222
+ masterBaseUrl = "http://localhost:8081/";
223
223
  fractalGatewayUrl = "https://api-dev.merchant-trends.com/";
224
224
  datacapUrl = "https://token-cert.dcap.com/v1/client";
225
225
  threedsSecurePublicKey = "pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw";
@@ -1016,9 +1016,10 @@ function RequestPayment(props) {
1016
1016
  let cash_discount = CalculateCashDiscount(props == null ? void 0 : props.amount, props == null ? void 0 : props.surcharge);
1017
1017
  setCashDiscount(cash_discount);
1018
1018
  }
1019
- }, [props == null ? void 0 : props.pass_fee]);
1019
+ }, [props == null ? void 0 : props.pass_fee, show]);
1020
1020
  const handleClose = () => {
1021
1021
  setShow(false);
1022
+ setCashDiscount(0);
1022
1023
  setErrors({});
1023
1024
  };
1024
1025
  const handleShow = () => setShow(true);
@@ -2416,6 +2417,19 @@ position:relative;
2416
2417
  border: 0;
2417
2418
  border-right: 1px solid #dee2e6;
2418
2419
  }
2420
+
2421
+ .frac-fee-text{
2422
+ display: block;
2423
+ padding: 10px 0 4px;
2424
+ font-family: 'IBM Plex Mono', monospace !important;
2425
+ color: #727272 !important;
2426
+ font-size: 12px;
2427
+ line-height: 1.4;
2428
+ }
2429
+ .frac-fee-amount{
2430
+ color: #c62828 !important;
2431
+ }
2432
+
2419
2433
  ` });
2420
2434
  }
2421
2435
 
@@ -3483,6 +3497,8 @@ function GetPaymentPage(props) {
3483
3497
  const [selectedCard, setSelectedCard] = useState4();
3484
3498
  const [selectedReader, setSelectedReader] = useState4(void 0);
3485
3499
  const [cashDiscount, setCashDiscount] = useState4(Number(props == null ? void 0 : props.amount));
3500
+ const [bankAmount, setBankAmount] = useState4(Number(props == null ? void 0 : props.amount));
3501
+ const [bankFeeAmount, setBankFeeAmount] = useState4(0);
3486
3502
  const [paymentData, setPaymentData] = useState4();
3487
3503
  let [tranId, setTranId] = useState4("");
3488
3504
  const tokenizerRef = useRef3(null);
@@ -3517,7 +3533,25 @@ function GetPaymentPage(props) {
3517
3533
  useEffect8(() => {
3518
3534
  if (show) {
3519
3535
  let cash_discount = CalculateCashDiscount(props == null ? void 0 : props.amount, (props == null ? void 0 : props.surcharge) || 0);
3536
+ let bankAmount2 = cash_discount;
3537
+ if ((props == null ? void 0 : props.bankFeeAmount) && Number(props == null ? void 0 : props.bankFeeAmount) > 0) {
3538
+ bankAmount2 = Number(cash_discount) + Number(props == null ? void 0 : props.bankFeeAmount);
3539
+ }
3540
+ setBankAmount(bankAmount2);
3520
3541
  setCashDiscount(cash_discount);
3542
+ const cardFeeAmount = Number((Number(props == null ? void 0 : props.amount) - Number(cash_discount || 0)).toFixed(2));
3543
+ const bankFeeAmount2 = Number((props == null ? void 0 : props.bankFeeAmount) || 0);
3544
+ const bankSavingsAmount = Math.max(bankFeeAmount2 > 0 ? cardFeeAmount - bankFeeAmount2 : cardFeeAmount, 0);
3545
+ const bankSavingsText = bankSavingsAmount > 0 ? `Save ${formatUSD(bankSavingsAmount.toFixed(2))}` : "";
3546
+ setBankFeeAmount(bankFeeAmount2);
3547
+ console.log({
3548
+ cash_discount,
3549
+ bankAmount: bankAmount2,
3550
+ cardFeeAmount,
3551
+ bankFeeAmount: bankFeeAmount2,
3552
+ bankSavingsAmount,
3553
+ bankSavingsText
3554
+ });
3521
3555
  }
3522
3556
  }, [show, props == null ? void 0 : props.pass_fee, props == null ? void 0 : props.amount, props == null ? void 0 : props.surcharge]);
3523
3557
  const handleClose = () => {
@@ -3857,7 +3891,7 @@ function GetPaymentPage(props) {
3857
3891
  routing_number: achData == null ? void 0 : achData.routingNumber,
3858
3892
  bank_name: achData == null ? void 0 : achData.bankName,
3859
3893
  account_type: achData == null ? void 0 : achData.accountType,
3860
- amount: String(cashDiscount || 0),
3894
+ amount: String(bankAmount || 0),
3861
3895
  isSaveAch: saveACHinfo,
3862
3896
  customer_id: props == null ? void 0 : props.customerId,
3863
3897
  order_id: props == null ? void 0 : props.orderID,
@@ -3939,11 +3973,11 @@ function GetPaymentPage(props) {
3939
3973
  let amount = String(props == null ? void 0 : props.amount);
3940
3974
  let card_id = selectedCard == null ? void 0 : selectedCard.id;
3941
3975
  let card_type = selectedCard == null ? void 0 : selectedCard.card_type;
3942
- if (fractalpayPublicKey && order_id && amount && cashDiscount) {
3976
+ if (fractalpayPublicKey && order_id && amount && bankAmount) {
3943
3977
  if (customer_id) {
3944
3978
  if (card_id) {
3945
3979
  let chargeobj = __spreadValues({
3946
- amount: card_type === "Bank" ? `${cashDiscount}` : amount,
3980
+ amount: card_type === "Bank" ? `${bankAmount}` : amount,
3947
3981
  order_id,
3948
3982
  customer_id,
3949
3983
  card_id,
@@ -4182,22 +4216,21 @@ function GetPaymentPage(props) {
4182
4216
  /* @__PURE__ */ jsx19("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx19("small", { className: "pay-payment-amount", children: "Select paymet type" }) }),
4183
4217
  /* @__PURE__ */ jsxs11("div", { className: "frac-card-bank-radio-main", children: [
4184
4218
  /* @__PURE__ */ jsx19(CardBankRadio, { label: "Card", amount: (_a = Number(props == null ? void 0 : props.amount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
4185
- (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && /* @__PURE__ */ jsx19(CardBankRadio, { label: "Bank", amount: (_b = Number(cashDiscount)) == null ? void 0 : _b.toFixed(2), value: "ach", onChange: handletabchange, activetab }),
4219
+ (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && /* @__PURE__ */ jsx19(CardBankRadio, { label: "Bank", amount: (_b = Number(bankAmount)) == null ? void 0 : _b.toFixed(2), value: "ach", onChange: handletabchange, activetab }),
4186
4220
  (props == null ? void 0 : props.isReader) && (paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((_c = paymentData == null ? void 0 : paymentData.paymentDeviceList) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsx19(CardBankRadio, { label: "Reader", amount: (_d = Number(props == null ? void 0 : props.amount)) == null ? void 0 : _d.toFixed(2), value: "reader", onChange: handletabchange, activetab })
4187
4221
  ] }),
4188
- !loading && (numberToBoolean(paymentData == null ? void 0 : paymentData.showSurcharge) ? cashDiscount && cashDiscount > 0 && (props == null ? void 0 : props.pass_fee) ? /* @__PURE__ */ jsxs11("div", { className: "frac-cash-discount-fee", children: [
4189
- /* @__PURE__ */ jsxs11("small", { children: [
4190
- activetab === "card" || activetab === "reader" ? "Cash Discount" : "Cash Discount Savings",
4191
- " "
4192
- ] }),
4193
- /* @__PURE__ */ jsx19("p", { children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) })
4194
- ] }) : null : cashDiscount && cashDiscount > 0 && (props == null ? void 0 : props.pass_fee) && (activetab === "card" || activetab === "reader") ? /* @__PURE__ */ jsxs11("div", { className: "frac-cash-discount-fee", children: [
4195
- /* @__PURE__ */ jsxs11("small", { children: [
4196
- activetab === "card" || activetab === "reader" ? "Surcharge" : null,
4197
- " "
4222
+ !loading && /* @__PURE__ */ jsxs11("div", { className: "", children: [
4223
+ activetab == "ach" && bankFeeAmount > 0 && /* @__PURE__ */ jsxs11("small", { className: "frac-fee-text", children: [
4224
+ "There is a processing fee of ",
4225
+ /* @__PURE__ */ jsx19("span", { className: "frac-fee-amount", children: formatUSD(bankFeeAmount.toFixed(2)) }),
4226
+ "."
4198
4227
  ] }),
4199
- /* @__PURE__ */ jsx19("p", { children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) })
4200
- ] }) : null)
4228
+ (activetab === "card" || activetab === "reader") && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs11("small", { className: "frac-fee-text", children: [
4229
+ "Credit cards include a fee amount of ",
4230
+ /* @__PURE__ */ jsx19("span", { className: "frac-fee-amount", children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) }),
4231
+ "."
4232
+ ] })
4233
+ ] })
4201
4234
  ] })
4202
4235
  ] }),
4203
4236
  /* @__PURE__ */ jsxs11("div", { className: "pay-conatiner-one-last", children: [
@@ -4502,7 +4535,7 @@ function GetPaymentPage(props) {
4502
4535
  /* @__PURE__ */ jsx19(CardList, { listHeading: "Banks", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
4503
4536
  setActiveinBank("form");
4504
4537
  } }),
4505
- /* @__PURE__ */ jsx19("div", { className: "form-group", style: { padding: "0" }, children: /* @__PURE__ */ jsx19("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlepayment, children: formatUSD((_n = Number(cashDiscount)) == null ? void 0 : _n.toFixed(2)) }) })
4538
+ /* @__PURE__ */ jsx19("div", { className: "form-group", style: { padding: "0" }, children: /* @__PURE__ */ jsx19("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlepayment, children: formatUSD((_n = Number(bankAmount)) == null ? void 0 : _n.toFixed(2)) }) })
4506
4539
  ] }) : /* @__PURE__ */ jsxs11("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
4507
4540
  if (e.key === "Enter" && loading2) {
4508
4541
  e.preventDefault();
@@ -4630,7 +4663,7 @@ function GetPaymentPage(props) {
4630
4663
  " to have my permission to charge this bank account for agreed upon purchases in the future."
4631
4664
  ] }) })
4632
4665
  ] }),
4633
- /* @__PURE__ */ jsx19("div", { className: "form-group ", children: /* @__PURE__ */ jsx19("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit", children: formatUSD((_v = Number(cashDiscount)) == null ? void 0 : _v.toFixed(2)) }) })
4666
+ /* @__PURE__ */ jsx19("div", { className: "form-group ", children: /* @__PURE__ */ jsx19("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit", children: formatUSD((_v = Number(bankAmount)) == null ? void 0 : _v.toFixed(2)) }) })
4634
4667
  ] })
4635
4668
  ] }),
4636
4669
  /* @__PURE__ */ jsxs11("div", { id: "reader", style: { display: activetab === "reader" ? "block" : "none" }, className: "tabcontent", children: [
@@ -7338,7 +7371,7 @@ import { IoArrowBack as IoArrowBack3 } from "react-icons/io5";
7338
7371
  import { NumericFormat } from "react-number-format";
7339
7372
  import { Fragment as Fragment17, jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
7340
7373
  function PartialPayment(props) {
7341
- 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, _A;
7374
+ 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;
7342
7375
  const buttonRef = useRef8(null);
7343
7376
  useEffect13(() => {
7344
7377
  if (props.onTriggerPay) {
@@ -8124,10 +8157,7 @@ function PartialPayment(props) {
8124
8157
  ] }),
8125
8158
  /* @__PURE__ */ jsxs17("div", { className: "amt-pay-con", children: [
8126
8159
  /* @__PURE__ */ jsx28("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Select payment type" }) }),
8127
- /* @__PURE__ */ jsxs17("div", { className: "frac-card-bank-radio-main", children: [
8128
- /* @__PURE__ */ jsx28(CardBankRadio, { label: "Card", amount: (_a = Number(aftertaxAmount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
8129
- (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && /* @__PURE__ */ jsx28(CardBankRadio, { label: "Bank", amount: (_b = Number(cashDiscount)) == null ? void 0 : _b.toFixed(2), value: "ach", onChange: handletabchange, activetab })
8130
- ] }),
8160
+ /* @__PURE__ */ jsx28("div", { className: "frac-card-bank-radio-main", children: /* @__PURE__ */ jsx28(CardBankRadio, { label: "Card", amount: (_a = Number(aftertaxAmount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }) }),
8131
8161
  numberToBoolean(paymentData == null ? void 0 : paymentData.showSurcharge) ? cashDiscount && cashDiscount > 0 && (props == null ? void 0 : props.pass_fee) ? /* @__PURE__ */ jsxs17("div", { className: "frac-cash-discount-fee", children: [
8132
8162
  /* @__PURE__ */ jsxs17("small", { children: [
8133
8163
  activetab === "card" ? "Cash Discount" : "Cash Discount Savings",
@@ -8196,7 +8226,7 @@ function PartialPayment(props) {
8196
8226
  /* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Payment Amount" }),
8197
8227
  /* @__PURE__ */ jsxs17("strong", { className: "pay-amount", children: [
8198
8228
  "$",
8199
- (_c = Number(aftertaxAmount)) == null ? void 0 : _c.toFixed(2)
8229
+ (_b = Number(aftertaxAmount)) == null ? void 0 : _b.toFixed(2)
8200
8230
  ] })
8201
8231
  ] }),
8202
8232
  activetab != "ach" && /* @__PURE__ */ jsxs17("div", { children: [
@@ -8238,7 +8268,7 @@ function PartialPayment(props) {
8238
8268
  /* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Payment Amount" }),
8239
8269
  /* @__PURE__ */ jsxs17("strong", { className: "pay-amount", children: [
8240
8270
  "$",
8241
- (_d = Number(aftertaxAmount)) == null ? void 0 : _d.toFixed(2)
8271
+ (_c = Number(aftertaxAmount)) == null ? void 0 : _c.toFixed(2)
8242
8272
  ] })
8243
8273
  ] }),
8244
8274
  /* @__PURE__ */ jsxs17("div", { children: [
@@ -8273,7 +8303,7 @@ function PartialPayment(props) {
8273
8303
  /* @__PURE__ */ jsx28(CardList, { listHeading: "Cards", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: cardList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Card", otherButtonAction: () => {
8274
8304
  setActiveinCard("form");
8275
8305
  } }),
8276
- /* @__PURE__ */ jsx28("div", { className: "form-group", style: { padding: "0" }, children: /* @__PURE__ */ jsx28("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlepayment, children: partialAmount && !partialError ? formatUSD((_e = Number(partialAmount)) == null ? void 0 : _e.toFixed(2)) : formatUSD((_f = Number(aftertaxAmount)) == null ? void 0 : _f.toFixed(2)) }) })
8306
+ /* @__PURE__ */ jsx28("div", { className: "form-group", style: { padding: "0" }, children: /* @__PURE__ */ jsx28("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)) }) })
8277
8307
  ] }) : (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 ? /* @__PURE__ */ jsxs17(
8278
8308
  "form",
8279
8309
  {
@@ -8317,14 +8347,14 @@ function PartialPayment(props) {
8317
8347
  maxLength: 100,
8318
8348
  placeholder: "Order Id",
8319
8349
  disabled: true,
8320
- value: (_g = props == null ? void 0 : props.orderID) != null ? _g : "",
8350
+ value: (_f = props == null ? void 0 : props.orderID) != null ? _f : "",
8321
8351
  style: { background: "#F6F6F7", color: "#727272" }
8322
8352
  }
8323
8353
  )
8324
8354
  ] }),
8325
8355
  /* @__PURE__ */ jsxs17("div", { className: "form-group", children: [
8326
8356
  /* @__PURE__ */ jsx28("label", { htmlFor: "zip", children: "ZIP" }),
8327
- /* @__PURE__ */ jsx28("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (_h = cardData == null ? void 0 : cardData.zipCode) != null ? _h : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
8357
+ /* @__PURE__ */ jsx28("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) }),
8328
8358
  (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx28("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
8329
8359
  ] }),
8330
8360
  (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsx28("div", { className: "form-group", children: /* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
@@ -8351,8 +8381,8 @@ function PartialPayment(props) {
8351
8381
  ] }) })
8352
8382
  ] }),
8353
8383
  /* @__PURE__ */ jsxs17("div", { className: "form-group", style: { marginTop: "20px", padding: "0" }, children: [
8354
- (paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((_i = paymentData == null ? void 0 : paymentData.paymentDeviceList) == null ? void 0 : _i.length) > 0 && /* @__PURE__ */ jsx28("button", { type: "button", style: { marginBottom: "10px" }, className: "pay-button", onClick: () => setActiveForm(!activeForm), children: activeForm ? "Pay With Reader" : "Pay With Card" }),
8355
- /* @__PURE__ */ jsx28("button", { type: "submit", style: { margin: 0 }, className: "pay-button", children: partialAmount && !partialError ? formatUSD((_j = Number(partialAmount)) == null ? void 0 : _j.toFixed(2)) : formatUSD((_k = Number(aftertaxAmount)) == null ? void 0 : _k.toFixed(2)) })
8384
+ (paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((_h = paymentData == null ? void 0 : paymentData.paymentDeviceList) == null ? void 0 : _h.length) > 0 && /* @__PURE__ */ jsx28("button", { type: "button", style: { marginBottom: "10px" }, className: "pay-button", onClick: () => setActiveForm(!activeForm), children: activeForm ? "Pay With Reader" : "Pay With Card" }),
8385
+ /* @__PURE__ */ jsx28("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)) })
8356
8386
  ] })
8357
8387
  ]
8358
8388
  }
@@ -8391,14 +8421,14 @@ function PartialPayment(props) {
8391
8421
  maxLength: 100,
8392
8422
  placeholder: "Order Id",
8393
8423
  disabled: true,
8394
- value: (_l = props == null ? void 0 : props.orderID) != null ? _l : "",
8424
+ value: (_k = props == null ? void 0 : props.orderID) != null ? _k : "",
8395
8425
  style: { background: "#F6F6F7", color: "#727272" }
8396
8426
  }
8397
8427
  )
8398
8428
  ] }),
8399
8429
  /* @__PURE__ */ jsxs17("div", { className: "form-group", children: [
8400
8430
  /* @__PURE__ */ jsx28("label", { htmlFor: "zip", children: "ZIP" }),
8401
- /* @__PURE__ */ jsx28("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (_m = cardData == null ? void 0 : cardData.zipCode) != null ? _m : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
8431
+ /* @__PURE__ */ jsx28("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) }),
8402
8432
  (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx28("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
8403
8433
  ] }),
8404
8434
  (props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsx28("div", { className: "form-group", children: /* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
@@ -8425,8 +8455,8 @@ function PartialPayment(props) {
8425
8455
  ] }) })
8426
8456
  ] }),
8427
8457
  /* @__PURE__ */ jsxs17("div", { className: "form-group", style: { marginTop: "20px", padding: "0" }, children: [
8428
- (paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((_n = paymentData == null ? void 0 : paymentData.paymentDeviceList) == null ? void 0 : _n.length) > 0 && /* @__PURE__ */ jsx28("button", { type: "button", style: { marginBottom: "10px" }, className: "pay-button", onClick: () => setActiveForm(!activeForm), children: activeForm ? "Pay With Reader" : "Pay With Card" }),
8429
- /* @__PURE__ */ jsx28("button", { type: "submit", style: { margin: 0 }, className: "pay-button", children: partialAmount && !partialError ? formatUSD((_o = Number(partialAmount)) == null ? void 0 : _o.toFixed(2)) : formatUSD((_p = Number(aftertaxAmount)) == null ? void 0 : _p.toFixed(2)) })
8458
+ (paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((_m = paymentData == null ? void 0 : paymentData.paymentDeviceList) == null ? void 0 : _m.length) > 0 && /* @__PURE__ */ jsx28("button", { type: "button", style: { marginBottom: "10px" }, className: "pay-button", onClick: () => setActiveForm(!activeForm), children: activeForm ? "Pay With Reader" : "Pay With Card" }),
8459
+ /* @__PURE__ */ jsx28("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)) })
8430
8460
  ] })
8431
8461
  ] })
8432
8462
  ] }),
@@ -8442,7 +8472,7 @@ function PartialPayment(props) {
8442
8472
  /* @__PURE__ */ jsx28(CardList, { listHeading: "Banks", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
8443
8473
  setActiveinBank("form");
8444
8474
  } }),
8445
- /* @__PURE__ */ jsx28("div", { className: "form-group", style: { padding: "0" }, children: /* @__PURE__ */ jsx28("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlepayment, children: partialAmount && !partialError ? formatUSD((_q = Number(partialAmount)) == null ? void 0 : _q.toFixed(2)) : formatUSD((_r = Number(cashDiscount)) == null ? void 0 : _r.toFixed(2)) }) })
8475
+ /* @__PURE__ */ jsx28("div", { className: "form-group", style: { padding: "0" }, children: /* @__PURE__ */ jsx28("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)) }) })
8446
8476
  ] }) : /* @__PURE__ */ jsxs17("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
8447
8477
  if (e.key === "Enter" && loading2) {
8448
8478
  e.preventDefault();
@@ -8455,7 +8485,7 @@ function PartialPayment(props) {
8455
8485
  }, children: [
8456
8486
  /* @__PURE__ */ jsxs17("div", { className: "form-group mb-4", children: [
8457
8487
  /* @__PURE__ */ jsx28("label", { htmlFor: "nameonaccount", children: "Name on account" }),
8458
- /* @__PURE__ */ jsx28("input", { type: "text", id: "nameonaccount", className: "form-control", maxLength: 100, placeholder: "John Doe", name: "name", value: (_s = achData == null ? void 0 : achData.name) != null ? _s : "", onChange: handleChangeAch }),
8488
+ /* @__PURE__ */ jsx28("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 }),
8459
8489
  (achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx28("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
8460
8490
  ] }),
8461
8491
  /* @__PURE__ */ jsxs17("div", { className: "form-group mb-4", children: [
@@ -8469,7 +8499,7 @@ function PartialPayment(props) {
8469
8499
  maxLength: 9,
8470
8500
  placeholder: "000000000",
8471
8501
  name: "routingNumber",
8472
- value: (_t = achData == null ? void 0 : achData.routingNumber) != null ? _t : "",
8502
+ value: (_s = achData == null ? void 0 : achData.routingNumber) != null ? _s : "",
8473
8503
  onChange: handleChangeAch
8474
8504
  }
8475
8505
  ),
@@ -8486,7 +8516,7 @@ function PartialPayment(props) {
8486
8516
  maxLength: 16,
8487
8517
  placeholder: "0000000000",
8488
8518
  name: "accountNumber",
8489
- value: (_u = achData == null ? void 0 : achData.accountNumber) != null ? _u : "",
8519
+ value: (_t = achData == null ? void 0 : achData.accountNumber) != null ? _t : "",
8490
8520
  onChange: handleChangeAch
8491
8521
  }
8492
8522
  ),
@@ -8503,7 +8533,7 @@ function PartialPayment(props) {
8503
8533
  maxLength: 16,
8504
8534
  placeholder: "0000000000",
8505
8535
  name: "confirmAccountNumber",
8506
- value: (_v = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _v : "",
8536
+ value: (_u = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _u : "",
8507
8537
  onChange: handleChangeAch
8508
8538
  }
8509
8539
  ),
@@ -8520,7 +8550,7 @@ function PartialPayment(props) {
8520
8550
  maxLength: 100,
8521
8551
  placeholder: "My Bank",
8522
8552
  name: "bankName",
8523
- value: (_w = achData == null ? void 0 : achData.bankName) != null ? _w : "",
8553
+ value: (_v = achData == null ? void 0 : achData.bankName) != null ? _v : "",
8524
8554
  onChange: handleChangeAch
8525
8555
  }
8526
8556
  ),
@@ -8537,7 +8567,7 @@ function PartialPayment(props) {
8537
8567
  maxLength: 100,
8538
8568
  placeholder: "My Company",
8539
8569
  name: "companyName",
8540
- value: (_x = achData == null ? void 0 : achData.companyName) != null ? _x : "",
8570
+ value: (_w = achData == null ? void 0 : achData.companyName) != null ? _w : "",
8541
8571
  onChange: handleChangeAch
8542
8572
  }
8543
8573
  ),
@@ -8545,7 +8575,7 @@ function PartialPayment(props) {
8545
8575
  ] }),
8546
8576
  /* @__PURE__ */ jsxs17("div", { className: "form-group mb-4", children: [
8547
8577
  /* @__PURE__ */ jsx28("label", { htmlFor: "accounttype", children: "Select account type" }),
8548
- /* @__PURE__ */ jsxs17("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_y = achData == null ? void 0 : achData.accountType) != null ? _y : "", onChange: handleChangeAch, children: [
8578
+ /* @__PURE__ */ jsxs17("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_x = achData == null ? void 0 : achData.accountType) != null ? _x : "", onChange: handleChangeAch, children: [
8549
8579
  /* @__PURE__ */ jsx28("option", { value: "", children: "Select account" }),
8550
8580
  accountTypes.map((type) => /* @__PURE__ */ jsx28("option", { value: type.value, children: type.label }, type.value))
8551
8581
  ] })
@@ -8579,7 +8609,7 @@ function PartialPayment(props) {
8579
8609
  " to have my permission to charge this bank account for agreed upon purchases in the future."
8580
8610
  ] }) })
8581
8611
  ] }),
8582
- /* @__PURE__ */ jsx28("div", { className: "form-group ", children: /* @__PURE__ */ jsx28("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit", children: partialAmount && !partialError ? formatUSD((_z = Number(partialAmount)) == null ? void 0 : _z.toFixed(2)) : formatUSD((_A = Number(cashDiscount)) == null ? void 0 : _A.toFixed(2)) }) })
8612
+ /* @__PURE__ */ jsx28("div", { className: "form-group ", children: /* @__PURE__ */ jsx28("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)) }) })
8583
8613
  ] })
8584
8614
  ] })
8585
8615
  ] }) }) })