@fractalpay/fractalpay-next-dev 0.0.251 → 0.0.252

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  "package.json"(exports, module) {
40
40
  module.exports = {
41
41
  name: "@fractalpay/fractalpay-next-dev",
42
- version: "0.0.251",
42
+ version: "0.0.252",
43
43
  private: false,
44
44
  type: "module",
45
45
  scripts: {
@@ -113,8 +113,25 @@ import { useState, useEffect } from "react";
113
113
  import { jsx } from "react/jsx-runtime";
114
114
  var LoaderStyle = (props) => {
115
115
  return /* @__PURE__ */ jsx("style", { children: `
116
-
117
- .loader {
116
+
117
+ .loader-light {
118
+ position: fixed; /* Fixed position to cover the viewport */
119
+ top: 0;
120
+ left: 0;
121
+ width: 100%;
122
+ height: 100%;
123
+ display: flex;
124
+ justify-content: center;
125
+ align-items: center;
126
+ /* background: rgba(255, 255, 0, 0.01); Adjust the blur effect */
127
+ background-color: rgba(31, 29, 29, 0.52); /* Semi-transparent black background */
128
+
129
+ backdrop-filter: blur(0.5px); /* Blur effect */
130
+ z-index: 999999999999 !important; /* Ensure it's on top of other elements */
131
+ transform: translate(0%, 0%) !important
132
+ }
133
+
134
+ .loader-dark {
118
135
  position: fixed; /* Fixed position to cover the viewport */
119
136
  top: 0;
120
137
  left: 0;
@@ -126,7 +143,7 @@ var LoaderStyle = (props) => {
126
143
  /* background: rgba(255, 255, 0, 0.01); Adjust the blur effect */
127
144
  background-color: rgba(31, 29, 29, 0.52); /* Semi-transparent black background */
128
145
 
129
- backdrop-filter: blur(.5px); /* Blur effect */
146
+ backdrop-filter: blur(6.5px); /* Blur effect */
130
147
  z-index: 999999999999 !important; /* Ensure it's on top of other elements */
131
148
  transform: translate(0%, 0%) !important
132
149
  }
@@ -201,10 +218,11 @@ var LoaderStyle_default = LoaderStyle;
201
218
 
202
219
  // src/app/components/Loader/Loader.tsx
203
220
  import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
204
- var Loader = (props) => {
221
+ var Loader = (_a) => {
222
+ var _b = _a, { intensity = "light" } = _b, props = __objRest(_b, ["intensity"]);
205
223
  return /* @__PURE__ */ jsxs(Fragment, { children: [
206
224
  /* @__PURE__ */ jsx2(LoaderStyle_default, {}),
207
- (props == null ? void 0 : props.loading) && /* @__PURE__ */ jsx2("div", { className: "loader", children: /* @__PURE__ */ jsxs("div", { className: "lds-ellipsis", children: [
225
+ (props == null ? void 0 : props.loading) && /* @__PURE__ */ jsx2("div", { className: `loader-${intensity}`, children: /* @__PURE__ */ jsxs("div", { className: "lds-ellipsis", children: [
208
226
  /* @__PURE__ */ jsx2("div", {}),
209
227
  /* @__PURE__ */ jsx2("div", {}),
210
228
  /* @__PURE__ */ jsx2("div", {}),
@@ -218,41 +236,65 @@ var Loader_default = Loader;
218
236
  var { name } = require_package();
219
237
  var S3Url = "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/";
220
238
  if (name === "@fractalpay/fractalpay-next-dev") {
221
- baseUrl = "http://localhost:8082/";
222
- masterBaseUrl = "http://localhost:8081/";
239
+ masterBaseUrl = "https://dev-sky-node.fractalpay.com/";
240
+ baseUrl = "https://dev-widget.fractalpay.com/";
223
241
  fractalGatewayUrl = "https://api-dev.merchant-trends.com/";
224
242
  datacapUrl = "https://token-cert.dcap.com/v1/client";
225
243
  threedsSecurePublicKey = "pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw";
244
+ applePayMerchantId = "fractal";
245
+ googlePayMerchantId = "12345678901234567890";
246
+ googlePayEnvironment = "TEST";
247
+ googlePayGatewayMerchantId = "fractal";
226
248
  } else if (name === "@fractalpay/fractalpay-next-test") {
227
249
  masterBaseUrl = "https://testapi.fractalpay.com/";
228
250
  baseUrl = "https://staging-widget.fractalpay.com/";
229
251
  fractalGatewayUrl = "https://api-dev.merchant-trends.com/";
230
252
  datacapUrl = "https://token-cert.dcap.com/v1/client";
231
253
  threedsSecurePublicKey = "pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw";
254
+ applePayMerchantId = "fractal";
255
+ googlePayMerchantId = "12345678901234567890";
256
+ googlePayEnvironment = "TEST";
257
+ googlePayGatewayMerchantId = "fractal";
232
258
  } else if (name === "@fractalpay/fractalpay-next-testprod") {
233
259
  masterBaseUrl = "https://sky-node-prod.fractalpay.com/";
234
260
  baseUrl = "https://widget-prod.fractalpay.com/";
235
261
  fractalGatewayUrl = "https://api.merchant-trends.com/";
236
262
  datacapUrl = "https://token.dcap.com/v1/client";
237
263
  threedsSecurePublicKey = "pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB";
264
+ applePayMerchantId = "fractal";
265
+ googlePayMerchantId = "BCR2DN4T6OC2TCQH";
266
+ googlePayEnvironment = "PRODUCTION";
267
+ googlePayGatewayMerchantId = "fractal";
238
268
  } else if (name === "@fractalpay/fractalpay-next") {
239
269
  masterBaseUrl = "https://api.fractalpay.com/";
240
270
  baseUrl = "https://widget.fractalpay.com/";
241
271
  fractalGatewayUrl = "https://api.merchant-trends.com/";
242
272
  datacapUrl = "https://token.dcap.com/v1/client";
243
273
  threedsSecurePublicKey = "pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB";
274
+ applePayMerchantId = "fractal";
275
+ googlePayMerchantId = "BCR2DN4T6OC2TCQH";
276
+ googlePayEnvironment = "PRODUCTION";
277
+ googlePayGatewayMerchantId = "fractal";
244
278
  } else {
245
279
  baseUrl = "http://localhost:8082/";
246
280
  masterBaseUrl = "http://localhost:8081/";
247
281
  fractalGatewayUrl = "https://api-dev.merchant-trends.com/";
248
282
  datacapUrl = "https://token-cert.dcap.com/v1/client";
249
283
  threedsSecurePublicKey = "pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw";
284
+ applePayMerchantId = "fractal";
285
+ googlePayMerchantId = "12345678901234567890";
286
+ googlePayEnvironment = "TEST";
287
+ googlePayGatewayMerchantId = "fractal";
250
288
  }
251
289
  var masterBaseUrl;
252
290
  var baseUrl;
253
291
  var fractalGatewayUrl;
254
292
  var datacapUrl;
255
293
  var threedsSecurePublicKey;
294
+ var applePayMerchantId;
295
+ var googlePayMerchantId;
296
+ var googlePayEnvironment;
297
+ var googlePayGatewayMerchantId;
256
298
 
257
299
  // src/app/components/Errortext.ts
258
300
  var ErrorText = {
@@ -1016,10 +1058,9 @@ function RequestPayment(props) {
1016
1058
  let cash_discount = CalculateCashDiscount(props == null ? void 0 : props.amount, props == null ? void 0 : props.surcharge);
1017
1059
  setCashDiscount(cash_discount);
1018
1060
  }
1019
- }, [props == null ? void 0 : props.pass_fee, show]);
1061
+ }, [props == null ? void 0 : props.pass_fee]);
1020
1062
  const handleClose = () => {
1021
1063
  setShow(false);
1022
- setCashDiscount(0);
1023
1064
  setErrors({});
1024
1065
  };
1025
1066
  const handleShow = () => setShow(true);
@@ -2417,19 +2458,6 @@ position:relative;
2417
2458
  border: 0;
2418
2459
  border-right: 1px solid #dee2e6;
2419
2460
  }
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
-
2433
2461
  ` });
2434
2462
  }
2435
2463
 
@@ -2922,7 +2950,7 @@ function ErrorCardMszStyle() {
2922
2950
 
2923
2951
  // src/app/components/ErrorCardMessage/ErrorCardMessage.tsx
2924
2952
  import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
2925
- var ErrorCardMessage = ({ onClose, error }) => {
2953
+ var ErrorCardMessage = ({ onClose, error, autoTrigger = false }) => {
2926
2954
  return /* @__PURE__ */ jsxs6(Fragment6, { children: [
2927
2955
  /* @__PURE__ */ jsx12(ErrorCardMszStyle, {}),
2928
2956
  /* @__PURE__ */ jsx12("div", { className: "card-error", children: /* @__PURE__ */ jsx12("div", { className: "payment-error-container", children: /* @__PURE__ */ jsxs6("div", { className: "error-icon", children: [
@@ -2931,7 +2959,7 @@ var ErrorCardMessage = ({ onClose, error }) => {
2931
2959
  /* @__PURE__ */ jsx12("div", { className: "payment-error-text", children: error }),
2932
2960
  /* @__PURE__ */ jsx12("div", { className: "thank-you-text", children: "Try again later " })
2933
2961
  ] }),
2934
- /* @__PURE__ */ jsx12("div", { className: "error-btn-div", children: /* @__PURE__ */ jsx12("button", { onClick: onClose, children: "OK" }) })
2962
+ !autoTrigger && /* @__PURE__ */ jsx12("div", { className: "error-btn-div", children: /* @__PURE__ */ jsx12("button", { onClick: onClose, children: "OK" }) })
2935
2963
  ] }) }) })
2936
2964
  ] });
2937
2965
  };
@@ -2948,14 +2976,28 @@ var socketClient_default = socket;
2948
2976
 
2949
2977
  // src/app/components/Atoms/CardBankRadio/CardBankRadio.tsx
2950
2978
  import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
2951
- var CardBankRadio = (props) => {
2952
- return /* @__PURE__ */ jsx13(Fragment7, { children: /* @__PURE__ */ jsxs7(
2979
+ var CardBankRadio = (_a) => {
2980
+ var _b = _a, { skydesign = false, savingsText } = _b, props = __objRest(_b, ["skydesign", "savingsText"]);
2981
+ const savingsBadgeClass = `frac-saving-badge ${skydesign ? "frac-saving-badge-corner" : "frac-saving-badge-corner frac-saving-badge-with-radio"}`;
2982
+ return /* @__PURE__ */ jsx13(Fragment7, { children: /* @__PURE__ */ jsx13(
2953
2983
  "div",
2954
2984
  {
2955
2985
  className: `frac-card-bank-radio ${props.activetab === props.value ? "frac-active" : ""}`,
2956
2986
  onClick: () => props.onChange(props.value),
2957
2987
  role: "radio",
2958
- children: [
2988
+ children: skydesign ? /* @__PURE__ */ jsxs7(Fragment7, { children: [
2989
+ /* @__PURE__ */ jsxs7("div", { className: "frac-card-title-main", children: [
2990
+ /* @__PURE__ */ jsxs7("div", { className: "box-inner-card-text", children: [
2991
+ /* @__PURE__ */ jsx13("img", { src: props.label.toLowerCase() === "card" ? defaultcard : props.label.toLowerCase() === "reader" ? pax : bankNew, className: "frac-payment-type-logo", alt: "" }),
2992
+ /* @__PURE__ */ jsx13("div", { className: "frac-card-label-text", children: props.label })
2993
+ ] }),
2994
+ /* @__PURE__ */ jsx13("div", { className: "frac-card-label", children: /* @__PURE__ */ jsx13("div", { className: "frac-card-label-amount", children: formatUSD(props.amount) }) })
2995
+ ] }),
2996
+ savingsText ? /* @__PURE__ */ jsx13("button", { type: "button", className: savingsBadgeClass, children: savingsText }) : null,
2997
+ /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsx13("input", { name: "paymenttype", checked: props.activetab === props.value, type: "hidden", value: props.value, onChange: (e) => {
2998
+ props.onChange(e.target.value);
2999
+ } }) })
3000
+ ] }) : /* @__PURE__ */ jsxs7(Fragment7, { children: [
2959
3001
  /* @__PURE__ */ jsxs7("div", { className: "frac-card-title-main", children: [
2960
3002
  /* @__PURE__ */ jsx13("img", { src: props.label.toLowerCase() === "card" ? defaultcard : props.label.toLowerCase() === "reader" ? pax : bankNew, className: "frac-payment-type-logo", alt: "" }),
2961
3003
  /* @__PURE__ */ jsxs7("div", { className: "frac-card-label", children: [
@@ -2963,10 +3005,11 @@ var CardBankRadio = (props) => {
2963
3005
  /* @__PURE__ */ jsx13("div", { className: "frac-card-label-amount", children: formatUSD(props.amount) })
2964
3006
  ] })
2965
3007
  ] }),
3008
+ savingsText ? /* @__PURE__ */ jsx13("button", { type: "button", className: savingsBadgeClass, children: savingsText }) : null,
2966
3009
  /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsx13("input", { name: "paymenttype", checked: props.activetab === props.value, type: "radio", value: props.value, onChange: (e) => {
2967
3010
  props.onChange(e.target.value);
2968
3011
  } }) })
2969
- ]
3012
+ ] })
2970
3013
  }
2971
3014
  ) });
2972
3015
  };
@@ -2991,6 +3034,7 @@ function CardBankRadioStyles({}) {
2991
3034
  justify-content: space-between;
2992
3035
  align-items: center;
2993
3036
  align-self: stretch;
3037
+ position: relative;
2994
3038
  }
2995
3039
 
2996
3040
  input[type="radio"] {
@@ -3048,6 +3092,28 @@ function CardBankRadioStyles({}) {
3048
3092
  .frac-card-bank-radio.frac-active {
3049
3093
  background: #F6F6F7;
3050
3094
  }
3095
+
3096
+ .frac-saving-badge {
3097
+ padding: 1px 7px !important;
3098
+ border: 1px solid #9ad7ab;
3099
+ border-radius: 999px;
3100
+ background: #e8f8ec;
3101
+ color: #1e6a34;
3102
+ font-size: 10px;
3103
+ font-weight: 600;
3104
+ line-height: 15px;
3105
+ pointer-events: none;
3106
+ }
3107
+
3108
+ .frac-saving-badge-corner {
3109
+ position: absolute;
3110
+ top: 8px;
3111
+ right: 10px;
3112
+ }
3113
+
3114
+ .frac-saving-badge-with-radio {
3115
+ right: 34px;
3116
+ }
3051
3117
  ` });
3052
3118
  }
3053
3119
 
@@ -3225,7 +3291,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
3225
3291
  {
3226
3292
  id: "card_number",
3227
3293
  className: "form-control card-number-new",
3228
- style: { height: `${isSky ? "36px" : "46px"}`, display: "inline-block" }
3294
+ style: { height: `${isSky ? "36px" : "46px"}` }
3229
3295
  }
3230
3296
  ),
3231
3297
  /* @__PURE__ */ jsx17("div", { className: "card-crdi card-expiry-new", children: /* @__PURE__ */ jsxs10("div", { className: "exp-date-year-container", children: [
@@ -3234,7 +3300,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
3234
3300
  {
3235
3301
  id: "exp_month",
3236
3302
  className: "form-control required card-cvv-in",
3237
- style: { height: "36px", display: "inline-block" }
3303
+ style: { height: "36px", display: "block", minHeight: "36px" }
3238
3304
  }
3239
3305
  ) }),
3240
3306
  /* @__PURE__ */ jsx17("div", { className: "exp-year form-group input-main-wrap-frac", children: /* @__PURE__ */ jsx17(
@@ -3242,7 +3308,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
3242
3308
  {
3243
3309
  id: "exp_year",
3244
3310
  className: "form-control required card-cvv-in",
3245
- style: { height: "36px", display: "inline-block" }
3311
+ style: { height: "36px", display: "block", minHeight: "36px" }
3246
3312
  }
3247
3313
  ) }),
3248
3314
  /* @__PURE__ */ jsx17("div", { className: "security-digit form-group input-main-wrap-frac", children: /* @__PURE__ */ jsx17(
@@ -3250,7 +3316,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
3250
3316
  {
3251
3317
  id: "cvv",
3252
3318
  className: "form-control card-cvv-in required",
3253
- style: { height: "36px", display: "inline-block" }
3319
+ style: { height: "36px", display: "block", minHeight: "36px" }
3254
3320
  }
3255
3321
  ) })
3256
3322
  ] }) })
@@ -3373,7 +3439,8 @@ var DataCapFields = ({
3373
3439
  isOpen,
3374
3440
  tokenKey,
3375
3441
  setLoader,
3376
- isAddCard
3442
+ isAddCard,
3443
+ isEmbedded
3377
3444
  }) => {
3378
3445
  const iframeId = "datacap-iframe";
3379
3446
  const resolverRef = useRef2(null);
@@ -3399,6 +3466,20 @@ var DataCapFields = ({
3399
3466
 
3400
3467
  `;
3401
3468
  }
3469
+ if (isEmbedded) {
3470
+ customCSS += `
3471
+
3472
+ input {
3473
+ background-color: #F6F6F7;
3474
+ box-shadow: 1px 1px 2px inset rgba(0, 0, 0, 0.1;
3475
+ }
3476
+
3477
+ select {
3478
+ background-color: #F6F6F7;
3479
+ box-shadow: 1px 1px 2px inset rgba(0, 0, 0, 0.1);
3480
+ }
3481
+ `;
3482
+ }
3402
3483
  const initialize = async () => {
3403
3484
  setLoader == null ? void 0 : setLoader(true);
3404
3485
  setIframeReady(false);
@@ -3430,13 +3511,18 @@ var DataCapFields = ({
3430
3511
  };
3431
3512
  initialize();
3432
3513
  }, [isOpen, tokenKey]);
3433
- window.requestDcToken = () => {
3434
- return new Promise((resolve, reject) => {
3435
- setLoader == null ? void 0 : setLoader(true);
3436
- resolverRef.current = { resolve, reject };
3437
- window.DatacapHostedWebToken.requestToken();
3438
- });
3439
- };
3514
+ useEffect7(() => {
3515
+ window.requestDcToken = () => {
3516
+ return new Promise((resolve, reject) => {
3517
+ setLoader == null ? void 0 : setLoader(true);
3518
+ resolverRef.current = { resolve, reject };
3519
+ });
3520
+ };
3521
+ return () => {
3522
+ delete window.requestDcToken;
3523
+ };
3524
+ }, []);
3525
+ console.log(setLoader, "loadingIframe");
3440
3526
  return /* @__PURE__ */ jsx18(
3441
3527
  "iframe",
3442
3528
  {
@@ -3497,8 +3583,6 @@ function GetPaymentPage(props) {
3497
3583
  const [selectedCard, setSelectedCard] = useState4();
3498
3584
  const [selectedReader, setSelectedReader] = useState4(void 0);
3499
3585
  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);
3502
3586
  const [paymentData, setPaymentData] = useState4();
3503
3587
  let [tranId, setTranId] = useState4("");
3504
3588
  const tokenizerRef = useRef3(null);
@@ -3533,25 +3617,7 @@ function GetPaymentPage(props) {
3533
3617
  useEffect8(() => {
3534
3618
  if (show) {
3535
3619
  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);
3541
3620
  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
- });
3555
3621
  }
3556
3622
  }, [show, props == null ? void 0 : props.pass_fee, props == null ? void 0 : props.amount, props == null ? void 0 : props.surcharge]);
3557
3623
  const handleClose = () => {
@@ -3718,7 +3784,7 @@ function GetPaymentPage(props) {
3718
3784
  }
3719
3785
  }
3720
3786
  if (!isBankConsentChecked) {
3721
- setErrorBankConsent("Above consent is required");
3787
+ setErrorBankConsent("Above consent is requied");
3722
3788
  }
3723
3789
  setAchError(errors);
3724
3790
  return Object.keys(errors).length > 0 || !isBankConsentChecked;
@@ -3891,7 +3957,7 @@ function GetPaymentPage(props) {
3891
3957
  routing_number: achData == null ? void 0 : achData.routingNumber,
3892
3958
  bank_name: achData == null ? void 0 : achData.bankName,
3893
3959
  account_type: achData == null ? void 0 : achData.accountType,
3894
- amount: String(bankAmount || 0),
3960
+ amount: String(cashDiscount || 0),
3895
3961
  isSaveAch: saveACHinfo,
3896
3962
  customer_id: props == null ? void 0 : props.customerId,
3897
3963
  order_id: props == null ? void 0 : props.orderID,
@@ -3973,11 +4039,11 @@ function GetPaymentPage(props) {
3973
4039
  let amount = String(props == null ? void 0 : props.amount);
3974
4040
  let card_id = selectedCard == null ? void 0 : selectedCard.id;
3975
4041
  let card_type = selectedCard == null ? void 0 : selectedCard.card_type;
3976
- if (fractalpayPublicKey && order_id && amount && bankAmount) {
4042
+ if (fractalpayPublicKey && order_id && amount && cashDiscount) {
3977
4043
  if (customer_id) {
3978
4044
  if (card_id) {
3979
4045
  let chargeobj = __spreadValues({
3980
- amount: card_type === "Bank" ? `${bankAmount}` : amount,
4046
+ amount: card_type === "Bank" ? `${cashDiscount}` : amount,
3981
4047
  order_id,
3982
4048
  customer_id,
3983
4049
  card_id,
@@ -4216,21 +4282,22 @@ function GetPaymentPage(props) {
4216
4282
  /* @__PURE__ */ jsx19("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx19("small", { className: "pay-payment-amount", children: "Select paymet type" }) }),
4217
4283
  /* @__PURE__ */ jsxs11("div", { className: "frac-card-bank-radio-main", children: [
4218
4284
  /* @__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 }),
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 }),
4285
+ (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 }),
4220
4286
  (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 })
4221
4287
  ] }),
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
- "."
4288
+ !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: [
4289
+ /* @__PURE__ */ jsxs11("small", { children: [
4290
+ activetab === "card" || activetab === "reader" ? "Cash Discount" : "Cash Discount Savings",
4291
+ " "
4227
4292
  ] }),
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
- ] })
4293
+ /* @__PURE__ */ jsx19("p", { children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) })
4294
+ ] }) : null : cashDiscount && cashDiscount > 0 && (props == null ? void 0 : props.pass_fee) && (activetab === "card" || activetab === "reader") ? /* @__PURE__ */ jsxs11("div", { className: "frac-cash-discount-fee", children: [
4295
+ /* @__PURE__ */ jsxs11("small", { children: [
4296
+ activetab === "card" || activetab === "reader" ? "Surcharge" : null,
4297
+ " "
4298
+ ] }),
4299
+ /* @__PURE__ */ jsx19("p", { children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) })
4300
+ ] }) : null)
4234
4301
  ] })
4235
4302
  ] }),
4236
4303
  /* @__PURE__ */ jsxs11("div", { className: "pay-conatiner-one-last", children: [
@@ -4535,7 +4602,7 @@ function GetPaymentPage(props) {
4535
4602
  /* @__PURE__ */ jsx19(CardList, { listHeading: "Banks", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
4536
4603
  setActiveinBank("form");
4537
4604
  } }),
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)) }) })
4605
+ /* @__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)) }) })
4539
4606
  ] }) : /* @__PURE__ */ jsxs11("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
4540
4607
  if (e.key === "Enter" && loading2) {
4541
4608
  e.preventDefault();
@@ -4663,7 +4730,7 @@ function GetPaymentPage(props) {
4663
4730
  " to have my permission to charge this bank account for agreed upon purchases in the future."
4664
4731
  ] }) })
