@fractalpay/fractalpay-next-test 0.0.36 → 0.0.37

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-test",
42
- version: "0.0.36",
42
+ version: "0.0.37",
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", {}),
@@ -223,36 +241,60 @@ if (name === "@fractalpay/fractalpay-next-dev") {
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 = {
@@ -2908,7 +2950,7 @@ function ErrorCardMszStyle() {
2908
2950
 
2909
2951
  // src/app/components/ErrorCardMessage/ErrorCardMessage.tsx
2910
2952
  import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
2911
- var ErrorCardMessage = ({ onClose, error }) => {
2953
+ var ErrorCardMessage = ({ onClose, error, autoTrigger = false }) => {
2912
2954
  return /* @__PURE__ */ jsxs6(Fragment6, { children: [
2913
2955
  /* @__PURE__ */ jsx12(ErrorCardMszStyle, {}),
2914
2956
  /* @__PURE__ */ jsx12("div", { className: "card-error", children: /* @__PURE__ */ jsx12("div", { className: "payment-error-container", children: /* @__PURE__ */ jsxs6("div", { className: "error-icon", children: [
@@ -2917,7 +2959,7 @@ var ErrorCardMessage = ({ onClose, error }) => {
2917
2959
  /* @__PURE__ */ jsx12("div", { className: "payment-error-text", children: error }),
2918
2960
  /* @__PURE__ */ jsx12("div", { className: "thank-you-text", children: "Try again later " })
2919
2961
  ] }),
2920
- /* @__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" }) })
2921
2963
  ] }) }) })
2922
2964
  ] });
2923
2965
  };
@@ -2934,14 +2976,27 @@ var socketClient_default = socket;
2934
2976
 
2935
2977
  // src/app/components/Atoms/CardBankRadio/CardBankRadio.tsx
2936
2978
  import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
2937
- var CardBankRadio = (props) => {
2938
- 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(
2939
2983
  "div",
2940
2984
  {
2941
2985
  className: `frac-card-bank-radio ${props.activetab === props.value ? "frac-active" : ""}`,
2942
2986
  onClick: () => props.onChange(props.value),
2943
2987
  role: "radio",
2944
- 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
+ /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsx13("input", { name: "paymenttype", checked: props.activetab === props.value, type: "hidden", value: props.value, onChange: (e) => {
2997
+ props.onChange(e.target.value);
2998
+ } }) })
2999
+ ] }) : /* @__PURE__ */ jsxs7(Fragment7, { children: [
2945
3000
  /* @__PURE__ */ jsxs7("div", { className: "frac-card-title-main", children: [
2946
3001
  /* @__PURE__ */ jsx13("img", { src: props.label.toLowerCase() === "card" ? defaultcard : props.label.toLowerCase() === "reader" ? pax : bankNew, className: "frac-payment-type-logo", alt: "" }),
2947
3002
  /* @__PURE__ */ jsxs7("div", { className: "frac-card-label", children: [
@@ -2952,7 +3007,7 @@ var CardBankRadio = (props) => {
2952
3007
  /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsx13("input", { name: "paymenttype", checked: props.activetab === props.value, type: "radio", value: props.value, onChange: (e) => {
2953
3008
  props.onChange(e.target.value);
2954
3009
  } }) })
2955
- ]
3010
+ ] })
2956
3011
  }
2957
3012
  ) });
2958
3013
  };
@@ -2977,6 +3032,7 @@ function CardBankRadioStyles({}) {
2977
3032
  justify-content: space-between;
2978
3033
  align-items: center;
2979
3034
  align-self: stretch;
3035
+ position: relative;
2980
3036
  }
2981
3037
 
2982
3038
  input[type="radio"] {
@@ -3034,6 +3090,28 @@ function CardBankRadioStyles({}) {
3034
3090
  .frac-card-bank-radio.frac-active {
3035
3091
  background: #F6F6F7;
3036
3092
  }
3093
+
3094
+ .frac-saving-badge {
3095
+ padding: 1px 7px !important;
3096
+ border: 1px solid #9ad7ab;
3097
+ border-radius: 999px;
3098
+ background: #e8f8ec;
3099
+ color: #1e6a34;
3100
+ font-size: 10px;
3101
+ font-weight: 600;
3102
+ line-height: 15px;
3103
+ pointer-events: none;
3104
+ }
3105
+
3106
+ .frac-saving-badge-corner {
3107
+ position: absolute;
3108
+ top: 8px;
3109
+ right: 10px;
3110
+ }
3111
+
3112
+ .frac-saving-badge-with-radio {
3113
+ right: 34px;
3114
+ }
3037
3115
  ` });
3038
3116
  }
3039
3117
 
@@ -3211,7 +3289,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
3211
3289
  {
3212
3290
  id: "card_number",
3213
3291
  className: "form-control card-number-new",
3214
- style: { height: `${isSky ? "36px" : "46px"}`, display: "inline-block" }
3292
+ style: { height: `${isSky ? "36px" : "46px"}` }
3215
3293
  }
3216
3294
  ),
3217
3295
  /* @__PURE__ */ jsx17("div", { className: "card-crdi card-expiry-new", children: /* @__PURE__ */ jsxs10("div", { className: "exp-date-year-container", children: [
@@ -3220,7 +3298,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
3220
3298
  {
3221
3299
  id: "exp_month",
3222
3300
  className: "form-control required card-cvv-in",
3223
- style: { height: "36px", display: "inline-block" }
3301
+ style: { height: "36px", display: "block", minHeight: "36px" }
3224
3302
  }
3225
3303
  ) }),
3226
3304
  /* @__PURE__ */ jsx17("div", { className: "exp-year form-group input-main-wrap-frac", children: /* @__PURE__ */ jsx17(
@@ -3228,7 +3306,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
3228
3306
  {
3229
3307
  id: "exp_year",
3230
3308
  className: "form-control required card-cvv-in",
3231
- style: { height: "36px", display: "inline-block" }
3309
+ style: { height: "36px", display: "block", minHeight: "36px" }
3232
3310
  }
3233
3311
  ) }),
3234
3312
  /* @__PURE__ */ jsx17("div", { className: "security-digit form-group input-main-wrap-frac", children: /* @__PURE__ */ jsx17(
@@ -3236,7 +3314,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
3236
3314
  {
3237
3315
  id: "cvv",
3238
3316
  className: "form-control card-cvv-in required",
3239
- style: { height: "36px", display: "inline-block" }
3317
+ style: { height: "36px", display: "block", minHeight: "36px" }
3240
3318
  }
3241
3319
  ) })
3242
3320
  ] }) })
@@ -3359,7 +3437,10 @@ var DataCapFields = ({
3359
3437
  isOpen,
3360
3438
  tokenKey,
3361
3439
  setLoader,
3362
- isAddCard
3440
+ isAddCard,
3441
+ isEmbedded,
3442
+ customCSS: extraCss,
3443
+ height
3363
3444
  }) => {
3364
3445
  const iframeId = "datacap-iframe";
3365
3446
  const resolverRef = useRef2(null);
@@ -3385,15 +3466,37 @@ var DataCapFields = ({
3385
3466
 
3386
3467
  `;
3387
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
+ }
3483
+ if (extraCss) {
3484
+ customCSS += extraCss;
3485
+ }
3388
3486
  const initialize = async () => {
3389
3487
  setLoader == null ? void 0 : setLoader(true);
3390
3488
  setIframeReady(false);
3391
- const waitForSDK = () => new Promise((resolve) => {
3489
+ const waitForSDK = () => new Promise((resolve, reject) => {
3490
+ let attempts = 0;
3392
3491
  const interval = setInterval(() => {
3393
3492
  if (window.DatacapHostedWebToken) {
3394
3493
  clearInterval(interval);
3395
3494
  resolve();
3396
3495
  }
3496
+ if (attempts++ > 50) {
3497
+ clearInterval(interval);
3498
+ reject("Datacap SDK not loaded");
3499
+ }
3397
3500
  }, 100);
3398
3501
  });
3399
3502
  await waitForSDK();
@@ -3416,13 +3519,20 @@ var DataCapFields = ({
3416
3519
  };
3417
3520
  initialize();
3418
3521
  }, [isOpen, tokenKey]);
3419
- window.requestDcToken = () => {
3420
- return new Promise((resolve, reject) => {
3421
- setLoader == null ? void 0 : setLoader(true);
3422
- resolverRef.current = { resolve, reject };
3423
- window.DatacapHostedWebToken.requestToken();
3424
- });
3425
- };
3522
+ useEffect7(() => {
3523
+ const uniqueId = Math.random();
3524
+ const fn = () => {
3525
+ return new Promise((resolve, reject) => {
3526
+ setLoader == null ? void 0 : setLoader(true);
3527
+ resolverRef.current = { resolve, reject };
3528
+ window.DatacapHostedWebToken.requestToken();
3529
+ });
3530
+ };
3531
+ window.requestDcToken = fn;
3532
+ return () => {
3533
+ delete window.requestDcToken;
3534
+ };
3535
+ }, []);
3426
3536
  return /* @__PURE__ */ jsx18(
3427
3537
  "iframe",
3428
3538
  {
@@ -3434,7 +3544,7 @@ var DataCapFields = ({
3434
3544
  },
3435
3545
  style: {
3436
3546
  width: "100%",
3437
- height: "250px",
3547
+ height: `${height || "250px"}`,
3438
3548
  border: "none",
3439
3549
  opacity: iframeReady ? 1 : 0,
3440
3550
  transition: "opacity 0.3s ease"
@@ -6702,7 +6812,7 @@ var FractalFieldsAddCardSky_default = FractalFieldsAddCardSky;
6702
6812
 
6703
6813
  // src/app/components/AddCard/AddCardSky.tsx
6704
6814
  import { Fragment as Fragment16, jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
6705
- function CardOnFile({ session_token, callback, isloading, onCancel, showChecks, merchantName, signCheckbox, checkedSignCheckbox, onCheckSign, cancelbtnClass, savebtnClass, inputClass, isDual }) {
6815
+ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks, merchantName, signCheckbox, checkedSignCheckbox, onCheckSign, cancelbtnClass, savebtnClass, inputClass, isDual, customCSS: customCSS2, height }) {
6706
6816
  var _a, _b;
6707
6817
  const [loading, setLoading] = useState7(false);
6708
6818
  const [errorIframe, setErrorIframe] = useState7("");
@@ -7215,7 +7325,9 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
7215
7325
  {
7216
7326
  isOpen: true,
7217
7327
  tokenKey: dcToken,
7218
- setLoader: setLoadingIframe
7328
+ setLoader: setLoadingIframe,
7329
+ customCSS: customCSS2,
7330
+ height
7219
7331
  }
7220
7332
  ) }),
7221
7333
  /* @__PURE__ */ jsxs16("div", { className: "form-group", children: [
@@ -8594,7 +8706,7 @@ function PartialPayment(props) {
8594
8706
  }
8595
8707
 
8596
8708
  // src/app/components/Skysystemz/PayButtonWithForm.tsx
8597
- import { useEffect as useEffect16, useState as useState11, useMemo } from "react";
8709
+ import { useEffect as useEffect19, useState as useState12, useMemo } from "react";
8598
8710
 
8599
8711
  // src/app/components/Skysystemz/SkyChargewidgetstyles.tsx
8600
8712
  import { jsx as jsx29 } from "react/jsx-runtime";
@@ -8830,6 +8942,17 @@ function SkyChargewidgetstyles() {
8830
8942
  text-align : left !important;
8831
8943
  text-transform: uppercase !important;
8832
8944
  }
8945
+ .frac-form .frac-fee-text{
8946
+ display: block;
8947
+ padding: 10px 0 4px;
8948
+ font-family: 'IBM Plex Mono', monospace !important;
8949
+ color: #727272 !important;
8950
+ font-size: 12px;
8951
+ line-height: 1.4;
8952
+ }
8953
+ .frac-form .frac-fee-amount{
8954
+ color: #c62828 !important;
8955
+ }
8833
8956
  .form-control-frac{
8834
8957
  display: block;
8835
8958
  width: 100%;
@@ -8864,7 +8987,7 @@ function SkyChargewidgetstyles() {
8864
8987
  }
8865
8988
  .exp-date-year-container .form-group {
8866
8989
  flex: 1;
8867
- padding-left:.75rem;
8990
+ padding-left:.75rem !important;
8868
8991
  }
8869
8992
  .card-crdi {
8870
8993
  display: flex;
@@ -8881,7 +9004,7 @@ function SkyChargewidgetstyles() {
8881
9004
  }
8882
9005
  .exp-date-year-container .form-group-frac{
8883
9006
  flex:1;
8884
- padding: 0px !important
9007
+ // padding: 0px !important
8885
9008
 
8886
9009
  }
8887
9010
 
@@ -9382,13 +9505,54 @@ margin:0px !important;
9382
9505
  padding:0px !important;
9383
9506
  }
9384
9507
 
9385
-
9508
+
9509
+ .toggle-num-wrapper-new div#card_number {
9510
+ display: block !important;
9511
+ }
9512
+ .toggle-num-wrapper-new .input-main-wrap-frac {
9513
+ height: 36px;
9514
+ }
9515
+ .toggle-num-wrapper-new:focus {
9516
+ border: 1px solid #004eab !important;
9517
+ }
9518
+ .frac-or {
9519
+ position: relative;
9520
+ margin: 15px 0;
9521
+ text-align: center;
9522
+ }
9523
+ .frac-or:before {
9524
+ position: absolute;
9525
+ left: 0;
9526
+ transform: translateY(-50%);
9527
+ top: 50%;
9528
+ height: 1px;
9529
+ width: 100%;
9530
+ background: #E0DFE2;
9531
+ content: '';
9532
+ z-index: 1;
9533
+ }
9534
+ .frac-or span {
9535
+ background: transparent;
9536
+ font-size: 13px;
9537
+ margin: 0 auto;
9538
+ width: 15px;
9539
+ font-weight: 500;
9540
+ text-transform: uppercase;
9541
+ color: #727272;
9542
+ padding: 3px;
9543
+ position: relative;
9544
+ z-index: 3;
9545
+ }
9546
+ button#gpay-button-online-api-id{
9547
+ width: 100%;
9548
+ }
9549
+
9386
9550
 
9387
9551
  ` });
9388
9552
  }
9389
9553
 
9390
9554
  // src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
9391
- import { useCallback, useEffect as useEffect15, useRef as useRef10, useState as useState10 } from "react";
9555
+ import { useCallback, useEffect as useEffect18, useRef as useRef12, useState as useState11 } from "react";
9392
9556
  import axios9 from "axios";
9393
9557
  import Swal5 from "sweetalert2";
9394
9558
 
@@ -9529,110 +9693,601 @@ function CheckoutWrapper({ clientSecret, onSuccess, showLoader, setError, sessio
9529
9693
  // src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
9530
9694
  import { IoArrowBack as IoArrowBack4 } from "react-icons/io5";
9531
9695
  import { NumericFormat as NumericFormat2 } from "react-number-format";
9532
- import { Fragment as Fragment18, jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
9533
- 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 }) => {
9534
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
9535
- const hasRunRef = useRef10(false);
9536
- const cardListRunRef = useRef10(false);
9537
- const threeDSContainerRef = useRef10(null);
9538
- const [activetab, setActive] = useState10("card");
9539
- const [activeList, setActiveList] = useState10("card");
9540
- const [cardData, setCardData] = useState10();
9541
- const [cardError, setCardError] = useState10({});
9542
- const [achData, setAchData] = useState10();
9543
- const [achError, setAchError] = useState10({});
9544
- const [saveACHinfo, setSaveACHinfo] = useState10(false);
9545
- const [saveCardInfo, setSaveCardInfo] = useState10(false);
9546
- const [error, setError] = useState10("");
9547
- const [errorIframe, setErrorIframe] = useState10("");
9548
- const [success, setSuccess] = useState10(false);
9549
- let [tranId, setTranId] = useState10("");
9550
- const [loading, setLoading] = useState10(false);
9551
- const [loading2, setLoading2] = useState10(false);
9552
- const [loadingIframe, setLoadingIframe] = useState10(false);
9553
- const [cardList, setCardList] = useState10([]);
9554
- const [bankList, setBankList] = useState10([]);
9555
- const [selectedCard, setSelectedCard] = useState10();
9556
- const [cashDiscount, setCashDiscount] = useState10(Number(amount));
9557
- const [activeinCard, setActiveinCard] = useState10("form");
9558
- const [activeinBank, setActiveinBank] = useState10("form");
9559
- const [isBankActive, setIsBankActive] = useState10(false);
9560
- const [processingFee, setProcessingFee] = useState10(0);
9561
- const [clientSecret, setClientSecret] = useState10("");
9562
- const [errorMessage, setErrorMessage] = useState10(null);
9563
- const [initialLoader, setInitialLoader] = useState10(false);
9564
- const [is3DSEnable, setIs3DSEnable] = useState10(false);
9565
- const [stripeResponse, setStripeResponse] = useState10(null);
9566
- const [orderLoader, setOrderLoader] = useState10(false);
9567
- const [orderGuid, setOrderGuid] = useState10(ordGuid || null);
9568
- const [partialAmount, setPartialAmount] = useState10("");
9569
- const [partialError, setPartialError] = useState10("");
9570
- const [remainingAmount, setRemainingAmount] = useState10("");
9571
- const [paymentGateway, setPaymentGateway] = useState10();
9572
- const [dcToken, setDCToken] = useState10();
9573
- const [isBankConsentChecked, setIsBankConsentChecked] = useState10(false);
9574
- const [errorBankConsent, setErrorBankConsent] = useState10("");
9575
- let mastercard2 = S3Url + "widget/mc-img.svg";
9576
- let visa2 = S3Url + "widget/visa-img.svg";
9577
- let americanexp2 = S3Url + "widget/ae-img.svg";
9578
- let discover2 = S3Url + "widget/discover-img.svg";
9579
- let defaultcard2 = S3Url + "widget/card.svg";
9580
- let trash2 = S3Url + "widget/Trash.svg";
9581
- let bank2 = S3Url + "widget/bank.svg";
9582
- let secure2 = S3Url + "widget/secure-img.png";
9583
- let pov2 = S3Url + "widget/pov-by.png";
9584
- let pax2 = S3Url + "widget/pax.svg";
9585
- let cardicon = S3Url + "widget/cardicon.svg";
9586
- let bankicon = S3Url + "widget/bankicon.svg";
9587
- const showLoader = () => setLoading(true);
9588
- const hideLoader = () => setLoading(false);
9589
- const CalculateCashDiscount = (amount2, surcharge2) => {
9590
- const surchargeVal = (parseFloat(surcharge2) || 0) / 100;
9591
- const originalAmount = amount2 / (1 + surchargeVal);
9592
- return Math.round(originalAmount * 100) / 100;
9696
+
9697
+ // src/app/components/ErrorCardMessage/ErrorCardOverlaystyle.tsx
9698
+ import { jsx as jsx32 } from "react/jsx-runtime";
9699
+ function ErrorCardOverlayStyle() {
9700
+ return /* @__PURE__ */ jsx32("style", { children: `
9701
+ .card-error-overlay .logo-container {
9702
+ display: flex;
9703
+ justify-content: center;
9704
+ align-items: center;
9705
+ margin-bottom: -50px; /* Adjust this to overlap the content */
9706
+ z-index: 10;
9707
+ }
9708
+
9709
+ .card-error-overlay .client-logo {
9710
+ max-width: 100px;
9711
+ height: auto;
9712
+ object-fit: contain;
9713
+ display: block;
9714
+ }
9715
+
9716
+
9717
+ .card-error-overlay .error-icon-overlay {
9718
+ display: flex;
9719
+ flex-direction: column;
9720
+ align-items: center;
9721
+ gap: 12px;
9722
+ min-height: 116px;
9723
+ z-index: 2;
9724
+ }
9725
+
9726
+ .card-error-overlay .circle {
9727
+ width: 50px;
9728
+ height: 50px;
9729
+ border: 1px solid red;
9730
+ border-radius: 50%;
9731
+ display: flex;
9732
+ justify-content: center;
9733
+ align-items: center;
9734
+ margin-bottom:20px
9735
+ }
9736
+
9737
+ .card-error-overlay .circle .fa-times {
9738
+ font-size: 30px;
9739
+ color: red;
9740
+ }
9741
+
9742
+ .card-error-overlay .error-text-overlay {
9743
+ display: flex;
9744
+ flex-direction: column;
9745
+ justify-content: center;
9746
+ align-items: center;
9747
+ gap: 4px;
9748
+ // width: 227px;
9749
+ }
9750
+
9751
+ .card-error-overlay .payment-error-text-overlay {
9752
+ font-family: 'Inter', sans-serif;
9753
+ font-weight: 500;
9754
+ font-size: 18px;
9755
+ line-height: 21px;
9756
+ text-align: center;
9757
+ letter-spacing: -0.02em;
9758
+ color: #161616;
9759
+ }
9760
+
9761
+ .card-error-overlay .thank-you-text-overlay {
9762
+ font-family: 'Inter', sans-serif;
9763
+ font-weight: 500;
9764
+ font-size: 16px;
9765
+ line-height: 18px;
9766
+ text-align: center;
9767
+ letter-spacing: -0.02em;
9768
+ color: #161616 !important;
9769
+ opacity: 0.5;
9770
+ padding-top:10px
9771
+ }
9772
+
9773
+ .card-error-overlay .error-btn-div-overlay{
9774
+ padding-top:20px;
9775
+ width: 100%;
9776
+
9777
+ }
9778
+ .card-error-overlay .error-btn-div-overlay button{
9779
+ outline: 0;
9780
+ height: 46px;
9781
+ font-size: 16px;
9782
+ background: #727272;
9783
+ border: none;
9784
+ display: block;
9785
+ color: #fff;
9786
+ width: 100%;
9787
+ border-radius: 180px;
9788
+ margin: 10px 0;
9789
+ text-decoration: none;
9790
+ }
9791
+ .card-error-overlay .error-btn-div-overlay button:hover, .card-error-overlay .error-btn-div-overlay button:focus {
9792
+ background: #222;
9793
+ color: #fff;
9794
+ cursor: pointer;
9795
+ }
9796
+ .payment-error-container-overlay {
9797
+ width: fit-content;
9798
+ position: relative;
9799
+ top: 50%;
9800
+ left: 50%;
9801
+ transform: translate(-50%, -50%);
9802
+ background: rgba(255, 255, 255, 0.15);
9803
+ backdrop-filter: blur(12px);
9804
+ -webkit-backdrop-filter: blur(12px);
9805
+ border-radius: 12px;
9806
+ z-index: 11111;
9807
+ max-width: 240px;
9808
+ min-width: 224px;
9809
+ padding: 20px;
9810
+ margin-left: 17px !important;
9811
+ }
9812
+ .card-error-overlay {
9813
+ position: absolute;
9814
+ top: 0;
9815
+ left: 0;
9816
+ width: 100%;
9817
+ height: 100%;
9818
+ background: rgb(87 87 87 / 15%);
9819
+ backdrop-filter: blur(2px);
9820
+ -webkit-backdrop-filter: blur(12px);
9821
+ z-index: 1111;
9822
+ }
9823
+ ` });
9824
+ }
9825
+
9826
+ // src/app/components/ErrorCardMessage/ErrorCardOverlay.tsx
9827
+ import { Fragment as Fragment18, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
9828
+ var ErrorCardOverlay = ({ onClose, error, autoTrigger = false }) => {
9829
+ return /* @__PURE__ */ jsxs19(Fragment18, { children: [
9830
+ /* @__PURE__ */ jsx33(ErrorCardOverlayStyle, {}),
9831
+ /* @__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: [
9832
+ /* @__PURE__ */ jsx33("div", { className: "circle", children: /* @__PURE__ */ jsx33("i", { className: "fa fa-times", "aria-hidden": "true" }) }),
9833
+ /* @__PURE__ */ jsxs19("div", { className: "error-text-overlay", children: [
9834
+ /* @__PURE__ */ jsx33("div", { className: "payment-error-text-overlay", children: error }),
9835
+ /* @__PURE__ */ jsx33("div", { className: "thank-you-text-overlay", children: "Try again later " })
9836
+ ] }),
9837
+ !autoTrigger && /* @__PURE__ */ jsx33("div", { className: "error-btn-div-overlay", children: /* @__PURE__ */ jsx33("button", { onClick: onClose, children: "OK" }) })
9838
+ ] }) }) })
9839
+ ] });
9840
+ };
9841
+ var ErrorCardOverlay_default = ErrorCardOverlay;
9842
+
9843
+ // src/app/components/Atoms/Googlepay/Googlepay.tsx
9844
+ import { useRef as useRef10 } from "react";
9845
+
9846
+ // src/app/components/Atoms/Googlepay/GooglePayScriptLoader.tsx
9847
+ import { useEffect as useEffect15 } from "react";
9848
+ var googlePayScriptLoaded = false;
9849
+ var GooglePayScriptLoader = ({
9850
+ onLoad
9851
+ }) => {
9852
+ useEffect15(() => {
9853
+ if (googlePayScriptLoaded) {
9854
+ onLoad == null ? void 0 : onLoad();
9855
+ return;
9856
+ }
9857
+ const existingScript = document.querySelector(
9858
+ `script[src="https://pay.google.com/gp/p/js/pay.js"]`
9859
+ );
9860
+ if (!existingScript) {
9861
+ const script2 = document.createElement("script");
9862
+ script2.src = "https://pay.google.com/gp/p/js/pay.js";
9863
+ script2.async = true;
9864
+ script2.onload = () => {
9865
+ console.log("\u2705 Google Pay script loaded");
9866
+ googlePayScriptLoaded = true;
9867
+ console.log("google:", window.google);
9868
+ onLoad == null ? void 0 : onLoad();
9869
+ };
9870
+ script2.onerror = (err) => {
9871
+ console.error("\u274C Google Pay script failed", err);
9872
+ };
9873
+ document.head.appendChild(script2);
9874
+ } else {
9875
+ googlePayScriptLoaded = true;
9876
+ onLoad == null ? void 0 : onLoad();
9877
+ }
9878
+ }, []);
9879
+ return null;
9880
+ };
9881
+
9882
+ // src/app/components/Atoms/Googlepay/Googlepay.tsx
9883
+ import { Fragment as Fragment19, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
9884
+ function GooglePayComponent({
9885
+ amount,
9886
+ googlePayEnvironment: googlePayEnvironment2,
9887
+ googlePayGatewayMerchantId: googlePayGatewayMerchantId2,
9888
+ googlePayMerchantId: googlePayMerchantId2,
9889
+ googlePayMerchantName,
9890
+ require3ds = false,
9891
+ completeFractalFlow,
9892
+ setLoading
9893
+ }) {
9894
+ const containerRef = useRef10(null);
9895
+ const paymentsClientRef = useRef10(null);
9896
+ const baseRequest = {
9897
+ apiVersion: 2,
9898
+ apiVersionMinor: 0
9593
9899
  };
9594
- const tokenizerRef = useRef10(null);
9595
- const fractalStyles = {
9596
- input: {
9597
- "font-family": "'Inter', sans-serif",
9598
- "font-size": "16px",
9599
- "color": "#212529",
9600
- "background-color": "transparent",
9601
- "padding": "0px",
9602
- "appearance": "none",
9603
- "outline": "none",
9604
- "border": "none",
9605
- "box-shadow": "none"
9606
- },
9607
- ":focus": {
9608
- "color": "#212529",
9609
- "outline": "none",
9610
- "border": "none"
9611
- },
9612
- "::placeholder": {
9613
- "color": "#212529"
9900
+ const allowedCardNetworks = ["AMEX", "DISCOVER", "MASTERCARD", "VISA"];
9901
+ const allowedCardAuthMethods = require3ds ? ["CRYPTOGRAM_3DS"] : ["PAN_ONLY", "CRYPTOGRAM_3DS"];
9902
+ const baseCardPaymentMethod = {
9903
+ type: "CARD",
9904
+ parameters: {
9905
+ allowedAuthMethods: allowedCardAuthMethods,
9906
+ allowedCardNetworks
9614
9907
  }
9615
9908
  };
9616
- const handleCharge = async (data) => {
9617
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
9909
+ const cardPaymentMethod = __spreadProps(__spreadValues({}, baseCardPaymentMethod), {
9910
+ tokenizationSpecification: {
9911
+ type: "PAYMENT_GATEWAY",
9912
+ parameters: {
9913
+ gateway: googlePayGatewayMerchantId2,
9914
+ gatewayMerchantId: googlePayGatewayMerchantId2
9915
+ }
9916
+ }
9917
+ });
9918
+ const handlePaymentAuthorization = async (paymentData) => {
9919
+ var _a, _b;
9618
9920
  try {
9619
- let dataObj = __spreadValues({
9620
- pass_fee_amount: Number(amount) - cashDiscount,
9621
- pass_fee,
9622
- Token: data == null ? void 0 : data.Token,
9623
- amount: partialAmount ? partialAmount : amount,
9624
- postal_code: data == null ? void 0 : data.postalCode,
9625
- require3ds,
9626
- isPartial,
9627
- orderGuid: orderGuid || ordGuid
9628
- }, saveCardInfo ? {
9629
- card: {
9630
- postal_code: cardData == null ? void 0 : cardData.zipCode,
9631
- customer_id: customerId,
9632
- gateway_token: (data == null ? void 0 : data.Token) || (data == null ? void 0 : data.gateway_token),
9633
- name: cardData == null ? void 0 : cardData.cardName
9921
+ const token = (_b = (_a = paymentData == null ? void 0 : paymentData.paymentMethodData) == null ? void 0 : _a.tokenizationData) == null ? void 0 : _b.token;
9922
+ if (!token) throw new Error("Missing token");
9923
+ const parsed = JSON.parse(token);
9924
+ console.log(parsed, "parsed token");
9925
+ setLoading(true);
9926
+ completeFractalFlow(parsed, null, "google_pay");
9927
+ return {
9928
+ transactionState: "SUCCESS"
9929
+ // CLOSES GOOGLE PAY POPUP
9930
+ };
9931
+ } catch (err) {
9932
+ console.error("Payment failed:", err);
9933
+ return {
9934
+ transactionState: "ERROR",
9935
+ // CLOSES WITH ERROR UI
9936
+ error: {
9937
+ intent: "PAYMENT_AUTHORIZATION",
9938
+ message: "Payment failed",
9939
+ reason: "PAYMENT_DATA_INVALID"
9634
9940
  }
9635
- } : null);
9941
+ };
9942
+ }
9943
+ };
9944
+ const getPaymentsClient = () => {
9945
+ if (!paymentsClientRef.current && typeof window !== "undefined") {
9946
+ const google = window.google;
9947
+ if (!google) return null;
9948
+ paymentsClientRef.current = new google.payments.api.PaymentsClient({
9949
+ environment: googlePayEnvironment2,
9950
+ // ✅ ADD THIS
9951
+ paymentDataCallbacks: {
9952
+ onPaymentAuthorized: handlePaymentAuthorization
9953
+ }
9954
+ });
9955
+ }
9956
+ return paymentsClientRef.current;
9957
+ };
9958
+ const getIsReadyToPayRequest = () => __spreadProps(__spreadValues({}, baseRequest), {
9959
+ allowedPaymentMethods: [baseCardPaymentMethod]
9960
+ });
9961
+ const getTransactionInfo = () => ({
9962
+ countryCode: "US",
9963
+ currencyCode: "USD",
9964
+ totalPriceStatus: "FINAL",
9965
+ totalPrice: amount,
9966
+ checkoutOption: "COMPLETE_IMMEDIATE_PURCHASE"
9967
+ });
9968
+ const getPaymentDataRequest = () => __spreadProps(__spreadValues({}, baseRequest), {
9969
+ allowedPaymentMethods: [cardPaymentMethod],
9970
+ transactionInfo: getTransactionInfo(),
9971
+ merchantInfo: {
9972
+ merchantId: googlePayMerchantId2,
9973
+ merchantName: googlePayMerchantName
9974
+ },
9975
+ // ✅ ADD THIS
9976
+ callbackIntents: ["PAYMENT_AUTHORIZATION"]
9977
+ });
9978
+ const initializeGooglePay = async () => {
9979
+ try {
9980
+ const client = getPaymentsClient();
9981
+ if (!client) {
9982
+ console.error("Google Pay client not ready");
9983
+ return;
9984
+ }
9985
+ const response = await client.isReadyToPay(
9986
+ getIsReadyToPayRequest()
9987
+ );
9988
+ if (response.result && containerRef.current) {
9989
+ const button = client.createButton({
9990
+ onClick: onGooglePayClick,
9991
+ allowedPaymentMethods: [baseCardPaymentMethod],
9992
+ buttonType: "pay",
9993
+ buttonColor: "black",
9994
+ buttonRadius: 8
9995
+ });
9996
+ if (containerRef.current) {
9997
+ containerRef.current.innerHTML = "";
9998
+ }
9999
+ containerRef.current.appendChild(button);
10000
+ }
10001
+ } catch (err) {
10002
+ console.error("Google Pay init error:", err);
10003
+ }
10004
+ };
10005
+ const onGooglePayClick = async () => {
10006
+ const client = getPaymentsClient();
10007
+ if (!client) {
10008
+ console.error("Google Pay client not ready");
10009
+ return;
10010
+ }
10011
+ try {
10012
+ await client.loadPaymentData(getPaymentDataRequest());
10013
+ } catch (err) {
10014
+ if ((err == null ? void 0 : err.statusCode) !== "CANCELED") {
10015
+ console.error(err);
10016
+ }
10017
+ }
10018
+ };
10019
+ const onScriptLoad = () => {
10020
+ if (!googlePayEnvironment2 || !googlePayGatewayMerchantId2 || !amount || !googlePayMerchantId2) {
10021
+ console.error("Missing Google Pay config");
10022
+ return;
10023
+ }
10024
+ setTimeout(() => {
10025
+ initializeGooglePay();
10026
+ }, 0);
10027
+ };
10028
+ return /* @__PURE__ */ jsxs20(Fragment19, { children: [
10029
+ /* @__PURE__ */ jsx34("div", { ref: containerRef, className: "text-center" }),
10030
+ /* @__PURE__ */ jsx34(GooglePayScriptLoader, { onLoad: onScriptLoad })
10031
+ ] });
10032
+ }
10033
+
10034
+ // src/app/components/Atoms/Applepay/ApplePayButton.tsx
10035
+ import { useEffect as useEffect17, useRef as useRef11 } from "react";
10036
+ import { jsx as jsx35 } from "react/jsx-runtime";
10037
+ function ApplePayButton({
10038
+ applePayMerchantId: applePayMerchantId2,
10039
+ applePayAmount,
10040
+ applePayMerchantName,
10041
+ showLoader,
10042
+ completeFractalFlow
10043
+ }) {
10044
+ const applePayRef = useRef11(null);
10045
+ const paymentRequestMethods = [
10046
+ {
10047
+ supportedMethods: "https://apple.com/apple-pay",
10048
+ data: {
10049
+ version: 3,
10050
+ merchantIdentifier: applePayMerchantId2,
10051
+ // ✅ FIXED
10052
+ merchantCapabilities: ["supports3DS"],
10053
+ supportedNetworks: ["amex", "discover", "mastercard", "visa"],
10054
+ // ✅ FIXED
10055
+ countryCode: "US"
10056
+ }
10057
+ }
10058
+ ];
10059
+ const paymentRequestOptions = {
10060
+ requestPayerName: false,
10061
+ requestPayerEmail: false,
10062
+ requestPayerPhone: false,
10063
+ requestShipping: false
10064
+ };
10065
+ function buildPaymentDetails() {
10066
+ return {
10067
+ total: {
10068
+ label: applePayMerchantName,
10069
+ amount: {
10070
+ currency: "USD",
10071
+ value: applePayAmount
10072
+ }
10073
+ }
10074
+ };
10075
+ }
10076
+ async function validateMerchant(event) {
10077
+ var _a;
10078
+ console.log("\u{1F7E1} STEP 1: Merchant validation started");
10079
+ try {
10080
+ console.log("Validation URL:", event.validationURL);
10081
+ console.log("Domain:", window.location.hostname);
10082
+ const res = await fetch(
10083
+ `${masterBaseUrl}api/v1/widget/generate-apple-pay-session`,
10084
+ {
10085
+ method: "POST",
10086
+ headers: {
10087
+ "Content-Type": "application/json"
10088
+ },
10089
+ body: JSON.stringify({
10090
+ validationUrl: event.validationURL,
10091
+ applePayMerchantId: applePayMerchantId2,
10092
+ applepayDisplayName: applePayMerchantName,
10093
+ requestDomain: window.location.hostname
10094
+ // ✅ IMPORTANT
10095
+ })
10096
+ }
10097
+ );
10098
+ console.log("\u{1F7E1} STEP 2: Response status:", res.status);
10099
+ const data = await res.json();
10100
+ console.log("RAW session response:", JSON.stringify(data));
10101
+ console.log("\u{1F7E2} STEP 3: Session response: data fetched");
10102
+ const merchantSession = (_a = data == null ? void 0 : data.data) != null ? _a : data;
10103
+ if (!merchantSession || typeof merchantSession !== "object") {
10104
+ console.error("\u274C Bad session shape");
10105
+ event.complete(null);
10106
+ return;
10107
+ }
10108
+ console.log("\u{1F7E2} STEP 4.1: Completing merchant validation");
10109
+ event.complete(merchantSession);
10110
+ console.log("\u{1F7E2} STEP 4.2: Completed merchant validation");
10111
+ } catch (err) {
10112
+ console.log("\u274C Merchant validation failed:", err == null ? void 0 : err.message);
10113
+ event.complete(null);
10114
+ }
10115
+ }
10116
+ async function authorizePayment(paymentResponse) {
10117
+ console.log("\u{1F7E1} STEP 5: Authorizing payment");
10118
+ try {
10119
+ const token = paymentResponse.details.token.paymentData;
10120
+ console.log("\u{1F7E2} STEP 6: Got token");
10121
+ await completeFractalFlow(token, null, "apple_pay");
10122
+ await paymentResponse.complete("success");
10123
+ console.log("\u2705 Payment completed successfully");
10124
+ } catch (err) {
10125
+ console.log("\u274C Authorization failed:", err == null ? void 0 : err.message);
10126
+ await paymentResponse.complete("fail");
10127
+ }
10128
+ }
10129
+ async function handleApplePayClick() {
10130
+ console.log("\u{1F7E1} STEP A: Click detected");
10131
+ try {
10132
+ const request = new PaymentRequest(
10133
+ paymentRequestMethods,
10134
+ buildPaymentDetails(),
10135
+ paymentRequestOptions
10136
+ );
10137
+ request.onmerchantvalidation = validateMerchant;
10138
+ console.log("\u{1F7E1} STEP B: Calling show()");
10139
+ const response = await request.show();
10140
+ console.log("\u{1F7E2} STEP C: Payment sheet opened");
10141
+ await authorizePayment(response);
10142
+ } catch (err) {
10143
+ console.log("\u274C Apple Pay flow failed:", err == null ? void 0 : err.message);
10144
+ }
10145
+ }
10146
+ useEffect17(() => {
10147
+ if (window.ApplePaySession && window.ApplePaySession.canMakePayments()) {
10148
+ console.log("\u2705 Apple Pay is available");
10149
+ } else {
10150
+ console.log("\u274C Apple Pay NOT available");
10151
+ }
10152
+ }, []);
10153
+ useEffect17(() => {
10154
+ const btn = applePayRef.current;
10155
+ if (!btn) return;
10156
+ const handleClick = () => handleApplePayClick();
10157
+ btn.addEventListener("click", handleClick);
10158
+ return () => btn.removeEventListener("click", handleClick);
10159
+ }, [applePayMerchantId2, applePayAmount, applePayMerchantName]);
10160
+ return /* @__PURE__ */ jsx35("div", { children: /* @__PURE__ */ jsx35(
10161
+ "apple-pay-button",
10162
+ {
10163
+ ref: applePayRef,
10164
+ buttonstyle: "black",
10165
+ type: "pay",
10166
+ locale: "en-US",
10167
+ style: { width: "100%" }
10168
+ }
10169
+ ) });
10170
+ }
10171
+
10172
+ // src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
10173
+ import { Fragment as Fragment20, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
10174
+ 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, customCSS: customCSS2 }) => {
10175
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
10176
+ const hasRunRef = useRef12(false);
10177
+ const cardFormRef = useRef12(null);
10178
+ const bankFormRef = useRef12(null);
10179
+ const expiryYearRef = useRef12(null);
10180
+ const expiryMonthRef = useRef12(null);
10181
+ const cardListRunRef = useRef12(false);
10182
+ const threeDSContainerRef = useRef12(null);
10183
+ const [activetab, setActive] = useState11("card");
10184
+ const [activeList, setActiveList] = useState11("card");
10185
+ const [cardData, setCardData] = useState11();
10186
+ const [cardError, setCardError] = useState11({});
10187
+ const [achData, setAchData] = useState11();
10188
+ const [achError, setAchError] = useState11({});
10189
+ const [saveACHinfo, setSaveACHinfo] = useState11(false);
10190
+ const [saveCardInfo, setSaveCardInfo] = useState11(false);
10191
+ const [error, setError] = useState11("");
10192
+ const [errorIframe, setErrorIframe] = useState11("");
10193
+ const [success, setSuccess] = useState11(false);
10194
+ let [tranId, setTranId] = useState11("");
10195
+ const [loading, setLoading] = useState11(false);
10196
+ const [loading2, setLoading2] = useState11(false);
10197
+ const [loadingIframe, setLoadingIframe] = useState11(false);
10198
+ const [cardList, setCardList] = useState11([]);
10199
+ const [bankList, setBankList] = useState11([]);
10200
+ const [selectedCard, setSelectedCard] = useState11();
10201
+ const [cashDiscount, setCashDiscount] = useState11(Number(amount));
10202
+ const [activeinCard, setActiveinCard] = useState11("form");
10203
+ const [activeinBank, setActiveinBank] = useState11("form");
10204
+ const [isBankActive, setIsBankActive] = useState11(false);
10205
+ const [processingFee, setProcessingFee] = useState11(0);
10206
+ const [clientSecret, setClientSecret] = useState11("");
10207
+ const [errorMessage, setErrorMessage] = useState11(null);
10208
+ const [initialLoader, setInitialLoader] = useState11(false);
10209
+ const [is3DSEnable, setIs3DSEnable] = useState11(false);
10210
+ const [stripeResponse, setStripeResponse] = useState11(null);
10211
+ const [orderLoader, setOrderLoader] = useState11(false);
10212
+ const [orderGuid, setOrderGuid] = useState11(ordGuid || null);
10213
+ const [partialAmount, setPartialAmount] = useState11("");
10214
+ const [partialError, setPartialError] = useState11("");
10215
+ const [remainingAmount, setRemainingAmount] = useState11("");
10216
+ const [paymentGateway, setPaymentGateway] = useState11();
10217
+ const [dcToken, setDCToken] = useState11();
10218
+ const [isBankConsentChecked, setIsBankConsentChecked] = useState11(false);
10219
+ const [errorBankConsent, setErrorBankConsent] = useState11("");
10220
+ let mastercard2 = S3Url + "widget/mc-img.svg";
10221
+ let visa2 = S3Url + "widget/visa-img.svg";
10222
+ let americanexp2 = S3Url + "widget/ae-img.svg";
10223
+ let discover2 = S3Url + "widget/discover-img.svg";
10224
+ let defaultcard2 = S3Url + "widget/card.svg";
10225
+ let trash2 = S3Url + "widget/Trash.svg";
10226
+ let bank2 = S3Url + "widget/bank.svg";
10227
+ let secure2 = S3Url + "widget/secure-img.png";
10228
+ let pov2 = S3Url + "widget/pov-by.png";
10229
+ let pax2 = S3Url + "widget/pax.svg";
10230
+ let cardicon = S3Url + "widget/cardicon.svg";
10231
+ let bankicon = S3Url + "widget/bankicon.svg";
10232
+ let defualtcardborder = S3Url + "widget/defualtcardborder.svg";
10233
+ let unionicon = S3Url + "widget/unionpay.svg";
10234
+ let dinersicon = S3Url + "widget/diners.svg";
10235
+ let jcbicon = S3Url + "widget/jcb.svg";
10236
+ const showLoader = () => setLoading(true);
10237
+ const hideLoader = () => setLoading(false);
10238
+ const CalculateCashDiscount = (amount2, surcharge2) => {
10239
+ const surchargeVal = (parseFloat(surcharge2) || 0) / 100;
10240
+ const originalAmount = amount2 / (1 + surchargeVal);
10241
+ return Math.round(originalAmount * 100) / 100;
10242
+ };
10243
+ const cardFeeAmount = Number(pass_fee_amount || 0);
10244
+ const bankFeeAmount = Number(bankSurcharge || 0);
10245
+ const bankSavingsAmount = Math.max(bankFeeAmount > 0 ? cardFeeAmount - bankFeeAmount : cardFeeAmount, 0);
10246
+ const bankSavingsText = bankSavingsAmount > 0 ? `Save ${formatUSD(bankSavingsAmount.toFixed(2))}` : "";
10247
+ const tokenizerRef = useRef12(null);
10248
+ const fractalStyles = {
10249
+ input: {
10250
+ "font-family": "'Inter', sans-serif",
10251
+ "font-size": "16px",
10252
+ "color": "#212529",
10253
+ "background-color": "transparent",
10254
+ "padding": "0px",
10255
+ "appearance": "none",
10256
+ "outline": "none",
10257
+ "border": "none",
10258
+ "box-shadow": "none"
10259
+ },
10260
+ ":focus": {
10261
+ "color": "#212529",
10262
+ "outline": "none",
10263
+ "border": "none"
10264
+ },
10265
+ "::placeholder": {
10266
+ "color": "#212529"
10267
+ }
10268
+ };
10269
+ const handleCharge = async (data) => {
10270
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
10271
+ try {
10272
+ let dataObj = __spreadValues(__spreadValues({
10273
+ pass_fee_amount: Number(amount) - cashDiscount,
10274
+ pass_fee,
10275
+ Token: data == null ? void 0 : data.Token,
10276
+ amount: partialAmount ? partialAmount : amount,
10277
+ postal_code: data == null ? void 0 : data.postalCode,
10278
+ require3ds,
10279
+ isPartial,
10280
+ orderGuid: orderGuid || ordGuid
10281
+ }, saveCardInfo ? {
10282
+ card: {
10283
+ postal_code: cardData == null ? void 0 : cardData.zipCode,
10284
+ customer_id: customerId,
10285
+ gateway_token: (data == null ? void 0 : data.Token) || (data == null ? void 0 : data.gateway_token),
10286
+ name: cardData == null ? void 0 : cardData.cardName
10287
+ }
10288
+ } : null), (data == null ? void 0 : data.typeoftoken) ? {
10289
+ typeoftoken: data == null ? void 0 : data.typeoftoken
10290
+ } : null);
9636
10291
  if (require3ds && (data == null ? void 0 : data.stripe_3ds_auth_id)) {
9637
10292
  dataObj.stripe_3ds_auth_id = data == null ? void 0 : data.stripe_3ds_auth_id;
9638
10293
  }
@@ -9761,14 +10416,23 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9761
10416
  setAchError(errors);
9762
10417
  return Object.keys(errors).length > 0 || !isBankConsentChecked;
9763
10418
  };
9764
- const completeFractalFlow = async (tokenizeData, intentid) => {
10419
+ const completeFractalFlow = async (tokenizeData, intentid, typeoftoken) => {
9765
10420
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
9766
10421
  try {
10422
+ if (typeoftoken == "google_pay" || typeoftoken == "apple_pay") {
10423
+ handleCharge({
10424
+ Token: tokenizeData,
10425
+ postalCode: cardData == null ? void 0 : cardData.zipCode,
10426
+ typeoftoken
10427
+ });
10428
+ return;
10429
+ }
9767
10430
  let token = tokenizeData;
9768
10431
  let verifyandsaveresp = await axios9.post(`${masterBaseUrl}api/v1/gateway/verify-and-save/${session_token}`, {
9769
10432
  token,
9770
10433
  require3ds,
9771
- pass_fee
10434
+ pass_fee,
10435
+ typeoftoken
9772
10436
  });
9773
10437
  if ((verifyandsaveresp == null ? void 0 : verifyandsaveresp.status) == 200) {
9774
10438
  let responsetemp = (_a2 = verifyandsaveresp == null ? void 0 : verifyandsaveresp.data) == null ? void 0 : _a2.data;
@@ -9800,7 +10464,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9800
10464
  }
9801
10465
  };
9802
10466
  const handleFractalTokenFlow = async () => {
9803
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t, _u, _v, _w;
10467
+ 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;
9804
10468
  try {
9805
10469
  const requestOptions = {
9806
10470
  method: "POST",
@@ -9841,17 +10505,29 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9841
10505
  three_ds_data
9842
10506
  );
9843
10507
  } catch (error2) {
9844
- setErrorIframe(error2);
10508
+ console.log(error2, "error in tokenization");
10509
+ let readableMessage = "Something went wrong!";
10510
+ try {
10511
+ const rawError = ((_n2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _n2.data) || (error2 == null ? void 0 : error2.message) || "";
10512
+ const errorText = typeof rawError === "string" ? rawError : JSON.stringify(rawError);
10513
+ const lines = ((_p2 = (_o2 = errorText.split) == null ? void 0 : _o2.call(errorText, "\n")) == null ? void 0 : _p2.filter(Boolean)) || [];
10514
+ const lastLine = lines.at(-1) || "";
10515
+ const parts = (_q2 = lastLine.split) == null ? void 0 : _q2.call(lastLine, ": ");
10516
+ readableMessage = (parts == null ? void 0 : parts.length) > 1 ? parts.pop().trim() : lastLine.trim() || readableMessage;
10517
+ } catch (e) {
10518
+ readableMessage = "Something went wrong!";
10519
+ }
10520
+ setErrorIframe(readableMessage);
9845
10521
  hideLoader();
9846
10522
  }
9847
10523
  if (tokenizeData == null ? void 0 : tokenizeData.token) {
9848
10524
  let ThreedsData = tokenizeData == null ? void 0 : tokenizeData.stripe_three_ds_response;
9849
- if (require3ds && !ThreedsData && (ThreedsData == null ? void 0 : ThreedsData.status) === "200 OK" && ((_n2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _n2.challenge_url)) {
10525
+ if (require3ds && !ThreedsData && (ThreedsData == null ? void 0 : ThreedsData.status) === "200 OK" && ((_r2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _r2.challenge_url)) {
9850
10526
  setError("Something went wrong. Please try again later.");
9851
10527
  }
9852
10528
  if (require3ds) {
9853
- if (!((_o2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _o2.challenge_url)) {
9854
- completeFractalFlow(tokenizeData == null ? void 0 : tokenizeData.token, (_p2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _p2.id);
10529
+ if (!((_s2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _s2.challenge_url)) {
10530
+ completeFractalFlow(tokenizeData == null ? void 0 : tokenizeData.token, (_t2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _t2.id);
9855
10531
  } else {
9856
10532
  hideLoader();
9857
10533
  setStripeResponse(__spreadProps(__spreadValues({}, ThreedsData == null ? void 0 : ThreedsData.data), {
@@ -9867,11 +10543,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9867
10543
  console.log(error2, "error");
9868
10544
  let readableMessage = "Something went wrong!";
9869
10545
  try {
9870
- const rawError = ((_q2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _q2.data) || (error2 == null ? void 0 : error2.message) || "";
10546
+ const rawError = ((_u2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _u2.data) || (error2 == null ? void 0 : error2.message) || "";
9871
10547
  const errorText = typeof rawError === "string" ? rawError : JSON.stringify(rawError);
9872
- const lines = ((_s2 = (_r2 = errorText.split) == null ? void 0 : _r2.call(errorText, "\n")) == null ? void 0 : _s2.filter(Boolean)) || [];
10548
+ const lines = ((_w = (_v = errorText.split) == null ? void 0 : _v.call(errorText, "\n")) == null ? void 0 : _w.filter(Boolean)) || [];
9873
10549
  const lastLine = lines.at(-1) || "";
9874
- const parts = (_t = lastLine.split) == null ? void 0 : _t.call(lastLine, ": ");
10550
+ const parts = (_x = lastLine.split) == null ? void 0 : _x.call(lastLine, ": ");
9875
10551
  readableMessage = (parts == null ? void 0 : parts.length) > 1 ? parts.pop().trim() : lastLine.trim() || readableMessage;
9876
10552
  } catch (e) {
9877
10553
  readableMessage = "Something went wrong!";
@@ -9879,8 +10555,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9879
10555
  setError(readableMessage);
9880
10556
  callback({
9881
10557
  error: readableMessage,
9882
- result: (_v = (_u = error2 == null ? void 0 : error2.response) == null ? void 0 : _u.data) == null ? void 0 : _v.result,
9883
- statusCode: (_w = error2 == null ? void 0 : error2.response) == null ? void 0 : _w.status
10558
+ result: (_z = (_y = error2 == null ? void 0 : error2.response) == null ? void 0 : _y.data) == null ? void 0 : _z.result,
10559
+ statusCode: (_A = error2 == null ? void 0 : error2.response) == null ? void 0 : _A.status
9884
10560
  });
9885
10561
  }
9886
10562
  };
@@ -9941,7 +10617,6 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9941
10617
  } else {
9942
10618
  try {
9943
10619
  const result2 = await window.requestDcToken();
9944
- ;
9945
10620
  console.log("Token:", result2.Token);
9946
10621
  if (result2.Token) {
9947
10622
  handleTokenCallback(result2);
@@ -10297,8 +10972,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10297
10972
  });
10298
10973
  };
10299
10974
  const handlechargeCustomer = async (e) => {
10300
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
10301
- e.currentTarget.blur();
10975
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
10976
+ e == null ? void 0 : e.currentTarget.blur();
10302
10977
  if (loading) return;
10303
10978
  let customer_id = customerId;
10304
10979
  let card_id = selectedCard == null ? void 0 : selectedCard.id;
@@ -10345,7 +11020,6 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10345
11020
  statusCode: (_g2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _g2.status
10346
11021
  });
10347
11022
  hideLoader();
10348
- setError(((_i2 = (_h2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _h2.data) == null ? void 0 : _i2.message) || "Something went wrong!");
10349
11023
  }
10350
11024
  } else {
10351
11025
  setError("Please Select A Card/Bank");
@@ -10367,7 +11041,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10367
11041
  }
10368
11042
  };
10369
11043
  const getPaymentDetails = async () => {
10370
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2;
11044
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
10371
11045
  try {
10372
11046
  showLoader();
10373
11047
  const res = await axios9.get(`${masterBaseUrl}api/v1/gateway/get-payment-details/${session_token}`, {
@@ -10390,6 +11064,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10390
11064
  result: (_n2 = (_m2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _m2.data) == null ? void 0 : _n2.result,
10391
11065
  statusCode: (_o2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _o2.status
10392
11066
  });
11067
+ setError(((_q2 = (_p2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _p2.data) == null ? void 0 : _q2.message) || (error2 == null ? void 0 : error2.message) || "Something went wrong");
10393
11068
  hideLoader();
10394
11069
  }
10395
11070
  };
@@ -10420,21 +11095,21 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10420
11095
  setOrderLoader(false);
10421
11096
  }
10422
11097
  };
10423
- useEffect15(() => {
11098
+ useEffect18(() => {
10424
11099
  if (!show && !autoTrigger) {
10425
11100
  hasRunRef.current = false;
10426
11101
  cardListRunRef.current = false;
10427
11102
  }
10428
11103
  }, [show, autoTrigger]);
10429
- useEffect15(() => {
10430
- if (!hasRunRef.current && (show || autoTrigger)) {
11104
+ useEffect18(() => {
11105
+ if (!hasRunRef.current && (show || autoTrigger) && onLoad) {
10431
11106
  getPaymentDetails();
10432
11107
  if (isPartial && !partialRef) {
10433
11108
  crateOrderFrac();
10434
11109
  }
10435
11110
  }
10436
- }, [show, autoTrigger, isPartial]);
10437
- useEffect15(() => {
11111
+ }, [show, autoTrigger, isPartial, onLoad]);
11112
+ useEffect18(() => {
10438
11113
  if ((show || autoTrigger) && pass_fee_amount) {
10439
11114
  let cashdisc = Number(amount) - Number(pass_fee_amount);
10440
11115
  if (cashdisc && !isNaN(cashdisc)) {
@@ -10496,7 +11171,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10496
11171
  console.error("3DS Auth failed \u274C", status);
10497
11172
  setError(`3DS Authentication ${status}`);
10498
11173
  };
10499
- useEffect15(() => {
11174
+ useEffect18(() => {
10500
11175
  if (setHandleCloseRef) {
10501
11176
  setHandleCloseRef(() => handleClose);
10502
11177
  }
@@ -10514,24 +11189,95 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10514
11189
  setPartialError("");
10515
11190
  }
10516
11191
  };
10517
- useEffect15(() => {
11192
+ useEffect18(() => {
10518
11193
  if (typeof FractalTokenizer === "undefined") return;
10519
11194
  const tokenizer = new FractalTokenizer({
10520
11195
  styles: {}
10521
11196
  });
10522
11197
  }, []);
10523
- console.log(activeinCard === "list", "activeinCard", activeList);
10524
- return /* @__PURE__ */ jsxs19(Fragment18, { children: [
10525
- initialLoader && /* @__PURE__ */ jsx32(Loader_default, { loading: initialLoader }),
10526
- error && /* @__PURE__ */ jsx32("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx32(ErrorCardMessage_default, { error, onClose: handleClose }) }),
10527
- errorIframe && /* @__PURE__ */ jsx32("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx32(ErrorCardMessage_default, { error: errorIframe, onClose: () => {
11198
+ const stateRef = useRef12({
11199
+ activeinBank,
11200
+ activeinCard,
11201
+ activetab
11202
+ });
11203
+ useEffect18(() => {
11204
+ stateRef.current = {
11205
+ activeinBank,
11206
+ activeinCard,
11207
+ activetab
11208
+ };
11209
+ }, [activeinBank, activeinCard, activetab]);
11210
+ const submit = useCallback(() => {
11211
+ var _a2, _b2;
11212
+ const { activeinBank: activeinBank2, activeinCard: activeinCard2, activetab: activetab2 } = stateRef.current;
11213
+ if (activetab2 === "card") {
11214
+ if (activeinCard2 === "form") {
11215
+ (_a2 = cardFormRef.current) == null ? void 0 : _a2.requestSubmit();
11216
+ } else if (activeinCard2 === "list") {
11217
+ handlechargeCustomer();
11218
+ }
11219
+ } else if (activetab2 === "ach") {
11220
+ if (activeinBank2 === "form") {
11221
+ (_b2 = bankFormRef.current) == null ? void 0 : _b2.requestSubmit();
11222
+ } else if (activeinBank2 === "list") {
11223
+ handlechargeCustomer();
11224
+ }
11225
+ }
11226
+ }, []);
11227
+ useEffect18(() => {
11228
+ onSubmit == null ? void 0 : onSubmit(submit);
11229
+ }, [onSubmit, submit]);
11230
+ function detectCardType(cardinput) {
11231
+ if (!cardinput) return null;
11232
+ const number = cardinput.replace(/\D/g, "");
11233
+ const patterns = {
11234
+ visa: /^4/,
11235
+ mastercard: /^(5[1-5]|2[2-7][0-9]{2})/,
11236
+ amex: /^3[47]/,
11237
+ discover: /^(6011|65|64[4-9])/,
11238
+ diners: /^(30[0-5]|36|38)/,
11239
+ jcb: /^(35[2-8][0-9])/,
11240
+ unionpay: /^62/
11241
+ };
11242
+ for (const [type, regex] of Object.entries(patterns)) {
11243
+ if (regex.test(number)) {
11244
+ return type;
11245
+ }
11246
+ }
11247
+ return "unknown";
11248
+ }
11249
+ function getCardImage(cardInput) {
11250
+ const cardType = detectCardType(cardInput);
11251
+ switch (cardType) {
11252
+ case "visa":
11253
+ return /* @__PURE__ */ jsx36("img", { src: visa2, alt: "visa", width: 33 });
11254
+ case "mastercard":
11255
+ return /* @__PURE__ */ jsx36("img", { src: mastercard2, width: 33, alt: "mastercard" });
11256
+ case "amex":
11257
+ return /* @__PURE__ */ jsx36("img", { src: americanexp2, alt: "amex", width: 33 });
11258
+ case "discover":
11259
+ return /* @__PURE__ */ jsx36("img", { src: discover2, width: 33, alt: "discover" });
11260
+ case "diners":
11261
+ return /* @__PURE__ */ jsx36("img", { src: dinersicon, alt: "Diners Club" });
11262
+ case "jcb":
11263
+ return /* @__PURE__ */ jsx36("img", { src: jcbicon, alt: "JCB" });
11264
+ case "unionpay":
11265
+ return /* @__PURE__ */ jsx36("img", { src: unionicon, alt: "UnionPay" });
11266
+ default:
11267
+ return /* @__PURE__ */ jsx36("img", { src: defualtcardborder, alt: "card" });
11268
+ }
11269
+ }
11270
+ return /* @__PURE__ */ jsxs21(Fragment20, { children: [
11271
+ (initialLoader || !onLoad) && /* @__PURE__ */ jsx36(Loader_default, { intensity: "dark", loading: initialLoader || !onLoad }),
11272
+ error && /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ErrorCardOverlay_default, { error, onClose: handleClose, autoTrigger }) }),
11273
+ errorIframe && /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ErrorCardOverlay_default, { error: errorIframe, onClose: () => {
10528
11274
  setErrorIframe("");
10529
- } }) }),
10530
- !error && !errorIframe && /* @__PURE__ */ jsxs19(Fragment18, { children: [
10531
- (loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx32(Loader_default, { loading: loading || loading2 || loadingPrev || orderLoader || loadingIframe }),
10532
- /* @__PURE__ */ jsxs19("div", { className: "frac-card-payment-page frac-form frac-new-form", children: [
10533
- /* @__PURE__ */ jsx32("div", { ref: threeDSContainerRef, style: { width: "100%", height: "100%" } }),
10534
- (stripeResponse == null ? void 0 : stripeResponse.challenge_url) ? /* @__PURE__ */ jsx32(
11275
+ }, autoTrigger: onSubmit ? !onSubmit : autoTrigger }) }),
11276
+ /* @__PURE__ */ jsxs21(Fragment20, { children: [
11277
+ (loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx36(Loader_default, { intensity: "light", loading: loading || loading2 || loadingPrev || orderLoader || loadingIframe }),
11278
+ /* @__PURE__ */ jsxs21("div", { className: "frac-card-payment-page frac-form frac-new-form", children: [
11279
+ /* @__PURE__ */ jsx36("div", { ref: threeDSContainerRef, style: { width: "100%", height: "100%" } }),
11280
+ (stripeResponse == null ? void 0 : stripeResponse.challenge_url) ? /* @__PURE__ */ jsx36(
10535
11281
  ThreeDSChallenge,
10536
11282
  {
10537
11283
  containerRef: threeDSContainerRef,
@@ -10541,40 +11287,33 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10541
11287
  onSuccess: handleSuccess,
10542
11288
  onError: handleError
10543
11289
  }
10544
- ) : /* @__PURE__ */ jsxs19("div", { className: "parent-pay-container", children: [
10545
- /* @__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: [
10546
- /* @__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" }) }),
10547
- /* @__PURE__ */ jsx32("defs", { children: /* @__PURE__ */ jsx32("clipPath", { id: "clip0_12425_52336", children: /* @__PURE__ */ jsx32("rect", { width: "16", height: "16", fill: "white" }) }) })
11290
+ ) : /* @__PURE__ */ jsxs21("div", { className: "parent-pay-container", children: [
11291
+ /* @__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: [
11292
+ /* @__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" }) }),
11293
+ /* @__PURE__ */ jsx36("defs", { children: /* @__PURE__ */ jsx36("clipPath", { id: "clip0_12425_52336", children: /* @__PURE__ */ jsx36("rect", { width: "16", height: "16", fill: "white" }) }) })
10548
11294
  ] }) }),
10549
- /* @__PURE__ */ jsx32("div", { className: "pay-main-logo-res" }),
10550
- /* @__PURE__ */ jsxs19("div", { className: "pay-container", children: [
10551
- /* @__PURE__ */ jsxs19("div", { className: "pay-header pay-conatiner-one", children: [
10552
- /* @__PURE__ */ jsxs19("div", { className: "pay-conatiner-one-first", children: [
10553
- /* @__PURE__ */ jsxs19("div", { className: "pay-logo-container", children: [
10554
- /* @__PURE__ */ jsx32("div", { className: "pay-main-logo" }),
10555
- /* @__PURE__ */ jsx32("h1", { className: "pay-heading", children: "Pay" }),
10556
- (cardList == null ? void 0 : cardList.length) > 0 && activetab !== "cardList" && /* @__PURE__ */ jsxs19("button", { className: "res-charge-payment-back-btn ", onClick: () => setActive("cardList"), children: [
11295
+ /* @__PURE__ */ jsx36("div", { className: "pay-main-logo-res" }),
11296
+ /* @__PURE__ */ jsxs21("div", { className: onSubmit ? "pay-container frac-pay-container " : "pay-container", children: [
11297
+ !onSubmit && /* @__PURE__ */ jsxs21("div", { className: "pay-header pay-conatiner-one", children: [
11298
+ /* @__PURE__ */ jsxs21("div", { className: "pay-conatiner-one-first", children: [
11299
+ /* @__PURE__ */ jsxs21("div", { className: "pay-logo-container", children: [
11300
+ /* @__PURE__ */ jsx36("div", { className: "pay-main-logo" }),
11301
+ /* @__PURE__ */ jsx36("h1", { className: "pay-heading", children: "Pay" }),
11302
+ (cardList == null ? void 0 : cardList.length) > 0 && activetab !== "cardList" && /* @__PURE__ */ jsxs21("button", { className: "res-charge-payment-back-btn ", onClick: () => setActive("cardList"), children: [
10557
11303
  " ",
10558
- /* @__PURE__ */ jsx32(IoArrowBack4, {}),
11304
+ /* @__PURE__ */ jsx36(IoArrowBack4, {}),
10559
11305
  " Back"
10560
11306
  ] })
10561
11307
  ] }),
10562
- /* @__PURE__ */ jsx32("div", { className: "amt-pay-con", children: /* @__PURE__ */ jsxs19("div", { className: "pay-amount-conatiner", children: [
10563
- /* @__PURE__ */ jsx32("small", { className: "pay-payment-amount", children: "Select payment type" }),
10564
- /* @__PURE__ */ jsxs19("div", { className: "frac-card-bank-radio-main", children: [
10565
- /* @__PURE__ */ jsx32(CardBankRadio, { label: "Card", amount: (_a = Number(amount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
10566
- !isPreAuth && isBankActive && !isPartial && /* @__PURE__ */ jsx32(CardBankRadio, { label: "Bank", amount: (_b = Number(bankAmount)) == null ? void 0 : _b.toFixed(2), value: "ach", onChange: handletabchange, activetab })
11308
+ /* @__PURE__ */ jsx36("div", { className: "amt-pay-con", children: /* @__PURE__ */ jsxs21("div", { className: "pay-amount-conatiner", children: [
11309
+ /* @__PURE__ */ jsx36("small", { className: "pay-payment-amount", children: "Select payment type" }),
11310
+ /* @__PURE__ */ jsxs21("div", { className: "frac-card-bank-radio-main", children: [
11311
+ /* @__PURE__ */ jsx36(CardBankRadio, { label: "Card", amount: (_a = Number(amount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
11312
+ !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 })
10567
11313
  ] }),
10568
- pass_fee && activetab === "card" && cashDiscount && Number(amount) - Number(cashDiscount) > 0 ? /* @__PURE__ */ jsxs19("div", { className: "frac-cash-discount-fee", children: [
10569
- /* @__PURE__ */ jsxs19("small", { children: [
10570
- activetab === "card" ? "Cash Discount" : "Cash Discount Savings",
10571
- " "
10572
- ] }),
10573
- /* @__PURE__ */ jsx32("p", { children: formatUSD((Number(amount) - Number(cashDiscount)).toFixed(2)) })
10574
- ] }) : null,
10575
- isPartial && /* @__PURE__ */ jsxs19("div", { className: "frac-partial-payment-input", children: [
10576
- /* @__PURE__ */ jsx32("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
10577
- /* @__PURE__ */ jsx32(
11314
+ isPartial && /* @__PURE__ */ jsxs21("div", { className: "frac-partial-payment-input", children: [
11315
+ /* @__PURE__ */ jsx36("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
11316
+ /* @__PURE__ */ jsx36(
10578
11317
  NumericFormat2,
10579
11318
  {
10580
11319
  prefix: "$",
@@ -10598,331 +11337,406 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10598
11337
  }
10599
11338
  }
10600
11339
  ),
10601
- partialError && /* @__PURE__ */ jsx32("span", { className: "error-span", children: partialError })
11340
+ partialError && /* @__PURE__ */ jsx36("span", { className: "error-span", children: partialError })
10602
11341
  ] })
10603
11342
  ] }) })
10604
11343
  ] }),
10605
- /* @__PURE__ */ jsxs19("div", { className: "pay-conatiner-one-last", children: [
10606
- /* @__PURE__ */ jsx32("img", { src: secure2, alt: "" }),
10607
- /* @__PURE__ */ jsx32("img", { src: pov2, alt: "" }),
11344
+ /* @__PURE__ */ jsxs21("div", { className: "pay-conatiner-one-last", children: [
11345
+ /* @__PURE__ */ jsx36("img", { src: secure2, alt: "" }),
11346
+ /* @__PURE__ */ jsx36("img", { src: pov2, alt: "" }),
10608
11347
  "Secure payments powered by Fractal"
10609
11348
  ] })
10610
11349
  ] }),
10611
- /* @__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: [
10612
- /* @__PURE__ */ jsxs19("div", { id: "ach", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent", children: [
10613
- /* @__PURE__ */ jsxs19("div", { className: "frac-heading-card-wrap", children: [
10614
- /* @__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: [
10615
- " ",
10616
- /* @__PURE__ */ jsx32(IoArrowBack4, {})
10617
- ] }) }),
10618
- /* @__PURE__ */ jsx32("h6", { className: "frac-card-payment-heading", children: "Card Payment" })
11350
+ /* @__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: [
11351
+ onSubmit && /* @__PURE__ */ jsx36("div", { className: "amt-pay-con", children: /* @__PURE__ */ jsxs21("div", { className: "pay-amount-conatiner", children: [
11352
+ /* @__PURE__ */ jsxs21("div", { className: "frac-card-bank-radio-main", children: [
11353
+ /* @__PURE__ */ jsx36(CardBankRadio, { skydesign: true, label: "Card", amount: (_c = Number(amount)) == null ? void 0 : _c.toFixed(2), value: "card", onChange: handletabchange, activetab }),
11354
+ !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 })
10619
11355
  ] }),
10620
- /* @__PURE__ */ jsxs19("div", { style: { display: "flex", gap: "8px", margin: "8px 0px 19px 0px" }, children: [
10621
- /* @__PURE__ */ jsx32("img", { src: visa2, alt: "", width: 33 }),
10622
- /* @__PURE__ */ jsx32("img", { src: mastercard2, width: 33, alt: "" }),
10623
- /* @__PURE__ */ jsx32("img", { src: americanexp2, alt: "", width: 33 }),
10624
- /* @__PURE__ */ jsx32("img", { src: discover2, width: 33, alt: "" })
10625
- ] }),
10626
- activeinCard === "list" && (cardList == null ? void 0 : cardList.length) > 0 ? /* @__PURE__ */ jsxs19(Fragment18, { children: [
10627
- /* @__PURE__ */ jsx32(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Card", ListItems: cardList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Card", otherButtonAction: () => {
10628
- setActiveinCard("form");
10629
- } }),
10630
- /* @__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)) }) })
10631
- ] }) : paymentGateway == 32 ? /* @__PURE__ */ jsxs19("form", { id: "paymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, onKeyDown: (e) => {
10632
- if (e.key === "Enter" && loading) {
10633
- e.preventDefault();
10634
- e.stopPropagation();
10635
- }
10636
- }, children: [
10637
- /* @__PURE__ */ jsxs19("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
10638
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10639
- /* @__PURE__ */ jsx32("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
10640
- /* @__PURE__ */ jsx32("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
10641
- const value = e.target.value;
10642
- if (/^[a-zA-Z\s]*$/.test(value)) {
10643
- handleCardChange("cardName", value);
10644
- }
10645
- } }),
10646
- (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
11356
+ isPartial && /* @__PURE__ */ jsxs21("div", { className: "frac-partial-payment-input", children: [
11357
+ /* @__PURE__ */ jsx36("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
11358
+ /* @__PURE__ */ jsx36(
11359
+ NumericFormat2,
11360
+ {
11361
+ prefix: "$",
11362
+ className: "form-control-frac",
11363
+ value: partialAmount,
11364
+ onValueChange: (values) => {
11365
+ handlePartialChange(values);
11366
+ },
11367
+ thousandSeparator: true,
11368
+ placeholder: "Enter partial amount",
11369
+ allowNegative: false,
11370
+ allowLeadingZeros: false,
11371
+ decimalScale: 2,
11372
+ fixedDecimalScale: true
11373
+ }
11374
+ ),
11375
+ partialError && /* @__PURE__ */ jsx36("span", { className: "error-span", children: partialError })
11376
+ ] })
11377
+ ] }) }),
11378
+ is3DSEnable ? clientSecret && /* @__PURE__ */ jsx36(CheckoutWrapper, { onSuccess, clientSecret, amount, showLoader, hideLoader, callback, session_token, handleClose, setError, isPreAuth }) : /* @__PURE__ */ jsxs21(Fragment20, { children: [
11379
+ /* @__PURE__ */ jsxs21("div", { id: "ach", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent", children: [
11380
+ !onSubmit && /* @__PURE__ */ jsxs21(Fragment20, { children: [
11381
+ /* @__PURE__ */ jsxs21("div", { className: "frac-heading-card-wrap", children: [
11382
+ /* @__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: [
11383
+ " ",
11384
+ /* @__PURE__ */ jsx36(IoArrowBack4, {})
11385
+ ] }) }),
11386
+ /* @__PURE__ */ jsx36("h6", { className: "frac-card-payment-heading", children: "Card Payment" })
10647
11387
  ] }),
10648
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10649
- /* @__PURE__ */ jsx32("label", { htmlFor: "cardNumber", children: "CARD NUMBER" }),
10650
- /* @__PURE__ */ jsx32("div", { className: "toggle-num-wrapper", children: (show || autoTrigger) && paymentGateway === 32 && /* @__PURE__ */ jsx32(
10651
- FractalFields_default,
11388
+ /* @__PURE__ */ jsxs21("div", { style: { display: "flex", gap: "8px", margin: "8px 0px 19px 0px" }, children: [
11389
+ /* @__PURE__ */ jsx36("img", { src: visa2, alt: "", width: 33 }),
11390
+ /* @__PURE__ */ jsx36("img", { src: mastercard2, width: 33, alt: "" }),
11391
+ /* @__PURE__ */ jsx36("img", { src: americanexp2, alt: "", width: 33 }),
11392
+ /* @__PURE__ */ jsx36("img", { src: discover2, width: 33, alt: "" })
11393
+ ] })
11394
+ ] }),
11395
+ activeinCard === "list" && (cardList == null ? void 0 : cardList.length) > 0 ? /* @__PURE__ */ jsxs21(Fragment20, { children: [
11396
+ /* @__PURE__ */ jsx36(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Card", ListItems: cardList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Card", otherButtonAction: () => {
11397
+ setActiveinCard("form");
11398
+ } }),
11399
+ /* @__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)) }) })
11400
+ ] }) : paymentGateway == 32 ? /* @__PURE__ */ jsxs21(Fragment20, { children: [
11401
+ onSubmit && /* @__PURE__ */ jsxs21(Fragment20, { children: [
11402
+ /* @__PURE__ */ jsx36(
11403
+ ApplePayButton,
10652
11404
  {
10653
- fractalStyles,
10654
- tokenizerRef,
10655
- isSky: true
11405
+ applePayAmount: partialAmount ? partialAmount : amount,
11406
+ applePayMerchantId,
11407
+ applePayMerchantName: merchantName,
11408
+ completeFractalFlow,
11409
+ showLoader
10656
11410
  }
10657
- ) })
10658
- ] }),
10659
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10660
- /* @__PURE__ */ jsx32("label", { htmlFor: "zip", children: "ZIP" }),
10661
- /* @__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) }),
10662
- (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
10663
- ] }),
10664
- 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: [
10665
- /* @__PURE__ */ jsx32(
10666
- "input",
11411
+ ),
11412
+ /* @__PURE__ */ jsx36(
11413
+ GooglePayComponent,
10667
11414
  {
10668
- type: "checkbox",
10669
- id: "save_card",
10670
- className: "toggle-checkbox",
10671
- checked: saveCardInfo,
10672
- onChange: (e) => setSaveCardInfo(e.target.checked)
11415
+ amount: partialAmount ? partialAmount : amount,
11416
+ googlePayEnvironment,
11417
+ googlePayGatewayMerchantId,
11418
+ googlePayMerchantId,
11419
+ googlePayMerchantName: merchantName,
11420
+ completeFractalFlow,
11421
+ setLoading
10673
11422
  }
10674
11423
  ),
10675
- /* @__PURE__ */ jsx32("label", { htmlFor: "save_card", className: "toggle-label" }),
10676
- /* @__PURE__ */ jsx32("label", { htmlFor: "save_card", children: "Save card for future payments " }),
10677
- /* @__PURE__ */ jsxs19("div", { className: "frac-tooltip-wrapper", children: [
10678
- /* @__PURE__ */ jsx32("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs19(
10679
- "svg",
10680
- {
10681
- xmlns: "http://www.w3.org/2000/svg",
10682
- width: "20",
10683
- height: "20",
10684
- viewBox: "0 0 20 20",
10685
- fill: "none",
10686
- children: [
10687
- /* @__PURE__ */ jsx32("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
10688
- /* @__PURE__ */ jsx32(
10689
- "path",
10690
- {
10691
- 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",
10692
- fill: "#161616"
10693
- }
10694
- )
10695
- ]
10696
- }
10697
- ) }),
10698
- /* @__PURE__ */ jsx32("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs19("p", { children: [
10699
- "If checked, I agree to give the ",
10700
- /* @__PURE__ */ jsx32("b", { children: merchantName || "merchant" }),
10701
- " permission to charge this credit card for agreed-upon purchases in the future."
10702
- ] }) })
10703
- ] })
10704
- ] }) })
10705
- ] }),
10706
- /* @__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)) }) })
10707
- ] }) : /* @__PURE__ */ jsxs19("form", { id: "PaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, onKeyDown: (e) => {
10708
- if (e.key === "Enter" && loading) {
10709
- e.preventDefault();
10710
- e.stopPropagation();
10711
- }
10712
- }, children: [
10713
- /* @__PURE__ */ jsxs19("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
10714
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10715
- /* @__PURE__ */ jsx32("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
10716
- /* @__PURE__ */ jsx32("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
10717
- const value = e.target.value;
10718
- if (/^[a-zA-Z\s]*$/.test(value)) {
10719
- handleCardChange("cardName", value);
10720
- }
10721
- } }),
10722
- (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
11424
+ /* @__PURE__ */ jsx36("div", { id: "digital-wallet-or", className: "frac-or", children: /* @__PURE__ */ jsx36("span", { children: "or" }) })
10723
11425
  ] }),
10724
- /* @__PURE__ */ jsx32("div", { className: "form-group-frac", children: /* @__PURE__ */ jsx32(
10725
- DataCapFields,
10726
- {
10727
- isOpen: show || autoTrigger,
10728
- tokenKey: dcToken,
10729
- setLoader: activeinCard === "form" ? setLoadingIframe : null
11426
+ /* @__PURE__ */ jsxs21("form", { id: "paymentForm", style: { textAlign: "start" }, ref: cardFormRef, onSubmit: submitFunc, onKeyDown: (e) => {
11427
+ if (e.key === "Enter" && loading) {
11428
+ e.preventDefault();
11429
+ e.stopPropagation();
10730
11430
  }
10731
- ) }),
10732
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10733
- /* @__PURE__ */ jsx32("label", { htmlFor: "zip", children: "ZIP" }),
10734
- /* @__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) }),
10735
- (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode })
10736
- ] }),
10737
- 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: [
10738
- /* @__PURE__ */ jsx32(
10739
- "input",
11431
+ }, children: [
11432
+ /* @__PURE__ */ jsxs21("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
11433
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11434
+ /* @__PURE__ */ jsx36("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
11435
+ /* @__PURE__ */ jsx36("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
11436
+ const value = e.target.value;
11437
+ if (/^[a-zA-Z\s]*$/.test(value)) {
11438
+ handleCardChange("cardName", value);
11439
+ }
11440
+ } }),
11441
+ (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
11442
+ ] }),
11443
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11444
+ /* @__PURE__ */ jsx36("label", { htmlFor: "cardNumber", children: "CARD NUMBER" }),
11445
+ /* @__PURE__ */ jsx36("div", { className: "toggle-num-wrapper toggle-num-wrapper-new", children: (show || autoTrigger) && paymentGateway === 32 && /* @__PURE__ */ jsx36(
11446
+ FractalFields_default,
11447
+ {
11448
+ fractalStyles,
11449
+ tokenizerRef,
11450
+ isSky: true
11451
+ }
11452
+ ) })
11453
+ ] }),
11454
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11455
+ /* @__PURE__ */ jsx36("label", { htmlFor: "zip", children: "ZIP" }),
11456
+ /* @__PURE__ */ jsx36("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "000000", value: (_g = cardData == null ? void 0 : cardData.zipCode) != null ? _g : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
11457
+ (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode }),
11458
+ pass_fee && cardFeeAmount > 0 && /* @__PURE__ */ jsxs21("small", { className: "frac-fee-text", children: [
11459
+ "Credit cards include a fee amount of ",
11460
+ /* @__PURE__ */ jsx36("span", { className: "frac-fee-amount", children: formatUSD(cardFeeAmount.toFixed(2)) }),
11461
+ "."
11462
+ ] })
11463
+ ] }),
11464
+ 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: [
11465
+ /* @__PURE__ */ jsx36(
11466
+ "input",
11467
+ {
11468
+ type: "checkbox",
11469
+ id: "save_card",
11470
+ className: "toggle-checkbox",
11471
+ checked: saveCardInfo,
11472
+ onChange: (e) => setSaveCardInfo(e.target.checked)
11473
+ }
11474
+ ),
11475
+ /* @__PURE__ */ jsx36("label", { htmlFor: "save_card", className: "toggle-label" }),
11476
+ /* @__PURE__ */ jsx36("label", { htmlFor: "save_card", children: "Save card for future payments " }),
11477
+ /* @__PURE__ */ jsxs21("div", { className: "frac-tooltip-wrapper", children: [
11478
+ /* @__PURE__ */ jsx36("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs21(
11479
+ "svg",
11480
+ {
11481
+ xmlns: "http://www.w3.org/2000/svg",
11482
+ width: "20",
11483
+ height: "20",
11484
+ viewBox: "0 0 20 20",
11485
+ fill: "none",
11486
+ children: [
11487
+ /* @__PURE__ */ jsx36("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
11488
+ /* @__PURE__ */ jsx36(
11489
+ "path",
11490
+ {
11491
+ 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",
11492
+ fill: "#161616"
11493
+ }
11494
+ )
11495
+ ]
11496
+ }
11497
+ ) }),
11498
+ /* @__PURE__ */ jsx36("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs21("p", { children: [
11499
+ "If checked, I agree to give the ",
11500
+ /* @__PURE__ */ jsx36("b", { children: merchantName || "merchant" }),
11501
+ " permission to charge this credit card for agreed-upon purchases in the future."
11502
+ ] }) })
11503
+ ] })
11504
+ ] }) })
11505
+ ] }),
11506
+ /* @__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)) }) })
11507
+ ] })
11508
+ ] }) : /* @__PURE__ */ jsxs21("form", { id: "PaymentForm", style: { textAlign: "start" }, ref: cardFormRef, onSubmit: submitFunc, onKeyDown: (e) => {
11509
+ if (e.key === "Enter" && loading) {
11510
+ e.preventDefault();
11511
+ e.stopPropagation();
11512
+ }
11513
+ }, children: [
11514
+ /* @__PURE__ */ jsxs21("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
11515
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11516
+ /* @__PURE__ */ jsx36("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
11517
+ /* @__PURE__ */ jsx36("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
11518
+ const value = e.target.value;
11519
+ if (/^[a-zA-Z\s]*$/.test(value)) {
11520
+ handleCardChange("cardName", value);
11521
+ }
11522
+ } }),
11523
+ (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
11524
+ ] }),
11525
+ /* @__PURE__ */ jsx36("div", { className: "form-group-frac", children: /* @__PURE__ */ jsx36(
11526
+ DataCapFields,
10740
11527
  {
10741
- type: "checkbox",
10742
- id: "save_card",
10743
- className: "toggle-checkbox",
10744
- checked: saveCardInfo,
10745
- onChange: (e) => setSaveCardInfo(e.target.checked)
11528
+ isOpen: show || autoTrigger,
11529
+ tokenKey: dcToken,
11530
+ setLoader: activeinCard === "form" ? setLoadingIframe : null,
11531
+ isEmbedded: onSubmit ? true : false,
11532
+ customCSS: customCSS2
10746
11533
  }
10747
- ),
10748
- /* @__PURE__ */ jsx32("label", { htmlFor: "save_card", className: "toggle-label" }),
10749
- /* @__PURE__ */ jsx32("label", { htmlFor: "save_card", children: "Save card for future payments " }),
10750
- /* @__PURE__ */ jsxs19("div", { className: "frac-tooltip-wrapper", children: [
10751
- /* @__PURE__ */ jsx32("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs19(
10752
- "svg",
11534
+ ) }),
11535
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11536
+ /* @__PURE__ */ jsx36("label", { htmlFor: "zip", children: "ZIP" }),
11537
+ /* @__PURE__ */ jsx36("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "000000", value: (_j = cardData == null ? void 0 : cardData.zipCode) != null ? _j : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }),
11538
+ (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode }),
11539
+ pass_fee && cardFeeAmount > 0 && /* @__PURE__ */ jsxs21("small", { className: "frac-fee-text", children: [
11540
+ "Credit cards include a fee amount of ",
11541
+ /* @__PURE__ */ jsx36("span", { className: "frac-fee-amount", children: formatUSD(cardFeeAmount.toFixed(2)) }),
11542
+ "."
11543
+ ] })
11544
+ ] }),
11545
+ 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: [
11546
+ /* @__PURE__ */ jsx36(
11547
+ "input",
10753
11548
  {
10754
- xmlns: "http://www.w3.org/2000/svg",
10755
- width: "20",
10756
- height: "20",
10757
- viewBox: "0 0 20 20",
10758
- fill: "none",
10759
- children: [
10760
- /* @__PURE__ */ jsx32("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
10761
- /* @__PURE__ */ jsx32(
10762
- "path",
10763
- {
10764
- 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",
10765
- fill: "#161616"
10766
- }
10767
- )
10768
- ]
11549
+ type: "checkbox",
11550
+ id: "save_card",
11551
+ className: "toggle-checkbox",
11552
+ checked: saveCardInfo,
11553
+ onChange: (e) => setSaveCardInfo(e.target.checked)
10769
11554
  }
10770
- ) }),
10771
- /* @__PURE__ */ jsx32("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs19("p", { children: [
10772
- "If checked, I agree to give the ",
10773
- /* @__PURE__ */ jsx32("b", { children: merchantName || "merchant" }),
10774
- " permission to charge this credit card for agreed-upon purchases in the future."
10775
- ] }) })
10776
- ] })
10777
- ] }) })
10778
- ] }),
10779
- /* @__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)) }) })
10780
- ] })
10781
- ] }),
10782
- /* @__PURE__ */ jsx32("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent", children: /* @__PURE__ */ jsxs19(Fragment18, { children: [
10783
- /* @__PURE__ */ jsxs19("div", { className: "frac-heading-card-wrap", children: [
10784
- /* @__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: [
10785
- " ",
10786
- /* @__PURE__ */ jsx32(IoArrowBack4, {})
10787
- ] }) }),
10788
- /* @__PURE__ */ jsx32("h6", { className: "frac-card-payment-heading", children: "Bank Payment" })
11555
+ ),
11556
+ /* @__PURE__ */ jsx36("label", { htmlFor: "save_card", className: "toggle-label" }),
11557
+ /* @__PURE__ */ jsx36("label", { htmlFor: "save_card", children: "Save card for future payments " }),
11558
+ /* @__PURE__ */ jsxs21("div", { className: "frac-tooltip-wrapper", children: [
11559
+ /* @__PURE__ */ jsx36("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs21(
11560
+ "svg",
11561
+ {
11562
+ xmlns: "http://www.w3.org/2000/svg",
11563
+ width: "20",
11564
+ height: "20",
11565
+ viewBox: "0 0 20 20",
11566
+ fill: "none",
11567
+ children: [
11568
+ /* @__PURE__ */ jsx36("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
11569
+ /* @__PURE__ */ jsx36(
11570
+ "path",
11571
+ {
11572
+ 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",
11573
+ fill: "#161616"
11574
+ }
11575
+ )
11576
+ ]
11577
+ }
11578
+ ) }),
11579
+ /* @__PURE__ */ jsx36("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs21("p", { children: [
11580
+ "If checked, I agree to give the ",
11581
+ /* @__PURE__ */ jsx36("b", { children: merchantName || "merchant" }),
11582
+ " permission to charge this credit card for agreed-upon purchases in the future."
11583
+ ] }) })
11584
+ ] })
11585
+ ] }) })
11586
+ ] }),
11587
+ /* @__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)) }) })
11588
+ ] })
10789
11589
  ] }),
10790
- activeinBank === "list" && (bankList == null ? void 0 : bankList.length) > 0 ? /* @__PURE__ */ jsxs19(Fragment18, { children: [
10791
- /* @__PURE__ */ jsx32(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Banks", ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
10792
- setActiveinBank("form");
10793
- } }),
10794
- /* @__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)) }) })
10795
- ] }) : /* @__PURE__ */ jsxs19("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
10796
- if (e.key === "Enter" && loading) {
10797
- e.preventDefault();
10798
- e.stopPropagation();
10799
- }
10800
- }, children: [
10801
- /* @__PURE__ */ jsxs19("div", { className: "ach-scrl", style: {
10802
- minHeight: "444px",
10803
- maxHeight: "444px"
11590
+ /* @__PURE__ */ jsx36("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent", children: /* @__PURE__ */ jsxs21(Fragment20, { children: [
11591
+ !onSubmit && /* @__PURE__ */ jsxs21("div", { className: "frac-heading-card-wrap", children: [
11592
+ /* @__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: [
11593
+ " ",
11594
+ /* @__PURE__ */ jsx36(IoArrowBack4, {})
11595
+ ] }) }),
11596
+ /* @__PURE__ */ jsx36("h6", { className: "frac-card-payment-heading", children: "Bank Payment" })
11597
+ ] }),
11598
+ activeinBank === "list" && (bankList == null ? void 0 : bankList.length) > 0 ? /* @__PURE__ */ jsxs21(Fragment20, { children: [
11599
+ /* @__PURE__ */ jsx36(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Banks", ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
11600
+ setActiveinBank("form");
11601
+ } }),
11602
+ /* @__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)) }) })
11603
+ ] }) : /* @__PURE__ */ jsxs21("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, ref: bankFormRef, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
11604
+ if (e.key === "Enter" && loading) {
11605
+ e.preventDefault();
11606
+ e.stopPropagation();
11607
+ }
10804
11608
  }, children: [
10805
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10806
- /* @__PURE__ */ jsx32("label", { htmlFor: "nameonaccount", children: "Name on account" }),
10807
- /* @__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 }),
10808
- (achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
10809
- ] }),
10810
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10811
- /* @__PURE__ */ jsx32("label", { htmlFor: "routingnumber", children: "Routing number" }),
10812
- /* @__PURE__ */ jsx32(
10813
- "input",
10814
- {
10815
- type: "text",
10816
- id: "routingnumber",
10817
- className: "form-control-frac",
10818
- maxLength: 9,
10819
- placeholder: "000000000",
10820
- name: "routingNumber",
10821
- value: (_m = achData == null ? void 0 : achData.routingNumber) != null ? _m : "",
10822
- onChange: handleChangeAch
10823
- }
10824
- ),
10825
- (achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.routingNumber })
10826
- ] }),
10827
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10828
- /* @__PURE__ */ jsx32("label", { htmlFor: "accountnumber", children: "Account number" }),
10829
- /* @__PURE__ */ jsx32(
10830
- "input",
10831
- {
10832
- type: "text",
10833
- id: "accountnumber",
10834
- className: "form-control-frac",
10835
- maxLength: 16,
10836
- placeholder: "0000000000",
10837
- name: "accountNumber",
10838
- value: (_n = achData == null ? void 0 : achData.accountNumber) != null ? _n : "",
10839
- onChange: handleChangeAch
10840
- }
10841
- ),
10842
- (achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.accountNumber })
10843
- ] }),
10844
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10845
- /* @__PURE__ */ jsx32("label", { htmlFor: "confirmaccountnumber", children: "Confirm account number" }),
10846
- /* @__PURE__ */ jsx32(
10847
- "input",
10848
- {
10849
- type: "text",
10850
- id: "confirmaccountnumber",
10851
- className: "form-control-frac",
10852
- maxLength: 16,
10853
- placeholder: "0000000000",
10854
- name: "confirmAccountNumber",
10855
- value: (_o = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _o : "",
10856
- onChange: handleChangeAch
10857
- }
10858
- ),
10859
- (achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.confirmAccountNumber })
10860
- ] }),
10861
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10862
- /* @__PURE__ */ jsx32("label", { htmlFor: "bankname", children: "Bank name" }),
10863
- /* @__PURE__ */ jsx32(
10864
- "input",
10865
- {
10866
- type: "text",
10867
- id: "bankname",
10868
- className: "form-control-frac",
10869
- maxLength: 100,
10870
- placeholder: "My Bank",
10871
- name: "bankName",
10872
- value: (_p = achData == null ? void 0 : achData.bankName) != null ? _p : "",
10873
- onChange: handleChangeAch
10874
- }
10875
- ),
10876
- (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.bankName })
10877
- ] }),
10878
- ((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10879
- /* @__PURE__ */ jsx32("label", { htmlFor: "companyName", children: "Company name" }),
10880
- /* @__PURE__ */ jsx32(
10881
- "input",
10882
- {
10883
- type: "text",
10884
- id: "companyName",
10885
- className: "form-control-frac",
10886
- maxLength: 100,
10887
- placeholder: "My Company",
10888
- name: "companyName",
10889
- value: (_q = achData == null ? void 0 : achData.companyName) != null ? _q : "",
10890
- onChange: handleChangeAch
10891
- }
10892
- ),
10893
- (achError == null ? void 0 : achError.companyName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.companyName })
10894
- ] }),
10895
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
10896
- /* @__PURE__ */ jsx32("label", { htmlFor: "accounttype", children: "Select account type" }),
10897
- /* @__PURE__ */ jsxs19("select", { name: "accountType", id: "accounttype", className: "form-control-frac", value: (_r = achData == null ? void 0 : achData.accountType) != null ? _r : "", onChange: handleChangeAch, children: [
10898
- /* @__PURE__ */ jsx32("option", { value: "", children: "Select account" }),
10899
- accountTypes.map((type) => /* @__PURE__ */ jsx32("option", { value: type.value, children: type.label }, type.value))
11609
+ /* @__PURE__ */ jsxs21("div", { className: "ach-scrl", style: {
11610
+ minHeight: "444px",
11611
+ maxHeight: "444px"
11612
+ }, children: [
11613
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11614
+ /* @__PURE__ */ jsx36("label", { htmlFor: "nameonaccount", children: "Name on account" }),
11615
+ /* @__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 }),
11616
+ (achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
11617
+ ] }),
11618
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11619
+ /* @__PURE__ */ jsx36("label", { htmlFor: "routingnumber", children: "Routing number" }),
11620
+ /* @__PURE__ */ jsx36(
11621
+ "input",
11622
+ {
11623
+ type: "text",
11624
+ id: "routingnumber",
11625
+ className: "form-control-frac",
11626
+ maxLength: 9,
11627
+ placeholder: "000000000",
11628
+ name: "routingNumber",
11629
+ value: (_o = achData == null ? void 0 : achData.routingNumber) != null ? _o : "",
11630
+ onChange: handleChangeAch
11631
+ }
11632
+ ),
11633
+ (achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.routingNumber })
11634
+ ] }),
11635
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11636
+ /* @__PURE__ */ jsx36("label", { htmlFor: "accountnumber", children: "Account number" }),
11637
+ /* @__PURE__ */ jsx36(
11638
+ "input",
11639
+ {
11640
+ type: "text",
11641
+ id: "accountnumber",
11642
+ className: "form-control-frac",
11643
+ maxLength: 16,
11644
+ placeholder: "0000000000",
11645
+ name: "accountNumber",
11646
+ value: (_p = achData == null ? void 0 : achData.accountNumber) != null ? _p : "",
11647
+ onChange: handleChangeAch
11648
+ }
11649
+ ),
11650
+ (achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.accountNumber })
11651
+ ] }),
11652
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11653
+ /* @__PURE__ */ jsx36("label", { htmlFor: "confirmaccountnumber", children: "Confirm account number" }),
11654
+ /* @__PURE__ */ jsx36(
11655
+ "input",
11656
+ {
11657
+ type: "text",
11658
+ id: "confirmaccountnumber",
11659
+ className: "form-control-frac",
11660
+ maxLength: 16,
11661
+ placeholder: "0000000000",
11662
+ name: "confirmAccountNumber",
11663
+ value: (_q = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _q : "",
11664
+ onChange: handleChangeAch
11665
+ }
11666
+ ),
11667
+ (achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.confirmAccountNumber })
11668
+ ] }),
11669
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11670
+ /* @__PURE__ */ jsx36("label", { htmlFor: "bankname", children: "Bank name" }),
11671
+ /* @__PURE__ */ jsx36(
11672
+ "input",
11673
+ {
11674
+ type: "text",
11675
+ id: "bankname",
11676
+ className: "form-control-frac",
11677
+ maxLength: 100,
11678
+ placeholder: "My Bank",
11679
+ name: "bankName",
11680
+ value: (_r = achData == null ? void 0 : achData.bankName) != null ? _r : "",
11681
+ onChange: handleChangeAch
11682
+ }
11683
+ ),
11684
+ (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.bankName })
11685
+ ] }),
11686
+ ((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11687
+ /* @__PURE__ */ jsx36("label", { htmlFor: "companyName", children: "Company name" }),
11688
+ /* @__PURE__ */ jsx36(
11689
+ "input",
11690
+ {
11691
+ type: "text",
11692
+ id: "companyName",
11693
+ className: "form-control-frac",
11694
+ maxLength: 100,
11695
+ placeholder: "My Company",
11696
+ name: "companyName",
11697
+ value: (_s = achData == null ? void 0 : achData.companyName) != null ? _s : "",
11698
+ onChange: handleChangeAch
11699
+ }
11700
+ ),
11701
+ (achError == null ? void 0 : achError.companyName) && /* @__PURE__ */ jsx36("span", { className: "error-span", children: achError == null ? void 0 : achError.companyName })
11702
+ ] }),
11703
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac", children: [
11704
+ /* @__PURE__ */ jsx36("label", { htmlFor: "accounttype", children: "Select account type" }),
11705
+ /* @__PURE__ */ jsxs21("select", { name: "accountType", id: "accounttype", className: "form-control-frac", value: (_t = achData == null ? void 0 : achData.accountType) != null ? _t : "", onChange: handleChangeAch, children: [
11706
+ /* @__PURE__ */ jsx36("option", { value: "", children: "Select account" }),
11707
+ accountTypes.map((type) => /* @__PURE__ */ jsx36("option", { value: type.value, children: type.label }, type.value))
11708
+ ] }),
11709
+ bankFeeAmount > 0 && /* @__PURE__ */ jsxs21("small", { className: "frac-fee-text", children: [
11710
+ "There is a processing fee of ",
11711
+ /* @__PURE__ */ jsx36("span", { className: "frac-fee-amount", children: formatUSD(bankFeeAmount.toFixed(2)) }),
11712
+ "."
11713
+ ] }),
11714
+ /* @__PURE__ */ jsxs21("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
11715
+ /* @__PURE__ */ jsx36("input", { type: "checkbox", id: "achconsent", className: "", checked: isBankConsentChecked, onChange: (e) => {
11716
+ setIsBankConsentChecked(e.target.checked);
11717
+ if (e.target.checked) {
11718
+ setErrorBankConsent("");
11719
+ }
11720
+ } }),
11721
+ /* @__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.` })
11722
+ ] }),
11723
+ errorBankConsent && /* @__PURE__ */ jsx36("span", { className: "error-span", children: errorBankConsent }),
11724
+ customerId && /* @__PURE__ */ jsxs21("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
11725
+ /* @__PURE__ */ jsx36("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
11726
+ /* @__PURE__ */ jsx36("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save Bank" })
11727
+ ] }),
11728
+ saveACHinfo && /* @__PURE__ */ jsx36("div", { className: "form-group-frac saveachtext", children: /* @__PURE__ */ jsxs21("p", { children: [
11729
+ "If checked, I agree to give the ",
11730
+ /* @__PURE__ */ jsx36("b", { children: merchantName || "merchant" }),
11731
+ " permission to charge this bank account for agreed-upon purchases in the future."
11732
+ ] }) })
10900
11733
  ] })
10901
11734
  ] }),
10902
- /* @__PURE__ */ jsxs19("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
10903
- /* @__PURE__ */ jsx32("input", { type: "checkbox", id: "achconsent", className: "", checked: isBankConsentChecked, onChange: (e) => {
10904
- setIsBankConsentChecked(e.target.checked);
10905
- if (e.target.checked) {
10906
- setErrorBankConsent("");
10907
- }
10908
- } }),
10909
- /* @__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.` })
10910
- ] }),
10911
- errorBankConsent && /* @__PURE__ */ jsx32("span", { className: "error-span", children: errorBankConsent }),
10912
- customerId && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
10913
- /* @__PURE__ */ jsx32("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
10914
- /* @__PURE__ */ jsx32("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save Bank" })
10915
- ] }),
10916
- saveACHinfo && /* @__PURE__ */ jsx32("div", { className: "form-group-frac saveachtext", children: /* @__PURE__ */ jsxs19("p", { children: [
10917
- "If checked, I agree to give the ",
10918
- /* @__PURE__ */ jsx32("b", { children: merchantName || "merchant" }),
10919
- " permission to charge this bank account for agreed-upon purchases in the future."
10920
- ] }) })
10921
- ] }),
10922
- /* @__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)) }) })
10923
- ] })
10924
- ] }) })
10925
- ] }) }) }) })
11735
+ /* @__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)) }) })
11736
+ ] })
11737
+ ] }) })
11738
+ ] })
11739
+ ] }) }) })
10926
11740
  ] })
10927
11741
  ] })
10928
11742
  ] })
@@ -10933,7 +11747,7 @@ var ModelContentSky_default = ModelContentSky;
10933
11747
 
10934
11748
  // src/app/components/Skysystemz/PayButtonWithForm.tsx
10935
11749
  import axios10 from "axios";
10936
- import { Fragment as Fragment19, jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
11750
+ import { Fragment as Fragment21, jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
10937
11751
  var PaymentWidget = ({
10938
11752
  amount,
10939
11753
  bankAmount,
@@ -10953,14 +11767,15 @@ var PaymentWidget = ({
10953
11767
  autoTrigger = false,
10954
11768
  isPartial,
10955
11769
  bankSurcharge,
10956
- partialRef
11770
+ partialRef,
11771
+ customCSS: customCSS2
10957
11772
  }) => {
10958
- const [show, setShow] = useState11(autoTrigger || false);
10959
- const [loading, setLoading] = useState11(false);
10960
- const [childHandleClose, setChildHandleClose] = useState11(() => () => {
11773
+ const [show, setShow] = useState12(autoTrigger || false);
11774
+ const [loading, setLoading] = useState12(false);
11775
+ const [childHandleClose, setChildHandleClose] = useState12(() => () => {
10961
11776
  });
10962
- const [orderGuid, setOrderGuid] = useState11(null);
10963
- const [remainingAmount, setRemainingAmount] = useState11(null);
11777
+ const [orderGuid, setOrderGuid] = useState12(null);
11778
+ const [remainingAmount, setRemainingAmount] = useState12(null);
10964
11779
  const initialCommonProps = useMemo(
10965
11780
  () => ({
10966
11781
  amount,
@@ -10983,7 +11798,8 @@ var PaymentWidget = ({
10983
11798
  setHandleCloseRef: setChildHandleClose,
10984
11799
  isPartial,
10985
11800
  bankSurcharge,
10986
- partialRef
11801
+ partialRef,
11802
+ customCSS: customCSS2
10987
11803
  }),
10988
11804
  [
10989
11805
  amount,
@@ -11007,8 +11823,8 @@ var PaymentWidget = ({
11007
11823
  partialRef
11008
11824
  ]
11009
11825
  );
11010
- const [commonProps, setCommonProps] = useState11(initialCommonProps);
11011
- useEffect16(() => {
11826
+ const [commonProps, setCommonProps] = useState12(initialCommonProps);
11827
+ useEffect19(() => {
11012
11828
  if (show) {
11013
11829
  setCommonProps(initialCommonProps);
11014
11830
  }
@@ -11039,29 +11855,556 @@ var PaymentWidget = ({
11039
11855
  setLoading(false);
11040
11856
  }
11041
11857
  };
11042
- useEffect16(() => {
11858
+ useEffect19(() => {
11043
11859
  if (show && isPartial && partialRef) {
11044
11860
  getskyosOrderDetails();
11045
11861
  }
11046
11862
  }, [show, isPartial, partialRef]);
11047
- return /* @__PURE__ */ jsxs20(Fragment19, { children: [
11048
- /* @__PURE__ */ jsx33("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
11049
- /* @__PURE__ */ jsx33(DataScript, {}),
11050
- /* @__PURE__ */ jsx33(FractalTokenizerScript, {}),
11051
- /* @__PURE__ */ jsx33(SkyChargewidgetstyles, {}),
11052
- /* @__PURE__ */ jsx33(CardBankRadioStyles, {}),
11053
- /* @__PURE__ */ jsx33(CustomModal2styles_default, {}),
11054
- /* @__PURE__ */ jsx33(DataCapScriptLoader, {}),
11055
- !autoTrigger && /* @__PURE__ */ jsxs20("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
11863
+ return /* @__PURE__ */ jsxs22(Fragment21, { children: [
11864
+ /* @__PURE__ */ jsx37("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
11865
+ /* @__PURE__ */ jsx37(DataScript, {}),
11866
+ /* @__PURE__ */ jsx37(FractalTokenizerScript, {}),
11867
+ /* @__PURE__ */ jsx37(SkyChargewidgetstyles, {}),
11868
+ /* @__PURE__ */ jsx37(CardBankRadioStyles, {}),
11869
+ /* @__PURE__ */ jsx37(CustomModal2styles_default, {}),
11870
+ /* @__PURE__ */ jsx37(DataCapScriptLoader, {}),
11871
+ !autoTrigger && /* @__PURE__ */ jsxs22("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
11872
+ submitBtnText,
11873
+ submitBtnIcon
11874
+ ] }),
11875
+ !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 }))
11876
+ ] });
11877
+ };
11878
+
11879
+ // src/app/components/Skysystemz/EmbeddedCheckout.tsx
11880
+ import { useEffect as useEffect21, useState as useState13, useMemo as useMemo2 } from "react";
11881
+ import axios11 from "axios";
11882
+
11883
+ // src/app/components/Skysystemz/EmbeddedCheckoutStyles.tsx
11884
+ import { jsx as jsx38 } from "react/jsx-runtime";
11885
+ function EmbeddedCheckoutStyles({ extraCustomCSS }) {
11886
+ return /* @__PURE__ */ jsx38("style", { children: `
11887
+
11888
+ .pay-amount-conatiner{
11889
+ margin-top: 20px !important;
11890
+ margin-bottom: 20px !important ;
11891
+ }
11892
+
11893
+ .frac-pay-container.pay-container {
11894
+ grid-template-columns:1fr;
11895
+ }
11896
+
11897
+
11898
+ /* Card */
11899
+ .plan-card {
11900
+ width: 100%;
11901
+ font-family: Inter, sans-serif;
11902
+ background: #fff;
11903
+ }
11904
+
11905
+ /* Header */
11906
+ .card-header {
11907
+ padding: 12px 0 0 0;
11908
+ }
11909
+
11910
+ /* Button */
11911
+ .collapse-btn {
11912
+ width: 100%;
11913
+ background: none;
11914
+ border: none;
11915
+ display: flex;
11916
+ justify-content: space-between;
11917
+ align-items: center;
11918
+ cursor: pointer;
11919
+ font-size: 15px;
11920
+ padding: 0;
11921
+ }
11922
+
11923
+ /* Arrow */
11924
+ .arrow {
11925
+ transition: transform 0.3s ease;
11926
+ height: 8px;
11927
+ }
11928
+
11929
+ /* Open State */
11930
+ .collapse-btn.open .arrow {
11931
+ transform: rotate(180deg); /* Down */
11932
+ }
11933
+
11934
+ /* Body */
11935
+ .card-body {
11936
+ padding: 0;
11937
+ }
11938
+
11939
+ /* Plan Header */
11940
+ .plan-header {
11941
+ font-size: 15px;
11942
+ font-weight: 600;
11943
+ }
11944
+
11945
+ /* Scrollable List */
11946
+ .plan-list {
11947
+ max-height: 200px;
11948
+ overflow-y: auto;
11949
+ padding-right: 6px;
11950
+ }
11951
+
11952
+ /* Items */
11953
+ .plan-item {
11954
+ display: flex;
11955
+ justify-content: space-between;
11956
+ padding: 6px 0;
11957
+ font-size: 14px;
11958
+ }
11959
+
11960
+ /* Badges */
11961
+ .badge {
11962
+ padding: 4px 10px;
11963
+ border-radius: 12px;
11964
+ font-size: 12px;
11965
+ font-weight: 500;
11966
+ }
11967
+
11968
+ .badge-included {
11969
+ background: #f1f3f5;
11970
+ color: #495057;
11971
+ }
11972
+
11973
+ .badge-available {
11974
+ background: #f8f9fa;
11975
+ color: #212529;
11976
+ }
11977
+
11978
+ /* Helpers */
11979
+ .row-between {
11980
+ display: flex;
11981
+ justify-content: space-between;
11982
+ }
11983
+
11984
+ .text-end {
11985
+ text-align: right;
11986
+ }
11987
+
11988
+ .text-muted {
11989
+ color: #6c757d;
11990
+ font-size: 12px;
11991
+ }
11992
+
11993
+ .fw-semibold {
11994
+ font-weight: 600;
11995
+ }
11996
+
11997
+ .mb-2 {
11998
+ margin-bottom: 8px;
11999
+ }
12000
+
12001
+ /* Divider */
12002
+ .divider {
12003
+ height: 1px;
12004
+ background: #e5e7eb;
12005
+ margin: 8px 0;
12006
+ }
12007
+
12008
+ /* Collapse Animation */
12009
+ .collapse {
12010
+ max-height: 0;
12011
+ overflow: hidden;
12012
+ transition: max-height 0.3s ease;
12013
+ }
12014
+
12015
+ .collapse.show {
12016
+ max-height: 1000px;
12017
+ }
12018
+ .frac-pay-container.pay-container {
12019
+ grid-template-columns:1fr;
12020
+ }
12021
+ .frac-payment-form-div .amt-pay-con {
12022
+ padding-right: 0px;
12023
+ }
12024
+ .frac-payment-form-div .ach-scrl {
12025
+ padding-right: 0px;
12026
+ gap: 10px;
12027
+ max-height: fit-content !important;
12028
+ min-height: fit-content !important;
12029
+ overflow: hidden !important;
12030
+ }
12031
+ .frac-payment-form-div .frac-card-bank-radio-main {
12032
+ display: flex;
12033
+ flex-direction: row;
12034
+ align-items: flex-start;
12035
+ align-self: stretch;
12036
+ border-radius: 14px;
12037
+ border: none;
12038
+ overflow: visible;
12039
+ gap: 10px;
12040
+ }
12041
+ .frac-payment-form-div .frac-card-bank-radio {
12042
+ display: flex;
12043
+ padding: 12px 16px;
12044
+ justify-content: space-between;
12045
+ align-items: center;
12046
+ align-self: stretch;
12047
+ width: 50%;
12048
+ border: 1px solid #E0DFE2;
12049
+ border-radius: 10px;
12050
+ box-shadow: rgba(149, 157, 165, 0.2) 0px 1px 4px;
12051
+ }
12052
+ .frac-payment-form-div .frac-card-bank-radio.frac-active {
12053
+ background: #fff;
12054
+ border: 2px solid #004eab !important;
12055
+ }
12056
+
12057
+ .frac-payment-form-div .form-control-frac {
12058
+ border: 1px solid #dee2e6 !important;
12059
+ border-radius: 0.375rem !important;
12060
+ background-color: #F6F6F7;
12061
+ box-shadow: 1px 1px 2px inset rgba(0, 0, 0, 0.1);
12062
+ }
12063
+ .frac-payment-form-div .form-control-frac:focus {
12064
+ border: 1px solid #004eab !important;
12065
+ }
12066
+ .frac-payment-form-div .card-expiry-new {
12067
+ border: none;
12068
+ gap: 10px;
12069
+ }
12070
+ .frac-payment-form-div .exp-date-year-container {
12071
+ gap: 10px;
12072
+ width: 100%;
12073
+ }
12074
+ .frac-payment-form-div .card-type-logo-wrap{
12075
+ position: absolute;
12076
+ right: 10px;
12077
+ max-width: 30px;
12078
+ }
12079
+ .detials-wrap.detials-wrap-1 {
12080
+ display: flex;
12081
+ flex-wrap: wrap;
12082
+ }
12083
+ @media screen and (max-width: 1280px) {
12084
+ .frac-pay-container.pay-container {
12085
+ grid-template-columns: 1fr;
12086
+ border: none;
12087
+ }
12088
+ }
12089
+ @media screen and (max-width: 899px) {
12090
+ .detials-wrap {
12091
+ grid-template-columns: 1fr !important;
12092
+ }
12093
+ .frac-payment-form-div .exp-date-year-container{
12094
+ width: 100%;}
12095
+
12096
+ }
12097
+ @media screen and (max-width: 575px) {
12098
+ .frac-payment-form-div .card-type-logo-wrap{
12099
+ max-width: 30px;
12100
+ }
12101
+ form#ACHPaymentForm .ach-scrl {
12102
+ grid-template-columns: 1fr !important;
12103
+ }
12104
+ @media screen and (max-width: 375px) {
12105
+ .frac-payment-form-div .exp-date-year-container {
12106
+ flex-direction: column;
12107
+ }
12108
+ .parent-pay-container {
12109
+ padding: 10px;
12110
+ }
12111
+ }
12112
+ }
12113
+ .box-inner-card-text{
12114
+ display: flex;
12115
+ gap: 0px;
12116
+ flex-direction: column;
12117
+ }
12118
+ .box-inner-card-text .frac-payment-type-logo {
12119
+ width: 17px;
12120
+ height: 17px;
12121
+ aspect-ratio: 1/1;
12122
+ }
12123
+ .exp-date-year-wrap.form-control-frac input {
12124
+ background: transparent;
12125
+ border: none;
12126
+ outline: none;
12127
+ font-size: 1rem;
12128
+ font-weight: 400;
12129
+ }
12130
+ .exp-date-year-wrap.form-control-frac {
12131
+ display: flex;
12132
+ gap: 2px;
12133
+ }
12134
+ .exp-date-year-wrap input.exp-month {
12135
+ width: 32px;
12136
+ }
12137
+ .detials-wrap {
12138
+ display: grid;
12139
+ grid-template-columns: 1fr 1fr;
12140
+ gap: 10px;
12141
+ }
12142
+ .detials-wrap.detials-wrap-2{
12143
+ grid-template-columns: 1fr 1fr;
12144
+ }
12145
+ form#ACHPaymentForm .ach-scrl {
12146
+ display: grid;
12147
+ grid-gap: 0px 10px;
12148
+ grid-template-columns: 1fr;
12149
+ }
12150
+ .plan-list {
12151
+ max-height: 130px;
12152
+ min-height: 130px;
12153
+ overflow-y: auto;
12154
+ padding-right: 6px;
12155
+ }
12156
+ .plan-list::-webkit-scrollbar {
12157
+ width: 3px;
12158
+ background-color: #F5F5F5;
12159
+ }
12160
+ .plan-list::-webkit-scrollbar-thumb {
12161
+ background-color: #35254D;
12162
+ }
12163
+ div#cvv {
12164
+ border-top-left-radius: 0;
12165
+ border-bottom-left-radius: 0;
12166
+ border-top: 0;
12167
+ border-bottom: 0;
12168
+ border-right: 0;
12169
+ }
12170
+ div#exp_year {
12171
+ height: 36px;
12172
+ width: calc(100% + 1px);
12173
+ border-radius: 0;
12174
+ border-top: 0;
12175
+ border-bottom: 0;
12176
+ border-right: 1px solid #dee2e6;
12177
+ }
12178
+ div#exp_month {
12179
+ width: calc(100% + 1px);
12180
+ border-top-right-radius: 0;
12181
+ border-bottom-right-radius: 0;
12182
+ border: 0;
12183
+ border-right: 1px solid #dee2e6;
12184
+ }
12185
+ .exp-date-year-container .form-group {
12186
+ flex: 1;
12187
+ }
12188
+ .input-main-wrap-frac{
12189
+ margin:0px !important;
12190
+ padding:0px !important;
12191
+ }
12192
+ .toggle-num-wrapper.toggle-num-wrapper-new {
12193
+ border: 1px solid #dee2e6 !important;
12194
+ border-radius: 0.375rem !important;
12195
+ background-color: #F6F6F7;
12196
+ box-shadow: 1px 1px 2px inset rgba(0, 0, 0, 0.1);
12197
+ }
12198
+ .toggle-num-wrapper-new div#card_number {
12199
+ padding: 0px 10px;
12200
+ border: none;
12201
+ border-bottom: 1px solid #dee2e6;
12202
+ }
12203
+ .toggle-num-wrapper-new .card-crdi.card-expiry-new {
12204
+ padding: 0px 10px;
12205
+ }
12206
+ .toggle-num-wrapper-new .input-main-wrap-frac {
12207
+ height: 36px;
12208
+ }
12209
+ .toggle-num-wrapper-new:focus {
12210
+ border: 1px solid #004eab !important;
12211
+ }
12212
+ .frac-card-title-main {
12213
+ display: flex;
12214
+ align-items: start;
12215
+ gap: 4px;
12216
+ flex-direction: column;
12217
+ }
12218
+ .parent-pay-container {
12219
+ padding: 24px;
12220
+ background-color: #ffffff !important;
12221
+ border-radius: 15px;
12222
+ min-width: 300px;
12223
+ }
12224
+
12225
+
12226
+ ${extraCustomCSS}
12227
+
12228
+ ` });
12229
+ }
12230
+
12231
+ // src/app/components/Atoms/Applepay/ApplePayScriptLoader.tsx
12232
+ import { useEffect as useEffect20 } from "react";
12233
+ var applePayScriptLoaded = false;
12234
+ var ApplePayScriptLoader = () => {
12235
+ useEffect20(() => {
12236
+ if (applePayScriptLoaded) return;
12237
+ const existingScript = document.querySelector(
12238
+ `script[src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js"]`
12239
+ );
12240
+ if (!existingScript) {
12241
+ const script2 = document.createElement("script");
12242
+ script2.src = "https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js";
12243
+ script2.async = true;
12244
+ script2.onload = () => {
12245
+ console.log("\u2705 Apple Pay script loaded");
12246
+ applePayScriptLoaded = true;
12247
+ console.log("ApplePaySession:", window.ApplePaySession);
12248
+ };
12249
+ script2.onerror = (err) => {
12250
+ console.error("\u274C Apple Pay script failed", err);
12251
+ };
12252
+ document.head.appendChild(script2);
12253
+ } else {
12254
+ applePayScriptLoaded = true;
12255
+ }
12256
+ }, []);
12257
+ return null;
12258
+ };
12259
+
12260
+ // src/app/components/Skysystemz/EmbeddedCheckout.tsx
12261
+ import { Fragment as Fragment22, jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
12262
+ var EmbeddedCheckout = ({
12263
+ amount,
12264
+ bankAmount,
12265
+ submitBtnText = "Pay",
12266
+ session_token,
12267
+ customerId,
12268
+ callback,
12269
+ merchantName = "merchant",
12270
+ isPreAuth,
12271
+ surcharge = "0",
12272
+ submitBtnClass,
12273
+ submitBtnIcon,
12274
+ isRequest,
12275
+ pass_fee,
12276
+ pass_fee_amount,
12277
+ require3ds = false,
12278
+ autoTrigger = false,
12279
+ isPartial,
12280
+ bankSurcharge,
12281
+ partialRef,
12282
+ onSubmit,
12283
+ onLoad,
12284
+ customCSS: customCSS2
12285
+ }) => {
12286
+ const [show, setShow] = useState13(false);
12287
+ const [loading, setLoading] = useState13(false);
12288
+ const [childHandleClose, setChildHandleClose] = useState13(() => () => {
12289
+ });
12290
+ const [orderGuid, setOrderGuid] = useState13(null);
12291
+ const [remainingAmount, setRemainingAmount] = useState13(null);
12292
+ const initialCommonProps = useMemo2(
12293
+ () => ({
12294
+ amount,
12295
+ bankAmount,
12296
+ submitBtnText,
12297
+ session_token,
12298
+ customerId,
12299
+ callback,
12300
+ merchantName,
12301
+ isPreAuth,
12302
+ surcharge,
12303
+ submitBtnClass,
12304
+ submitBtnIcon,
12305
+ isRequest,
12306
+ pass_fee,
12307
+ pass_fee_amount,
12308
+ require3ds,
12309
+ autoTrigger,
12310
+ setShow,
12311
+ setHandleCloseRef: setChildHandleClose,
12312
+ isPartial,
12313
+ bankSurcharge,
12314
+ partialRef
12315
+ }),
12316
+ [
12317
+ amount,
12318
+ bankAmount,
12319
+ submitBtnText,
12320
+ session_token,
12321
+ customerId,
12322
+ callback,
12323
+ merchantName,
12324
+ isPreAuth,
12325
+ surcharge,
12326
+ submitBtnClass,
12327
+ submitBtnIcon,
12328
+ isRequest,
12329
+ pass_fee,
12330
+ pass_fee_amount,
12331
+ require3ds,
12332
+ autoTrigger,
12333
+ isPartial,
12334
+ bankSurcharge,
12335
+ partialRef
12336
+ ]
12337
+ );
12338
+ const [commonProps, setCommonProps] = useState13(initialCommonProps);
12339
+ useEffect21(() => {
12340
+ if (show) {
12341
+ setCommonProps(initialCommonProps);
12342
+ }
12343
+ }, [show, initialCommonProps]);
12344
+ const getskyosOrderDetails = async () => {
12345
+ var _a;
12346
+ setLoading(true);
12347
+ try {
12348
+ const res = await axios11.get(
12349
+ `${masterBaseUrl}api/v1/gateway/get-order-details/${session_token}`,
12350
+ { params: { isPartial, partialRef } }
12351
+ );
12352
+ if ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.result) {
12353
+ const data = res.data.data;
12354
+ if (data == null ? void 0 : data.orderGuid) {
12355
+ setOrderGuid(data == null ? void 0 : data.orderGuid);
12356
+ setRemainingAmount(data == null ? void 0 : data.remainingAmount);
12357
+ }
12358
+ setCommonProps((prev) => __spreadProps(__spreadValues({}, prev), {
12359
+ amount: data.amount,
12360
+ pass_fee_amount: data.pass_fee_amount,
12361
+ pass_fee: data.pass_fee
12362
+ }));
12363
+ }
12364
+ } catch (error) {
12365
+ console.log("error while getting skyosorderdeatils", error);
12366
+ } finally {
12367
+ setLoading(false);
12368
+ }
12369
+ };
12370
+ useEffect21(() => {
12371
+ if (show && isPartial && partialRef) {
12372
+ getskyosOrderDetails();
12373
+ }
12374
+ }, [show, isPartial, partialRef]);
12375
+ console.log(onLoad, "onLoad");
12376
+ useEffect21(() => {
12377
+ const supported = !!window.ApplePaySession;
12378
+ let canPay = false;
12379
+ if (supported) {
12380
+ try {
12381
+ canPay = window.ApplePaySession.canMakePayments();
12382
+ } catch (e) {
12383
+ }
12384
+ }
12385
+ console.log(`ApplePaySession: ${supported}, canMakePayments: ${canPay}`);
12386
+ }, []);
12387
+ return /* @__PURE__ */ jsxs23(Fragment22, { children: [
12388
+ /* @__PURE__ */ jsx39("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
12389
+ /* @__PURE__ */ jsx39(DataScript, {}),
12390
+ /* @__PURE__ */ jsx39(FractalTokenizerScript, {}),
12391
+ /* @__PURE__ */ jsx39(SkyChargewidgetstyles, {}),
12392
+ /* @__PURE__ */ jsx39(CardBankRadioStyles, {}),
12393
+ /* @__PURE__ */ jsx39(CustomModal2styles_default, {}),
12394
+ /* @__PURE__ */ jsx39(DataCapScriptLoader, {}),
12395
+ /* @__PURE__ */ jsx39(ApplePayScriptLoader, {}),
12396
+ /* @__PURE__ */ jsx39(EmbeddedCheckoutStyles, { extraCustomCSS: customCSS2 }),
12397
+ !autoTrigger && /* @__PURE__ */ jsxs23("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
11056
12398
  submitBtnText,
11057
12399
  submitBtnIcon
11058
12400
  ] }),
11059
- !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 }))
12401
+ !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 }))
11060
12402
  ] });
11061
12403
  };
11062
12404
  export {
11063
12405
  AddCardEasyPay as AddCard,
11064
12406
  CardOnFile,
12407
+ EmbeddedCheckout,
11065
12408
  GetPaymentPage,
11066
12409
  PartialPayment,
11067
12410
  PaymentWidget,