@fractalpay/fractalpay-next-test 0.0.37 → 0.0.39
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 +3 -1
- package/dist/index.js +251 -122
- package/dist/index.js.map +1 -1
- package/next.config.ts +1 -0
- package/package.json +8 -3
- package/next-env.d.ts +0 -6
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-test",
|
|
42
|
-
version: "0.0.
|
|
42
|
+
version: "0.0.39",
|
|
43
43
|
private: false,
|
|
44
44
|
type: "module",
|
|
45
45
|
scripts: {
|
|
@@ -97,7 +97,12 @@ var require_package = __commonJS({
|
|
|
97
97
|
},
|
|
98
98
|
author: "Mukul",
|
|
99
99
|
license: "MIT",
|
|
100
|
-
keywords: [
|
|
100
|
+
keywords: [
|
|
101
|
+
"nextjs",
|
|
102
|
+
"next",
|
|
103
|
+
"typescript",
|
|
104
|
+
"tailwindcss"
|
|
105
|
+
],
|
|
101
106
|
publishConfig: {
|
|
102
107
|
access: "public"
|
|
103
108
|
}
|
|
@@ -236,8 +241,8 @@ var Loader_default = Loader;
|
|
|
236
241
|
var { name } = require_package();
|
|
237
242
|
var S3Url = "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/";
|
|
238
243
|
if (name === "@fractalpay/fractalpay-next-dev") {
|
|
239
|
-
masterBaseUrl = "https://dev
|
|
240
|
-
baseUrl = "https://
|
|
244
|
+
masterBaseUrl = "https://api.dev.fractalpay.com/";
|
|
245
|
+
baseUrl = "https://widget.dev.fractalpay.com/";
|
|
241
246
|
fractalGatewayUrl = "https://api-dev.merchant-trends.com/";
|
|
242
247
|
datacapUrl = "https://token-cert.dcap.com/v1/client";
|
|
243
248
|
threedsSecurePublicKey = "pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw";
|
|
@@ -1058,9 +1063,10 @@ function RequestPayment(props) {
|
|
|
1058
1063
|
let cash_discount = CalculateCashDiscount(props == null ? void 0 : props.amount, props == null ? void 0 : props.surcharge);
|
|
1059
1064
|
setCashDiscount(cash_discount);
|
|
1060
1065
|
}
|
|
1061
|
-
}, [props == null ? void 0 : props.pass_fee]);
|
|
1066
|
+
}, [props == null ? void 0 : props.pass_fee, show]);
|
|
1062
1067
|
const handleClose = () => {
|
|
1063
1068
|
setShow(false);
|
|
1069
|
+
setCashDiscount(0);
|
|
1064
1070
|
setErrors({});
|
|
1065
1071
|
};
|
|
1066
1072
|
const handleShow = () => setShow(true);
|
|
@@ -2458,6 +2464,20 @@ position:relative;
|
|
|
2458
2464
|
border: 0;
|
|
2459
2465
|
border-right: 1px solid #dee2e6;
|
|
2460
2466
|
}
|
|
2467
|
+
|
|
2468
|
+
.frac-fee-text{
|
|
2469
|
+
display: block;
|
|
2470
|
+
padding: 10px 0 4px;
|
|
2471
|
+
font-family: 'IBM Plex Mono', monospace !important;
|
|
2472
|
+
color: #727272 !important;
|
|
2473
|
+
font-size: 12px;
|
|
2474
|
+
line-height: 1.4;
|
|
2475
|
+
text-align: start !important;
|
|
2476
|
+
}
|
|
2477
|
+
.frac-fee-amount{
|
|
2478
|
+
color: #c62828 !important;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2461
2481
|
` });
|
|
2462
2482
|
}
|
|
2463
2483
|
|
|
@@ -3298,7 +3318,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
|
|
|
3298
3318
|
{
|
|
3299
3319
|
id: "exp_month",
|
|
3300
3320
|
className: "form-control required card-cvv-in",
|
|
3301
|
-
style: { height: "
|
|
3321
|
+
style: { height: "46px", display: "block", minHeight: "46px" }
|
|
3302
3322
|
}
|
|
3303
3323
|
) }),
|
|
3304
3324
|
/* @__PURE__ */ jsx17("div", { className: "exp-year form-group input-main-wrap-frac", children: /* @__PURE__ */ jsx17(
|
|
@@ -3306,7 +3326,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
|
|
|
3306
3326
|
{
|
|
3307
3327
|
id: "exp_year",
|
|
3308
3328
|
className: "form-control required card-cvv-in",
|
|
3309
|
-
style: { height: "
|
|
3329
|
+
style: { height: "46px", display: "block", minHeight: "46px" }
|
|
3310
3330
|
}
|
|
3311
3331
|
) }),
|
|
3312
3332
|
/* @__PURE__ */ jsx17("div", { className: "security-digit form-group input-main-wrap-frac", children: /* @__PURE__ */ jsx17(
|
|
@@ -3314,7 +3334,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
|
|
|
3314
3334
|
{
|
|
3315
3335
|
id: "cvv",
|
|
3316
3336
|
className: "form-control card-cvv-in required",
|
|
3317
|
-
style: { height: "
|
|
3337
|
+
style: { height: "46px", display: "block", minHeight: "46px" }
|
|
3318
3338
|
}
|
|
3319
3339
|
) })
|
|
3320
3340
|
] }) })
|
|
@@ -3573,6 +3593,8 @@ function GetPaymentPage(props) {
|
|
|
3573
3593
|
const [saveACHinfo, setSaveACHinfo] = useState4(false);
|
|
3574
3594
|
const [isBankConsentChecked, setIsBankConsentChecked] = useState4(false);
|
|
3575
3595
|
const [errorBankConsent, setErrorBankConsent] = useState4("");
|
|
3596
|
+
const [saveACHConsent1, setSaveACHConsent1] = useState4(false);
|
|
3597
|
+
const [errorBankConsentOther, setErrorBankConsentOther] = useState4("");
|
|
3576
3598
|
const fractalpayClientKey = props.merchantPublicKey;
|
|
3577
3599
|
let mastercard2 = S3Url + "widget/mc-img.svg";
|
|
3578
3600
|
let visa2 = S3Url + "widget/visa-img.svg";
|
|
@@ -3593,6 +3615,8 @@ function GetPaymentPage(props) {
|
|
|
3593
3615
|
const [selectedCard, setSelectedCard] = useState4();
|
|
3594
3616
|
const [selectedReader, setSelectedReader] = useState4(void 0);
|
|
3595
3617
|
const [cashDiscount, setCashDiscount] = useState4(Number(props == null ? void 0 : props.amount));
|
|
3618
|
+
const [bankAmount, setBankAmount] = useState4(Number(props == null ? void 0 : props.amount));
|
|
3619
|
+
const [bankFeeAmount, setBankFeeAmount] = useState4(0);
|
|
3596
3620
|
const [paymentData, setPaymentData] = useState4();
|
|
3597
3621
|
let [tranId, setTranId] = useState4("");
|
|
3598
3622
|
const tokenizerRef = useRef3(null);
|
|
@@ -3627,7 +3651,25 @@ function GetPaymentPage(props) {
|
|
|
3627
3651
|
useEffect8(() => {
|
|
3628
3652
|
if (show) {
|
|
3629
3653
|
let cash_discount = CalculateCashDiscount(props == null ? void 0 : props.amount, (props == null ? void 0 : props.surcharge) || 0);
|
|
3654
|
+
let bankAmount2 = cash_discount;
|
|
3655
|
+
if ((props == null ? void 0 : props.bankFeeAmount) && Number(props == null ? void 0 : props.bankFeeAmount) > 0) {
|
|
3656
|
+
bankAmount2 = Number(cash_discount) + Number(props == null ? void 0 : props.bankFeeAmount);
|
|
3657
|
+
}
|
|
3658
|
+
setBankAmount(bankAmount2);
|
|
3630
3659
|
setCashDiscount(cash_discount);
|
|
3660
|
+
const cardFeeAmount = Number((Number(props == null ? void 0 : props.amount) - Number(cash_discount || 0)).toFixed(2));
|
|
3661
|
+
const bankFeeAmount2 = Number((props == null ? void 0 : props.bankFeeAmount) || 0);
|
|
3662
|
+
const bankSavingsAmount = Math.max(bankFeeAmount2 > 0 ? cardFeeAmount - bankFeeAmount2 : cardFeeAmount, 0);
|
|
3663
|
+
const bankSavingsText = bankSavingsAmount > 0 ? `Save ${formatUSD(bankSavingsAmount.toFixed(2))}` : "";
|
|
3664
|
+
setBankFeeAmount(bankFeeAmount2);
|
|
3665
|
+
console.log({
|
|
3666
|
+
cash_discount,
|
|
3667
|
+
bankAmount: bankAmount2,
|
|
3668
|
+
cardFeeAmount,
|
|
3669
|
+
bankFeeAmount: bankFeeAmount2,
|
|
3670
|
+
bankSavingsAmount,
|
|
3671
|
+
bankSavingsText
|
|
3672
|
+
});
|
|
3631
3673
|
}
|
|
3632
3674
|
}, [show, props == null ? void 0 : props.pass_fee, props == null ? void 0 : props.amount, props == null ? void 0 : props.surcharge]);
|
|
3633
3675
|
const handleClose = () => {
|
|
@@ -3694,6 +3736,8 @@ function GetPaymentPage(props) {
|
|
|
3694
3736
|
setCardList([]);
|
|
3695
3737
|
setIsBankConsentChecked(false);
|
|
3696
3738
|
setErrorBankConsent("");
|
|
3739
|
+
setSaveACHConsent1(false);
|
|
3740
|
+
setErrorBankConsentOther("");
|
|
3697
3741
|
};
|
|
3698
3742
|
const handleShow = () => setShow(true);
|
|
3699
3743
|
const handletabchange = (id) => {
|
|
@@ -3793,11 +3837,14 @@ function GetPaymentPage(props) {
|
|
|
3793
3837
|
errors.companyName = "Company Name is required for business accounts";
|
|
3794
3838
|
}
|
|
3795
3839
|
}
|
|
3796
|
-
if (!isBankConsentChecked) {
|
|
3840
|
+
if (!saveACHinfo && !isBankConsentChecked) {
|
|
3797
3841
|
setErrorBankConsent("Above consent is required");
|
|
3798
3842
|
}
|
|
3843
|
+
if (saveACHinfo && !saveACHConsent1) {
|
|
3844
|
+
setErrorBankConsentOther("Your consent is required to save your bank details for future use");
|
|
3845
|
+
}
|
|
3799
3846
|
setAchError(errors);
|
|
3800
|
-
return Object.keys(errors).length > 0
|
|
3847
|
+
return Object.keys(errors).length > 0;
|
|
3801
3848
|
};
|
|
3802
3849
|
const submitFunc = async (e) => {
|
|
3803
3850
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2;
|
|
@@ -3956,7 +4003,13 @@ function GetPaymentPage(props) {
|
|
|
3956
4003
|
}
|
|
3957
4004
|
}
|
|
3958
4005
|
} else {
|
|
3959
|
-
|
|
4006
|
+
let hasError = validateAchData();
|
|
4007
|
+
if (saveACHinfo && !saveACHConsent1) {
|
|
4008
|
+
hasError = true;
|
|
4009
|
+
}
|
|
4010
|
+
if (!saveACHinfo && !isBankConsentChecked) {
|
|
4011
|
+
hasError = true;
|
|
4012
|
+
}
|
|
3960
4013
|
if (hasError) return;
|
|
3961
4014
|
else {
|
|
3962
4015
|
setLoading2(true);
|
|
@@ -3967,7 +4020,7 @@ function GetPaymentPage(props) {
|
|
|
3967
4020
|
routing_number: achData == null ? void 0 : achData.routingNumber,
|
|
3968
4021
|
bank_name: achData == null ? void 0 : achData.bankName,
|
|
3969
4022
|
account_type: achData == null ? void 0 : achData.accountType,
|
|
3970
|
-
amount: String(
|
|
4023
|
+
amount: String(bankAmount || 0),
|
|
3971
4024
|
isSaveAch: saveACHinfo,
|
|
3972
4025
|
customer_id: props == null ? void 0 : props.customerId,
|
|
3973
4026
|
order_id: props == null ? void 0 : props.orderID,
|
|
@@ -4049,11 +4102,11 @@ function GetPaymentPage(props) {
|
|
|
4049
4102
|
let amount = String(props == null ? void 0 : props.amount);
|
|
4050
4103
|
let card_id = selectedCard == null ? void 0 : selectedCard.id;
|
|
4051
4104
|
let card_type = selectedCard == null ? void 0 : selectedCard.card_type;
|
|
4052
|
-
if (fractalpayPublicKey && order_id && amount &&
|
|
4105
|
+
if (fractalpayPublicKey && order_id && amount && bankAmount) {
|
|
4053
4106
|
if (customer_id) {
|
|
4054
4107
|
if (card_id) {
|
|
4055
4108
|
let chargeobj = __spreadValues({
|
|
4056
|
-
amount: card_type === "Bank" ? `${
|
|
4109
|
+
amount: card_type === "Bank" ? `${bankAmount}` : amount,
|
|
4057
4110
|
order_id,
|
|
4058
4111
|
customer_id,
|
|
4059
4112
|
card_id,
|
|
@@ -4292,22 +4345,21 @@ function GetPaymentPage(props) {
|
|
|
4292
4345
|
/* @__PURE__ */ jsx19("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx19("small", { className: "pay-payment-amount", children: "Select paymet type" }) }),
|
|
4293
4346
|
/* @__PURE__ */ jsxs11("div", { className: "frac-card-bank-radio-main", children: [
|
|
4294
4347
|
/* @__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 }),
|
|
4295
|
-
(paymentData == null ? void 0 : paymentData.isSkyFiAccount) && /* @__PURE__ */ jsx19(CardBankRadio, { label: "Bank", amount: (_b = Number(
|
|
4348
|
+
(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 }),
|
|
4296
4349
|
(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 })
|
|
4297
4350
|
] }),
|
|
4298
|
-
!loading &&
|
|
4299
|
-
/* @__PURE__ */ jsxs11("small", { children: [
|
|
4300
|
-
|
|
4301
|
-
"
|
|
4302
|
-
|
|
4303
|
-
/* @__PURE__ */ jsx19("p", { children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) })
|
|
4304
|
-
] }) : null : cashDiscount && cashDiscount > 0 && (props == null ? void 0 : props.pass_fee) && (activetab === "card" || activetab === "reader") ? /* @__PURE__ */ jsxs11("div", { className: "frac-cash-discount-fee", children: [
|
|
4305
|
-
/* @__PURE__ */ jsxs11("small", { children: [
|
|
4306
|
-
activetab === "card" || activetab === "reader" ? "Surcharge" : null,
|
|
4307
|
-
" "
|
|
4351
|
+
!loading && /* @__PURE__ */ jsxs11("div", { className: "", children: [
|
|
4352
|
+
activetab == "ach" && bankFeeAmount > 0 && /* @__PURE__ */ jsxs11("small", { className: "frac-fee-text", children: [
|
|
4353
|
+
"There is a processing fee of ",
|
|
4354
|
+
/* @__PURE__ */ jsx19("span", { className: "frac-fee-amount", children: formatUSD(bankFeeAmount.toFixed(2)) }),
|
|
4355
|
+
"."
|
|
4308
4356
|
] }),
|
|
4309
|
-
/* @__PURE__ */
|
|
4310
|
-
|
|
4357
|
+
(activetab === "card" || activetab === "reader") && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs11("small", { className: "frac-fee-text", children: [
|
|
4358
|
+
"Cards include a fee amount of ",
|
|
4359
|
+
/* @__PURE__ */ jsx19("span", { className: "frac-fee-amount", children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) }),
|
|
4360
|
+
"."
|
|
4361
|
+
] })
|
|
4362
|
+
] })
|
|
4311
4363
|
] })
|
|
4312
4364
|
] }),
|
|
4313
4365
|
/* @__PURE__ */ jsxs11("div", { className: "pay-conatiner-one-last", children: [
|
|
@@ -4612,7 +4664,7 @@ function GetPaymentPage(props) {
|
|
|
4612
4664
|
/* @__PURE__ */ jsx19(CardList, { listHeading: "Banks", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
|
|
4613
4665
|
setActiveinBank("form");
|
|
4614
4666
|
} }),
|
|
4615
|
-
/* @__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(
|
|
4667
|
+
/* @__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)) }) })
|
|
4616
4668
|
] }) : /* @__PURE__ */ jsxs11("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
|
|
4617
4669
|
if (e.key === "Enter" && loading2) {
|
|
4618
4670
|
e.preventDefault();
|
|
@@ -4720,27 +4772,46 @@ function GetPaymentPage(props) {
|
|
|
4720
4772
|
accountTypes.map((type) => /* @__PURE__ */ jsx19("option", { value: type.value, children: type.label }, type.value))
|
|
4721
4773
|
] })
|
|
4722
4774
|
] }),
|
|
4723
|
-
/* @__PURE__ */ jsxs11(
|
|
4724
|
-
/* @__PURE__ */
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4775
|
+
!saveACHinfo && /* @__PURE__ */ jsxs11(Fragment11, { children: [
|
|
4776
|
+
/* @__PURE__ */ jsxs11("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
4777
|
+
/* @__PURE__ */ jsx19("input", { type: "checkbox", id: "achconsent", className: "", checked: isBankConsentChecked, onChange: (e) => {
|
|
4778
|
+
setIsBankConsentChecked(e.target.checked);
|
|
4779
|
+
if (e.target.checked) {
|
|
4780
|
+
setErrorBankConsent("");
|
|
4781
|
+
}
|
|
4782
|
+
} }),
|
|
4783
|
+
/* @__PURE__ */ jsx19("label", { htmlFor: "achconsent", children: `By selecting this box, I authorize SkyFi, on behalf of ${(paymentData == null ? void 0 : paymentData.bname) || "merchant"}, to initiate a one-time electronic ACH debit from my bank account for the total amount displayed on this screen, including any applicable processing fee. I confirm that I am authorized to use this account and that the bank account information I provided is correct.` })
|
|
4784
|
+
] }),
|
|
4785
|
+
errorBankConsent && /* @__PURE__ */ jsx19("span", { className: "error-span", children: errorBankConsent })
|
|
4731
4786
|
] }),
|
|
4732
|
-
errorBankConsent && /* @__PURE__ */ jsx19("span", { className: "error-span", children: errorBankConsent }),
|
|
4733
4787
|
(props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsxs11("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
4734
|
-
/* @__PURE__ */ jsx19("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) =>
|
|
4735
|
-
|
|
4788
|
+
/* @__PURE__ */ jsx19("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => {
|
|
4789
|
+
setSaveACHinfo(e.target.checked);
|
|
4790
|
+
if (!e.target.checked) {
|
|
4791
|
+
setSaveACHConsent1(false);
|
|
4792
|
+
setErrorBankConsentOther("");
|
|
4793
|
+
}
|
|
4794
|
+
} }),
|
|
4795
|
+
/* @__PURE__ */ jsx19("label", { htmlFor: "saveACH", children: "Save for future use" })
|
|
4736
4796
|
] }),
|
|
4737
|
-
saveACHinfo && /* @__PURE__ */
|
|
4738
|
-
"
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4797
|
+
saveACHinfo && /* @__PURE__ */ jsxs11(Fragment11, { children: [
|
|
4798
|
+
/* @__PURE__ */ jsxs11("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
4799
|
+
/* @__PURE__ */ jsx19("input", { type: "checkbox", id: "saveACHConsent1", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHConsent1, onChange: (e) => {
|
|
4800
|
+
setSaveACHConsent1(e.target.checked);
|
|
4801
|
+
if (e.target.checked) {
|
|
4802
|
+
setErrorBankConsentOther("");
|
|
4803
|
+
}
|
|
4804
|
+
} }),
|
|
4805
|
+
/* @__PURE__ */ jsxs11("label", { className: "saveachlabel", htmlFor: "saveACHConsent1", children: [
|
|
4806
|
+
"By providing my bank account information and selecting \u2018Save for future payments\u2019, I authorize ",
|
|
4807
|
+
(paymentData == null ? void 0 : paymentData.bname) || "merchant",
|
|
4808
|
+
" 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."
|
|
4809
|
+
] })
|
|
4810
|
+
] }),
|
|
4811
|
+
errorBankConsentOther && /* @__PURE__ */ jsx19("span", { className: "error-span", children: errorBankConsentOther })
|
|
4812
|
+
] })
|
|
4742
4813
|
] }),
|
|
4743
|
-
/* @__PURE__ */ jsx19("div", { className: "form-group ", children: /* @__PURE__ */ jsx19("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit", children: formatUSD((_v = Number(
|
|
4814
|
+
/* @__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)) }) })
|
|
4744
4815
|
] })
|
|
4745
4816
|
] }),
|
|
4746
4817
|
/* @__PURE__ */ jsxs11("div", { id: "reader", style: { display: activetab === "reader" ? "block" : "none" }, className: "tabcontent", children: [
|
|
@@ -7450,7 +7521,7 @@ import { IoArrowBack as IoArrowBack3 } from "react-icons/io5";
|
|
|
7450
7521
|
import { NumericFormat } from "react-number-format";
|
|
7451
7522
|
import { Fragment as Fragment17, jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7452
7523
|
function PartialPayment(props) {
|
|
7453
|
-
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
|
|
7524
|
+
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;
|
|
7454
7525
|
const buttonRef = useRef8(null);
|
|
7455
7526
|
useEffect13(() => {
|
|
7456
7527
|
if (props.onTriggerPay) {
|
|
@@ -7498,6 +7569,8 @@ function PartialPayment(props) {
|
|
|
7498
7569
|
const [partialError, setPartialError] = useState8("");
|
|
7499
7570
|
const [isBankConsentChecked, setIsBankConsentChecked] = useState8(false);
|
|
7500
7571
|
const [errorBankConsent, setErrorBankConsent] = useState8("");
|
|
7572
|
+
const [saveACHConsent1, setSaveACHConsent1] = useState8(false);
|
|
7573
|
+
const [errorBankConsentOther, setErrorBankConsentOther] = useState8("");
|
|
7501
7574
|
const tokenizerRef = useRef8(null);
|
|
7502
7575
|
const fractalStyles = {
|
|
7503
7576
|
input: {
|
|
@@ -7611,6 +7684,8 @@ function PartialPayment(props) {
|
|
|
7611
7684
|
setPartialError("");
|
|
7612
7685
|
setIsBankConsentChecked(false);
|
|
7613
7686
|
setErrorBankConsent("");
|
|
7687
|
+
setSaveACHConsent1(false);
|
|
7688
|
+
setErrorBankConsentOther("");
|
|
7614
7689
|
};
|
|
7615
7690
|
const handleShow = () => setShow(true);
|
|
7616
7691
|
const handletabchange = (id) => {
|
|
@@ -7711,11 +7786,14 @@ function PartialPayment(props) {
|
|
|
7711
7786
|
errors.companyName = "Company Name is required for business accounts";
|
|
7712
7787
|
}
|
|
7713
7788
|
}
|
|
7714
|
-
if (!isBankConsentChecked) {
|
|
7789
|
+
if (!saveACHinfo && !isBankConsentChecked) {
|
|
7715
7790
|
setErrorBankConsent("Above consent is required");
|
|
7716
7791
|
}
|
|
7792
|
+
if (saveACHinfo && !saveACHConsent1) {
|
|
7793
|
+
setErrorBankConsentOther("Your consent is required to save your bank details for future use");
|
|
7794
|
+
}
|
|
7717
7795
|
setAchError(errors);
|
|
7718
|
-
return Object.keys(errors).length > 0
|
|
7796
|
+
return Object.keys(errors).length > 0;
|
|
7719
7797
|
};
|
|
7720
7798
|
const submitFunc = async (e) => {
|
|
7721
7799
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2;
|
|
@@ -7860,7 +7938,13 @@ function PartialPayment(props) {
|
|
|
7860
7938
|
}
|
|
7861
7939
|
}
|
|
7862
7940
|
} else {
|
|
7863
|
-
|
|
7941
|
+
let hasError = validateAchData();
|
|
7942
|
+
if (saveACHinfo && !saveACHConsent1) {
|
|
7943
|
+
hasError = true;
|
|
7944
|
+
}
|
|
7945
|
+
if (!saveACHinfo && !isBankConsentChecked) {
|
|
7946
|
+
hasError = true;
|
|
7947
|
+
}
|
|
7864
7948
|
if (hasError) return;
|
|
7865
7949
|
else {
|
|
7866
7950
|
setLoading2(true);
|
|
@@ -8236,10 +8320,7 @@ function PartialPayment(props) {
|
|
|
8236
8320
|
] }),
|
|
8237
8321
|
/* @__PURE__ */ jsxs17("div", { className: "amt-pay-con", children: [
|
|
8238
8322
|
/* @__PURE__ */ jsx28("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Select payment type" }) }),
|
|
8239
|
-
/* @__PURE__ */
|
|
8240
|
-
/* @__PURE__ */ jsx28(CardBankRadio, { label: "Card", amount: (_a = Number(aftertaxAmount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
|
|
8241
|
-
(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 })
|
|
8242
|
-
] }),
|
|
8323
|
+
/* @__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 }) }),
|
|
8243
8324
|
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: [
|
|
8244
8325
|
/* @__PURE__ */ jsxs17("small", { children: [
|
|
8245
8326
|
activetab === "card" ? "Cash Discount" : "Cash Discount Savings",
|
|
@@ -8308,7 +8389,7 @@ function PartialPayment(props) {
|
|
|
8308
8389
|
/* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Payment Amount" }),
|
|
8309
8390
|
/* @__PURE__ */ jsxs17("strong", { className: "pay-amount", children: [
|
|
8310
8391
|
"$",
|
|
8311
|
-
(
|
|
8392
|
+
(_b = Number(aftertaxAmount)) == null ? void 0 : _b.toFixed(2)
|
|
8312
8393
|
] })
|
|
8313
8394
|
] }),
|
|
8314
8395
|
activetab != "ach" && /* @__PURE__ */ jsxs17("div", { children: [
|
|
@@ -8350,7 +8431,7 @@ function PartialPayment(props) {
|
|
|
8350
8431
|
/* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Payment Amount" }),
|
|
8351
8432
|
/* @__PURE__ */ jsxs17("strong", { className: "pay-amount", children: [
|
|
8352
8433
|
"$",
|
|
8353
|
-
(
|
|
8434
|
+
(_c = Number(aftertaxAmount)) == null ? void 0 : _c.toFixed(2)
|
|
8354
8435
|
] })
|
|
8355
8436
|
] }),
|
|
8356
8437
|
/* @__PURE__ */ jsxs17("div", { children: [
|
|
@@ -8385,7 +8466,7 @@ function PartialPayment(props) {
|
|
|
8385
8466
|
/* @__PURE__ */ jsx28(CardList, { listHeading: "Cards", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: cardList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Card", otherButtonAction: () => {
|
|
8386
8467
|
setActiveinCard("form");
|
|
8387
8468
|
} }),
|
|
8388
|
-
/* @__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((
|
|
8469
|
+
/* @__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)) }) })
|
|
8389
8470
|
] }) : (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 ? /* @__PURE__ */ jsxs17(
|
|
8390
8471
|
"form",
|
|
8391
8472
|
{
|
|
@@ -8429,14 +8510,14 @@ function PartialPayment(props) {
|
|
|
8429
8510
|
maxLength: 100,
|
|
8430
8511
|
placeholder: "Order Id",
|
|
8431
8512
|
disabled: true,
|
|
8432
|
-
value: (
|
|
8513
|
+
value: (_f = props == null ? void 0 : props.orderID) != null ? _f : "",
|
|
8433
8514
|
style: { background: "#F6F6F7", color: "#727272" }
|
|
8434
8515
|
}
|
|
8435
8516
|
)
|
|
8436
8517
|
] }),
|
|
8437
8518
|
/* @__PURE__ */ jsxs17("div", { className: "form-group", children: [
|
|
8438
8519
|
/* @__PURE__ */ jsx28("label", { htmlFor: "zip", children: "ZIP" }),
|
|
8439
|
-
/* @__PURE__ */ jsx28("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (
|
|
8520
|
+
/* @__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) }),
|
|
8440
8521
|
(cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx28("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
|
|
8441
8522
|
] }),
|
|
8442
8523
|
(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: [
|
|
@@ -8463,8 +8544,8 @@ function PartialPayment(props) {
|
|
|
8463
8544
|
] }) })
|
|
8464
8545
|
] }),
|
|
8465
8546
|
/* @__PURE__ */ jsxs17("div", { className: "form-group", style: { marginTop: "20px", padding: "0" }, children: [
|
|
8466
|
-
(paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((
|
|
8467
|
-
/* @__PURE__ */ jsx28("button", { type: "submit", style: { margin: 0 }, className: "pay-button", children: partialAmount && !partialError ? formatUSD((
|
|
8547
|
+
(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" }),
|
|
8548
|
+
/* @__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)) })
|
|
8468
8549
|
] })
|
|
8469
8550
|
]
|
|
8470
8551
|
}
|
|
@@ -8503,14 +8584,14 @@ function PartialPayment(props) {
|
|
|
8503
8584
|
maxLength: 100,
|
|
8504
8585
|
placeholder: "Order Id",
|
|
8505
8586
|
disabled: true,
|
|
8506
|
-
value: (
|
|
8587
|
+
value: (_k = props == null ? void 0 : props.orderID) != null ? _k : "",
|
|
8507
8588
|
style: { background: "#F6F6F7", color: "#727272" }
|
|
8508
8589
|
}
|
|
8509
8590
|
)
|
|
8510
8591
|
] }),
|
|
8511
8592
|
/* @__PURE__ */ jsxs17("div", { className: "form-group", children: [
|
|
8512
8593
|
/* @__PURE__ */ jsx28("label", { htmlFor: "zip", children: "ZIP" }),
|
|
8513
|
-
/* @__PURE__ */ jsx28("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (
|
|
8594
|
+
/* @__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) }),
|
|
8514
8595
|
(cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx28("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
|
|
8515
8596
|
] }),
|
|
8516
8597
|
(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: [
|
|
@@ -8537,8 +8618,8 @@ function PartialPayment(props) {
|
|
|
8537
8618
|
] }) })
|
|
8538
8619
|
] }),
|
|
8539
8620
|
/* @__PURE__ */ jsxs17("div", { className: "form-group", style: { marginTop: "20px", padding: "0" }, children: [
|
|
8540
|
-
(paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((
|
|
8541
|
-
/* @__PURE__ */ jsx28("button", { type: "submit", style: { margin: 0 }, className: "pay-button", children: partialAmount && !partialError ? formatUSD((
|
|
8621
|
+
(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" }),
|
|
8622
|
+
/* @__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)) })
|
|
8542
8623
|
] })
|
|
8543
8624
|
] })
|
|
8544
8625
|
] }),
|
|
@@ -8554,7 +8635,7 @@ function PartialPayment(props) {
|
|
|
8554
8635
|
/* @__PURE__ */ jsx28(CardList, { listHeading: "Banks", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
|
|
8555
8636
|
setActiveinBank("form");
|
|
8556
8637
|
} }),
|
|
8557
|
-
/* @__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((
|
|
8638
|
+
/* @__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)) }) })
|
|
8558
8639
|
] }) : /* @__PURE__ */ jsxs17("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
|
|
8559
8640
|
if (e.key === "Enter" && loading2) {
|
|
8560
8641
|
e.preventDefault();
|
|
@@ -8567,7 +8648,7 @@ function PartialPayment(props) {
|
|
|
8567
8648
|
}, children: [
|
|
8568
8649
|
/* @__PURE__ */ jsxs17("div", { className: "form-group mb-4", children: [
|
|
8569
8650
|
/* @__PURE__ */ jsx28("label", { htmlFor: "nameonaccount", children: "Name on account" }),
|
|
8570
|
-
/* @__PURE__ */ jsx28("input", { type: "text", id: "nameonaccount", className: "form-control", maxLength: 100, placeholder: "John Doe", name: "name", value: (
|
|
8651
|
+
/* @__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 }),
|
|
8571
8652
|
(achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx28("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
|
|
8572
8653
|
] }),
|
|
8573
8654
|
/* @__PURE__ */ jsxs17("div", { className: "form-group mb-4", children: [
|
|
@@ -8581,7 +8662,7 @@ function PartialPayment(props) {
|
|
|
8581
8662
|
maxLength: 9,
|
|
8582
8663
|
placeholder: "000000000",
|
|
8583
8664
|
name: "routingNumber",
|
|
8584
|
-
value: (
|
|
8665
|
+
value: (_s = achData == null ? void 0 : achData.routingNumber) != null ? _s : "",
|
|
8585
8666
|
onChange: handleChangeAch
|
|
8586
8667
|
}
|
|
8587
8668
|
),
|
|
@@ -8598,7 +8679,7 @@ function PartialPayment(props) {
|
|
|
8598
8679
|
maxLength: 16,
|
|
8599
8680
|
placeholder: "0000000000",
|
|
8600
8681
|
name: "accountNumber",
|
|
8601
|
-
value: (
|
|
8682
|
+
value: (_t = achData == null ? void 0 : achData.accountNumber) != null ? _t : "",
|
|
8602
8683
|
onChange: handleChangeAch
|
|
8603
8684
|
}
|
|
8604
8685
|
),
|
|
@@ -8615,7 +8696,7 @@ function PartialPayment(props) {
|
|
|
8615
8696
|
maxLength: 16,
|
|
8616
8697
|
placeholder: "0000000000",
|
|
8617
8698
|
name: "confirmAccountNumber",
|
|
8618
|
-
value: (
|
|
8699
|
+
value: (_u = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _u : "",
|
|
8619
8700
|
onChange: handleChangeAch
|
|
8620
8701
|
}
|
|
8621
8702
|
),
|
|
@@ -8632,7 +8713,7 @@ function PartialPayment(props) {
|
|
|
8632
8713
|
maxLength: 100,
|
|
8633
8714
|
placeholder: "My Bank",
|
|
8634
8715
|
name: "bankName",
|
|
8635
|
-
value: (
|
|
8716
|
+
value: (_v = achData == null ? void 0 : achData.bankName) != null ? _v : "",
|
|
8636
8717
|
onChange: handleChangeAch
|
|
8637
8718
|
}
|
|
8638
8719
|
),
|
|
@@ -8649,7 +8730,7 @@ function PartialPayment(props) {
|
|
|
8649
8730
|
maxLength: 100,
|
|
8650
8731
|
placeholder: "My Company",
|
|
8651
8732
|
name: "companyName",
|
|
8652
|
-
value: (
|
|
8733
|
+
value: (_w = achData == null ? void 0 : achData.companyName) != null ? _w : "",
|
|
8653
8734
|
onChange: handleChangeAch
|
|
8654
8735
|
}
|
|
8655
8736
|
),
|
|
@@ -8657,41 +8738,54 @@ function PartialPayment(props) {
|
|
|
8657
8738
|
] }),
|
|
8658
8739
|
/* @__PURE__ */ jsxs17("div", { className: "form-group mb-4", children: [
|
|
8659
8740
|
/* @__PURE__ */ jsx28("label", { htmlFor: "accounttype", children: "Select account type" }),
|
|
8660
|
-
/* @__PURE__ */ jsxs17("select", { name: "accountType", id: "accounttype", className: "form-control", value: (
|
|
8741
|
+
/* @__PURE__ */ jsxs17("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_x = achData == null ? void 0 : achData.accountType) != null ? _x : "", onChange: handleChangeAch, children: [
|
|
8661
8742
|
/* @__PURE__ */ jsx28("option", { value: "", children: "Select account" }),
|
|
8662
8743
|
accountTypes.map((type) => /* @__PURE__ */ jsx28("option", { value: type.value, children: type.label }, type.value))
|
|
8663
8744
|
] })
|
|
8664
8745
|
] }),
|
|
8665
|
-
/* @__PURE__ */ jsxs17(
|
|
8666
|
-
/* @__PURE__ */
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8746
|
+
!saveACHinfo && /* @__PURE__ */ jsxs17(Fragment17, { children: [
|
|
8747
|
+
/* @__PURE__ */ jsxs17("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
8748
|
+
/* @__PURE__ */ jsx28(
|
|
8749
|
+
"input",
|
|
8750
|
+
{
|
|
8751
|
+
type: "checkbox",
|
|
8752
|
+
id: "achconsent",
|
|
8753
|
+
className: "",
|
|
8754
|
+
checked: isBankConsentChecked,
|
|
8755
|
+
onChange: (e) => {
|
|
8756
|
+
setIsBankConsentChecked(e.target.checked);
|
|
8757
|
+
if (e.target.checked) {
|
|
8758
|
+
setErrorBankConsent("");
|
|
8759
|
+
}
|
|
8677
8760
|
}
|
|
8678
8761
|
}
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8762
|
+
),
|
|
8763
|
+
/* @__PURE__ */ jsx28("label", { htmlFor: "achconsent", children: `By selecting this box, I authorize SkyFi, on behalf of ${(paymentData == null ? void 0 : paymentData.bname) || "merchant"}, to initiate a one-time electronic ACH debit from my bank account for the total amount displayed on this screen, including any applicable processing fee. I confirm that I am authorized to use this account and that the bank account information I provided is correct.` })
|
|
8764
|
+
] }),
|
|
8765
|
+
errorBankConsent && /* @__PURE__ */ jsx28("span", { className: "error-span", children: errorBankConsent })
|
|
8682
8766
|
] }),
|
|
8683
|
-
errorBankConsent && /* @__PURE__ */ jsx28("span", { className: "error-span", children: errorBankConsent }),
|
|
8684
8767
|
(props == null ? void 0 : props.customerId) && /* @__PURE__ */ jsxs17("div", { className: "form-group mb-4 save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
8685
8768
|
/* @__PURE__ */ jsx28("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
|
|
8686
|
-
/* @__PURE__ */ jsx28("label", { htmlFor: "saveACH", children: "Save
|
|
8769
|
+
/* @__PURE__ */ jsx28("label", { htmlFor: "saveACH", children: "Save for future use" })
|
|
8687
8770
|
] }),
|
|
8688
|
-
saveACHinfo && /* @__PURE__ */
|
|
8689
|
-
"
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8771
|
+
saveACHinfo && /* @__PURE__ */ jsxs17(Fragment17, { children: [
|
|
8772
|
+
/* @__PURE__ */ jsxs17("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
8773
|
+
/* @__PURE__ */ jsx28("input", { type: "checkbox", id: "saveACHConsent1", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHConsent1, onChange: (e) => {
|
|
8774
|
+
setSaveACHConsent1(e.target.checked);
|
|
8775
|
+
if (e.target.checked) {
|
|
8776
|
+
setErrorBankConsentOther("");
|
|
8777
|
+
}
|
|
8778
|
+
} }),
|
|
8779
|
+
/* @__PURE__ */ jsxs17("label", { className: "saveachlabel", htmlFor: "saveACHConsent1", children: [
|
|
8780
|
+
"By providing my bank account information and selecting \u2018Save for future payments\u2019, I authorize ",
|
|
8781
|
+
(paymentData == null ? void 0 : paymentData.bname) || "merchant",
|
|
8782
|
+
" 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."
|
|
8783
|
+
] })
|
|
8784
|
+
] }),
|
|
8785
|
+
errorBankConsentOther && /* @__PURE__ */ jsx28("span", { className: "error-span", children: errorBankConsentOther })
|
|
8786
|
+
] })
|
|
8693
8787
|
] }),
|
|
8694
|
-
/* @__PURE__ */ jsx28("div", { className: "form-group ", children: /* @__PURE__ */ jsx28("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit", children: partialAmount && !partialError ? formatUSD((
|
|
8788
|
+
/* @__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)) }) })
|
|
8695
8789
|
] })
|
|
8696
8790
|
] })
|
|
8697
8791
|
] }) }) })
|
|
@@ -10187,6 +10281,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10187
10281
|
const [achData, setAchData] = useState11();
|
|
10188
10282
|
const [achError, setAchError] = useState11({});
|
|
10189
10283
|
const [saveACHinfo, setSaveACHinfo] = useState11(false);
|
|
10284
|
+
const [saveACHConsent1, setSaveACHConsent1] = useState11(false);
|
|
10190
10285
|
const [saveCardInfo, setSaveCardInfo] = useState11(false);
|
|
10191
10286
|
const [error, setError] = useState11("");
|
|
10192
10287
|
const [errorIframe, setErrorIframe] = useState11("");
|
|
@@ -10217,6 +10312,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10217
10312
|
const [dcToken, setDCToken] = useState11();
|
|
10218
10313
|
const [isBankConsentChecked, setIsBankConsentChecked] = useState11(false);
|
|
10219
10314
|
const [errorBankConsent, setErrorBankConsent] = useState11("");
|
|
10315
|
+
const [errorBankConsentOther, setErrorBankConsentOther] = useState11("");
|
|
10220
10316
|
let mastercard2 = S3Url + "widget/mc-img.svg";
|
|
10221
10317
|
let visa2 = S3Url + "widget/visa-img.svg";
|
|
10222
10318
|
let americanexp2 = S3Url + "widget/ae-img.svg";
|
|
@@ -10410,11 +10506,14 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10410
10506
|
errors.companyName = "Company Name is required for business accounts";
|
|
10411
10507
|
}
|
|
10412
10508
|
}
|
|
10413
|
-
if (!isBankConsentChecked) {
|
|
10509
|
+
if (!saveACHinfo && !isBankConsentChecked) {
|
|
10414
10510
|
setErrorBankConsent("Above consent is required");
|
|
10415
10511
|
}
|
|
10512
|
+
if (saveACHinfo && !saveACHConsent1) {
|
|
10513
|
+
setErrorBankConsentOther("Your consent is required to save your bank details for future use");
|
|
10514
|
+
}
|
|
10416
10515
|
setAchError(errors);
|
|
10417
|
-
return Object.keys(errors).length > 0
|
|
10516
|
+
return Object.keys(errors).length > 0;
|
|
10418
10517
|
};
|
|
10419
10518
|
const completeFractalFlow = async (tokenizeData, intentid, typeoftoken) => {
|
|
10420
10519
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
@@ -10597,7 +10696,13 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10597
10696
|
let isValid = true;
|
|
10598
10697
|
if (!isValid) return;
|
|
10599
10698
|
} else {
|
|
10600
|
-
|
|
10699
|
+
let hasError = validateAchData();
|
|
10700
|
+
if (saveACHinfo && !saveACHConsent1) {
|
|
10701
|
+
hasError = true;
|
|
10702
|
+
}
|
|
10703
|
+
if (!saveACHinfo && !isBankConsentChecked) {
|
|
10704
|
+
hasError = true;
|
|
10705
|
+
}
|
|
10601
10706
|
if (hasError) return;
|
|
10602
10707
|
}
|
|
10603
10708
|
try {
|
|
@@ -10828,6 +10933,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10828
10933
|
setRemainingAmount("");
|
|
10829
10934
|
setIsBankConsentChecked(false);
|
|
10830
10935
|
setErrorBankConsent("");
|
|
10936
|
+
setSaveACHConsent1(false);
|
|
10937
|
+
setErrorBankConsentOther("");
|
|
10831
10938
|
};
|
|
10832
10939
|
const getCardList = async () => {
|
|
10833
10940
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
|
|
@@ -11456,7 +11563,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11456
11563
|
/* @__PURE__ */ jsx36("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "000000", value: (_g = cardData == null ? void 0 : cardData.zipCode) != null ? _g : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
|
|
11457
11564
|
(cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode }),
|
|
11458
11565
|
pass_fee && cardFeeAmount > 0 && /* @__PURE__ */ jsxs21("small", { className: "frac-fee-text", children: [
|
|
11459
|
-
"
|
|
11566
|
+
"Cards include a fee amount of ",
|
|
11460
11567
|
/* @__PURE__ */ jsx36("span", { className: "frac-fee-amount", children: formatUSD(cardFeeAmount.toFixed(2)) }),
|
|
11461
11568
|
"."
|
|
11462
11569
|
] })
|
|
@@ -11537,7 +11644,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11537
11644
|
/* @__PURE__ */ jsx36("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "000000", value: (_j = cardData == null ? void 0 : cardData.zipCode) != null ? _j : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
|
|
11538
11645
|
(cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode }),
|
|
11539
11646
|
pass_fee && cardFeeAmount > 0 && /* @__PURE__ */ jsxs21("small", { className: "frac-fee-text", children: [
|
|
11540
|
-
"
|
|
11647
|
+
"Cards include a fee amount of ",
|
|
11541
11648
|
/* @__PURE__ */ jsx36("span", { className: "frac-fee-amount", children: formatUSD(cardFeeAmount.toFixed(2)) }),
|
|
11542
11649
|
"."
|
|
11543
11650
|
] })
|
|
@@ -11711,25 +11818,44 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11711
11818
|
/* @__PURE__ */ jsx36("span", { className: "frac-fee-amount", children: formatUSD(bankFeeAmount.toFixed(2)) }),
|
|
11712
11819
|
"."
|
|
11713
11820
|
] }),
|
|
11714
|
-
/* @__PURE__ */ jsxs21(
|
|
11715
|
-
/* @__PURE__ */
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11821
|
+
!saveACHinfo && /* @__PURE__ */ jsxs21(Fragment20, { children: [
|
|
11822
|
+
/* @__PURE__ */ jsxs21("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
11823
|
+
/* @__PURE__ */ jsx36("input", { type: "checkbox", id: "achconsent", className: "", checked: isBankConsentChecked, onChange: (e) => {
|
|
11824
|
+
setIsBankConsentChecked(e.target.checked);
|
|
11825
|
+
if (e.target.checked) {
|
|
11826
|
+
setErrorBankConsent("");
|
|
11827
|
+
}
|
|
11828
|
+
} }),
|
|
11829
|
+
/* @__PURE__ */ jsx36("label", { className: "saveachlabel", htmlFor: "achconsent", children: `By selecting this box, I authorize SkyFi, on behalf of ${merchantName || "merchant"}, to initiate a one-time electronic ACH debit from my bank account for the total amount displayed on this screen, including any applicable processing fee. I confirm that I am authorized to use this account and that the bank account information I provided is correct.` })
|
|
11830
|
+
] }),
|
|
11831
|
+
errorBankConsent && /* @__PURE__ */ jsx36("span", { className: "error-span", children: errorBankConsent })
|
|
11722
11832
|
] }),
|
|
11723
|
-
errorBankConsent && /* @__PURE__ */ jsx36("span", { className: "error-span", children: errorBankConsent }),
|
|
11724
11833
|
customerId && /* @__PURE__ */ jsxs21("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
11725
|
-
/* @__PURE__ */ jsx36("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) =>
|
|
11726
|
-
|
|
11834
|
+
/* @__PURE__ */ jsx36("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => {
|
|
11835
|
+
setSaveACHinfo(e.target.checked);
|
|
11836
|
+
if (!e.target.checked) {
|
|
11837
|
+
setSaveACHConsent1(false);
|
|
11838
|
+
setErrorBankConsentOther("");
|
|
11839
|
+
}
|
|
11840
|
+
} }),
|
|
11841
|
+
/* @__PURE__ */ jsx36("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save for future use" })
|
|
11727
11842
|
] }),
|
|
11728
|
-
saveACHinfo && /* @__PURE__ */
|
|
11729
|
-
"
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11843
|
+
saveACHinfo && /* @__PURE__ */ jsxs21(Fragment20, { children: [
|
|
11844
|
+
/* @__PURE__ */ jsxs21("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
11845
|
+
/* @__PURE__ */ jsx36("input", { type: "checkbox", id: "saveACHConsent1", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHConsent1, onChange: (e) => {
|
|
11846
|
+
setSaveACHConsent1(e.target.checked);
|
|
11847
|
+
if (e.target.checked) {
|
|
11848
|
+
setErrorBankConsentOther("");
|
|
11849
|
+
}
|
|
11850
|
+
} }),
|
|
11851
|
+
/* @__PURE__ */ jsxs21("label", { className: "saveachlabel", htmlFor: "saveACHConsent1", children: [
|
|
11852
|
+
"By providing my bank account information and selecting \u2018Save for future payments\u2019, I authorize ",
|
|
11853
|
+
merchantName || "merchant",
|
|
11854
|
+
" 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."
|
|
11855
|
+
] })
|
|
11856
|
+
] }),
|
|
11857
|
+
errorBankConsentOther && /* @__PURE__ */ jsx36("span", { className: "error-span", children: errorBankConsentOther })
|
|
11858
|
+
] })
|
|
11733
11859
|
] })
|
|
11734
11860
|
] }),
|
|
11735
11861
|
/* @__PURE__ */ jsx36("div", { className: "form-group-frac ", children: /* @__PURE__ */ jsx36("button", { className: "pay-button", style: { margin: "20px 0 0", display: onSubmit ? "none" : "block" }, type: "submit", children: formatUSD((_u = Number(bankAmount)) == null ? void 0 : _u.toFixed(2)) }) })
|
|
@@ -11768,7 +11894,8 @@ var PaymentWidget = ({
|
|
|
11768
11894
|
isPartial,
|
|
11769
11895
|
bankSurcharge,
|
|
11770
11896
|
partialRef,
|
|
11771
|
-
customCSS: customCSS2
|
|
11897
|
+
customCSS: customCSS2,
|
|
11898
|
+
disableSubmitBtn = false
|
|
11772
11899
|
}) => {
|
|
11773
11900
|
const [show, setShow] = useState12(autoTrigger || false);
|
|
11774
11901
|
const [loading, setLoading] = useState12(false);
|
|
@@ -11799,7 +11926,8 @@ var PaymentWidget = ({
|
|
|
11799
11926
|
isPartial,
|
|
11800
11927
|
bankSurcharge,
|
|
11801
11928
|
partialRef,
|
|
11802
|
-
customCSS: customCSS2
|
|
11929
|
+
customCSS: customCSS2,
|
|
11930
|
+
disableSubmitBtn
|
|
11803
11931
|
}),
|
|
11804
11932
|
[
|
|
11805
11933
|
amount,
|
|
@@ -11820,7 +11948,8 @@ var PaymentWidget = ({
|
|
|
11820
11948
|
autoTrigger,
|
|
11821
11949
|
isPartial,
|
|
11822
11950
|
bankSurcharge,
|
|
11823
|
-
partialRef
|
|
11951
|
+
partialRef,
|
|
11952
|
+
disableSubmitBtn
|
|
11824
11953
|
]
|
|
11825
11954
|
);
|
|
11826
11955
|
const [commonProps, setCommonProps] = useState12(initialCommonProps);
|
|
@@ -11868,7 +11997,7 @@ var PaymentWidget = ({
|
|
|
11868
11997
|
/* @__PURE__ */ jsx37(CardBankRadioStyles, {}),
|
|
11869
11998
|
/* @__PURE__ */ jsx37(CustomModal2styles_default, {}),
|
|
11870
11999
|
/* @__PURE__ */ jsx37(DataCapScriptLoader, {}),
|
|
11871
|
-
!autoTrigger && /* @__PURE__ */ jsxs22("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
|
|
12000
|
+
!autoTrigger && /* @__PURE__ */ jsxs22("button", { className: submitBtnClass || "paymentBtn", disabled: disableSubmitBtn, onClick: () => setShow(true), children: [
|
|
11872
12001
|
submitBtnText,
|
|
11873
12002
|
submitBtnIcon
|
|
11874
12003
|
] }),
|
|
@@ -12103,7 +12232,7 @@ form#ACHPaymentForm .ach-scrl {
|
|
|
12103
12232
|
}
|
|
12104
12233
|
@media screen and (max-width: 375px) {
|
|
12105
12234
|
.frac-payment-form-div .exp-date-year-container {
|
|
12106
|
-
flex-direction: column;
|
|
12235
|
+
// flex-direction: column;
|
|
12107
12236
|
}
|
|
12108
12237
|
.parent-pay-container {
|
|
12109
12238
|
padding: 10px;
|
|
@@ -12204,7 +12333,7 @@ padding:0px !important;
|
|
|
12204
12333
|
padding: 0px 10px;
|
|
12205
12334
|
}
|
|
12206
12335
|
.toggle-num-wrapper-new .input-main-wrap-frac {
|
|
12207
|
-
height:
|
|
12336
|
+
height: 38px;
|
|
12208
12337
|
}
|
|
12209
12338
|
.toggle-num-wrapper-new:focus {
|
|
12210
12339
|
border: 1px solid #004eab !important;
|