4665
4732
  ] }),
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)) }) })
4733
+ /* @__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)) }) })
4667
4734
  ] })
4668
4735
  ] }),
4669
4736
  /* @__PURE__ */ jsxs11("div", { id: "reader", style: { display: activetab === "reader" ? "block" : "none" }, className: "tabcontent", children: [
@@ -7371,7 +7438,7 @@ import { IoArrowBack as IoArrowBack3 } from "react-icons/io5";
7371
7438
  import { NumericFormat } from "react-number-format";
7372
7439
  import { Fragment as Fragment17, jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
7373
7440
  function PartialPayment(props) {
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;
7441
+ 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;
7375
7442
  const buttonRef = useRef8(null);
7376
7443
  useEffect13(() => {
7377
7444
  if (props.onTriggerPay) {
@@ -7633,7 +7700,7 @@ function PartialPayment(props) {
7633
7700
  }
7634
7701
  }
7635
7702
  if (!isBankConsentChecked) {
7636
- setErrorBankConsent("Above consent is required");
7703
+ setErrorBankConsent("Above consent is requied");
7637
7704
  }
7638
7705
  setAchError(errors);
7639
7706
  return Object.keys(errors).length > 0 || !isBankConsentChecked;
@@ -8157,7 +8224,10 @@ function PartialPayment(props) {
8157
8224
  ] }),
8158
8225
  /* @__PURE__ */ jsxs17("div", { className: "amt-pay-con", children: [
8159
8226
  /* @__PURE__ */ jsx28("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Select payment type" }) }),
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 }) }),
8227
+ /* @__PURE__ */ jsxs17("div", { className: "frac-card-bank-radio-main", children: [
8228
+ /* @__PURE__ */ jsx28(CardBankRadio, { label: "Card", amount: (_a = Number(aftertaxAmount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
8229
+ (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 })
8230
+ ] }),
8161
8231
  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: [
8162
8232
  /* @__PURE__ */ jsxs17("small", { children: [
8163
8233
  activetab === "card" ? "Cash Discount" : "Cash Discount Savings",
@@ -8226,7 +8296,7 @@ function PartialPayment(props) {
8226
8296
  /* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Payment Amount" }),
8227
8297
  /* @__PURE__ */ jsxs17("strong", { className: "pay-amount", children: [
8228
8298
  "$",
8229
- (_b = Number(aftertaxAmount)) == null ? void 0 : _b.toFixed(2)
8299
+ (_c = Number(aftertaxAmount)) == null ? void 0 : _c.toFixed(2)
8230
8300
  ] })
8231
8301
  ] }),
8232
8302
  activetab != "ach" && /* @__PURE__ */ jsxs17("div", { children: [
@@ -8268,7 +8338,7 @@ function PartialPayment(props) {
8268
8338
  /* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Payment Amount" }),
8269
8339
  /* @__PURE__ */ jsxs17("strong", { className: "pay-amount", children: [
8270
8340
  "$",
8271
- (_c = Number(aftertaxAmount)) == null ? void 0 : _c.toFixed(2)
8341
+ (_d = Number(aftertaxAmount)) == null ? void 0 : _d.toFixed(2)
8272
8342
  ] })
8273
8343
  ] }),
8274
8344
  /* @__PURE__ */ jsxs17("div", { children: [
@@ -8303,7 +8373,7 @@ function PartialPayment(props) {
8303
8373
  /* @__PURE__ */ jsx28(CardList, { listHeading: "Cards", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: cardList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Card", otherButtonAction: () => {
8304
8374
  setActiveinCard("form");
8305
8375
  } }),
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)) }) })
8376
+ /* @__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)) }) })
8307
8377
  ] }) : (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 ? /* @__PURE__ */ jsxs17(
8308
8378
  "form",
8309
8379
  {
@@ -8347,14 +8417,14 @@ function PartialPayment(props) {
8347
8417
  maxLength: 100,
8348
8418
  placeholder: "Order Id",
8349
8419
  disabled: true,
8350
- value: (_f = props == null ? void 0 : props.orderID) != null ? _f : "",
8420
+ value: (_g = props == null ? void 0 : props.orderID) != null ? _g : "",
8351
8421
  style: { background: "#F6F6F7", color: "#727272" }
8352
8422
  }
8353
8423
  )
8354
8424
  ] }),
8355
8425
  /* @__PURE__ */ jsxs17("div", { className: "form-group", children: [
8356
8426
  /* @__PURE__ */ jsx28("label", { htmlFor: "zip", children: "ZIP" }),
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) }),
8427
+ /* @__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) }),
8358
8428
  (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx28("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
8359
8429
  ] }),
8360
8430
  (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: [
@@ -8381,8 +8451,8 @@ function PartialPayment(props) {
8381
8451
  ] }) })
8382
8452
  ] }),
8383
8453
  /* @__PURE__ */ jsxs17("div", { className: "form-group", style: { marginTop: "20px", padding: "0" }, children: [
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)) })
8454
+ (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" }),
8455
+ /* @__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)) })
8386
8456
  ] })
8387
8457
  ]
8388
8458
  }
@@ -8421,14 +8491,14 @@ function PartialPayment(props) {
8421
8491
  maxLength: 100,
8422
8492
  placeholder: "Order Id",
8423
8493
  disabled: true,
8424
- value: (_k = props == null ? void 0 : props.orderID) != null ? _k : "",
8494
+ value: (_l = props == null ? void 0 : props.orderID) != null ? _l : "",
8425
8495
  style: { background: "#F6F6F7", color: "#727272" }
8426
8496
  }
8427
8497
  )
8428
8498
  ] }),
8429
8499
  /* @__PURE__ */ jsxs17("div", { className: "form-group", children: [
8430
8500
  /* @__PURE__ */ jsx28("label", { htmlFor: "zip", children: "ZIP" }),
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) }),
8501
+ /* @__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) }),
8432
8502
  (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx28("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
8433
8503
  ] }),
8434
8504
  (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: [
@@ -8455,8 +8525,8 @@ function PartialPayment(props) {
8455
8525
  ] }) })
8456
8526
  ] }),
8457
8527
  /* @__PURE__ */ jsxs17("div", { className: "form-group", style: { marginTop: "20px", padding: "0" }, children: [
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)) })
8528
+ (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" }),
8529
+ /* @__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)) })
8460
8530
  ] })
8461
8531
  ] })
8462
8532
  ] }),
@@ -8472,7 +8542,7 @@ function PartialPayment(props) {
8472
8542
  /* @__PURE__ */ jsx28(CardList, { listHeading: "Banks", paymentGateway: paymentData == null ? void 0 : paymentData.paymentGateway, ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
8473
8543
  setActiveinBank("form");
8474
8544
  } }),
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)) }) })
8545
+ /* @__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)) }) })
8476
8546
  ] }) : /* @__PURE__ */ jsxs17("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
8477
8547
  if (e.key === "Enter" && loading2) {
8478
8548
  e.preventDefault();
@@ -8485,7 +8555,7 @@ function PartialPayment(props) {
8485
8555
  }, children: [
8486
8556
  /* @__PURE__ */ jsxs17("div", { className: "form-group mb-4", children: [
8487
8557
  /* @__PURE__ */ jsx28("label", { htmlFor: "nameonaccount", children: "Name on account" }),
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 }),
8558
+ /* @__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 }),
8489
8559
  (achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx28("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
8490
8560
  ] }),
8491
8561
  /* @__PURE__ */ jsxs17("div", { className: "form-group mb-4", children: [
@@ -8499,7 +8569,7 @@ function PartialPayment(props) {
8499
8569
  maxLength: 9,
8500
8570
  placeholder: "000000000",
8501
8571
  name: "routingNumber",
8502
- value: (_s = achData == null ? void 0 : achData.routingNumber) != null ? _s : "",
8572
+ value: (_t = achData == null ? void 0 : achData.routingNumber) != null ? _t : "",
8503
8573
  onChange: handleChangeAch
8504
8574
  }
8505
8575
  ),
@@ -8516,7 +8586,7 @@ function PartialPayment(props) {
8516
8586
  maxLength: 16,
8517
8587
  placeholder: "0000000000",
8518
8588
  name: "accountNumber",
8519
- value: (_t = achData == null ? void 0 : achData.accountNumber) != null ? _t : "",
8589
+ value: (_u = achData == null ? void 0 : achData.accountNumber) != null ? _u : "",
8520
8590
  onChange: handleChangeAch
8521
8591
  }
8522
8592
  ),
@@ -8533,7 +8603,7 @@ function PartialPayment(props) {
8533
8603
  maxLength: 16,
8534
8604
  placeholder: "0000000000",
8535
8605
  name: "confirmAccountNumber",
8536
- value: (_u = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _u : "",
8606
+ value: (_v = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _v : "",
8537
8607
  onChange: handleChangeAch
8538
8608
  }
8539
8609
  ),
@@ -8550,7 +8620,7 @@ function PartialPayment(props) {
8550
8620
  maxLength: 100,
8551
8621
  placeholder: "My Bank",
8552
8622
  name: "bankName",
8553
- value: (_v = achData == null ? void 0 : achData.bankName) != null ? _v : "",
8623
+ value: (_w = achData == null ? void 0 : achData.bankName) != null ? _w : "",
8554
8624
  onChange: handleChangeAch
8555
8625
  }
8556
8626
  ),
@@ -8567,7 +8637,7 @@ function PartialPayment(props) {
8567
8637
  maxLength: 100,
8568
8638
  placeholder: "My Company",
8569
8639
  name: "companyName",
8570
- value: (_w = achData == null ? void 0 : achData.companyName) != null ? _w : "",
8640
+ value: (_x = achData == null ? void 0 : achData.companyName) != null ? _x : "",
8571
8641
  onChange: handleChangeAch
8572
8642
  }
8573
8643
  ),
@@ -8575,7 +8645,7 @@ function PartialPayment(props) {
8575
8645
  ] }),
8576
8646
  /* @__PURE__ */ jsxs17("div", { className: "form-group mb-4", children: [
8577
8647
  /* @__PURE__ */ jsx28("label", { htmlFor: "accounttype", children: "Select account type" }),
8578
- /* @__PURE__ */ jsxs17("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_x = achData == null ? void 0 : achData.accountType) != null ? _x : "", onChange: handleChangeAch, children: [
8648
+ /* @__PURE__ */ jsxs17("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_y = achData == null ? void 0 : achData.accountType) != null ? _y : "", onChange: handleChangeAch, children: [
8579
8649
  /* @__PURE__ */ jsx28("option", { value: "", children: "Select account" }),
8580
8650
  accountTypes.map((type) => /* @__PURE__ */ jsx28("option", { value: type.value, children: type.label }, type.value))
8581
8651
  ] })
@@ -8609,7 +8679,7 @@ function PartialPayment(props) {
8609
8679
  " to have my permission to charge this bank account for agreed upon purchases in the future."
8610
8680
  ] }) })
8611
8681
  ] }),
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)) }) })
8682
+ /* @__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)) }) })
8613
8683
  ] })
8614
8684
  ] })
8615
8685
  ] }) }) })
@@ -8624,7 +8694,7 @@ function PartialPayment(props) {
8624
8694
  }
8625
8695
 
8626
8696
  // src/app/components/Skysystemz/PayButtonWithForm.tsx
8627
- import { useEffect as useEffect16, useState as useState11, useMemo } from "react";
8697
+ import { useEffect as useEffect18, useState as useState12, useMemo } from "react";
8628
8698
 
8629
8699
  // src/app/components/Skysystemz/SkyChargewidgetstyles.tsx
8630
8700
  import { jsx as jsx29 } from "react/jsx-runtime";
@@ -8860,6 +8930,17 @@ function SkyChargewidgetstyles() {
8860
8930
  text-align : left !important;
8861
8931
  text-transform: uppercase !important;
8862
8932
  }
8933
+ .frac-form .frac-fee-text{
8934
+ display: block;
8935
+ padding: 10px 0 4px;
8936
+ font-family: 'IBM Plex Mono', monospace !important;
8937
+ color: #727272 !important;
8938
+ font-size: 12px;
8939
+ line-height: 1.4;
8940
+ }
8941
+ .frac-form .frac-fee-amount{
8942
+ color: #c62828 !important;
8943
+ }
8863
8944
  .form-control-frac{
8864
8945
  display: block;
8865
8946
  width: 100%;
@@ -8894,7 +8975,7 @@ function SkyChargewidgetstyles() {
8894
8975
  }
8895
8976
  .exp-date-year-container .form-group {
8896
8977
  flex: 1;
8897
- padding-left:.75rem;
8978
+ padding-left:.75rem !important;
8898
8979
  }
8899
8980
  .card-crdi {
8900
8981
  display: flex;
@@ -8911,7 +8992,7 @@ function SkyChargewidgetstyles() {
8911
8992
  }
8912
8993
  .exp-date-year-container .form-group-frac{
8913
8994
  flex:1;
8914
- padding: 0px !important
8995
+ // padding: 0px !important
8915
8996
 
8916
8997
  }
8917
8998
 
@@ -9412,13 +9493,54 @@ margin:0px !important;
9412
9493
  padding:0px !important;
9413
9494
  }
9414
9495
 
9415
-
9496
+
9497
+ .toggle-num-wrapper-new div#card_number {
9498
+ display: block !important;
9499
+ }
9500
+ .toggle-num-wrapper-new .input-main-wrap-frac {
9501
+ height: 36px;
9502
+ }
9503
+ .toggle-num-wrapper-new:focus {
9504
+ border: 1px solid #004eab !important;
9505
+ }
9506
+ .frac-or {
9507
+ position: relative;
9508
+ margin: 15px 0;
9509
+ text-align: center;
9510
+ }
9511
+ .frac-or:before {
9512
+ position: absolute;
9513
+ left: 0;
9514
+ transform: translateY(-50%);
9515
+ top: 50%;
9516
+ height: 1px;
9517
+ width: 100%;
9518
+ background: #E0DFE2;
9519
+ content: '';
9520
+ z-index: 1;
9521
+ }
9522
+ .frac-or span {
9523
+ background: transparent;
9524
+ font-size: 13px;
9525
+ margin: 0 auto;
9526
+ width: 15px;
9527
+ font-weight: 500;
9528
+ text-transform: uppercase;
9529
+ color: #727272;
9530
+ padding: 3px;
9531
+ position: relative;
9532
+ z-index: 3;
9533
+ }
9534
+ button#gpay-button-online-api-id{
9535
+ width: 100%;
9536
+ }
9537
+
9416
9538
 
9417
9539
  ` });
9418
9540
  }
9419
9541
 
9420
9542
  // src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
9421
- import { useCallback, useEffect as useEffect15, useRef as useRef10, useState as useState10 } from "react";
9543
+ import { useCallback, useEffect as useEffect17, useRef as useRef12, useState as useState11 } from "react";
9422
9544
  import axios9 from "axios";
9423
9545
  import Swal5 from "sweetalert2";
9424
9546
 
@@ -9559,109 +9681,571 @@ function CheckoutWrapper({ clientSecret, onSuccess, showLoader, setError, sessio
9559
9681
  // src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
9560
9682
  import { IoArrowBack as IoArrowBack4 } from "react-icons/io5";
9561
9683
  import { NumericFormat as NumericFormat2 } from "react-number-format";
9562
- import { Fragment as Fragment18, jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
9563
- var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_token, customerId, callback, merchantName = "merchant", isPreAuth, surcharge = "0", submitBtnClass, submitBtnIcon, isRequest, pass_fee, pass_fee_amount, require3ds = false, autoTrigger = false, show, setShow, setHandleCloseRef, isPartial, bankSurcharge, partialRef, loadingPrev = false, orderGuid: ordGuid, remainingAmount: remAmount }) => {
9564
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
9565
- const hasRunRef = useRef10(false);
9566
- const cardListRunRef = useRef10(false);
9567
- const threeDSContainerRef = useRef10(null);
9568
- const [activetab, setActive] = useState10("card");
9569
- const [activeList, setActiveList] = useState10("card");
9570
- const [cardData, setCardData] = useState10();
9571
- const [cardError, setCardError] = useState10({});
9572
- const [achData, setAchData] = useState10();
9573
- const [achError, setAchError] = useState10({});
9574
- const [saveACHinfo, setSaveACHinfo] = useState10(false);
9575
- const [saveCardInfo, setSaveCardInfo] = useState10(false);
9576
- const [error, setError] = useState10("");
9577
- const [errorIframe, setErrorIframe] = useState10("");
9578
- const [success, setSuccess] = useState10(false);
9579
- let [tranId, setTranId] = useState10("");
9580
- const [loading, setLoading] = useState10(false);
9581
- const [loading2, setLoading2] = useState10(false);
9582
- const [loadingIframe, setLoadingIframe] = useState10(false);
9583
- const [cardList, setCardList] = useState10([]);
9584
- const [bankList, setBankList] = useState10([]);
9585
- const [selectedCard, setSelectedCard] = useState10();
9586
- const [cashDiscount, setCashDiscount] = useState10(Number(amount));
9587
- const [activeinCard, setActiveinCard] = useState10("form");
9588
- const [activeinBank, setActiveinBank] = useState10("form");
9589
- const [isBankActive, setIsBankActive] = useState10(false);
9590
- const [processingFee, setProcessingFee] = useState10(0);
9591
- const [clientSecret, setClientSecret] = useState10("");
9592
- const [errorMessage, setErrorMessage] = useState10(null);
9593
- const [initialLoader, setInitialLoader] = useState10(false);
9594
- const [is3DSEnable, setIs3DSEnable] = useState10(false);
9595
- const [stripeResponse, setStripeResponse] = useState10(null);
9596
- const [orderLoader, setOrderLoader] = useState10(false);
9597
- const [orderGuid, setOrderGuid] = useState10(ordGuid || null);
9598
- const [partialAmount, setPartialAmount] = useState10("");
9599
- const [partialError, setPartialError] = useState10("");
9600
- const [remainingAmount, setRemainingAmount] = useState10("");
9601
- const [paymentGateway, setPaymentGateway] = useState10();
9602
- const [dcToken, setDCToken] = useState10();
9603
- const [isBankConsentChecked, setIsBankConsentChecked] = useState10(false);
9604
- const [errorBankConsent, setErrorBankConsent] = useState10("");
9605
- let mastercard2 = S3Url + "widget/mc-img.svg";
9606
- let visa2 = S3Url + "widget/visa-img.svg";
9607
- let americanexp2 = S3Url + "widget/ae-img.svg";
9608
- let discover2 = S3Url + "widget/discover-img.svg";
9609
- let defaultcard2 = S3Url + "widget/card.svg";
9610
- let trash2 = S3Url + "widget/Trash.svg";
9611
- let bank2 = S3Url + "widget/bank.svg";
9612
- let secure2 = S3Url + "widget/secure-img.png";
9613
- let pov2 = S3Url + "widget/pov-by.png";
9614
- let pax2 = S3Url + "widget/pax.svg";
9615
- let cardicon = S3Url + "widget/cardicon.svg";
9616
- let bankicon = S3Url + "widget/bankicon.svg";
9617
- const showLoader = () => setLoading(true);
9618
- const hideLoader = () => setLoading(false);
9619
- const CalculateCashDiscount = (amount2, surcharge2) => {
9620
- const surchargeVal = (parseFloat(surcharge2) || 0) / 100;
9621
- const originalAmount = amount2 / (1 + surchargeVal);
9622
- return Math.round(originalAmount * 100) / 100;
9684
+
9685
+ // src/app/components/ErrorCardMessage/ErrorCardOverlaystyle.tsx
9686
+ import { jsx as jsx32 } from "react/jsx-runtime";
9687
+ function ErrorCardOverlayStyle() {
9688
+ return /* @__PURE__ */ jsx32("style", { children: `
9689
+ .card-error-overlay .logo-container {
9690
+ display: flex;
9691
+ justify-content: center;
9692
+ align-items: center;
9693
+ margin-bottom: -50px; /* Adjust this to overlap the content */
9694
+ z-index: 10;
9695
+ }
9696
+
9697
+ .card-error-overlay .client-logo {
9698
+ max-width: 100px;
9699
+ height: auto;
9700
+ object-fit: contain;
9701
+ display: block;
9702
+ }
9703
+
9704
+
9705
+ .card-error-overlay .error-icon-overlay {
9706
+ display: flex;
9707
+ flex-direction: column;
9708
+ align-items: center;
9709
+ gap: 12px;
9710
+ min-height: 116px;
9711
+ z-index: 2;
9712
+ }
9713
+
9714
+ .card-error-overlay .circle {
9715
+ width: 50px;
9716
+ height: 50px;
9717
+ border: 1px solid red;
9718
+ border-radius: 50%;
9719
+ display: flex;
9720
+ justify-content: center;
9721
+ align-items: center;
9722
+ margin-bottom:20px
9723
+ }
9724
+
9725
+ .card-error-overlay .circle .fa-times {
9726
+ font-size: 30px;
9727
+ color: red;
9728
+ }
9729
+
9730
+ .card-error-overlay .error-text-overlay {
9731
+ display: flex;
9732
+ flex-direction: column;
9733
+ justify-content: center;
9734
+ align-items: center;
9735
+ gap: 4px;
9736
+ // width: 227px;
9737
+ }
9738
+
9739
+ .card-error-overlay .payment-error-text-overlay {
9740
+ font-family: 'Inter', sans-serif;
9741
+ font-weight: 500;
9742
+ font-size: 18px;
9743
+ line-height: 21px;
9744
+ text-align: center;
9745
+ letter-spacing: -0.02em;
9746
+ color: #161616;
9747
+ }
9748
+
9749
+ .card-error-overlay .thank-you-text-overlay {
9750
+ font-family: 'Inter', sans-serif;
9751
+ font-weight: 500;
9752
+ font-size: 16px;
9753
+ line-height: 18px;
9754
+ text-align: center;
9755
+ letter-spacing: -0.02em;
9756
+ color: #161616 !important;
9757
+ opacity: 0.5;
9758
+ padding-top:10px
9759
+ }
9760
+
9761
+ .card-error-overlay .error-btn-div-overlay{
9762
+ padding-top:20px;
9763
+ width: 100%;
9764
+
9765
+ }
9766
+ .card-error-overlay .error-btn-div-overlay button{
9767
+ outline: 0;
9768
+ height: 46px;
9769
+ font-size: 16px;
9770
+ background: #727272;
9771
+ border: none;
9772
+ display: block;
9773
+ color: #fff;
9774
+ width: 100%;
9775
+ border-radius: 180px;
9776
+ margin: 10px 0;
9777
+ text-decoration: none;
9778
+ }
9779
+ .card-error-overlay .error-btn-div-overlay button:hover, .card-error-overlay .error-btn-div-overlay button:focus {
9780
+ background: #222;
9781
+ color: #fff;
9782
+ cursor: pointer;
9783
+ }
9784
+ .payment-error-container-overlay {
9785
+ width: fit-content;
9786
+ position: relative;
9787
+ top: 50%;
9788
+ left: 50%;
9789
+ transform: translate(-50%, -50%);
9790
+ background: rgba(255, 255, 255, 0.15);
9791
+ backdrop-filter: blur(12px);
9792
+ -webkit-backdrop-filter: blur(12px);
9793
+ border-radius: 12px;
9794
+ z-index: 11111;
9795
+ max-width: 240px;
9796
+ min-width: 224px;
9797
+ padding: 20px;
9798
+ margin-left: 17px !important;
9799
+ }
9800
+ .card-error-overlay {
9801
+ position: absolute;
9802
+ top: 0;
9803
+ left: 0;
9804
+ width: 100%;
9805
+ height: 100%;
9806
+ background: rgb(87 87 87 / 15%);
9807
+ backdrop-filter: blur(2px);
9808
+ -webkit-backdrop-filter: blur(12px);
9809
+ z-index: 1111;
9810
+ }
9811
+ ` });
9812
+ }
9813
+
9814
+ // src/app/components/ErrorCardMessage/ErrorCardOverlay.tsx
9815
+ import { Fragment as Fragment18, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
9816
+ var ErrorCardOverlay = ({ onClose, error, autoTrigger = false }) => {
9817
+ return /* @__PURE__ */ jsxs19(Fragment18, { children: [
9818
+ /* @__PURE__ */ jsx33(ErrorCardOverlayStyle, {}),
9819
+ /* @__PURE__ */ jsx33("div", { className: "card-error-overlay", children: /* @__PURE__ */ jsx33("div", { className: "payment-error-container-overlay", children: /* @__PURE__ */ jsxs19("div", { className: "error-icon-overlay", children: [
9820
+ /* @__PURE__ */ jsx33("div", { className: "circle", children: /* @__PURE__ */ jsx33("i", { className: "fa fa-times", "aria-hidden": "true" }) }),
9821
+ /* @__PURE__ */ jsxs19("div", { className: "error-text-overlay", children: [
9822
+ /* @__PURE__ */ jsx33("div", { className: "payment-error-text-overlay", children: error }),
9823
+ /* @__PURE__ */ jsx33("div", { className: "thank-you-text-overlay", children: "Try again later " })
9824
+ ] }),
9825
+ !autoTrigger && /* @__PURE__ */ jsx33("div", { className: "error-btn-div-overlay", children: /* @__PURE__ */ jsx33("button", { onClick: onClose, children: "OK" }) })
9826
+ ] }) }) })
9827
+ ] });
9828
+ };
9829
+ var ErrorCardOverlay_default = ErrorCardOverlay;
9830
+
9831
+ // src/app/components/Atoms/Googlepay/Googlepay.tsx
9832
+ import { useRef as useRef10 } from "react";
9833
+ import Script from "next/script";
9834
+ import { Fragment as Fragment19, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
9835
+ function GooglePayComponent({
9836
+ amount,
9837
+ googlePayEnvironment: googlePayEnvironment2,
9838
+ googlePayGatewayMerchantId: googlePayGatewayMerchantId2,
9839
+ googlePayMerchantId: googlePayMerchantId2,
9840
+ googlePayMerchantName,
9841
+ require3ds = false,
9842
+ completeFractalFlow,
9843
+ setLoading
9844
+ }) {
9845
+ const containerRef = useRef10(null);
9846
+ const paymentsClientRef = useRef10(null);
9847
+ const baseRequest = {
9848
+ apiVersion: 2,
9849
+ apiVersionMinor: 0
9623
9850
  };
9624
- const tokenizerRef = useRef10(null);
9625
- const fractalStyles = {
9626
- input: {
9627
- "font-family": "'Inter', sans-serif",
9628
- "font-size": "16px",
9629
- "color": "#212529",
9630
- "background-color": "transparent",
9631
- "padding": "0px",
9632
- "appearance": "none",
9633
- "outline": "none",
9634
- "border": "none",
9635
- "box-shadow": "none"
9636
- },
9637
- ":focus": {
9638
- "color": "#212529",
9639
- "outline": "none",
9640
- "border": "none"
9641
- },
9642
- "::placeholder": {
9643
- "color": "#212529"
9851
+ const allowedCardNetworks = ["AMEX", "DISCOVER", "MASTERCARD", "VISA"];
9852
+ const allowedCardAuthMethods = require3ds ? ["CRYPTOGRAM_3DS"] : ["PAN_ONLY", "CRYPTOGRAM_3DS"];
9853
+ const baseCardPaymentMethod = {
9854
+ type: "CARD",
9855
+ parameters: {
9856
+ allowedAuthMethods: allowedCardAuthMethods,
9857
+ allowedCardNetworks
9644
9858
  }
9645
9859
  };
9646
- const handleCharge = async (data) => {
9647
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
9860
+ const cardPaymentMethod = __spreadProps(__spreadValues({}, baseCardPaymentMethod), {
9861
+ tokenizationSpecification: {
9862
+ type: "PAYMENT_GATEWAY",
9863
+ parameters: {
9864
+ gateway: googlePayGatewayMerchantId2,
9865
+ gatewayMerchantId: googlePayGatewayMerchantId2
9866
+ }
9867
+ }
9868
+ });
9869
+ const handlePaymentAuthorization = async (paymentData) => {
9870
+ var _a, _b;
9648
9871
  try {
9649
- let dataObj = __spreadValues({
9650
- pass_fee_amount: Number(amount) - cashDiscount,
9651
- pass_fee,
9652
- Token: data == null ? void 0 : data.Token,
9653
- amount: partialAmount ? partialAmount : amount,
9654
- postal_code: data == null ? void 0 : data.postalCode,
9655
- require3ds,
9656
- isPartial,
9657
- orderGuid: orderGuid || ordGuid
9658
- }, saveCardInfo ? {
9872
+ const token = (_b = (_a = paymentData == null ? void 0 : paymentData.paymentMethodData) == null ? void 0 : _a.tokenizationData) == null ? void 0 : _b.token;
9873
+ if (!token) throw new Error("Missing token");
9874
+ const parsed = JSON.parse(token);
9875
+ console.log(parsed, "parsed token");
9876
+ setLoading(true);
9877
+ completeFractalFlow(parsed, null, "google_pay");
9878
+ return {
9879
+ transactionState: "SUCCESS"
9880
+ // CLOSES GOOGLE PAY POPUP
9881
+ };
9882
+ } catch (err) {
9883
+ console.error("Payment failed:", err);
9884
+ return {
9885
+ transactionState: "ERROR",
9886
+ // ❌ CLOSES WITH ERROR UI
9887
+ error: {
9888
+ intent: "PAYMENT_AUTHORIZATION",
9889
+ message: "Payment failed",
9890
+ reason: "PAYMENT_DATA_INVALID"
9891
+ }
9892
+ };
9893
+ }
9894
+ };
9895
+ const getPaymentsClient = () => {
9896
+ if (!paymentsClientRef.current && typeof window !== "undefined") {
9897
+ const google = window.google;
9898
+ if (!google) return null;
9899
+ paymentsClientRef.current = new google.payments.api.PaymentsClient({
9900
+ environment: googlePayEnvironment2,
9901
+ // ✅ ADD THIS
9902
+ paymentDataCallbacks: {
9903
+ onPaymentAuthorized: handlePaymentAuthorization
9904
+ }
9905
+ });
9906
+ }
9907
+ return paymentsClientRef.current;
9908
+ };
9909
+ const getIsReadyToPayRequest = () => __spreadProps(__spreadValues({}, baseRequest), {
9910
+ allowedPaymentMethods: [baseCardPaymentMethod]
9911
+ });
9912
+ const getTransactionInfo = () => ({
9913
+ countryCode: "US",
9914
+ currencyCode: "USD",
9915
+ totalPriceStatus: "FINAL",
9916
+ totalPrice: amount,
9917
+ checkoutOption: "COMPLETE_IMMEDIATE_PURCHASE"
9918
+ });
9919
+ const getPaymentDataRequest = () => __spreadProps(__spreadValues({}, baseRequest), {
9920
+ allowedPaymentMethods: [cardPaymentMethod],
9921
+ transactionInfo: getTransactionInfo(),
9922
+ merchantInfo: {
9923
+ merchantId: googlePayMerchantId2,
9924
+ merchantName: googlePayMerchantName
9925
+ },
9926
+ // ✅ ADD THIS
9927
+ callbackIntents: ["PAYMENT_AUTHORIZATION"]
9928
+ });
9929
+ const initializeGooglePay = async () => {
9930
+ try {
9931
+ const client = getPaymentsClient();
9932
+ const response = await client.isReadyToPay(
9933
+ getIsReadyToPayRequest()
9934
+ );
9935
+ if (response.result && containerRef.current) {
9936
+ const button = client.createButton({
9937
+ onClick: onGooglePayClick,
9938
+ allowedPaymentMethods: [baseCardPaymentMethod],
9939
+ buttonType: "pay",
9940
+ buttonColor: "black",
9941
+ buttonRadius: 8
9942
+ });
9943
+ containerRef.current.innerHTML = "";
9944
+ containerRef.current.appendChild(button);
9945
+ }
9946
+ } catch (err) {
9947
+ console.error("Google Pay init error:", err);
9948
+ }
9949
+ };
9950
+ const onGooglePayClick = async () => {
9951
+ const client = getPaymentsClient();
9952
+ try {
9953
+ await client.loadPaymentData(getPaymentDataRequest());
9954
+ } catch (err) {
9955
+ if ((err == null ? void 0 : err.statusCode) !== "CANCELED") {
9956
+ console.error(err);
9957
+ }
9958
+ }
9959
+ };
9960
+ const processPayment = async (paymentData) => {
9961
+ var _a, _b;
9962
+ console.log(paymentData, "paymentData");
9963
+ try {
9964
+ const token = (_b = (_a = paymentData == null ? void 0 : paymentData.paymentMethodData) == null ? void 0 : _a.tokenizationData) == null ? void 0 : _b.token;
9965
+ if (!token) throw new Error("Missing token");
9966
+ const parsed = JSON.parse(token);
9967
+ console.log(parsed, "pararararqr");
9968
+ alert("Payment successful!");
9969
+ } catch (err) {
9970
+ console.error("Processing error:", err);
9971
+ alert("Payment processing failed");
9972
+ } finally {
9973
+ setLoading(false);
9974
+ }
9975
+ };
9976
+ const onScriptLoad = () => {
9977
+ if (!googlePayEnvironment2 || !googlePayGatewayMerchantId2 || !amount || !googlePayMerchantId2) {
9978
+ console.error("Missing Google Pay config");
9979
+ return;
9980
+ }
9981
+ initializeGooglePay();
9982
+ };
9983
+ return /* @__PURE__ */ jsxs20(Fragment19, { children: [
9984
+ /* @__PURE__ */ jsx34("div", { ref: containerRef, className: "text-center" }),
9985
+ /* @__PURE__ */ jsx34(
9986
+ Script,
9987
+ {
9988
+ src: "https://pay.google.com/gp/p/js/pay.js",
9989
+ strategy: "afterInteractive",
9990
+ onLoad: onScriptLoad
9991
+ }
9992
+ )
9993
+ ] });
9994
+ }
9995
+
9996
+ // src/app/components/Atoms/Applepay/ApplePayButton.tsx
9997
+ import { useEffect as useEffect16, useRef as useRef11 } from "react";
9998
+ import { jsx as jsx35 } from "react/jsx-runtime";
9999
+ function ApplePayButton({
10000
+ applePayMerchantId: applePayMerchantId2,
10001
+ applePayAmount,
10002
+ applePayMerchantName,
10003
+ showLoader,
10004
+ completeFractalFlow
10005
+ }) {
10006
+ const applePayRef = useRef11(null);
10007
+ const paymentRequestMethods = [
10008
+ {
10009
+ supportedMethods: "https://apple.com/apple-pay",
10010
+ data: {
10011
+ version: 3,
10012
+ merchantIdentifier: applePayMerchantId2,
10013
+ // ✅ FIXED
10014
+ merchantCapabilities: ["supports3DS"],
10015
+ supportedNetworks: ["amex", "discover", "mastercard", "visa"],
10016
+ // ✅ FIXED
10017
+ countryCode: "US"
10018
+ }
10019
+ }
10020
+ ];
10021
+ const paymentRequestOptions = {
10022
+ requestPayerName: false,
10023
+ requestPayerEmail: false,
10024
+ requestPayerPhone: false,
10025
+ requestShipping: false
10026
+ };
10027
+ function buildPaymentDetails() {
10028
+ return {
10029
+ total: {
10030
+ label: applePayMerchantName,
10031
+ amount: {
10032
+ currency: "USD",
10033
+ value: applePayAmount
10034
+ }
10035
+ }
10036
+ };
10037
+ }
10038
+ async function validateMerchant(event) {
10039
+ console.log("\u{1F7E1} STEP 1: Merchant validation started");
10040
+ try {
10041
+ console.log("Validation URL:", event.validationURL);
10042
+ console.log("Domain:", window.location.hostname);
10043
+ const res = await fetch(
10044
+ `${masterBaseUrl}api/v1/widget/generate-apple-pay-session`,
10045
+ {
10046
+ method: "POST",
10047
+ headers: {
10048
+ "Content-Type": "application/json"
10049
+ },
10050
+ body: JSON.stringify({
10051
+ validationUrl: event.validationURL,
10052
+ applePayMerchantId: applePayMerchantId2,
10053
+ applepayDisplayName: applePayMerchantName,
10054
+ requestDomain: window.location.hostname
10055
+ // ✅ IMPORTANT
10056
+ })
10057
+ }
10058
+ );
10059
+ console.log("\u{1F7E1} STEP 2: Response status:", res.status);
10060
+ const data = await res.json();
10061
+ console.log("\u{1F7E2} STEP 3: Session response:", data);
10062
+ if (!data) {
10063
+ console.log("\u274C Invalid session data");
10064
+ event.complete(null);
10065
+ return;
10066
+ }
10067
+ console.log("\u{1F7E2} STEP 4: Completing merchant validation");
10068
+ event.complete(data);
10069
+ } catch (err) {
10070
+ console.log("\u274C Merchant validation failed:", err == null ? void 0 : err.message);
10071
+ event.complete(null);
10072
+ }
10073
+ }
10074
+ async function authorizePayment(paymentResponse) {
10075
+ console.log("\u{1F7E1} STEP 5: Authorizing payment");
10076
+ try {
10077
+ const token = paymentResponse.details.token.paymentData;
10078
+ console.log("\u{1F7E2} STEP 6: Got token");
10079
+ await completeFractalFlow(token, null, "apple_pay");
10080
+ await paymentResponse.complete("success");
10081
+ console.log("\u2705 Payment completed successfully");
10082
+ } catch (err) {
10083
+ console.log("\u274C Authorization failed:", err == null ? void 0 : err.message);
10084
+ await paymentResponse.complete("fail");
10085
+ }
10086
+ }
10087
+ async function handleApplePayClick() {
10088
+ console.log("\u{1F7E1} STEP A: Click detected");
10089
+ try {
10090
+ const request = new PaymentRequest(
10091
+ paymentRequestMethods,
10092
+ buildPaymentDetails(),
10093
+ paymentRequestOptions
10094
+ );
10095
+ request.onmerchantvalidation = validateMerchant;
10096
+ console.log("\u{1F7E1} STEP B: Calling show()");
10097
+ const response = await request.show();
10098
+ console.log("\u{1F7E2} STEP C: Payment sheet opened");
10099
+ await authorizePayment(response);
10100
+ } catch (err) {
10101
+ console.log("\u274C Apple Pay flow failed:", err == null ? void 0 : err.message);
10102
+ }
10103
+ }
10104
+ useEffect16(() => {
10105
+ if (window.ApplePaySession && window.ApplePaySession.canMakePayments()) {
10106
+ console.log("\u2705 Apple Pay is available");
10107
+ } else {
10108
+ console.log("\u274C Apple Pay NOT available");
10109
+ }
10110
+ }, []);
10111
+ useEffect16(() => {
10112
+ const btn = applePayRef.current;
10113
+ if (!btn) return;
10114
+ const handleClick = () => handleApplePayClick();
10115
+ btn.addEventListener("click", handleClick);
10116
+ return () => {
10117
+ btn.removeEventListener("click", handleClick);
10118
+ };
10119
+ }, []);
10120
+ return /* @__PURE__ */ jsx35("div", { children: /* @__PURE__ */ jsx35(
10121
+ "apple-pay-button",
10122
+ {
10123
+ ref: applePayRef,
10124
+ buttonstyle: "black",
10125
+ type: "pay",
10126
+ locale: "en-US"
10127
+ }
10128
+ ) });
10129
+ }
10130
+
10131
+ // src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
10132
+ import { Fragment as Fragment20, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
10133
+ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_token, customerId, callback, merchantName = "merchant", isPreAuth, surcharge = "0", submitBtnClass, submitBtnIcon, isRequest, pass_fee, pass_fee_amount, require3ds = false, autoTrigger = false, show, setShow, setHandleCloseRef, isPartial, bankSurcharge, partialRef, loadingPrev = false, orderGuid: ordGuid, remainingAmount: remAmount, onSubmit, onLoad = true }) => {
10134
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
10135
+ const hasRunRef = useRef12(false);
10136
+ const cardFormRef = useRef12(null);
10137
+ const bankFormRef = useRef12(null);
10138
+ const expiryYearRef = useRef12(null);
10139
+ const expiryMonthRef = useRef12(null);
10140
+ const cardListRunRef = useRef12(false);
10141
+ const threeDSContainerRef = useRef12(null);
10142
+ const [activetab, setActive] = useState11("card");
10143
+ const [activeList, setActiveList] = useState11("card");
10144
+ const [cardData, setCardData] = useState11();
10145
+ const [cardError, setCardError] = useState11({});
10146
+ const [achData, setAchData] = useState11();
10147
+ const [achError, setAchError] = useState11({});
10148
+ const [saveACHinfo, setSaveACHinfo] = useState11(false);
10149
+ const [saveCardInfo, setSaveCardInfo] = useState11(false);
10150
+ const [error, setError] = useState11("");
10151
+ const [errorIframe, setErrorIframe] = useState11("");
10152
+ const [success, setSuccess] = useState11(false);
10153
+ let [tranId, setTranId] = useState11("");
10154
+ const [loading, setLoading] = useState11(false);
10155
+ const [loading2, setLoading2] = useState11(false);
10156
+ const [loadingIframe, setLoadingIframe] = useState11(false);
10157
+ const [cardList, setCardList] = useState11([]);
10158
+ const [bankList, setBankList] = useState11([]);
10159
+ const [selectedCard, setSelectedCard] = useState11();
10160
+ const [cashDiscount, setCashDiscount] = useState11(Number(amount));
10161
+ const [activeinCard, setActiveinCard] = useState11("form");
10162
+ const [activeinBank, setActiveinBank] = useState11("form");
10163
+ const [isBankActive, setIsBankActive] = useState11(false);
10164
+ const [processingFee, setProcessingFee] = useState11(0);
10165
+ const [clientSecret, setClientSecret] = useState11("");
10166
+ const [errorMessage, setErrorMessage] = useState11(null);
10167
+ const [initialLoader, setInitialLoader] = useState11(false);
10168
+ const [is3DSEnable, setIs3DSEnable] = useState11(false);
10169
+ const [stripeResponse, setStripeResponse] = useState11(null);
10170
+ const [orderLoader, setOrderLoader] = useState11(false);
10171
+ const [orderGuid, setOrderGuid] = useState11(ordGuid || null);
10172
+ const [partialAmount, setPartialAmount] = useState11("");
10173
+ const [partialError, setPartialError] = useState11("");
10174
+ const [remainingAmount, setRemainingAmount] = useState11("");
10175
+ const [paymentGateway, setPaymentGateway] = useState11();
10176
+ const [dcToken, setDCToken] = useState11();
10177
+ const [isBankConsentChecked, setIsBankConsentChecked] = useState11(false);
10178
+ const [errorBankConsent, setErrorBankConsent] = useState11("");
10179
+ let mastercard2 = S3Url + "widget/mc-img.svg";
10180
+ let visa2 = S3Url + "widget/visa-img.svg";
10181
+ let americanexp2 = S3Url + "widget/ae-img.svg";
10182
+ let discover2 = S3Url + "widget/discover-img.svg";
10183
+ let defaultcard2 = S3Url + "widget/card.svg";
10184
+ let trash2 = S3Url + "widget/Trash.svg";
10185
+ let bank2 = S3Url + "widget/bank.svg";
10186
+ let secure2 = S3Url + "widget/secure-img.png";
10187
+ let pov2 = S3Url + "widget/pov-by.png";
10188
+ let pax2 = S3Url + "widget/pax.svg";
10189
+ let cardicon = S3Url + "widget/cardicon.svg";
10190
+ let bankicon = S3Url + "widget/bankicon.svg";
10191
+ let defualtcardborder = S3Url + "widget/defualtcardborder.svg";
10192
+ let unionicon = S3Url + "widget/unionpay.svg";
10193
+ let dinersicon = S3Url + "widget/diners.svg";
10194
+ let jcbicon = S3Url + "widget/jcb.svg";
10195
+ const showLoader = () => setLoading(true);
10196
+ const hideLoader = () => setLoading(false);
10197
+ const CalculateCashDiscount = (amount2, surcharge2) => {
10198
+ const surchargeVal = (parseFloat(surcharge2) || 0) / 100;
10199
+ const originalAmount = amount2 / (1 + surchargeVal);
10200
+ return Math.round(originalAmount * 100) / 100;
10201
+ };
10202
+ const cardFeeAmount = Number(pass_fee_amount || 0);
10203
+ const bankFeeAmount = Number(bankSurcharge || 0);
10204
+ const bankSavingsAmount = Math.max(bankFeeAmount > 0 ? cardFeeAmount - bankFeeAmount : cardFeeAmount, 0);
10205
+ const bankSavingsText = bankSavingsAmount > 0 ? `Save ${formatUSD(bankSavingsAmount.toFixed(2))}` : "";
10206
+ const tokenizerRef = useRef12(null);
10207
+ const fractalStyles = {
10208
+ input: {
10209
+ "font-family": "'Inter', sans-serif",
10210
+ "font-size": "16px",
10211
+ "color": "#212529",
10212
+ "background-color": "transparent",
10213
+ "padding": "0px",
10214
+ "appearance": "none",
10215
+ "outline": "none",
10216
+ "border": "none",
10217
+ "box-shadow": "none"
10218
+ },
10219
+ ":focus": {
10220
+ "color": "#212529",
10221
+ "outline": "none",
10222
+ "border": "none"
10223
+ },
10224
+ "::placeholder": {
10225
+ "color": "#212529"
10226
+ }
10227
+ };
10228
+ const handleCharge = async (data) => {
10229
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
10230
+ try {
10231
+ let dataObj = __spreadValues(__spreadValues({
10232
+ pass_fee_amount: Number(amount) - cashDiscount,
10233
+ pass_fee,
10234
+ Token: data == null ? void 0 : data.Token,
10235
+ amount: partialAmount ? partialAmount : amount,
10236
+ postal_code: data == null ? void 0 : data.postalCode,
10237
+ require3ds,
10238
+ isPartial,
10239
+ orderGuid: orderGuid || ordGuid
10240
+ }, saveCardInfo ? {
9659
10241
  card: {
9660
10242
  postal_code: cardData == null ? void 0 : cardData.zipCode,
9661
10243
  customer_id: customerId,
9662
10244
  gateway_token: (data == null ? void 0 : data.Token) || (data == null ? void 0 : data.gateway_token),
9663
10245
  name: cardData == null ? void 0 : cardData.cardName
9664
10246
  }
10247
+ } : null), (data == null ? void 0 : data.typeoftoken) ? {
10248
+ typeoftoken: data == null ? void 0 : data.typeoftoken
9665
10249
  } : null);
9666
10250
  if (require3ds && (data == null ? void 0 : data.stripe_3ds_auth_id)) {
9667
10251
  dataObj.stripe_3ds_auth_id = data == null ? void 0 : data.stripe_3ds_auth_id;
@@ -9786,19 +10370,28 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9786
10370
  }
9787
10371
  }
9788
10372
  if (!isBankConsentChecked) {
9789
- setErrorBankConsent("Above consent is required");
10373
+ setErrorBankConsent("Above consent is requied");
9790
10374
  }
9791
10375
  setAchError(errors);
9792
10376
  return Object.keys(errors).length > 0 || !isBankConsentChecked;
9793
10377
  };
9794
- const completeFractalFlow = async (tokenizeData, intentid) => {
10378
+ const completeFractalFlow = async (tokenizeData, intentid, typeoftoken) => {
9795
10379
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
9796
10380
  try {
10381
+ if (typeoftoken == "google_pay") {
10382
+ handleCharge({
10383
+ Token: tokenizeData,
10384
+ postalCode: cardData == null ? void 0 : cardData.zipCode,
10385
+ typeoftoken
10386
+ });
10387
+ return;
10388
+ }
9797
10389
  let token = tokenizeData;
9798
10390
  let verifyandsaveresp = await axios9.post(`${masterBaseUrl}api/v1/gateway/verify-and-save/${session_token}`, {
9799
10391
  token,
9800
10392
  require3ds,
9801
- pass_fee
10393
+ pass_fee,
10394
+ typeoftoken
9802
10395
  });
9803
10396
  if ((verifyandsaveresp == null ? void 0 : verifyandsaveresp.status) == 200) {
9804
10397
  let responsetemp = (_a2 = verifyandsaveresp == null ? void 0 : verifyandsaveresp.data) == null ? void 0 : _a2.data;
@@ -9830,7 +10423,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9830
10423
  }
9831
10424
  };
9832
10425
  const handleFractalTokenFlow = async () => {
9833
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t, _u, _v, _w;
10426
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v, _w, _x, _y, _z, _A;
9834
10427
  try {
9835
10428
  const requestOptions = {
9836
10429
  method: "POST",
@@ -9871,17 +10464,29 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9871
10464
  three_ds_data
9872
10465
  );
9873
10466
  } catch (error2) {
9874
- setErrorIframe(error2);
10467
+ console.log(error2, "error in tokenization");
10468
+ let readableMessage = "Something went wrong!";
10469
+ try {
10470
+ const rawError = ((_n2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _n2.data) || (error2 == null ? void 0 : error2.message) || "";
10471
+ const errorText = typeof rawError === "string" ? rawError : JSON.stringify(rawError);
10472
+ const lines = ((_p2 = (_o2 = errorText.split) == null ? void 0 : _o2.call(errorText, "\n")) == null ? void 0 : _p2.filter(Boolean)) || [];
10473
+ const lastLine = lines.at(-1) || "";
10474
+ const parts = (_q2 = lastLine.split) == null ? void 0 : _q2.call(lastLine, ": ");
10475
+ readableMessage = (parts == null ? void 0 : parts.length) > 1 ? parts.pop().trim() : lastLine.trim() || readableMessage;
10476
+ } catch (e) {
10477
+ readableMessage = "Something went wrong!";
10478
+ }
10479
+ setErrorIframe(readableMessage);
9875
10480
  hideLoader();
9876
10481
  }
9877
10482
  if (tokenizeData == null ? void 0 : tokenizeData.token) {
9878
10483
  let ThreedsData = tokenizeData == null ? void 0 : tokenizeData.stripe_three_ds_response;
9879
- if (require3ds && !ThreedsData && (ThreedsData == null ? void 0 : ThreedsData.status) === "200 OK" && ((_n2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _n2.challenge_url)) {
10484
+ if (require3ds && !ThreedsData && (ThreedsData == null ? void 0 : ThreedsData.status) === "200 OK" && ((_r2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _r2.challenge_url)) {
9880
10485
  setError("Something went wrong. Please try again later.");
9881
10486
  }
9882
10487
  if (require3ds) {
9883
- if (!((_o2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _o2.challenge_url)) {
9884
- completeFractalFlow(tokenizeData == null ? void 0 : tokenizeData.token, (_p2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _p2.id);
10488
+ if (!((_s2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _s2.challenge_url)) {
10489
+ completeFractalFlow(tokenizeData == null ? void 0 : tokenizeData.token, (_t2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _t2.id);
9885
10490
  } else {
9886
10491
  hideLoader();
9887
10492
  setStripeResponse(__spreadProps(__spreadValues({}, ThreedsData == null ? void 0 : ThreedsData.data), {
@@ -9897,11 +10502,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9897
10502
  console.log(error2, "error");
9898
10503
  let readableMessage = "Something went wrong!";
9899
10504
  try {
9900
- const rawError = ((_q2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _q2.data) || (error2 == null ? void 0 : error2.message) || "";
10505
+ const rawError = ((_u2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _u2.data) || (error2 == null ? void 0 : error2.message) || "";
9901
10506
  const errorText = typeof rawError === "string" ? rawError : JSON.stringify(rawError);
9902
- const lines = ((_s2 = (_r2 = errorText.split) == null ? void 0 : _r2.call(errorText, "\n")) == null ? void 0 : _s2.filter(Boolean)) || [];
10507
+ const lines = ((_w = (_v = errorText.split) == null ? void 0 : _v.call(errorText, "\n")) == null ? void 0 : _w.filter(Boolean)) || [];
9903
10508
  const lastLine = lines.at(-1) || "";
9904
- const parts = (_t = lastLine.split) == null ? void 0 : _t.call(lastLine, ": ");
10509
+ const parts = (_x = lastLine.split) == null ? void 0 : _x.call(lastLine, ": ");
9905
10510
  readableMessage = (parts == null ? void 0 : parts.length) > 1 ? parts.pop().trim() : lastLine.trim() || readableMessage;
9906
10511
  } catch (e) {
9907
10512
  readableMessage = "Something went wrong!";
@@ -9909,8 +10514,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9909
10514
  setError(readableMessage);
9910
10515
  callback({
9911
10516
  error: readableMessage,
9912
- result: (_v = (_u = error2 == null ? void 0 : error2.response) == null ? void 0 : _u.data) == null ? void 0 : _v.result,
9913
- statusCode: (_w = error2 == null ? void 0 : error2.response) == null ? void 0 : _w.status
10517
+ result: (_z = (_y = error2 == null ? void 0 : error2.response) == null ? void 0 : _y.data) == null ? void 0 : _z.result,
10518
+ statusCode: (_A = error2 == null ? void 0 : error2.response) == null ? void 0 : _A.status
9914
10519
  });
9915
10520
  }
9916
10521
  };
@@ -10327,8 +10932,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10327
10932
  });
10328
10933
  };
10329
10934
  const handlechargeCustomer = async (e) => {
10330
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
10331
- e.currentTarget.blur();
10935
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
10936
+ e == null ? void 0 : e.currentTarget.blur();
10332
10937
  if (loading) return;
10333
10938
  let customer_id = customerId;
10334
10939
  let card_id = selectedCard == null ? void 0 : selectedCard.id;
@@ -10375,7 +10980,6 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10375
10980
  statusCode: (_g2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _g2.status
10376
10981
  });
10377
10982
  hideLoader();
10378
- setError(((_i2 = (_h2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _h2.data) == null ? void 0 : _i2.message) || "Something went wrong!");
10379
10983
  }
10380
10984
  } else {
10381
10985
  setError("Please Select A Card/Bank");
@@ -10451,21 +11055,21 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10451
11055
  setOrderLoader(false);
10452
11056
  }
10453
11057
  };
10454
- useEffect15(() => {
11058
+ useEffect17(() => {
10455
11059
  if (!show && !autoTrigger) {
10456
11060
  hasRunRef.current = false;
10457
11061
  cardListRunRef.current = false;
10458
11062
  }
10459
11063
  }, [show, autoTrigger]);
10460
- useEffect15(() => {
10461
- if (!hasRunRef.current && (show || autoTrigger)) {
11064
+ useEffect17(() => {
11065
+ if (!hasRunRef.current && (show || autoTrigger) && onLoad) {
10462
11066
  getPaymentDetails();
10463
11067
  if (isPartial && !partialRef) {
10464
11068
  crateOrderFrac();
10465
11069
  }
10466
11070
  }
10467
- }, [show, autoTrigger, isPartial]);
10468
- useEffect15(() => {
11071
+ }, [show, autoTrigger, isPartial, onLoad]);
11072
+ useEffect17(() => {
10469
11073
  if ((show || autoTrigger) && pass_fee_amount) {
10470
11074
  let cashdisc = Number(amount) - Number(pass_fee_amount);
10471
11075
  if (cashdisc && !isNaN(cashdisc)) {
@@ -10527,7 +11131,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10527
11131
  console.error("3DS Auth failed \u274C", status);
10528
11132
  setError(`3DS Authentication ${status}`);
10529
11133
  };
10530
- useEffect15(() => {
11134
+ useEffect17(() => {
10531
11135
  if (setHandleCloseRef) {
10532
11136
  setHandleCloseRef(() => handleClose);
10533
11137
  }
@@ -10545,24 +11149,95 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10545
11149
  setPartialError("");
10546
11150
  }
10547
11151
  };
10548
- useEffect15(() => {
11152
+ useEffect17(() => {
10549
11153
  if (typeof FractalTokenizer === "undefined") return;
10550
11154
  const tokenizer = new FractalTokenizer({
10551
11155
  styles: {}
10552
11156
  });
10553
11157
  }, []);
10554
- console.log(activeinCard === "list", "activeinCard", activeList);
10555
- return /* @__PURE__ */ jsxs19(Fragment18, { children: [
10556
- initialLoader && /* @__PURE__ */ jsx32(Loader_default, { loading: initialLoader }),
10557
- error && /* @__PURE__ */ jsx32("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx32(ErrorCardMessage_default, { error, onClose: handleClose }) }),
10558
- errorIframe && /* @__PURE__ */ jsx32("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx32(ErrorCardMessage_default, { error: errorIframe, onClose: () => {
11158
+ const stateRef = useRef12({
11159
+ activeinBank,
11160
+ activeinCard,
11161
+ activetab
11162
+ });
11163
+ useEffect17(() => {
11164
+ stateRef.current = {
11165
+ activeinBank,
11166
+ activeinCard,
11167
+ activetab
11168
+ };
11169
+ }, [activeinBank, activeinCard, activetab]);
11170
+ const submit = useCallback(() => {
11171
+ var _a2, _b2;
11172
+ const { activeinBank: activeinBank2, activeinCard: activeinCard2, activetab: activetab2 } = stateRef.current;
11173
+ if (activetab2 === "card") {
11174
+ if (activeinCard2 === "form") {
11175
+ (_a2 = cardFormRef.current) == null ? void 0 : _a2.requestSubmit();
11176
+ } else if (activeinCard2 === "list") {
11177
+ handlechargeCustomer();
11178
+ }
11179
+ } else if (activetab2 === "ach") {
11180
+ if (activeinBank2 === "form") {
11181
+ (_b2 = bankFormRef.current) == null ? void 0 : _b2.requestSubmit();
11182
+ } else if (activeinBank2 === "list") {
11183
+ handlechargeCustomer();
11184
+ }
11185
+ }
11186
+ }, []);
11187
+ useEffect17(() => {
11188
+ onSubmit == null ? void 0 : onSubmit(submit);
11189
+ }, [onSubmit, submit]);
11190
+ function detectCardType(cardinput) {
11191
+ if (!cardinput) return null;
11192
+ const number = cardinput.replace(/\D/g, "");
11193
+ const patterns = {
11194
+ visa: /^4/,
11195
+ mastercard: /^(5[1-5]|2[2-7][0-9]{2})/,
11196
+ amex: /^3[47]/,
11197
+ discover: /^(6011|65|64[4-9])/,
11198
+ diners: /^(30[0-5]|36|38)/,
11199
+ jcb: /^(35[2-8][0-9])/,
11200
+ unionpay: /^62/
11201
+ };
11202
+ for (const [type, regex] of Object.entries(patterns)) {
11203
+ if (regex.test(number)) {
11204
+ return type;
11205
+ }
11206
+ }
11207
+ return "unknown";
11208
+ }
11209
+ function getCardImage(cardInput) {
11210
+ const cardType = detectCardType(cardInput);
11211
+ switch (cardType) {
11212
+ case "visa":
11213
+ return /* @__PURE__ */ jsx36("img", { src: visa2, alt: "visa", width: 33 });
11214
+ case "mastercard":
11215
+ return /* @__PURE__ */ jsx36("img", { src: mastercard2, width: 33, alt: "mastercard" });
11216
+ case "amex":
11217
+ return /* @__PURE__ */ jsx36("img", { src: americanexp2, alt: "amex", width: 33 });
11218
+ case "discover":
11219
+ return /* @__PURE__ */ jsx36("img", { src: discover2, width: 33, alt: "discover" });
11220
+ case "diners":
11221
+ return /* @__PURE__ */ jsx36("img", { src: dinersicon, alt: "Diners Club" });
11222
+ case "jcb":
11223
+ return /* @__PURE__ */ jsx36("img", { src: jcbicon, alt: "JCB" });
11224
+ case "unionpay":
11225
+ return /* @__PURE__ */ jsx36("img", { src: unionicon, alt: "UnionPay" });
11226
+ default:
11227
+ return /* @__PURE__ */ jsx36("img", { src: defualtcardborder, alt: "card" });
11228
+ }
11229
+ }
11230
+ return /* @__PURE__ */ jsxs21(Fragment20, { children: [
11231
+ (initialLoader || !onLoad) && /* @__PURE__ */ jsx36(Loader_default, { intensity: "dark", loading: initialLoader || !onLoad }),
11232
+ error && /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ErrorCardOverlay_default, { error, onClose: handleClose, autoTrigger }) }),
11233
+ errorIframe && /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ErrorCardOverlay_default, { error: errorIframe, onClose: () => {
10559
11234
  setErrorIframe("");
10560
- } }) }),
10561
- !error && !errorIframe && /* @__PURE__ */ jsxs19(Fragment18, { children: [
10562
- (loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx32(Loader_default, { loading: loading || loading2 || loadingPrev || orderLoader || loadingIframe }),
10563
- /* @__PURE__ */ jsxs19("div", { className: "frac-card-payment-page frac-form frac-new-form", children: [
10564
- /* @__PURE__ */ jsx32("div", { ref: threeDSContainerRef, style: { width: "100%", height: "100%" } }),
10565
- (stripeResponse == null ? void 0 : stripeResponse.challenge_url) ? /* @__PURE__ */ jsx32(
11235
+ }, autoTrigger: onSubmit ? !onSubmit : autoTrigger }) }),
11236
+ /* @__PURE__ */ jsxs21(Fragment20, { children: [
11237
+ (loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx36(Loader_default, { intensity: "light", loading: loading || loading2 || loadingPrev || orderLoader || loadingIframe }),
11238
+ /* @__PURE__ */ jsxs21("div", { className: "frac-card-payment-page frac-form frac-new-form", children: [
11239
+ /* @__PURE__ */ jsx36("div", { ref: threeDSContainerRef, style: { width: "100%", height: "100%" } }),
11240
+ (stripeResponse == null ? void 0 : stripeResponse.challenge_url) ? /* @__PURE__ */ jsx36(
10566
11241
  ThreeDSChallenge,
10567
11242
  {
10568
11243
  containerRef: threeDSContainerRef,
@@ -10572,40 +11247,33 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10572
11247
  onSuccess: handleSuccess,
10573
11248
  onError: handleError
10574
11249
  }
10575
- ) : /* @__PURE__ */ jsxs19("div", { className: "parent-pay-container", children: [
10576
- /* @__PURE__ */ jsx32("span", { style: { display: autoTrigger ? "none" : "block" }, className: "request-payment-close-popup", onClick: handleClose, children: /* @__PURE__ */ jsxs19("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
10577
- /* @__PURE__ */ jsx32("g", { clipPath: "url(#clip0_12425_52336)", children: /* @__PURE__ */ jsx32("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" }) }),
10578
- /* @__PURE__ */ jsx32("defs", { children: /* @__PURE__ */ jsx32("clipPath", { id: "clip0_12425_52336", children: /* @__PURE__ */ jsx32("rect", { width: "16", height: "16", fill: "white" }) }) })
11250
+ ) : /* @__PURE__ */ jsxs21("div", { className: "parent-pay-container", children: [
11251
+ /* @__PURE__ */ jsx36("span", { style: { display: autoTrigger ? "none" : "block" }, className: "request-payment-close-popup", onClick: handleClose, children: /* @__PURE__ */ jsxs21("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
11252
+ /* @__PURE__ */ jsx36("g", { clipPath: "url(#clip0_12425_52336)", children: /* @__PURE__ */ jsx36("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" }) }),
11253
+ /* @__PURE__ */ jsx36("defs", { children: /* @__PURE__ */ jsx36("clipPath", { id: "clip0_12425_52336", children: /* @__PURE__ */ jsx36("rect", { width: "16", height: "16", fill: "white" }) }) })
10579
11254
  ] }) }),
10580
- /* @__PURE__ */ jsx32("div", { className: "pay-main-logo-res" }),
10581
- /* @__PURE__ */ jsxs19("div", { className: "pay-container", children: [
10582
- /* @__PURE__ */ jsxs19("div", { className: "pay-header pay-conatiner-one", children: [
10583
- /* @__PURE__ */ jsxs19("div", { className: "pay-conatiner-one-first", children: [
10584
- /* @__PURE__ */ jsxs19("div", { className: "pay-logo-container", children: [
10585
- /* @__PURE__ */ jsx32("div", { className: "pay-main-logo" }),
10586
- /* @__PURE__ */ jsx32("h1", { className: "pay-heading", children: "Pay" }),
10587
- (cardList == null ? void 0 : cardList.length) > 0 && activetab !== "cardList" && /* @__PURE__ */ jsxs19("button", { className: "res-charge-payment-back-btn ", onClick: () => setActive("cardList"), children: [
11255
+ /* @__PURE__ */ jsx36("div", { className: "pay-main-logo-res" }),
11256
+ /* @__PURE__ */ jsxs21("div", { className: onSubmit ? "pay-container frac-pay-container " : "pay-container", children: [
11257
+ !onSubmit && /* @__PURE__ */ jsxs21("div", { className: "pay-header pay-conatiner-one", children: [
11258
+ /* @__PURE__ */ jsxs21("div", { className: "pay-conatiner-one-first", children: [
11259
+ /* @__PURE__ */ jsxs21("div", { className: "pay-logo-container", children: [
11260
+ /* @__PURE__ */ jsx36("div", { className: "pay-main-logo" }),
11261
+ /* @__PURE__ */ jsx36("h1", { className: "pay-heading", children: "Pay" }),
11262
+ (cardList == null ? void 0 : cardList.length) > 0 && activetab !== "cardList" && /* @__PURE__ */ jsxs21("button", { className: "res-charge-payment-back-btn ", onClick: () => setActive("cardList"), children: [
10588
11263
  " ",
10589
- /* @__PURE__ */ jsx32(IoArrowBack4, {}),
11264
+ /* @__PURE__ */ jsx36(IoArrowBack4, {}),
10590
11265
  " Back"
10591
11266
  ] })
10592
11267
  ] }),
10593
- /* @__PURE__ */ jsx32("div", { className: "amt-pay-con", children: /* @__PURE__ */ jsxs19("div", { className: "pay-amount-conatiner", children: [
10594
- /* @__PURE__ */ jsx32("small", { className: "pay-payment-amount", children: "Select payment type" }),
10595
- /* @__PURE__ */ jsxs19("div", { className: "frac-card-bank-radio-main", children: [
10596
- /* @__PURE__ */ jsx32(CardBankRadio, { label: "Card", amount: (_a = Number(amount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
10597
- !isPreAuth && isBankActive && !isPartial && /* @__PURE__ */ jsx32(CardBankRadio, { label: "Bank", amount: (_b = Number(bankAmount)) == null ? void 0 : _b.toFixed(2), value: "ach", onChange: handletabchange, activetab })
11268
+ /* @__PURE__ */ jsx36("div", { className: "amt-pay-con", children: /* @__PURE__ */ jsxs21("div", { className: "pay-amount-conatiner", children: [
11269
+ /* @__PURE__ */ jsx36("small", { className: "pay-payment-amount", children: "Select payment type" }),
11270
+ /* @__PURE__ */ jsxs21("div", { className: "frac-card-bank-radio-main", children: [
11271
+ /* @__PURE__ */ jsx36(CardBankRadio, { label: "Card", amount: (_a = Number(amount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
11272
+ !isPreAuth && isBankActive && !isPartial && /* @__PURE__ */ jsx36(CardBankRadio, { label: "Bank", amount: (_b = Number(bankAmount)) == null ? void 0 : _b.toFixed(2), value: "ach", onChange: handletabchange, activetab, savingsText: bankSavingsText })
10598
11273
  ] }),
10599
- pass_fee && activetab === "card" && cashDiscount && Number(amount) - Number(cashDiscount) > 0 ? /* @__PURE__ */ jsxs19("div", { className: "frac-cash-discount-fee", children: [
10600
- /* @__PURE__ */ jsxs19("small", { children: [
10601
- activetab === "card" ? "Cash Discount" : "Cash Discount Savings",
10602
- " "
10603
- ] }),
10604
- /* @__PURE__ */ jsx32("p", { children: formatUSD((Number(amount) - Number(cashDiscount)).toFixed(2)) })
10605
- ] }) : null,
10606
- isPartial && /* @__PURE__ */ jsxs19("div", { className: "frac-partial-payment-input", children: [
10607
- /* @__PURE__ */ jsx32("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
10608
- /* @__PURE__ */ jsx32(
11274
+ isPartial && /* @__PURE__ */ jsxs21("div", { className: "frac-partial-payment-input", children: [
11275
+ /* @__PURE__ */ jsx36("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
11276
+ /* @__PURE__ */ jsx36(
10609
11277
  NumericFormat2,
10610
11278
  {
10611
11279
  prefix: "$",
@@ -10629,331 +11297,403 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10629
11297
  }
10630
11298
  }
10631
11299
  ),
10632
- partialError && /* @__PURE__ */ jsx32("span", { className: "error-span", children: partialError })
11300
+ partialError && /* @__PURE__ */ jsx36("span", { className: "error-span", children: partialError })
10633
11301
  ] })
10634
11302
  ] }) })
10635
11303
  ] }),
10636
- /* @__PURE__ */ jsxs19("div", { className: "pay-conatiner-one-last", children: [
10637
- /* @__PURE__ */ jsx32("img", { src: secure2, alt: "" }),
10638
- /* @__PURE__ */ jsx32("img", { src: pov2, alt: "" }),
11304
+ /* @__PURE__ */ jsxs21("div", { className: "pay-conatiner-one-last", children: [
11305
+ /* @__PURE__ */ jsx36("img", { src: secure2, alt: "" }),
11306
+ /* @__PURE__ */ jsx36("img", { src: pov2, alt: "" }),
10639
11307
  "Secure payments powered by Fractal"
10640
11308
  ] })
10641
11309
  ] }),
10642
- /* @__PURE__ */ jsx32("div", { className: "pay-tab pay-conatiner-two", children: /* @__PURE__ */ jsx32("div", { className: "col-md-12", children: /* @__PURE__ */ jsx32("div", { id: "payment-form-div", children: is3DSEnable ? clientSecret && /* @__PURE__ */ jsx32(CheckoutWrapper, { onSuccess, clientSecret, amount, showLoader, hideLoader, callback, session_token, handleClose, setError, isPreAuth }) : /* @__PURE__ */ jsxs19(Fragment18, { children: [
10643
- /* @__PURE__ */ jsxs19("div", { id: "ach", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent", children: [
10644
- /* @__PURE__ */ jsxs19("div", { className: "frac-heading-card-wrap", children: [
10645
- /* @__PURE__ */ jsx32("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: [
10646
- " ",
10647
- /* @__PURE__ */ jsx32(IoArrowBack4, {})
10648
- ] }) }),
10649
- /* @__PURE__ */ jsx32("h6", { className: "frac-card-payment-heading", children: "Card Payment" })
10650
- ] }),
10651
- /* @__PURE__ */ jsxs19("div", { style: { display: "flex", gap: "8px", margin: "8px 0px 19px 0px" }, children: [
10652
- /* @__PURE__ */ jsx32("img", { src: visa2, alt: "", width: 33 }),
10653
- /* @__PURE__ */ jsx32("img", { src: mastercard2, width: 33, alt: "" }),
10654
- /* @__PURE__ */ jsx32("img", { src: americanexp2, alt: "", width: 33 }),
10655
- /* @__PURE__ */ jsx32("img", { src: discover2, width: 33, alt: "" })
11310
+ /* @__PURE__ */ jsx36("div", { className: "pay-tab pay-conatiner-two", children: /* @__PURE__ */ jsx36("div", { className: "col-md-12", children: /* @__PURE__ */ jsxs21("div", { id: "payment-form-div ", className: onSubmit ? "frac-payment-form-div" : "", children: [
11311
+ onSubmit && /* @__PURE__ */ jsx36("div", { className: "amt-pay-con", children: /* @__PURE__ */ jsxs21("div", { className: "pay-amount-conatiner", children: [
11312
+ /* @__PURE__ */ jsxs21("div", { className: "frac-card-bank-radio-main", children: [
11313
+ /* @__PURE__ */ jsx36(CardBankRadio, { skydesign: true, label: "Card", amount: (_c = Number(amount)) == null ? void 0 : _c.toFixed(2), value: "card", onChange: handletabchange, activetab }),
11314
+ !isPreAuth && isBankActive && !isPartial && /* @__PURE__ */ jsx36(CardBankRadio, { skydesign: true, label: "Bank", amount: (_d = Number(bankAmount)) == null ? void 0 : _d.toFixed(2), value: "ach", onChange: handletabchange, activetab, savingsText: bankSavingsText })
10656
11315
  ] }),
10657
- activeinCard === "list" && (cardList == null ? void 0 : cardList.length) > 0 ? /* @__PURE__ */ jsxs19(Fragment18, { children: [
10658
- /* @__PURE__ */ jsx32(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Card", ListItems: cardList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Card", otherButtonAction: () => {
10659
- setActiveinCard("form");
10660
- } }),
10661
- /* @__PURE__ */ jsx32("div", { className: "form-group-frac", style: { padding: "0" }, children: /* @__PURE__ */ jsx32("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer, children: partialAmount ? formatUSD((_c = Number(partialAmount)) == null ? void 0 : _c.toFixed(2)) : formatUSD((_d = Number(amount)) == null ? void 0 : _d.toFixed(2)) }) })
10662
- ] }) : paymentGateway == 32 ? /* @__PURE__ */ jsxs19("form", { id: "paymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, onKeyDown: (e) => {
10663
- if (e.key === "Enter" && loading) {
10664
- e.preventDefault();
10665
- e.stopPropagation();
10666
- }
10667
- }, children: [
10668
- /* @__PURE__ */ jsxs19("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
10669
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10670
- /* @__PURE__ */ jsx32("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
10671
- /* @__PURE__ */ jsx32("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
10672
- const value = e.target.value;
10673
- if (/^[a-zA-Z\s]*$/.test(value)) {
10674
- handleCardChange("cardName", value);
10675
- }
10676
- } }),
10677
- (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
10678
- ] }),
10679
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10680
- /* @__PURE__ */ jsx32("label", { htmlFor: "cardNumber", children: "CARD NUMBER" }),
10681
- /* @__PURE__ */ jsx32("div", { className: "toggle-num-wrapper", children: (show || autoTrigger) && paymentGateway === 32 && /* @__PURE__ */ jsx32(
10682
- FractalFields_default,
10683
- {
10684
- fractalStyles,
10685
- tokenizerRef,
10686
- isSky: true
10687
- }
10688
- ) })
10689
- ] }),
10690
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10691
- /* @__PURE__ */ jsx32("label", { htmlFor: "zip", children: "ZIP" }),
10692
- /* @__PURE__ */ jsx32("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "000000", value: (_e = cardData == null ? void 0 : cardData.zipCode) != null ? _e : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
10693
- (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
11316
+ isPartial && /* @__PURE__ */ jsxs21("div", { className: "frac-partial-payment-input", children: [
11317
+ /* @__PURE__ */ jsx36("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
11318
+ /* @__PURE__ */ jsx36(
11319
+ NumericFormat2,
11320
+ {
11321
+ prefix: "$",
11322
+ className: "form-control-frac",
11323
+ value: partialAmount,
11324
+ onValueChange: (values) => {
11325
+ handlePartialChange(values);
11326
+ },
11327
+ thousandSeparator: true,
11328
+ placeholder: "Enter partial amount",
11329
+ allowNegative: false,
11330
+ allowLeadingZeros: false,
11331
+ decimalScale: 2,
11332
+ fixedDecimalScale: true
11333
+ }
11334
+ ),
11335
+ partialError && /* @__PURE__ */ jsx36("span", { className: "error-span", children: partialError })
11336
+ ] })
11337
+ ] }) }),
11338
+ is3DSEnable ? clientSecret && /* @__PURE__ */ jsx36(CheckoutWrapper, { onSuccess, clientSecret, amount, showLoader, hideLoader, callback, session_token, handleClose, setError, isPreAuth }) : /* @__PURE__ */ jsxs21(Fragment20, { children: [
11339
+ /* @__PURE__ */ jsxs21("div", { id: "ach", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent", children: [
11340
+ !onSubmit && /* @__PURE__ */ jsxs21(Fragment20, { children: [
11341
+ /* @__PURE__ */ jsxs21("div", { className: "frac-heading-card-wrap", children: [
11342
+ /* @__PURE__ */ jsx36("div", { className: "frac-backarrow", children: (cardList == null ? void 0 : cardList.length) > 0 && activeinCard === "form" && /* @__PURE__ */ jsxs21("button", { className: "charge-payment-back-btn ", onClick: () => setActiveinCard("list"), children: [
11343
+ " ",
11344
+ /* @__PURE__ */ jsx36(IoArrowBack4, {})
11345
+ ] }) }),
11346
+ /* @__PURE__ */ jsx36("h6", { className: "frac-card-payment-heading", children: "Card Payment" })
10694
11347
  ] }),
10695
- customerId && /* @__PURE__ */ jsx32("div", { className: "form-group-frac", children: /* @__PURE__ */ jsxs19("div", { className: "frac-tooltip-mn", style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
10696
- /* @__PURE__ */ jsx32(
10697
- "input",
10698
- {
10699
- type: "checkbox",
10700
- id: "save_card",
10701
- className: "toggle-checkbox",
10702
- checked: saveCardInfo,
10703
- onChange: (e) => setSaveCardInfo(e.target.checked)
10704
- }
10705
- ),
10706
- /* @__PURE__ */ jsx32("label", { htmlFor: "save_card", className: "toggle-label" }),
10707
- /* @__PURE__ */ jsx32("label", { htmlFor: "save_card", children: "Save card for future payments " }),
10708
- /* @__PURE__ */ jsxs19("div", { className: "frac-tooltip-wrapper", children: [
10709
- /* @__PURE__ */ jsx32("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs19(
10710
- "svg",
10711
- {
10712
- xmlns: "http://www.w3.org/2000/svg",
10713
- width: "20",
10714
- height: "20",
10715
- viewBox: "0 0 20 20",
10716
- fill: "none",
10717
- children: [
10718
- /* @__PURE__ */ jsx32("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
10719
- /* @__PURE__ */ jsx32(
10720
- "path",
10721
- {
10722
- 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",
10723
- fill: "#161616"
10724
- }
10725
- )
10726
- ]
10727
- }
10728
- ) }),
10729
- /* @__PURE__ */ jsx32("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs19("p", { children: [
10730
- "If checked, I agree to give the ",
10731
- /* @__PURE__ */ jsx32("b", { children: merchantName || "merchant" }),
10732
- " permission to charge this credit card for agreed-upon purchases in the future."
10733
- ] }) })
10734
- ] })
10735
- ] }) })
11348
+ /* @__PURE__ */ jsxs21("div", { style: { display: "flex", gap: "8px", margin: "8px 0px 19px 0px" }, children: [
11349
+ /* @__PURE__ */ jsx36("img", { src: visa2, alt: "", width: 33 }),
11350
+ /* @__PURE__ */ jsx36("img", { src: mastercard2, width: 33, alt: "" }),
11351
+ /* @__PURE__ */ jsx36("img", { src: americanexp2, alt: "", width: 33 }),
11352
+ /* @__PURE__ */ jsx36("img", { src: discover2, width: 33, alt: "" })
11353
+ ] })
10736
11354
  ] }),
10737
- /* @__PURE__ */ jsx32("div", { className: "form-group-frac", style: { marginTop: "20px", padding: "0" }, children: /* @__PURE__ */ jsx32("button", { type: "submit", style: { margin: 0 }, className: "pay-button", children: partialAmount ? formatUSD((_f = Number(partialAmount)) == null ? void 0 : _f.toFixed(2)) : formatUSD((_g = Number(amount)) == null ? void 0 : _g.toFixed(2)) }) })
10738
- ] }) : /* @__PURE__ */ jsxs19("form", { id: "PaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, onKeyDown: (e) => {
10739
- if (e.key === "Enter" && loading) {
10740
- e.preventDefault();
10741
- e.stopPropagation();
10742
- }
10743
- }, children: [
10744
- /* @__PURE__ */ jsxs19("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
10745
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10746
- /* @__PURE__ */ jsx32("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
10747
- /* @__PURE__ */ jsx32("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
10748
- const value = e.target.value;
10749
- if (/^[a-zA-Z\s]*$/.test(value)) {
10750
- handleCardChange("cardName", value);
10751
- }
10752
- } }),
10753
- (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
10754
- ] }),
10755
- /* @__PURE__ */ jsx32("div", { className: "form-group-frac", children: /* @__PURE__ */ jsx32(
10756
- DataCapFields,
11355
+ activeinCard === "list" && (cardList == null ? void 0 : cardList.length) > 0 ? /* @__PURE__ */ jsxs21(Fragment20, { children: [
11356
+ /* @__PURE__ */ jsx36(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Card", ListItems: cardList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Card", otherButtonAction: () => {
11357
+ setActiveinCard("form");
11358
+ } }),
11359
+ /* @__PURE__ */ jsx36("div", { className: "form-group-frac", style: { padding: "0", display: onSubmit ? "none" : "block" }, children: /* @__PURE__ */ jsx36("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer, children: partialAmount ? formatUSD((_e = Number(partialAmount)) == null ? void 0 : _e.toFixed(2)) : formatUSD((_f = Number(amount)) == null ? void 0 : _f.toFixed(2)) }) })
11360
+ ] }) : paymentGateway == 32 ? /* @__PURE__ */ jsxs21(Fragment20, { children: [
11361
+ /* @__PURE__ */ jsx36(
11362
+ ApplePayButton,
10757
11363
  {
10758
- isOpen: show || autoTrigger,
10759
- tokenKey: dcToken,
10760
- setLoader: activeinCard === "form" ? setLoadingIframe : null
11364
+ applePayAmount: partialAmount ? partialAmount : amount,
11365
+ applePayMerchantId,
11366
+ applePayMerchantName: merchantName,
11367
+ completeFractalFlow,
11368
+ showLoader
10761
11369
  }
10762
- ) }),
10763
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10764
- /* @__PURE__ */ jsx32("label", { htmlFor: "zip", children: "ZIP" }),
10765
- /* @__PURE__ */ jsx32("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "000000", value: (_h = cardData == null ? void 0 : cardData.zipCode) != null ? _h : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
10766
- (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
10767
- ] }),
10768
- customerId && /* @__PURE__ */ jsx32("div", { className: "form-group-frac", children: /* @__PURE__ */ jsxs19("div", { className: "frac-tooltip-mn", style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
10769
- /* @__PURE__ */ jsx32(
10770
- "input",
11370
+ ),
11371
+ /* @__PURE__ */ jsx36(
11372
+ GooglePayComponent,
11373
+ {
11374
+ amount: partialAmount ? partialAmount : amount,
11375
+ googlePayEnvironment,
11376
+ googlePayGatewayMerchantId,
11377
+ googlePayMerchantId,
11378
+ googlePayMerchantName: merchantName,
11379
+ completeFractalFlow,
11380
+ setLoading
11381
+ }
11382
+ ),
11383
+ /* @__PURE__ */ jsx36("div", { id: "digital-wallet-or", className: "frac-or", children: /* @__PURE__ */ jsx36("span", { children: "or" }) }),
11384
+ /* @__PURE__ */ jsxs21("form", { id: "paymentForm", style: { textAlign: "start" }, ref: cardFormRef, onSubmit: submitFunc, onKeyDown: (e) => {
11385
+ if (e.key === "Enter" && loading) {
11386
+ e.preventDefault();
11387
+ e.stopPropagation();
11388
+ }
11389
+ }, children: [
11390
+ /* @__PURE__ */ jsxs21("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
11391
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11392
+ /* @__PURE__ */ jsx36("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
11393
+ /* @__PURE__ */ jsx36("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
11394
+ const value = e.target.value;
11395
+ if (/^[a-zA-Z\s]*$/.test(value)) {
11396
+ handleCardChange("cardName", value);
11397
+ }
11398
+ } }),
11399
+ (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
11400
+ ] }),
11401
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11402
+ /* @__PURE__ */ jsx36("label", { htmlFor: "cardNumber", children: "CARD NUMBER" }),
11403
+ /* @__PURE__ */ jsx36("div", { className: "toggle-num-wrapper toggle-num-wrapper-new", children: (show || autoTrigger) && paymentGateway === 32 && /* @__PURE__ */ jsx36(
11404
+ FractalFields_default,
11405
+ {
11406
+ fractalStyles,
11407
+ tokenizerRef,
11408
+ isSky: true
11409
+ }
11410
+ ) })
11411
+ ] }),
11412
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11413
+ /* @__PURE__ */ jsx36("label", { htmlFor: "zip", children: "ZIP" }),
11414
+ /* @__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) }),
11415
+ (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode }),
11416
+ pass_fee && cardFeeAmount > 0 && /* @__PURE__ */ jsxs21("small", { className: "frac-fee-text", children: [
11417
+ "Credit cards include a fee amount of ",
11418
+ /* @__PURE__ */ jsx36("span", { className: "frac-fee-amount", children: formatUSD(cardFeeAmount.toFixed(2)) }),
11419
+ "."
11420
+ ] })
11421
+ ] }),
11422
+ customerId && /* @__PURE__ */ jsx36("div", { className: "form-group-frac", children: /* @__PURE__ */ jsxs21("div", { className: "frac-tooltip-mn", style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
11423
+ /* @__PURE__ */ jsx36(
11424
+ "input",
11425
+ {
11426
+ type: "checkbox",
11427
+ id: "save_card",
11428
+ className: "toggle-checkbox",
11429
+ checked: saveCardInfo,
11430
+ onChange: (e) => setSaveCardInfo(e.target.checked)
11431
+ }
11432
+ ),
11433
+ /* @__PURE__ */ jsx36("label", { htmlFor: "save_card", className: "toggle-label" }),
11434
+ /* @__PURE__ */ jsx36("label", { htmlFor: "save_card", children: "Save card for future payments " }),
11435
+ /* @__PURE__ */ jsxs21("div", { className: "frac-tooltip-wrapper", children: [
11436
+ /* @__PURE__ */ jsx36("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs21(
11437
+ "svg",
11438
+ {
11439
+ xmlns: "http://www.w3.org/2000/svg",
11440
+ width: "20",
11441
+ height: "20",
11442
+ viewBox: "0 0 20 20",
11443
+ fill: "none",
11444
+ children: [
11445
+ /* @__PURE__ */ jsx36("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
11446
+ /* @__PURE__ */ jsx36(
11447
+ "path",
11448
+ {
11449
+ 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",
11450
+ fill: "#161616"
11451
+ }
11452
+ )
11453
+ ]
11454
+ }
11455
+ ) }),
11456
+ /* @__PURE__ */ jsx36("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs21("p", { children: [
11457
+ "If checked, I agree to give the ",
11458
+ /* @__PURE__ */ jsx36("b", { children: merchantName || "merchant" }),
11459
+ " permission to charge this credit card for agreed-upon purchases in the future."
11460
+ ] }) })
11461
+ ] })
11462
+ ] }) })
11463
+ ] }),
11464
+ /* @__PURE__ */ jsx36("div", { className: "form-group-frac", style: { marginTop: "20px", padding: "0" }, children: /* @__PURE__ */ jsx36("button", { type: "submit", style: { margin: 0, display: onSubmit ? "none" : "block" }, className: "pay-button", children: partialAmount ? formatUSD((_h = Number(partialAmount)) == null ? void 0 : _h.toFixed(2)) : formatUSD((_i = Number(amount)) == null ? void 0 : _i.toFixed(2)) }) })
11465
+ ] })
11466
+ ] }) : /* @__PURE__ */ jsxs21("form", { id: "PaymentForm", style: { textAlign: "start" }, ref: cardFormRef, onSubmit: submitFunc, onKeyDown: (e) => {
11467
+ if (e.key === "Enter" && loading) {
11468
+ e.preventDefault();
11469
+ e.stopPropagation();
11470
+ }
11471
+ }, children: [
11472
+ /* @__PURE__ */ jsxs21("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
11473
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11474
+ /* @__PURE__ */ jsx36("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
11475
+ /* @__PURE__ */ jsx36("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
11476
+ const value = e.target.value;
11477
+ if (/^[a-zA-Z\s]*$/.test(value)) {
11478
+ handleCardChange("cardName", value);
11479
+ }
11480
+ } }),
11481
+ (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
11482
+ ] }),
11483
+ /* @__PURE__ */ jsx36("div", { className: "form-group-frac", children: /* @__PURE__ */ jsx36(
11484
+ DataCapFields,
10771
11485
  {
10772
- type: "checkbox",
10773
- id: "save_card",
10774
- className: "toggle-checkbox",
10775
- checked: saveCardInfo,
10776
- onChange: (e) => setSaveCardInfo(e.target.checked)
11486
+ isOpen: show || autoTrigger,
11487
+ tokenKey: dcToken,
11488
+ setLoader: activeinCard === "form" ? setLoadingIframe : null,
11489
+ isEmbedded: onSubmit ? true : false
10777
11490
  }
10778
- ),
10779
- /* @__PURE__ */ jsx32("label", { htmlFor: "save_card", className: "toggle-label" }),
10780
- /* @__PURE__ */ jsx32("label", { htmlFor: "save_card", children: "Save card for future payments " }),
10781
- /* @__PURE__ */ jsxs19("div", { className: "frac-tooltip-wrapper", children: [
10782
- /* @__PURE__ */ jsx32("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs19(
10783
- "svg",
11491
+ ) }),
11492
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11493
+ /* @__PURE__ */ jsx36("label", { htmlFor: "zip", children: "ZIP" }),
11494
+ /* @__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) }),
11495
+ (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode }),
11496
+ pass_fee && cardFeeAmount > 0 && /* @__PURE__ */ jsxs21("small", { className: "frac-fee-text", children: [
11497
+ "Credit cards include a fee amount of ",
11498
+ /* @__PURE__ */ jsx36("span", { className: "frac-fee-amount", children: formatUSD(cardFeeAmount.toFixed(2)) }),
11499
+ "."
11500
+ ] })
11501
+ ] }),
11502
+ customerId && /* @__PURE__ */ jsx36("div", { className: "form-group-frac", children: /* @__PURE__ */ jsxs21("div", { className: "frac-tooltip-mn", style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
11503
+ /* @__PURE__ */ jsx36(
11504
+ "input",
10784
11505
  {
10785
- xmlns: "http://www.w3.org/2000/svg",
10786
- width: "20",
10787
- height: "20",
10788
- viewBox: "0 0 20 20",
10789
- fill: "none",
10790
- children: [
10791
- /* @__PURE__ */ jsx32("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
10792
- /* @__PURE__ */ jsx32(
10793
- "path",
10794
- {
10795
- 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",
10796
- fill: "#161616"
10797
- }
10798
- )
10799
- ]
11506
+ type: "checkbox",
11507
+ id: "save_card",
11508
+ className: "toggle-checkbox",
11509
+ checked: saveCardInfo,
11510
+ onChange: (e) => setSaveCardInfo(e.target.checked)
10800
11511
  }
10801
- ) }),
10802
- /* @__PURE__ */ jsx32("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs19("p", { children: [
10803
- "If checked, I agree to give the ",
10804
- /* @__PURE__ */ jsx32("b", { children: merchantName || "merchant" }),
10805
- " permission to charge this credit card for agreed-upon purchases in the future."
10806
- ] }) })
10807
- ] })
10808
- ] }) })
10809
- ] }),
10810
- /* @__PURE__ */ jsx32("div", { className: "form-group-frac", style: { marginTop: "20px", padding: "0" }, children: /* @__PURE__ */ jsx32("button", { type: "submit", style: { margin: 0 }, className: "pay-button", children: partialAmount ? formatUSD((_i = Number(partialAmount)) == null ? void 0 : _i.toFixed(2)) : formatUSD((_j = Number(amount)) == null ? void 0 : _j.toFixed(2)) }) })
10811
- ] })
10812
- ] }),
10813
- /* @__PURE__ */ jsx32("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent", children: /* @__PURE__ */ jsxs19(Fragment18, { children: [
10814
- /* @__PURE__ */ jsxs19("div", { className: "frac-heading-card-wrap", children: [
10815
- /* @__PURE__ */ jsx32("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: [
10816
- " ",
10817
- /* @__PURE__ */ jsx32(IoArrowBack4, {})
10818
- ] }) }),
10819
- /* @__PURE__ */ jsx32("h6", { className: "frac-card-payment-heading", children: "Bank Payment" })
10820
- ] }),
10821
- activeinBank === "list" && (bankList == null ? void 0 : bankList.length) > 0 ? /* @__PURE__ */ jsxs19(Fragment18, { children: [
10822
- /* @__PURE__ */ jsx32(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Banks", ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
10823
- setActiveinBank("form");
10824
- } }),
10825
- /* @__PURE__ */ jsx32("div", { className: "form-group-frac", style: { padding: "0" }, children: /* @__PURE__ */ jsx32("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer, children: formatUSD((_k = Number(bankAmount)) == null ? void 0 : _k.toFixed(2)) }) })
10826
- ] }) : /* @__PURE__ */ jsxs19("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
10827
- if (e.key === "Enter" && loading) {
10828
- e.preventDefault();
10829
- e.stopPropagation();
10830
- }
10831
- }, children: [
10832
- /* @__PURE__ */ jsxs19("div", { className: "ach-scrl", style: {
10833
- minHeight: "444px",
10834
- maxHeight: "444px"
10835
- }, children: [
10836
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10837
- /* @__PURE__ */ jsx32("label", { htmlFor: "nameonaccount", children: "Name on account" }),
10838
- /* @__PURE__ */ jsx32("input", { type: "text", id: "nameonaccount", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", name: "name", value: (_l = achData == null ? void 0 : achData.name) != null ? _l : "", onChange: handleChangeAch }),
10839
- (achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
11512
+ ),
11513
+ /* @__PURE__ */ jsx36("label", { htmlFor: "save_card", className: "toggle-label" }),
11514
+ /* @__PURE__ */ jsx36("label", { htmlFor: "save_card", children: "Save card for future payments " }),
11515
+ /* @__PURE__ */ jsxs21("div", { className: "frac-tooltip-wrapper", children: [
11516
+ /* @__PURE__ */ jsx36("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs21(
11517
+ "svg",
11518
+ {
11519
+ xmlns: "http://www.w3.org/2000/svg",
11520
+ width: "20",
11521
+ height: "20",
11522
+ viewBox: "0 0 20 20",
11523
+ fill: "none",
11524
+ children: [
11525
+ /* @__PURE__ */ jsx36("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
11526
+ /* @__PURE__ */ jsx36(
11527
+ "path",
11528
+ {
11529
+ 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",
11530
+ fill: "#161616"
11531
+ }
11532
+ )
11533
+ ]
11534
+ }
11535
+ ) }),
11536
+ /* @__PURE__ */ jsx36("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs21("p", { children: [
11537
+ "If checked, I agree to give the ",
11538
+ /* @__PURE__ */ jsx36("b", { children: merchantName || "merchant" }),
11539
+ " permission to charge this credit card for agreed-upon purchases in the future."
11540
+ ] }) })
11541
+ ] })
11542
+ ] }) })
10840
11543
  ] }),
10841
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10842
- /* @__PURE__ */ jsx32("label", { htmlFor: "routingnumber", children: "Routing number" }),
10843
- /* @__PURE__ */ jsx32(
10844
- "input",
10845
- {
10846
- type: "text",
10847
- id: "routingnumber",
10848
- className: "form-control-frac",
10849
- maxLength: 9,
10850
- placeholder: "000000000",
10851
- name: "routingNumber",
10852
- value: (_m = achData == null ? void 0 : achData.routingNumber) != null ? _m : "",
10853
- onChange: handleChangeAch
10854
- }
10855
- ),
10856
- (achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.routingNumber })
10857
- ] }),
10858
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10859
- /* @__PURE__ */ jsx32("label", { htmlFor: "accountnumber", children: "Account number" }),
10860
- /* @__PURE__ */ jsx32(
10861
- "input",
10862
- {
10863
- type: "text",
10864
- id: "accountnumber",
10865
- className: "form-control-frac",
10866
- maxLength: 16,
10867
- placeholder: "0000000000",
10868
- name: "accountNumber",
10869
- value: (_n = achData == null ? void 0 : achData.accountNumber) != null ? _n : "",
10870
- onChange: handleChangeAch
10871
- }
10872
- ),
10873
- (achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.accountNumber })
10874
- ] }),
10875
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10876
- /* @__PURE__ */ jsx32("label", { htmlFor: "confirmaccountnumber", children: "Confirm account number" }),
10877
- /* @__PURE__ */ jsx32(
10878
- "input",
10879
- {
10880
- type: "text",
10881
- id: "confirmaccountnumber",
10882
- className: "form-control-frac",
10883
- maxLength: 16,
10884
- placeholder: "0000000000",
10885
- name: "confirmAccountNumber",
10886
- value: (_o = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _o : "",
10887
- onChange: handleChangeAch
10888
- }
10889
- ),
10890
- (achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.confirmAccountNumber })
10891
- ] }),
10892
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10893
- /* @__PURE__ */ jsx32("label", { htmlFor: "bankname", children: "Bank name" }),
10894
- /* @__PURE__ */ jsx32(
10895
- "input",
10896
- {
10897
- type: "text",
10898
- id: "bankname",
10899
- className: "form-control-frac",
10900
- maxLength: 100,
10901
- placeholder: "My Bank",
10902
- name: "bankName",
10903
- value: (_p = achData == null ? void 0 : achData.bankName) != null ? _p : "",
10904
- onChange: handleChangeAch
10905
- }
10906
- ),
10907
- (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.bankName })
10908
- ] }),
10909
- ((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10910
- /* @__PURE__ */ jsx32("label", { htmlFor: "companyName", children: "Company name" }),
10911
- /* @__PURE__ */ jsx32(
10912
- "input",
10913
- {
10914
- type: "text",
10915
- id: "companyName",
10916
- className: "form-control-frac",
10917
- maxLength: 100,
10918
- placeholder: "My Company",
10919
- name: "companyName",
10920
- value: (_q = achData == null ? void 0 : achData.companyName) != null ? _q : "",
10921
- onChange: handleChangeAch
10922
- }
10923
- ),
10924
- (achError == null ? void 0 : achError.companyName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.companyName })
10925
- ] }),
10926
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10927
- /* @__PURE__ */ jsx32("label", { htmlFor: "accounttype", children: "Select account type" }),
10928
- /* @__PURE__ */ jsxs19("select", { name: "accountType", id: "accounttype", className: "form-control-frac", value: (_r = achData == null ? void 0 : achData.accountType) != null ? _r : "", onChange: handleChangeAch, children: [
10929
- /* @__PURE__ */ jsx32("option", { value: "", children: "Select account" }),
10930
- accountTypes.map((type) => /* @__PURE__ */ jsx32("option", { value: type.value, children: type.label }, type.value))
11544
+ /* @__PURE__ */ jsx36("div", { className: "form-group-frac", style: { marginTop: "20px", padding: "0" }, children: /* @__PURE__ */ jsx36("button", { type: "submit", style: { margin: 0, display: onSubmit ? "none" : "block" }, className: "pay-button", children: partialAmount ? formatUSD((_k = Number(partialAmount)) == null ? void 0 : _k.toFixed(2)) : formatUSD((_l = Number(amount)) == null ? void 0 : _l.toFixed(2)) }) })
11545
+ ] })
11546
+ ] }),
11547
+ /* @__PURE__ */ jsx36("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent", children: /* @__PURE__ */ jsxs21(Fragment20, { children: [
11548
+ !onSubmit && /* @__PURE__ */ jsxs21("div", { className: "frac-heading-card-wrap", children: [
11549
+ /* @__PURE__ */ jsx36("div", { className: "frac-backarrow", children: (bankList == null ? void 0 : bankList.length) > 0 && activeinBank === "form" && /* @__PURE__ */ jsxs21("button", { className: "charge-payment-back-btn ", onClick: () => setActiveinBank("list"), children: [
11550
+ " ",
11551
+ /* @__PURE__ */ jsx36(IoArrowBack4, {})
11552
+ ] }) }),
11553
+ /* @__PURE__ */ jsx36("h6", { className: "frac-card-payment-heading", children: "Bank Payment" })
11554
+ ] }),
11555
+ activeinBank === "list" && (bankList == null ? void 0 : bankList.length) > 0 ? /* @__PURE__ */ jsxs21(Fragment20, { children: [
11556
+ /* @__PURE__ */ jsx36(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Banks", ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
11557
+ setActiveinBank("form");
11558
+ } }),
11559
+ /* @__PURE__ */ jsx36("div", { className: "form-group-frac", style: { padding: "0", display: onSubmit ? "none" : "block" }, children: /* @__PURE__ */ jsx36("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer, children: formatUSD((_m = Number(bankAmount)) == null ? void 0 : _m.toFixed(2)) }) })
11560
+ ] }) : /* @__PURE__ */ jsxs21("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, ref: bankFormRef, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
11561
+ if (e.key === "Enter" && loading) {
11562
+ e.preventDefault();
11563
+ e.stopPropagation();
11564
+ }
11565
+ }, children: [
11566
+ /* @__PURE__ */ jsxs21("div", { className: "ach-scrl", style: {
11567
+ minHeight: "444px",
11568
+ maxHeight: "444px"
11569
+ }, children: [
11570
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11571
+ /* @__PURE__ */ jsx36("label", { htmlFor: "nameonaccount", children: "Name on account" }),
11572
+ /* @__PURE__ */ jsx36("input", { type: "text", id: "nameonaccount", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", name: "name", value: (_n = achData == null ? void 0 : achData.name) != null ? _n : "", onChange: handleChangeAch }),
11573
+ (achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
11574
+ ] }),
11575
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11576
+ /* @__PURE__ */ jsx36("label", { htmlFor: "routingnumber", children: "Routing number" }),
11577
+ /* @__PURE__ */ jsx36(
11578
+ "input",
11579
+ {
11580
+ type: "text",
11581
+ id: "routingnumber",
11582
+ className: "form-control-frac",
11583
+ maxLength: 9,
11584
+ placeholder: "000000000",
11585
+ name: "routingNumber",
11586
+ value: (_o = achData == null ? void 0 : achData.routingNumber) != null ? _o : "",
11587
+ onChange: handleChangeAch
11588
+ }
11589
+ ),
11590
+ (achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.routingNumber })
11591
+ ] }),
11592
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11593
+ /* @__PURE__ */ jsx36("label", { htmlFor: "accountnumber", children: "Account number" }),
11594
+ /* @__PURE__ */ jsx36(
11595
+ "input",
11596
+ {
11597
+ type: "text",
11598
+ id: "accountnumber",
11599
+ className: "form-control-frac",
11600
+ maxLength: 16,
11601
+ placeholder: "0000000000",
11602
+ name: "accountNumber",
11603
+ value: (_p = achData == null ? void 0 : achData.accountNumber) != null ? _p : "",
11604
+ onChange: handleChangeAch
11605
+ }
11606
+ ),
11607
+ (achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.accountNumber })
11608
+ ] }),
11609
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11610
+ /* @__PURE__ */ jsx36("label", { htmlFor: "confirmaccountnumber", children: "Confirm account number" }),
11611
+ /* @__PURE__ */ jsx36(
11612
+ "input",
11613
+ {
11614
+ type: "text",
11615
+ id: "confirmaccountnumber",
11616
+ className: "form-control-frac",
11617
+ maxLength: 16,
11618
+ placeholder: "0000000000",
11619
+ name: "confirmAccountNumber",
11620
+ value: (_q = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _q : "",
11621
+ onChange: handleChangeAch
11622
+ }
11623
+ ),
11624
+ (achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.confirmAccountNumber })
11625
+ ] }),
11626
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11627
+ /* @__PURE__ */ jsx36("label", { htmlFor: "bankname", children: "Bank name" }),
11628
+ /* @__PURE__ */ jsx36(
11629
+ "input",
11630
+ {
11631
+ type: "text",
11632
+ id: "bankname",
11633
+ className: "form-control-frac",
11634
+ maxLength: 100,
11635
+ placeholder: "My Bank",
11636
+ name: "bankName",
11637
+ value: (_r = achData == null ? void 0 : achData.bankName) != null ? _r : "",
11638
+ onChange: handleChangeAch
11639
+ }
11640
+ ),
11641
+ (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.bankName })
11642
+ ] }),
11643
+ ((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11644
+ /* @__PURE__ */ jsx36("label", { htmlFor: "companyName", children: "Company name" }),
11645
+ /* @__PURE__ */ jsx36(
11646
+ "input",
11647
+ {
11648
+ type: "text",
11649
+ id: "companyName",
11650
+ className: "form-control-frac",
11651
+ maxLength: 100,
11652
+ placeholder: "My Company",
11653
+ name: "companyName",
11654
+ value: (_s = achData == null ? void 0 : achData.companyName) != null ? _s : "",
11655
+ onChange: handleChangeAch
11656
+ }
11657
+ ),
11658
+ (achError == null ? void 0 : achError.companyName) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.companyName })
11659
+ ] }),
11660
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11661
+ /* @__PURE__ */ jsx36("label", { htmlFor: "accounttype", children: "Select account type" }),
11662
+ /* @__PURE__ */ jsxs21("select", { name: "accountType", id: "accounttype", className: "form-control-frac", value: (_t = achData == null ? void 0 : achData.accountType) != null ? _t : "", onChange: handleChangeAch, children: [
11663
+ /* @__PURE__ */ jsx36("option", { value: "", children: "Select account" }),
11664
+ accountTypes.map((type) => /* @__PURE__ */ jsx36("option", { value: type.value, children: type.label }, type.value))
11665
+ ] }),
11666
+ bankFeeAmount > 0 && /* @__PURE__ */ jsxs21("small", { className: "frac-fee-text", children: [
11667
+ "There is a processing fee of ",
11668
+ /* @__PURE__ */ jsx36("span", { className: "frac-fee-amount", children: formatUSD(bankFeeAmount.toFixed(2)) }),
11669
+ "."
11670
+ ] }),
11671
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
11672
+ /* @__PURE__ */ jsx36("input", { type: "checkbox", id: "achconsent", className: "", checked: isBankConsentChecked, onChange: (e) => {
11673
+ setIsBankConsentChecked(e.target.checked);
11674
+ if (e.target.checked) {
11675
+ setErrorBankConsent("");
11676
+ }
11677
+ } }),
11678
+ /* @__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.` })
11679
+ ] }),
11680
+ errorBankConsent && /* @__PURE__ */ jsx36("span", { className: "error-span", children: errorBankConsent }),
11681
+ customerId && /* @__PURE__ */ jsxs21("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
11682
+ /* @__PURE__ */ jsx36("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
11683
+ /* @__PURE__ */ jsx36("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save Bank" })
11684
+ ] }),
11685
+ saveACHinfo && /* @__PURE__ */ jsx36("div", { className: "form-group-frac saveachtext", children: /* @__PURE__ */ jsxs21("p", { children: [
11686
+ "If checked, I agree to give the ",
11687
+ /* @__PURE__ */ jsx36("b", { children: merchantName || "merchant" }),
11688
+ " permission to charge this bank account for agreed-upon purchases in the future."
11689
+ ] }) })
10931
11690
  ] })
10932
11691
  ] }),
10933
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
10934
- /* @__PURE__ */ jsx32("input", { type: "checkbox", id: "achconsent", className: "", checked: isBankConsentChecked, onChange: (e) => {
10935
- setIsBankConsentChecked(e.target.checked);
10936
- if (e.target.checked) {
10937
- setErrorBankConsent("");
10938
- }
10939
- } }),
10940
- /* @__PURE__ */ jsx32("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.` })
10941
- ] }),
10942
- errorBankConsent && /* @__PURE__ */ jsx32("span", { className: "error-span", children: errorBankConsent }),
10943
- customerId && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
10944
- /* @__PURE__ */ jsx32("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
10945
- /* @__PURE__ */ jsx32("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save Bank" })
10946
- ] }),
10947
- saveACHinfo && /* @__PURE__ */ jsx32("div", { className: "form-group-frac saveachtext", children: /* @__PURE__ */ jsxs19("p", { children: [
10948
- "If checked, I agree to give the ",
10949
- /* @__PURE__ */ jsx32("b", { children: merchantName || "merchant" }),
10950
- " permission to charge this bank account for agreed-upon purchases in the future."
10951
- ] }) })
10952
- ] }),
10953
- /* @__PURE__ */ jsx32("div", { className: "form-group-frac ", children: /* @__PURE__ */ jsx32("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit", children: formatUSD((_s = Number(bankAmount)) == null ? void 0 : _s.toFixed(2)) }) })
10954
- ] })
10955
- ] }) })
10956
- ] }) }) }) })
11692
+ /* @__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)) }) })
11693
+ ] })
11694
+ ] }) })
11695
+ ] })
11696
+ ] }) }) })
10957
11697
  ] })
10958
11698
  ] })
10959
11699
  ] })
@@ -10964,7 +11704,7 @@ var ModelContentSky_default = ModelContentSky;
10964
11704
 
10965
11705
  // src/app/components/Skysystemz/PayButtonWithForm.tsx
10966
11706
  import axios10 from "axios";
10967
- import { Fragment as Fragment19, jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
11707
+ import { Fragment as Fragment21, jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
10968
11708
  var PaymentWidget = ({
10969
11709
  amount,
10970
11710
  bankAmount,
@@ -10986,12 +11726,12 @@ var PaymentWidget = ({
10986
11726
  bankSurcharge,
10987
11727
  partialRef
10988
11728
  }) => {
10989
- const [show, setShow] = useState11(autoTrigger || false);
10990
- const [loading, setLoading] = useState11(false);
10991
- const [childHandleClose, setChildHandleClose] = useState11(() => () => {
11729
+ const [show, setShow] = useState12(autoTrigger || false);
11730
+ const [loading, setLoading] = useState12(false);
11731
+ const [childHandleClose, setChildHandleClose] = useState12(() => () => {
10992
11732
  });
10993
- const [orderGuid, setOrderGuid] = useState11(null);
10994
- const [remainingAmount, setRemainingAmount] = useState11(null);
11733
+ const [orderGuid, setOrderGuid] = useState12(null);
11734
+ const [remainingAmount, setRemainingAmount] = useState12(null);
10995
11735
  const initialCommonProps = useMemo(
10996
11736
  () => ({
10997
11737
  amount,
@@ -11038,8 +11778,8 @@ var PaymentWidget = ({
11038
11778
  partialRef
11039
11779
  ]
11040
11780
  );
11041
- const [commonProps, setCommonProps] = useState11(initialCommonProps);
11042
- useEffect16(() => {
11781
+ const [commonProps, setCommonProps] = useState12(initialCommonProps);
11782
+ useEffect18(() => {
11043
11783
  if (show) {
11044
11784
  setCommonProps(initialCommonProps);
11045
11785
  }
@@ -11070,29 +11810,556 @@ var PaymentWidget = ({
11070
11810
  setLoading(false);
11071
11811
  }
11072
11812
  };
11073
- useEffect16(() => {
11813
+ useEffect18(() => {
11074
11814
  if (show && isPartial && partialRef) {
11075
11815
  getskyosOrderDetails();
11076
11816
  }
11077
11817
  }, [show, isPartial, partialRef]);
11078
- return /* @__PURE__ */ jsxs20(Fragment19, { children: [
11079
- /* @__PURE__ */ jsx33("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
11080
- /* @__PURE__ */ jsx33(DataScript, {}),
11081
- /* @__PURE__ */ jsx33(FractalTokenizerScript, {}),
11082
- /* @__PURE__ */ jsx33(SkyChargewidgetstyles, {}),
11083
- /* @__PURE__ */ jsx33(CardBankRadioStyles, {}),
11084
- /* @__PURE__ */ jsx33(CustomModal2styles_default, {}),
11085
- /* @__PURE__ */ jsx33(DataCapScriptLoader, {}),
11086
- !autoTrigger && /* @__PURE__ */ jsxs20("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
11818
+ return /* @__PURE__ */ jsxs22(Fragment21, { children: [
11819
+ /* @__PURE__ */ jsx37("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
11820
+ /* @__PURE__ */ jsx37(DataScript, {}),
11821
+ /* @__PURE__ */ jsx37(FractalTokenizerScript, {}),
11822
+ /* @__PURE__ */ jsx37(SkyChargewidgetstyles, {}),
11823
+ /* @__PURE__ */ jsx37(CardBankRadioStyles, {}),
11824
+ /* @__PURE__ */ jsx37(CustomModal2styles_default, {}),
11825
+ /* @__PURE__ */ jsx37(DataCapScriptLoader, {}),
11826
+ !autoTrigger && /* @__PURE__ */ jsxs22("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
11827
+ submitBtnText,
11828
+ submitBtnIcon
11829
+ ] }),
11830
+ !autoTrigger ? /* @__PURE__ */ jsx37(CustomModal2_default, { open: show, onClose: childHandleClose, children: /* @__PURE__ */ jsx37(ModelContentSky_default, __spreadProps(__spreadValues({ show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount })) }) : /* @__PURE__ */ jsx37(ModelContentSky_default, __spreadProps(__spreadValues({ show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount }))
11831
+ ] });
11832
+ };
11833
+
11834
+ // src/app/components/Skysystemz/EmbeddedCheckout.tsx
11835
+ import { useEffect as useEffect20, useState as useState13, useMemo as useMemo2 } from "react";
11836
+ import axios11 from "axios";
11837
+
11838
+ // src/app/components/Skysystemz/EmbeddedCheckoutStyles.tsx
11839
+ import { jsx as jsx38 } from "react/jsx-runtime";
11840
+ function EmbeddedCheckoutStyles({ extraCustomCSS }) {
11841
+ return /* @__PURE__ */ jsx38("style", { children: `
11842
+
11843
+ .pay-amount-conatiner{
11844
+ margin-top: 20px !important;
11845
+ margin-bottom: 20px !important ;
11846
+ }
11847
+
11848
+ .frac-pay-container.pay-container {
11849
+ grid-template-columns:1fr;
11850
+ }
11851
+
11852
+
11853
+ /* Card */
11854
+ .plan-card {
11855
+ width: 100%;
11856
+ font-family: Inter, sans-serif;
11857
+ background: #fff;
11858
+ }
11859
+
11860
+ /* Header */
11861
+ .card-header {
11862
+ padding: 12px 0 0 0;
11863
+ }
11864
+
11865
+ /* Button */
11866
+ .collapse-btn {
11867
+ width: 100%;
11868
+ background: none;
11869
+ border: none;
11870
+ display: flex;
11871
+ justify-content: space-between;
11872
+ align-items: center;
11873
+ cursor: pointer;
11874
+ font-size: 15px;
11875
+ padding: 0;
11876
+ }
11877
+
11878
+ /* Arrow */
11879
+ .arrow {
11880
+ transition: transform 0.3s ease;
11881
+ height: 8px;
11882
+ }
11883
+
11884
+ /* Open State */
11885
+ .collapse-btn.open .arrow {
11886
+ transform: rotate(180deg); /* Down */
11887
+ }
11888
+
11889
+ /* Body */
11890
+ .card-body {
11891
+ padding: 0;
11892
+ }
11893
+
11894
+ /* Plan Header */
11895
+ .plan-header {
11896
+ font-size: 15px;
11897
+ font-weight: 600;
11898
+ }
11899
+
11900
+ /* Scrollable List */
11901
+ .plan-list {
11902
+ max-height: 200px;
11903
+ overflow-y: auto;
11904
+ padding-right: 6px;
11905
+ }
11906
+
11907
+ /* Items */
11908
+ .plan-item {
11909
+ display: flex;
11910
+ justify-content: space-between;
11911
+ padding: 6px 0;
11912
+ font-size: 14px;
11913
+ }
11914
+
11915
+ /* Badges */
11916
+ .badge {
11917
+ padding: 4px 10px;
11918
+ border-radius: 12px;
11919
+ font-size: 12px;
11920
+ font-weight: 500;
11921
+ }
11922
+
11923
+ .badge-included {
11924
+ background: #f1f3f5;
11925
+ color: #495057;
11926
+ }
11927
+
11928
+ .badge-available {
11929
+ background: #f8f9fa;
11930
+ color: #212529;
11931
+ }
11932
+
11933
+ /* Helpers */
11934
+ .row-between {
11935
+ display: flex;
11936
+ justify-content: space-between;
11937
+ }
11938
+
11939
+ .text-end {
11940
+ text-align: right;
11941
+ }
11942
+
11943
+ .text-muted {
11944
+ color: #6c757d;
11945
+ font-size: 12px;
11946
+ }
11947
+
11948
+ .fw-semibold {
11949
+ font-weight: 600;
11950
+ }
11951
+
11952
+ .mb-2 {
11953
+ margin-bottom: 8px;
11954
+ }
11955
+
11956
+ /* Divider */
11957
+ .divider {
11958
+ height: 1px;
11959
+ background: #e5e7eb;
11960
+ margin: 8px 0;
11961
+ }
11962
+
11963
+ /* Collapse Animation */
11964
+ .collapse {
11965
+ max-height: 0;
11966
+ overflow: hidden;
11967
+ transition: max-height 0.3s ease;
11968
+ }
11969
+
11970
+ .collapse.show {
11971
+ max-height: 1000px;
11972
+ }
11973
+ .frac-pay-container.pay-container {
11974
+ grid-template-columns:1fr;
11975
+ }
11976
+ .frac-payment-form-div .amt-pay-con {
11977
+ padding-right: 0px;
11978
+ }
11979
+ .frac-payment-form-div .ach-scrl {
11980
+ padding-right: 0px;
11981
+ gap: 10px;
11982
+ max-height: fit-content !important;
11983
+ min-height: fit-content !important;
11984
+ overflow: hidden !important;
11985
+ }
11986
+ .frac-payment-form-div .frac-card-bank-radio-main {
11987
+ display: flex;
11988
+ flex-direction: row;
11989
+ align-items: flex-start;
11990
+ align-self: stretch;
11991
+ border-radius: 14px;
11992
+ border: none;
11993
+ overflow: visible;
11994
+ gap: 10px;
11995
+ }
11996
+ .frac-payment-form-div .frac-card-bank-radio {
11997
+ display: flex;
11998
+ padding: 12px 16px;
11999
+ justify-content: space-between;
12000
+ align-items: center;
12001
+ align-self: stretch;
12002
+ width: 50%;
12003
+ border: 1px solid #E0DFE2;
12004
+ border-radius: 10px;
12005
+ box-shadow: rgba(149, 157, 165, 0.2) 0px 1px 4px;
12006
+ }
12007
+ .frac-payment-form-div .frac-card-bank-radio.frac-active {
12008
+ background: #fff;
12009
+ border: 2px solid #004eab !important;
12010
+ }
12011
+
12012
+ .frac-payment-form-div .form-control-frac {
12013
+ border: 1px solid #dee2e6 !important;
12014
+ border-radius: 0.375rem !important;
12015
+ background-color: #F6F6F7;
12016
+ box-shadow: 1px 1px 2px inset rgba(0, 0, 0, 0.1);
12017
+ }
12018
+ .frac-payment-form-div .form-control-frac:focus {
12019
+ border: 1px solid #004eab !important;
12020
+ }
12021
+ .frac-payment-form-div .card-expiry-new {
12022
+ border: none;
12023
+ gap: 10px;
12024
+ }
12025
+ .frac-payment-form-div .exp-date-year-container {
12026
+ gap: 10px;
12027
+ width: 100%;
12028
+ }
12029
+ .frac-payment-form-div .card-type-logo-wrap{
12030
+ position: absolute;
12031
+ right: 10px;
12032
+ max-width: 30px;
12033
+ }
12034
+ .detials-wrap.detials-wrap-1 {
12035
+ display: flex;
12036
+ flex-wrap: wrap;
12037
+ }
12038
+ @media screen and (max-width: 1280px) {
12039
+ .frac-pay-container.pay-container {
12040
+ grid-template-columns: 1fr;
12041
+ border: none;
12042
+ }
12043
+ }
12044
+ @media screen and (max-width: 899px) {
12045
+ .detials-wrap {
12046
+ grid-template-columns: 1fr !important;
12047
+ }
12048
+ .frac-payment-form-div .exp-date-year-container{
12049
+ width: 100%;}
12050
+
12051
+ }
12052
+ @media screen and (max-width: 575px) {
12053
+ .frac-payment-form-div .card-type-logo-wrap{
12054
+ max-width: 30px;
12055
+ }
12056
+ form#ACHPaymentForm .ach-scrl {
12057
+ grid-template-columns: 1fr !important;
12058
+ }
12059
+ @media screen and (max-width: 375px) {
12060
+ .frac-payment-form-div .exp-date-year-container {
12061
+ flex-direction: column;
12062
+ }
12063
+ .parent-pay-container {
12064
+ padding: 10px;
12065
+ }
12066
+ }
12067
+ }
12068
+ .box-inner-card-text{
12069
+ display: flex;
12070
+ gap: 0px;
12071
+ flex-direction: column;
12072
+ }
12073
+ .box-inner-card-text .frac-payment-type-logo {
12074
+ width: 17px;
12075
+ height: 17px;
12076
+ aspect-ratio: 1/1;
12077
+ }
12078
+ .exp-date-year-wrap.form-control-frac input {
12079
+ background: transparent;
12080
+ border: none;
12081
+ outline: none;
12082
+ font-size: 1rem;
12083
+ font-weight: 400;
12084
+ }
12085
+ .exp-date-year-wrap.form-control-frac {
12086
+ display: flex;
12087
+ gap: 2px;
12088
+ }
12089
+ .exp-date-year-wrap input.exp-month {
12090
+ width: 32px;
12091
+ }
12092
+ .detials-wrap {
12093
+ display: grid;
12094
+ grid-template-columns: 1fr 1fr;
12095
+ gap: 10px;
12096
+ }
12097
+ .detials-wrap.detials-wrap-2{
12098
+ grid-template-columns: 1fr 1fr;
12099
+ }
12100
+ form#ACHPaymentForm .ach-scrl {
12101
+ display: grid;
12102
+ grid-gap: 0px 10px;
12103
+ grid-template-columns: 1fr;
12104
+ }
12105
+ .plan-list {
12106
+ max-height: 130px;
12107
+ min-height: 130px;
12108
+ overflow-y: auto;
12109
+ padding-right: 6px;
12110
+ }
12111
+ .plan-list::-webkit-scrollbar {
12112
+ width: 3px;
12113
+ background-color: #F5F5F5;
12114
+ }
12115
+ .plan-list::-webkit-scrollbar-thumb {
12116
+ background-color: #35254D;
12117
+ }
12118
+ div#cvv {
12119
+ border-top-left-radius: 0;
12120
+ border-bottom-left-radius: 0;
12121
+ border-top: 0;
12122
+ border-bottom: 0;
12123
+ border-right: 0;
12124
+ }
12125
+ div#exp_year {
12126
+ height: 36px;
12127
+ width: calc(100% + 1px);
12128
+ border-radius: 0;
12129
+ border-top: 0;
12130
+ border-bottom: 0;
12131
+ border-right: 1px solid #dee2e6;
12132
+ }
12133
+ div#exp_month {
12134
+ width: calc(100% + 1px);
12135
+ border-top-right-radius: 0;
12136
+ border-bottom-right-radius: 0;
12137
+ border: 0;
12138
+ border-right: 1px solid #dee2e6;
12139
+ }
12140
+ .exp-date-year-container .form-group {
12141
+ flex: 1;
12142
+ }
12143
+ .input-main-wrap-frac{
12144
+ margin:0px !important;
12145
+ padding:0px !important;
12146
+ }
12147
+ .toggle-num-wrapper.toggle-num-wrapper-new {
12148
+ border: 1px solid #dee2e6 !important;
12149
+ border-radius: 0.375rem !important;
12150
+ background-color: #F6F6F7;
12151
+ box-shadow: 1px 1px 2px inset rgba(0, 0, 0, 0.1);
12152
+ }
12153
+ .toggle-num-wrapper-new div#card_number {
12154
+ padding: 0px 10px;
12155
+ border: none;
12156
+ border-bottom: 1px solid #dee2e6;
12157
+ }
12158
+ .toggle-num-wrapper-new .card-crdi.card-expiry-new {
12159
+ padding: 0px 10px;
12160
+ }
12161
+ .toggle-num-wrapper-new .input-main-wrap-frac {
12162
+ height: 36px;
12163
+ }
12164
+ .toggle-num-wrapper-new:focus {
12165
+ border: 1px solid #004eab !important;
12166
+ }
12167
+ .frac-card-title-main {
12168
+ display: flex;
12169
+ align-items: start;
12170
+ gap: 4px;
12171
+ flex-direction: column;
12172
+ }
12173
+ .parent-pay-container {
12174
+ padding: 24px;
12175
+ background-color: #ffffff !important;
12176
+ border-radius: 15px;
12177
+ min-width: 300px;
12178
+ }
12179
+
12180
+
12181
+ ${extraCustomCSS}
12182
+
12183
+ ` });
12184
+ }
12185
+
12186
+ // src/app/components/Atoms/Applepay/ApplePayScriptLoader.tsx
12187
+ import { useEffect as useEffect19 } from "react";
12188
+ var applePayScriptLoaded = false;
12189
+ var ApplePayScriptLoader = () => {
12190
+ useEffect19(() => {
12191
+ if (applePayScriptLoaded) return;
12192
+ const existingScript = document.querySelector(
12193
+ `script[src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js"]`
12194
+ );
12195
+ if (!existingScript) {
12196
+ const script2 = document.createElement("script");
12197
+ script2.src = "https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js";
12198
+ script2.async = true;
12199
+ script2.onload = () => {
12200
+ console.log("\u2705 Apple Pay script loaded");
12201
+ applePayScriptLoaded = true;
12202
+ console.log("ApplePaySession:", window.ApplePaySession);
12203
+ };
12204
+ script2.onerror = (err) => {
12205
+ console.error("\u274C Apple Pay script failed", err);
12206
+ };
12207
+ document.head.appendChild(script2);
12208
+ } else {
12209
+ applePayScriptLoaded = true;
12210
+ }
12211
+ }, []);
12212
+ return null;
12213
+ };
12214
+
12215
+ // src/app/components/Skysystemz/EmbeddedCheckout.tsx
12216
+ import { Fragment as Fragment22, jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
12217
+ var EmbeddedCheckout = ({
12218
+ amount,
12219
+ bankAmount,
12220
+ submitBtnText = "Pay",
12221
+ session_token,
12222
+ customerId,
12223
+ callback,
12224
+ merchantName = "merchant",
12225
+ isPreAuth,
12226
+ surcharge = "0",
12227
+ submitBtnClass,
12228
+ submitBtnIcon,
12229
+ isRequest,
12230
+ pass_fee,
12231
+ pass_fee_amount,
12232
+ require3ds = false,
12233
+ autoTrigger = false,
12234
+ isPartial,
12235
+ bankSurcharge,
12236
+ partialRef,
12237
+ onSubmit,
12238
+ onLoad,
12239
+ customCSS: customCSS2
12240
+ }) => {
12241
+ const [show, setShow] = useState13(false);
12242
+ const [loading, setLoading] = useState13(false);
12243
+ const [childHandleClose, setChildHandleClose] = useState13(() => () => {
12244
+ });
12245
+ const [orderGuid, setOrderGuid] = useState13(null);
12246
+ const [remainingAmount, setRemainingAmount] = useState13(null);
12247
+ const initialCommonProps = useMemo2(
12248
+ () => ({
12249
+ amount,
12250
+ bankAmount,
12251
+ submitBtnText,
12252
+ session_token,
12253
+ customerId,
12254
+ callback,
12255
+ merchantName,
12256
+ isPreAuth,
12257
+ surcharge,
12258
+ submitBtnClass,
12259
+ submitBtnIcon,
12260
+ isRequest,
12261
+ pass_fee,
12262
+ pass_fee_amount,
12263
+ require3ds,
12264
+ autoTrigger,
12265
+ setShow,
12266
+ setHandleCloseRef: setChildHandleClose,
12267
+ isPartial,
12268
+ bankSurcharge,
12269
+ partialRef
12270
+ }),
12271
+ [
12272
+ amount,
12273
+ bankAmount,
12274
+ submitBtnText,
12275
+ session_token,
12276
+ customerId,
12277
+ callback,
12278
+ merchantName,
12279
+ isPreAuth,
12280
+ surcharge,
12281
+ submitBtnClass,
12282
+ submitBtnIcon,
12283
+ isRequest,
12284
+ pass_fee,
12285
+ pass_fee_amount,
12286
+ require3ds,
12287
+ autoTrigger,
12288
+ isPartial,
12289
+ bankSurcharge,
12290
+ partialRef
12291
+ ]
12292
+ );
12293
+ const [commonProps, setCommonProps] = useState13(initialCommonProps);
12294
+ useEffect20(() => {
12295
+ if (show) {
12296
+ setCommonProps(initialCommonProps);
12297
+ }
12298
+ }, [show, initialCommonProps]);
12299
+ const getskyosOrderDetails = async () => {
12300
+ var _a;
12301
+ setLoading(true);
12302
+ try {
12303
+ const res = await axios11.get(
12304
+ `${masterBaseUrl}api/v1/gateway/get-order-details/${session_token}`,
12305
+ { params: { isPartial, partialRef } }
12306
+ );
12307
+ if ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.result) {
12308
+ const data = res.data.data;
12309
+ if (data == null ? void 0 : data.orderGuid) {
12310
+ setOrderGuid(data == null ? void 0 : data.orderGuid);
12311
+ setRemainingAmount(data == null ? void 0 : data.remainingAmount);
12312
+ }
12313
+ setCommonProps((prev) => __spreadProps(__spreadValues({}, prev), {
12314
+ amount: data.amount,
12315
+ pass_fee_amount: data.pass_fee_amount,
12316
+ pass_fee: data.pass_fee
12317
+ }));
12318
+ }
12319
+ } catch (error) {
12320
+ console.log("error while getting skyosorderdeatils", error);
12321
+ } finally {
12322
+ setLoading(false);
12323
+ }
12324
+ };
12325
+ useEffect20(() => {
12326
+ if (show && isPartial && partialRef) {
12327
+ getskyosOrderDetails();
12328
+ }
12329
+ }, [show, isPartial, partialRef]);
12330
+ console.log(onLoad, "onLoad");
12331
+ useEffect20(() => {
12332
+ const supported = !!window.ApplePaySession;
12333
+ let canPay = false;
12334
+ if (supported) {
12335
+ try {
12336
+ canPay = window.ApplePaySession.canMakePayments();
12337
+ } catch (e) {
12338
+ }
12339
+ }
12340
+ console.log(`ApplePaySession: ${supported}, canMakePayments: ${canPay}`);
12341
+ }, []);
12342
+ return /* @__PURE__ */ jsxs23(Fragment22, { children: [
12343
+ /* @__PURE__ */ jsx39("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
12344
+ /* @__PURE__ */ jsx39(DataScript, {}),
12345
+ /* @__PURE__ */ jsx39(FractalTokenizerScript, {}),
12346
+ /* @__PURE__ */ jsx39(SkyChargewidgetstyles, {}),
12347
+ /* @__PURE__ */ jsx39(CardBankRadioStyles, {}),
12348
+ /* @__PURE__ */ jsx39(CustomModal2styles_default, {}),
12349
+ /* @__PURE__ */ jsx39(DataCapScriptLoader, {}),
12350
+ /* @__PURE__ */ jsx39(ApplePayScriptLoader, {}),
12351
+ /* @__PURE__ */ jsx39(EmbeddedCheckoutStyles, { extraCustomCSS: customCSS2 }),
12352
+ !autoTrigger && /* @__PURE__ */ jsxs23("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
11087
12353
  submitBtnText,
11088
12354
  submitBtnIcon
11089
12355
  ] }),
11090
- !autoTrigger ? /* @__PURE__ */ jsx33(CustomModal2_default, { open: show, onClose: childHandleClose, children: /* @__PURE__ */ jsx33(ModelContentSky_default, __spreadProps(__spreadValues({ show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount })) }) : /* @__PURE__ */ jsx33(ModelContentSky_default, __spreadProps(__spreadValues({ show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount }))
12356
+ !autoTrigger ? /* @__PURE__ */ jsx39(CustomModal2_default, { open: show, onClose: childHandleClose, children: /* @__PURE__ */ jsx39(ModelContentSky_default, __spreadProps(__spreadValues({ onLoad, onSubmit, show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount })) }) : /* @__PURE__ */ jsx39(ModelContentSky_default, __spreadProps(__spreadValues({ onLoad, onSubmit, show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount }))
11091
12357
  ] });
11092
12358
  };
11093
12359
  export {
11094
12360
  AddCardEasyPay as AddCard,
11095
12361
  CardOnFile,
12362
+ EmbeddedCheckout,
11096
12363
  GetPaymentPage,
11097
12364
  PartialPayment,
11098
12365
  PaymentWidget,