@fractalpay/fractalpay-next 0.0.42 → 0.0.44
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 +638 -299
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var require_package = __commonJS({
|
|
|
39
39
|
"package.json"(exports, module) {
|
|
40
40
|
module.exports = {
|
|
41
41
|
name: "@fractalpay/fractalpay-next",
|
|
42
|
-
version: "0.0.
|
|
42
|
+
version: "0.0.44",
|
|
43
43
|
private: false,
|
|
44
44
|
type: "module",
|
|
45
45
|
scripts: {
|
|
@@ -2816,25 +2816,25 @@ import { IoArrowBack } from "react-icons/io5";
|
|
|
2816
2816
|
import { useEffect as useEffect3 } from "react";
|
|
2817
2817
|
function DataScript() {
|
|
2818
2818
|
useEffect3(() => {
|
|
2819
|
-
const
|
|
2819
|
+
const src = datacapUrl;
|
|
2820
2820
|
if (typeof window === "undefined") return;
|
|
2821
2821
|
if (window.DatacapWebToken) {
|
|
2822
2822
|
return;
|
|
2823
2823
|
}
|
|
2824
|
-
if (!document.querySelector(`script[src="${
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2824
|
+
if (!document.querySelector(`script[src="${src}"]`)) {
|
|
2825
|
+
const script = document.createElement("script");
|
|
2826
|
+
script.src = src;
|
|
2827
|
+
script.async = true;
|
|
2828
|
+
script.onload = () => {
|
|
2829
2829
|
if (window.DatacapWebToken) {
|
|
2830
2830
|
} else {
|
|
2831
2831
|
console.warn("\u26A0\uFE0F Script loaded, but DatacapWebToken not found");
|
|
2832
2832
|
}
|
|
2833
2833
|
};
|
|
2834
|
-
|
|
2834
|
+
script.onerror = (err) => {
|
|
2835
2835
|
console.error("\u274C Failed to load Datacap script", err);
|
|
2836
2836
|
};
|
|
2837
|
-
document.head.appendChild(
|
|
2837
|
+
document.head.appendChild(script);
|
|
2838
2838
|
} else {
|
|
2839
2839
|
}
|
|
2840
2840
|
}, []);
|
|
@@ -3214,21 +3214,31 @@ var PaxList = ({ listHeading = "Readers", ListItems, selectedPax, setSlectedPax,
|
|
|
3214
3214
|
|
|
3215
3215
|
// src/app/components/FractalTokenizer.tsx
|
|
3216
3216
|
import { useEffect as useEffect4 } from "react";
|
|
3217
|
-
function FractalTokenizerScript() {
|
|
3217
|
+
function FractalTokenizerScript({ onLoad }) {
|
|
3218
3218
|
useEffect4(() => {
|
|
3219
3219
|
const src = `${fractalGatewayUrl}tokenizer/static/js/fractal_tokenizer.js`;
|
|
3220
|
-
if (
|
|
3220
|
+
if (window.FractalTokenizer) {
|
|
3221
|
+
onLoad == null ? void 0 : onLoad();
|
|
3222
|
+
return;
|
|
3223
|
+
}
|
|
3224
|
+
const existing = document.querySelector(`script[src="${src}"]`);
|
|
3225
|
+
if (existing) {
|
|
3226
|
+
existing.addEventListener("load", () => onLoad == null ? void 0 : onLoad());
|
|
3227
|
+
return;
|
|
3228
|
+
}
|
|
3221
3229
|
const script = document.createElement("script");
|
|
3222
3230
|
script.src = src;
|
|
3223
3231
|
script.async = true;
|
|
3224
3232
|
script.onload = () => {
|
|
3225
3233
|
try {
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3234
|
+
if (typeof FractalTokenizer !== "undefined") {
|
|
3235
|
+
window.FractalTokenizer = FractalTokenizer;
|
|
3236
|
+
onLoad == null ? void 0 : onLoad();
|
|
3237
|
+
} else {
|
|
3238
|
+
console.error("FractalTokenizer not defined in global scope");
|
|
3229
3239
|
}
|
|
3230
3240
|
} catch (err) {
|
|
3231
|
-
console.error(
|
|
3241
|
+
console.error(err);
|
|
3232
3242
|
}
|
|
3233
3243
|
};
|
|
3234
3244
|
document.head.appendChild(script);
|
|
@@ -3242,8 +3252,12 @@ import { Fragment as Fragment10, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-
|
|
|
3242
3252
|
var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = false }) => {
|
|
3243
3253
|
const instanceRef = useRef(null);
|
|
3244
3254
|
useEffect5(() => {
|
|
3245
|
-
|
|
3246
|
-
|
|
3255
|
+
const Tokenizer = window.FractalTokenizer;
|
|
3256
|
+
if (!Tokenizer) {
|
|
3257
|
+
console.error("Tokenizer not available");
|
|
3258
|
+
return;
|
|
3259
|
+
}
|
|
3260
|
+
const instance = new Tokenizer({
|
|
3247
3261
|
styles: fractalStyles
|
|
3248
3262
|
});
|
|
3249
3263
|
instanceRef.current = instance;
|
|
@@ -3344,30 +3358,62 @@ var FractalFields_default = FractalFields;
|
|
|
3344
3358
|
|
|
3345
3359
|
// src/app/components/Datacap-Payment/DataCapScriptLoader.tsx
|
|
3346
3360
|
import { useEffect as useEffect6 } from "react";
|
|
3347
|
-
var
|
|
3348
|
-
|
|
3361
|
+
var DataCapScriptLoader = ({
|
|
3362
|
+
onReady,
|
|
3363
|
+
onError
|
|
3364
|
+
}) => {
|
|
3349
3365
|
useEffect6(() => {
|
|
3350
|
-
|
|
3366
|
+
const src = `${datacapUrl}/hosted`;
|
|
3367
|
+
if (window.__DATACAP_SCRIPT_LOADED__ && window.DatacapHostedWebToken) {
|
|
3368
|
+
onReady == null ? void 0 : onReady();
|
|
3351
3369
|
return;
|
|
3352
3370
|
}
|
|
3371
|
+
if (window.__DATACAP_SCRIPT_LOADING__) {
|
|
3372
|
+
const interval = setInterval(() => {
|
|
3373
|
+
if (window.DatacapHostedWebToken) {
|
|
3374
|
+
clearInterval(interval);
|
|
3375
|
+
onReady == null ? void 0 : onReady();
|
|
3376
|
+
}
|
|
3377
|
+
}, 100);
|
|
3378
|
+
return () => clearInterval(interval);
|
|
3379
|
+
}
|
|
3380
|
+
window.__DATACAP_SCRIPT_LOADING__ = true;
|
|
3353
3381
|
const existingScript = document.querySelector(
|
|
3354
|
-
`script[src="${
|
|
3382
|
+
`script[src="${src}"]`
|
|
3355
3383
|
);
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3384
|
+
if (existingScript) {
|
|
3385
|
+
waitForSDK();
|
|
3386
|
+
return;
|
|
3387
|
+
}
|
|
3388
|
+
const script = document.createElement("script");
|
|
3389
|
+
script.src = src;
|
|
3390
|
+
script.async = true;
|
|
3391
|
+
script.onload = () => {
|
|
3392
|
+
waitForSDK();
|
|
3393
|
+
};
|
|
3394
|
+
script.onerror = (err) => {
|
|
3395
|
+
console.error("Datacap script failed");
|
|
3396
|
+
window.__DATACAP_SCRIPT_LOADING__ = false;
|
|
3397
|
+
onError == null ? void 0 : onError(err);
|
|
3398
|
+
};
|
|
3399
|
+
document.head.appendChild(script);
|
|
3400
|
+
function waitForSDK() {
|
|
3401
|
+
let attempts = 0;
|
|
3402
|
+
const interval = setInterval(() => {
|
|
3403
|
+
attempts++;
|
|
3404
|
+
if (window.DatacapHostedWebToken) {
|
|
3405
|
+
clearInterval(interval);
|
|
3406
|
+
window.__DATACAP_SCRIPT_LOADING__ = false;
|
|
3407
|
+
window.__DATACAP_SCRIPT_LOADED__ = true;
|
|
3408
|
+
console.log("\u2705 Datacap SDK Ready");
|
|
3409
|
+
onReady == null ? void 0 : onReady();
|
|
3410
|
+
}
|
|
3411
|
+
if (attempts > 100) {
|
|
3412
|
+
clearInterval(interval);
|
|
3413
|
+
window.__DATACAP_SCRIPT_LOADING__ = false;
|
|
3414
|
+
onError == null ? void 0 : onError("SDK bootstrap timeout");
|
|
3415
|
+
}
|
|
3416
|
+
}, 100);
|
|
3371
3417
|
}
|
|
3372
3418
|
}, []);
|
|
3373
3419
|
return null;
|
|
@@ -3376,7 +3422,7 @@ var DataCapScriptLoader = () => {
|
|
|
3376
3422
|
// src/app/components/Datacap-Payment/DataCapFields.tsx
|
|
3377
3423
|
import { useEffect as useEffect7, useRef as useRef2, useState as useState3 } from "react";
|
|
3378
3424
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
3379
|
-
var
|
|
3425
|
+
var baseCSS = `
|
|
3380
3426
|
body {
|
|
3381
3427
|
margin: 0;
|
|
3382
3428
|
font-family: 'IBM Plex Mono', monospace !important;
|
|
@@ -3453,6 +3499,8 @@ var customCSS = `
|
|
|
3453
3499
|
}
|
|
3454
3500
|
|
|
3455
3501
|
`;
|
|
3502
|
+
var datacapInitializing = false;
|
|
3503
|
+
var datacapInitialized = false;
|
|
3456
3504
|
var DataCapFields = ({
|
|
3457
3505
|
isOpen,
|
|
3458
3506
|
tokenKey,
|
|
@@ -3465,6 +3513,7 @@ var DataCapFields = ({
|
|
|
3465
3513
|
const iframeId = "datacap-iframe";
|
|
3466
3514
|
const resolverRef = useRef2(null);
|
|
3467
3515
|
const [iframeReady, setIframeReady] = useState3(false);
|
|
3516
|
+
let customCSS = baseCSS;
|
|
3468
3517
|
useEffect7(() => {
|
|
3469
3518
|
if (!isOpen || !tokenKey) return;
|
|
3470
3519
|
if (isAddCard) {
|
|
@@ -3509,11 +3558,13 @@ var DataCapFields = ({
|
|
|
3509
3558
|
const waitForSDK = () => new Promise((resolve, reject) => {
|
|
3510
3559
|
let attempts = 0;
|
|
3511
3560
|
const interval = setInterval(() => {
|
|
3561
|
+
attempts++;
|
|
3512
3562
|
if (window.DatacapHostedWebToken) {
|
|
3513
3563
|
clearInterval(interval);
|
|
3564
|
+
console.log("\u2705 Datacap SDK Ready");
|
|
3514
3565
|
resolve();
|
|
3515
3566
|
}
|
|
3516
|
-
if (attempts
|
|
3567
|
+
if (attempts > 100) {
|
|
3517
3568
|
clearInterval(interval);
|
|
3518
3569
|
reject("Datacap SDK not loaded");
|
|
3519
3570
|
}
|
|
@@ -3521,10 +3572,28 @@ var DataCapFields = ({
|
|
|
3521
3572
|
});
|
|
3522
3573
|
await waitForSDK();
|
|
3523
3574
|
const sdk = window.DatacapHostedWebToken;
|
|
3575
|
+
if (datacapInitializing || datacapInitialized) {
|
|
3576
|
+
console.log("\u{1F7E1} Datacap already initializing/initialized");
|
|
3577
|
+
return;
|
|
3578
|
+
}
|
|
3579
|
+
datacapInitializing = true;
|
|
3580
|
+
const initTimeout = setTimeout(() => {
|
|
3581
|
+
var _a, _b;
|
|
3582
|
+
console.error("\u274C Datacap iframe load timeout");
|
|
3583
|
+
datacapInitializing = false;
|
|
3584
|
+
setLoader == null ? void 0 : setLoader(false);
|
|
3585
|
+
(_b = (_a = resolverRef.current) == null ? void 0 : _a.reject) == null ? void 0 : _b.call(
|
|
3586
|
+
_a,
|
|
3587
|
+
"Unable to load payment form"
|
|
3588
|
+
);
|
|
3589
|
+
}, 15e3);
|
|
3524
3590
|
sdk.init(
|
|
3525
3591
|
tokenKey,
|
|
3526
3592
|
iframeId,
|
|
3527
3593
|
(response) => {
|
|
3594
|
+
clearTimeout(initTimeout);
|
|
3595
|
+
datacapInitializing = false;
|
|
3596
|
+
datacapInitialized = true;
|
|
3528
3597
|
setLoader == null ? void 0 : setLoader(false);
|
|
3529
3598
|
if (!resolverRef.current) return;
|
|
3530
3599
|
if ((response == null ? void 0 : response.Error) || (response == null ? void 0 : response.Errors)) {
|
|
@@ -3538,6 +3607,9 @@ var DataCapFields = ({
|
|
|
3538
3607
|
);
|
|
3539
3608
|
};
|
|
3540
3609
|
initialize();
|
|
3610
|
+
return () => {
|
|
3611
|
+
resolverRef.current = null;
|
|
3612
|
+
};
|
|
3541
3613
|
}, [isOpen, tokenKey]);
|
|
3542
3614
|
useEffect7(() => {
|
|
3543
3615
|
const uniqueId = Math.random();
|
|
@@ -3545,7 +3617,15 @@ var DataCapFields = ({
|
|
|
3545
3617
|
return new Promise((resolve, reject) => {
|
|
3546
3618
|
setLoader == null ? void 0 : setLoader(true);
|
|
3547
3619
|
resolverRef.current = { resolve, reject };
|
|
3548
|
-
window.DatacapHostedWebToken
|
|
3620
|
+
if (!window.DatacapHostedWebToken) {
|
|
3621
|
+
reject("Datacap SDK unavailable");
|
|
3622
|
+
return;
|
|
3623
|
+
}
|
|
3624
|
+
try {
|
|
3625
|
+
window.DatacapHostedWebToken.requestToken();
|
|
3626
|
+
} catch (err) {
|
|
3627
|
+
reject(err);
|
|
3628
|
+
}
|
|
3549
3629
|
});
|
|
3550
3630
|
};
|
|
3551
3631
|
window.requestDcToken = fn;
|
|
@@ -3553,26 +3633,71 @@ var DataCapFields = ({
|
|
|
3553
3633
|
delete window.requestDcToken;
|
|
3554
3634
|
};
|
|
3555
3635
|
}, []);
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3636
|
+
useEffect7(() => {
|
|
3637
|
+
if (!isOpen) {
|
|
3638
|
+
datacapInitializing = false;
|
|
3639
|
+
datacapInitialized = false;
|
|
3640
|
+
}
|
|
3641
|
+
}, [isOpen]);
|
|
3642
|
+
return (
|
|
3643
|
+
// <iframe
|
|
3644
|
+
// id={iframeId}
|
|
3645
|
+
// onLoad={() => {
|
|
3646
|
+
// console.log("🟢 Iframe visually loaded");
|
|
3647
|
+
// setIframeReady(true);
|
|
3648
|
+
// setLoader?.(false);
|
|
3649
|
+
// }}
|
|
3650
|
+
// style={{
|
|
3651
|
+
// width: "100%",
|
|
3652
|
+
// height: `${height || "250px"}`,
|
|
3653
|
+
// border: "none",
|
|
3654
|
+
// opacity: iframeReady ? 1 : 0,
|
|
3655
|
+
// transition: "opacity 0.3s ease",
|
|
3656
|
+
// }}
|
|
3657
|
+
// />
|
|
3658
|
+
/* @__PURE__ */ jsx18(
|
|
3659
|
+
"iframe",
|
|
3660
|
+
{
|
|
3661
|
+
id: iframeId,
|
|
3662
|
+
onLoad: () => {
|
|
3663
|
+
console.log("\u{1F7E2} Iframe visually loaded");
|
|
3664
|
+
setIframeReady(true);
|
|
3665
|
+
setLoader == null ? void 0 : setLoader(false);
|
|
3666
|
+
},
|
|
3667
|
+
onError: () => {
|
|
3668
|
+
var _a, _b;
|
|
3669
|
+
console.error("\u274C iframe failed");
|
|
3670
|
+
setLoader == null ? void 0 : setLoader(false);
|
|
3671
|
+
(_b = (_a = resolverRef.current) == null ? void 0 : _a.reject) == null ? void 0 : _b.call(
|
|
3672
|
+
_a,
|
|
3673
|
+
"Payment form failed to load"
|
|
3674
|
+
);
|
|
3675
|
+
},
|
|
3676
|
+
style: {
|
|
3677
|
+
width: "100%",
|
|
3678
|
+
height: `${height || "250px"}`,
|
|
3679
|
+
border: "none",
|
|
3680
|
+
opacity: iframeReady ? 1 : 0,
|
|
3681
|
+
transition: "opacity 0.3s ease"
|
|
3682
|
+
}
|
|
3571
3683
|
}
|
|
3572
|
-
|
|
3684
|
+
)
|
|
3573
3685
|
);
|
|
3574
3686
|
};
|
|
3575
3687
|
|
|
3688
|
+
// src/app/utils/Constant.js
|
|
3689
|
+
var PaymentMethodKeys = {
|
|
3690
|
+
PROPAYKEY: "25",
|
|
3691
|
+
PAYARCKEY: "26",
|
|
3692
|
+
STRIPEKEYCC: "27",
|
|
3693
|
+
PAYRIXKEY: "28",
|
|
3694
|
+
SKYFIACHKEY: "29",
|
|
3695
|
+
JUSTIFIKEY: "30",
|
|
3696
|
+
INFINICEPTKEY: "31",
|
|
3697
|
+
FRACTALKEY: "32"
|
|
3698
|
+
};
|
|
3699
|
+
var DcLoadingError = "Something went wrong while loading the payment form. Please try again after some time.";
|
|
3700
|
+
|
|
3576
3701
|
// src/app/components/Charge/GetPaymentPage.tsx
|
|
3577
3702
|
import { Fragment as Fragment11, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3578
3703
|
function GetPaymentPage(props) {
|
|
@@ -3595,6 +3720,7 @@ function GetPaymentPage(props) {
|
|
|
3595
3720
|
const [errorBankConsent, setErrorBankConsent] = useState4("");
|
|
3596
3721
|
const [saveACHConsent1, setSaveACHConsent1] = useState4(false);
|
|
3597
3722
|
const [errorBankConsentOther, setErrorBankConsentOther] = useState4("");
|
|
3723
|
+
const [isTokenizerReady, setTokenizerReady] = useState4(false);
|
|
3598
3724
|
const fractalpayClientKey = props.merchantPublicKey;
|
|
3599
3725
|
let mastercard2 = S3Url + "widget/mc-img.svg";
|
|
3600
3726
|
let visa2 = S3Url + "widget/visa-img.svg";
|
|
@@ -3934,6 +4060,7 @@ function GetPaymentPage(props) {
|
|
|
3934
4060
|
} catch (err) {
|
|
3935
4061
|
setErrorIframe(((_h2 = (_g2 = err == null ? void 0 : err.response) == null ? void 0 : _g2.data) == null ? void 0 : _h2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
|
|
3936
4062
|
setLoading2(false);
|
|
4063
|
+
return;
|
|
3937
4064
|
}
|
|
3938
4065
|
console.log(tokenizeData, "tokenizeData");
|
|
3939
4066
|
const reqData = JSON.stringify(__spreadProps(__spreadValues({}, tokenizeData), {
|
|
@@ -4298,8 +4425,20 @@ function GetPaymentPage(props) {
|
|
|
4298
4425
|
}, []);
|
|
4299
4426
|
return /* @__PURE__ */ jsxs11(Fragment11, { children: [
|
|
4300
4427
|
/* @__PURE__ */ jsx19(DataScript, {}),
|
|
4301
|
-
/* @__PURE__ */ jsx19(FractalTokenizerScript, {}),
|
|
4302
|
-
/* @__PURE__ */ jsx19(
|
|
4428
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx19(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
4429
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx19(
|
|
4430
|
+
DataCapScriptLoader,
|
|
4431
|
+
{
|
|
4432
|
+
onReady: () => {
|
|
4433
|
+
console.log("SDK Ready");
|
|
4434
|
+
},
|
|
4435
|
+
onError: (err) => {
|
|
4436
|
+
setLoading(false);
|
|
4437
|
+
setLoadingIframe(false);
|
|
4438
|
+
setError(DcLoadingError);
|
|
4439
|
+
}
|
|
4440
|
+
}
|
|
4441
|
+
),
|
|
4303
4442
|
/* @__PURE__ */ jsx19(Chargewidgetstyles, {}),
|
|
4304
4443
|
/* @__PURE__ */ jsx19(CardBankRadioStyles, {}),
|
|
4305
4444
|
/* @__PURE__ */ jsxs11(Fragment11, { children: [
|
|
@@ -4503,7 +4642,7 @@ function GetPaymentPage(props) {
|
|
|
4503
4642
|
] }),
|
|
4504
4643
|
/* @__PURE__ */ jsxs11("div", { className: "form-group", children: [
|
|
4505
4644
|
/* @__PURE__ */ jsx19("label", { children: "CARD NUMBER" }),
|
|
4506
|
-
/* @__PURE__ */ jsx19("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx19(
|
|
4645
|
+
/* @__PURE__ */ jsx19("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx19(
|
|
4507
4646
|
FractalFields_default,
|
|
4508
4647
|
{
|
|
4509
4648
|
fractalStyles,
|
|
@@ -4857,6 +4996,7 @@ function PreAuthPayment(_a) {
|
|
|
4857
4996
|
const [activeinCard, setActiveinCard] = useState5("form");
|
|
4858
4997
|
const fractalpayClientKey = props.merchantPublicKey;
|
|
4859
4998
|
const [selectedReader, setSelectedReader] = useState5(void 0);
|
|
4999
|
+
const [isTokenizerReady, setTokenizerReady] = useState5(false);
|
|
4860
5000
|
const tokenizerRef = useRef4(null);
|
|
4861
5001
|
const fractalStyles = {
|
|
4862
5002
|
input: {
|
|
@@ -5393,10 +5533,22 @@ function PreAuthPayment(_a) {
|
|
|
5393
5533
|
}, []);
|
|
5394
5534
|
return /* @__PURE__ */ jsxs12(Fragment12, { children: [
|
|
5395
5535
|
/* @__PURE__ */ jsx20(DataScript, {}),
|
|
5396
|
-
/* @__PURE__ */ jsx20(FractalTokenizerScript, {}),
|
|
5536
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx20(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
5537
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx20(
|
|
5538
|
+
DataCapScriptLoader,
|
|
5539
|
+
{
|
|
5540
|
+
onReady: () => {
|
|
5541
|
+
console.log("SDK Ready");
|
|
5542
|
+
},
|
|
5543
|
+
onError: (err) => {
|
|
5544
|
+
setLoading(false);
|
|
5545
|
+
setLoadingIframe(false);
|
|
5546
|
+
setError(DcLoadingError);
|
|
5547
|
+
}
|
|
5548
|
+
}
|
|
5549
|
+
),
|
|
5397
5550
|
/* @__PURE__ */ jsx20(Chargewidgetstyles, {}),
|
|
5398
5551
|
/* @__PURE__ */ jsx20(CardBankRadioStyles, {}),
|
|
5399
|
-
/* @__PURE__ */ jsx20(DataCapScriptLoader, {}),
|
|
5400
5552
|
/* @__PURE__ */ jsxs12(Fragment12, { children: [
|
|
5401
5553
|
showButton && /* @__PURE__ */ jsx20(
|
|
5402
5554
|
"button",
|
|
@@ -5549,7 +5701,7 @@ function PreAuthPayment(_a) {
|
|
|
5549
5701
|
] }),
|
|
5550
5702
|
/* @__PURE__ */ jsxs12("div", { className: "form-group", children: [
|
|
5551
5703
|
/* @__PURE__ */ jsx20("label", { children: "CARD NUMBER" }),
|
|
5552
|
-
/* @__PURE__ */ jsx20("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx20(
|
|
5704
|
+
/* @__PURE__ */ jsx20("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx20(
|
|
5553
5705
|
FractalFields_default,
|
|
5554
5706
|
{
|
|
5555
5707
|
fractalStyles,
|
|
@@ -6141,6 +6293,7 @@ function AddCardEasyPay(props) {
|
|
|
6141
6293
|
const exp_year_ref = useRef5(null);
|
|
6142
6294
|
const cvv_ref = useRef5(null);
|
|
6143
6295
|
const name_ref = useRef5(null);
|
|
6296
|
+
const [isTokenizerReady, setTokenizerReady] = useState6(false);
|
|
6144
6297
|
const tokenizerRef = useRef5(null);
|
|
6145
6298
|
const fractalStyles = {
|
|
6146
6299
|
input: {
|
|
@@ -6413,8 +6566,20 @@ function AddCardEasyPay(props) {
|
|
|
6413
6566
|
}, []);
|
|
6414
6567
|
return /* @__PURE__ */ jsxs14(Fragment14, { children: [
|
|
6415
6568
|
/* @__PURE__ */ jsx24(DataScript, {}),
|
|
6416
|
-
/* @__PURE__ */ jsx24(FractalTokenizerScript, {}),
|
|
6417
|
-
/* @__PURE__ */ jsx24(
|
|
6569
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx24(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
6570
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx24(
|
|
6571
|
+
DataCapScriptLoader,
|
|
6572
|
+
{
|
|
6573
|
+
onReady: () => {
|
|
6574
|
+
console.log("SDK Ready");
|
|
6575
|
+
},
|
|
6576
|
+
onError: (err) => {
|
|
6577
|
+
setLoading(false);
|
|
6578
|
+
setLoadingIframe(false);
|
|
6579
|
+
setError(DcLoadingError);
|
|
6580
|
+
}
|
|
6581
|
+
}
|
|
6582
|
+
),
|
|
6418
6583
|
/* @__PURE__ */ jsx24(AddCardStyle, {}),
|
|
6419
6584
|
/* @__PURE__ */ jsx24(Loader_default, { loading: loading || loadingIframe }),
|
|
6420
6585
|
error && /* @__PURE__ */ jsx24("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx24(ErrorCardMessage_default, { error, onClose: handleClose }) }),
|
|
@@ -6443,7 +6608,7 @@ function AddCardEasyPay(props) {
|
|
|
6443
6608
|
/* @__PURE__ */ jsxs14("div", { style: { maxHeight: "350px", minHeight: "0" }, className: "card-scrl", children: [
|
|
6444
6609
|
/* @__PURE__ */ jsxs14("div", { className: "form-group", style: { marginTop: "0", marginBottom: "10px" }, children: [
|
|
6445
6610
|
/* @__PURE__ */ jsx24("label", { htmlFor: "cardNumber", children: "Card Number" }),
|
|
6446
|
-
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx24(
|
|
6611
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx24(
|
|
6447
6612
|
FractalFields_default,
|
|
6448
6613
|
{
|
|
6449
6614
|
fractalStyles,
|
|
@@ -6578,18 +6743,6 @@ function AddCardEasyPay(props) {
|
|
|
6578
6743
|
import { useEffect as useEffect12, useRef as useRef7, useState as useState7 } from "react";
|
|
6579
6744
|
import axios6 from "axios";
|
|
6580
6745
|
|
|
6581
|
-
// src/app/utils/Constant.js
|
|
6582
|
-
var PaymentMethodKeys = {
|
|
6583
|
-
PROPAYKEY: "25",
|
|
6584
|
-
PAYARCKEY: "26",
|
|
6585
|
-
STRIPEKEYCC: "27",
|
|
6586
|
-
PAYRIXKEY: "28",
|
|
6587
|
-
SKYFIACHKEY: "29",
|
|
6588
|
-
JUSTIFIKEY: "30",
|
|
6589
|
-
INFINICEPTKEY: "31",
|
|
6590
|
-
FRACTALKEY: "32"
|
|
6591
|
-
};
|
|
6592
|
-
|
|
6593
6746
|
// src/app/components/AddCard/AddCardSkyStyle.tsx
|
|
6594
6747
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
6595
6748
|
function AddCardSkyStyle({}) {
|
|
@@ -6797,8 +6950,12 @@ import { Fragment as Fragment15, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-
|
|
|
6797
6950
|
var FractalFieldsAddCardSky = ({ fractalStyles, tokenizerRef, extraInputs }) => {
|
|
6798
6951
|
const instanceRef = useRef6(null);
|
|
6799
6952
|
useEffect11(() => {
|
|
6800
|
-
|
|
6801
|
-
|
|
6953
|
+
const Tokenizer = window.FractalTokenizer;
|
|
6954
|
+
if (!Tokenizer) {
|
|
6955
|
+
console.error("Tokenizer not available");
|
|
6956
|
+
return;
|
|
6957
|
+
}
|
|
6958
|
+
const instance = new Tokenizer({
|
|
6802
6959
|
styles: fractalStyles
|
|
6803
6960
|
});
|
|
6804
6961
|
instanceRef.current = instance;
|
|
@@ -6883,7 +7040,7 @@ var FractalFieldsAddCardSky_default = FractalFieldsAddCardSky;
|
|
|
6883
7040
|
|
|
6884
7041
|
// src/app/components/AddCard/AddCardSky.tsx
|
|
6885
7042
|
import { Fragment as Fragment16, jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6886
|
-
function CardOnFile({ session_token, callback, isloading, onCancel, showChecks, merchantName, signCheckbox, checkedSignCheckbox, onCheckSign, cancelbtnClass, savebtnClass, inputClass, isDual, customCSS
|
|
7043
|
+
function CardOnFile({ session_token, callback, isloading, onCancel, showChecks, merchantName, signCheckbox, checkedSignCheckbox, onCheckSign, cancelbtnClass, savebtnClass, inputClass, isDual, customCSS, height }) {
|
|
6887
7044
|
var _a, _b;
|
|
6888
7045
|
const [loading, setLoading] = useState7(false);
|
|
6889
7046
|
const [errorIframe, setErrorIframe] = useState7("");
|
|
@@ -6894,10 +7051,11 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
6894
7051
|
const [error, setError] = useState7("");
|
|
6895
7052
|
const showLoader = () => setLoading(true);
|
|
6896
7053
|
const hideLoader = () => setLoading(false);
|
|
6897
|
-
const [passFee, setPassFee] = useState7(
|
|
7054
|
+
const [passFee, setPassFee] = useState7(null);
|
|
6898
7055
|
const [paymentGateway, setPaymentGateway] = useState7();
|
|
6899
7056
|
const [dcToken, setDCToken] = useState7();
|
|
6900
7057
|
const tokenizerRef = useRef7(null);
|
|
7058
|
+
const [isTokenizerReady, setTokenizerReady] = useState7(false);
|
|
6901
7059
|
const fractalStyles = {
|
|
6902
7060
|
input: {
|
|
6903
7061
|
"font-family": "'Inter', sans-serif",
|
|
@@ -7160,8 +7318,20 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7160
7318
|
}, []);
|
|
7161
7319
|
return /* @__PURE__ */ jsxs16(Fragment16, { children: [
|
|
7162
7320
|
/* @__PURE__ */ jsx27(DataScript, {}),
|
|
7163
|
-
/* @__PURE__ */ jsx27(FractalTokenizerScript, {}),
|
|
7164
|
-
/* @__PURE__ */ jsx27(
|
|
7321
|
+
paymentGateway == 32 && /* @__PURE__ */ jsx27(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
7322
|
+
paymentGateway == 31 && /* @__PURE__ */ jsx27(
|
|
7323
|
+
DataCapScriptLoader,
|
|
7324
|
+
{
|
|
7325
|
+
onReady: () => {
|
|
7326
|
+
console.log("SDK Ready");
|
|
7327
|
+
},
|
|
7328
|
+
onError: (err) => {
|
|
7329
|
+
setLoading(false);
|
|
7330
|
+
setLoadingIframe(false);
|
|
7331
|
+
setError(DcLoadingError);
|
|
7332
|
+
}
|
|
7333
|
+
}
|
|
7334
|
+
),
|
|
7165
7335
|
/* @__PURE__ */ jsx27(AddCardSkyStyle, {}),
|
|
7166
7336
|
/* @__PURE__ */ jsx27(Loader_default, { loading: loading || isloading || loadingIframe }),
|
|
7167
7337
|
error && /* @__PURE__ */ jsx27("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx27(ErrorCardMessage_default, { error, onClose: handleClose }) }),
|
|
@@ -7222,7 +7392,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7222
7392
|
(cardError == null ? void 0 : cardError.lastName) && /* @__PURE__ */ jsx27("small", { className: "error", children: cardError == null ? void 0 : cardError.lastName })
|
|
7223
7393
|
] })
|
|
7224
7394
|
] }),
|
|
7225
|
-
/* @__PURE__ */ jsx27(
|
|
7395
|
+
isTokenizerReady && /* @__PURE__ */ jsx27(
|
|
7226
7396
|
FractalFieldsAddCardSky_default,
|
|
7227
7397
|
{
|
|
7228
7398
|
fractalStyles,
|
|
@@ -7254,7 +7424,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7254
7424
|
type: "checkbox",
|
|
7255
7425
|
id: "pass_fee",
|
|
7256
7426
|
className: "toggle-checkbox",
|
|
7257
|
-
checked: passFee,
|
|
7427
|
+
checked: passFee != null ? passFee : false,
|
|
7258
7428
|
onChange: (e) => {
|
|
7259
7429
|
setPassFee(e.target.checked);
|
|
7260
7430
|
}
|
|
@@ -7397,7 +7567,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7397
7567
|
isOpen: true,
|
|
7398
7568
|
tokenKey: dcToken,
|
|
7399
7569
|
setLoader: setLoadingIframe,
|
|
7400
|
-
customCSS
|
|
7570
|
+
customCSS,
|
|
7401
7571
|
height
|
|
7402
7572
|
}
|
|
7403
7573
|
) }),
|
|
@@ -7426,7 +7596,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7426
7596
|
type: "checkbox",
|
|
7427
7597
|
id: "pass_fee",
|
|
7428
7598
|
className: "toggle-checkbox",
|
|
7429
|
-
checked: passFee,
|
|
7599
|
+
checked: passFee != null ? passFee : false,
|
|
7430
7600
|
onChange: (e) => {
|
|
7431
7601
|
setPassFee(e.target.checked);
|
|
7432
7602
|
}
|
|
@@ -7571,6 +7741,7 @@ function PartialPayment(props) {
|
|
|
7571
7741
|
const [errorBankConsent, setErrorBankConsent] = useState8("");
|
|
7572
7742
|
const [saveACHConsent1, setSaveACHConsent1] = useState8(false);
|
|
7573
7743
|
const [errorBankConsentOther, setErrorBankConsentOther] = useState8("");
|
|
7744
|
+
const [isTokenizerReady, setTokenizerReady] = useState8(false);
|
|
7574
7745
|
const tokenizerRef = useRef8(null);
|
|
7575
7746
|
const fractalStyles = {
|
|
7576
7747
|
input: {
|
|
@@ -8284,8 +8455,20 @@ function PartialPayment(props) {
|
|
|
8284
8455
|
/* @__PURE__ */ jsx28(DataScript, {}),
|
|
8285
8456
|
/* @__PURE__ */ jsx28(Chargewidgetstyles, {}),
|
|
8286
8457
|
/* @__PURE__ */ jsx28(CardBankRadioStyles, {}),
|
|
8287
|
-
/* @__PURE__ */ jsx28(FractalTokenizerScript, {}),
|
|
8288
|
-
/* @__PURE__ */ jsx28(
|
|
8458
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx28(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
8459
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx28(
|
|
8460
|
+
DataCapScriptLoader,
|
|
8461
|
+
{
|
|
8462
|
+
onReady: () => {
|
|
8463
|
+
console.log("SDK Ready");
|
|
8464
|
+
},
|
|
8465
|
+
onError: (err) => {
|
|
8466
|
+
setLoading(false);
|
|
8467
|
+
setLoadingIframe(false);
|
|
8468
|
+
setError(DcLoadingError);
|
|
8469
|
+
}
|
|
8470
|
+
}
|
|
8471
|
+
),
|
|
8289
8472
|
/* @__PURE__ */ jsxs17(Fragment17, { children: [
|
|
8290
8473
|
/* @__PURE__ */ jsx28("button", { ref: buttonRef, style: { display: "none" }, className: "paymentBtn", onClick: handleShow, children: "Pay" }),
|
|
8291
8474
|
/* @__PURE__ */ jsxs17(
|
|
@@ -8492,7 +8675,7 @@ function PartialPayment(props) {
|
|
|
8492
8675
|
] }),
|
|
8493
8676
|
/* @__PURE__ */ jsxs17("div", { className: "form-group", children: [
|
|
8494
8677
|
/* @__PURE__ */ jsx28("label", { children: "CARD NUMBER" }),
|
|
8495
|
-
/* @__PURE__ */ jsx28("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx28(
|
|
8678
|
+
/* @__PURE__ */ jsx28("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx28(
|
|
8496
8679
|
FractalFields_default,
|
|
8497
8680
|
{
|
|
8498
8681
|
fractalStyles,
|
|
@@ -8800,7 +8983,7 @@ function PartialPayment(props) {
|
|
|
8800
8983
|
}
|
|
8801
8984
|
|
|
8802
8985
|
// src/app/components/Skysystemz/PayButtonWithForm.tsx
|
|
8803
|
-
import { useEffect as
|
|
8986
|
+
import { useEffect as useEffect17, useState as useState11, useMemo } from "react";
|
|
8804
8987
|
|
|
8805
8988
|
// src/app/components/Skysystemz/SkyChargewidgetstyles.tsx
|
|
8806
8989
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
@@ -9646,7 +9829,7 @@ padding:0px !important;
|
|
|
9646
9829
|
}
|
|
9647
9830
|
|
|
9648
9831
|
// src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
|
|
9649
|
-
import { useCallback, useEffect as
|
|
9832
|
+
import { useCallback, useEffect as useEffect16, useRef as useRef11, useState as useState10 } from "react";
|
|
9650
9833
|
import axios9 from "axios";
|
|
9651
9834
|
import Swal5 from "sweetalert2";
|
|
9652
9835
|
|
|
@@ -9932,17 +10115,155 @@ var ErrorCardOverlay = ({ onClose, error, autoTrigger = false }) => {
|
|
|
9932
10115
|
};
|
|
9933
10116
|
var ErrorCardOverlay_default = ErrorCardOverlay;
|
|
9934
10117
|
|
|
10118
|
+
// src/app/components/Atoms/Applepay/ApplePayButton.tsx
|
|
10119
|
+
import { useEffect as useEffect15, useRef as useRef10 } from "react";
|
|
10120
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
10121
|
+
function ApplePayButton({
|
|
10122
|
+
applePayMerchantId: applePayMerchantId2,
|
|
10123
|
+
applePayAmount,
|
|
10124
|
+
applePayMerchantName,
|
|
10125
|
+
showLoader,
|
|
10126
|
+
completeFractalFlow
|
|
10127
|
+
}) {
|
|
10128
|
+
const applePayRef = useRef10(null);
|
|
10129
|
+
const paymentRequestMethods = [
|
|
10130
|
+
{
|
|
10131
|
+
supportedMethods: "https://apple.com/apple-pay",
|
|
10132
|
+
data: {
|
|
10133
|
+
version: 3,
|
|
10134
|
+
merchantIdentifier: applePayMerchantId2,
|
|
10135
|
+
// ✅ FIXED
|
|
10136
|
+
merchantCapabilities: ["supports3DS"],
|
|
10137
|
+
supportedNetworks: ["amex", "discover", "mastercard", "visa"],
|
|
10138
|
+
// ✅ FIXED
|
|
10139
|
+
countryCode: "US"
|
|
10140
|
+
}
|
|
10141
|
+
}
|
|
10142
|
+
];
|
|
10143
|
+
const paymentRequestOptions = {
|
|
10144
|
+
requestPayerName: false,
|
|
10145
|
+
requestPayerEmail: false,
|
|
10146
|
+
requestPayerPhone: false,
|
|
10147
|
+
requestShipping: false
|
|
10148
|
+
};
|
|
10149
|
+
function buildPaymentDetails() {
|
|
10150
|
+
return {
|
|
10151
|
+
total: {
|
|
10152
|
+
label: applePayMerchantName,
|
|
10153
|
+
amount: {
|
|
10154
|
+
currency: "USD",
|
|
10155
|
+
value: applePayAmount
|
|
10156
|
+
}
|
|
10157
|
+
}
|
|
10158
|
+
};
|
|
10159
|
+
}
|
|
10160
|
+
async function validateMerchant(event) {
|
|
10161
|
+
var _a;
|
|
10162
|
+
console.log("\u{1F7E1} STEP 1: Merchant validation started");
|
|
10163
|
+
try {
|
|
10164
|
+
console.log("Validation URL:", event.validationURL);
|
|
10165
|
+
console.log("Domain:", window.location.hostname);
|
|
10166
|
+
const res = await fetch(
|
|
10167
|
+
`${masterBaseUrl}api/v1/widget/generate-apple-pay-session`,
|
|
10168
|
+
{
|
|
10169
|
+
method: "POST",
|
|
10170
|
+
headers: {
|
|
10171
|
+
"Content-Type": "application/json"
|
|
10172
|
+
},
|
|
10173
|
+
body: JSON.stringify({
|
|
10174
|
+
validationUrl: event.validationURL,
|
|
10175
|
+
applePayMerchantId: applePayMerchantId2,
|
|
10176
|
+
applepayDisplayName: applePayMerchantName,
|
|
10177
|
+
requestDomain: window.location.hostname
|
|
10178
|
+
// ✅ IMPORTANT
|
|
10179
|
+
})
|
|
10180
|
+
}
|
|
10181
|
+
);
|
|
10182
|
+
console.log("\u{1F7E1} STEP 2: Response status:", res.status);
|
|
10183
|
+
const data = await res.json();
|
|
10184
|
+
console.log("RAW session response:", JSON.stringify(data));
|
|
10185
|
+
console.log("\u{1F7E2} STEP 3: Session response: data fetched");
|
|
10186
|
+
const merchantSession = (_a = data == null ? void 0 : data.data) != null ? _a : data;
|
|
10187
|
+
if (!merchantSession || typeof merchantSession !== "object") {
|
|
10188
|
+
console.error("\u274C Bad session shape");
|
|
10189
|
+
event.complete(null);
|
|
10190
|
+
return;
|
|
10191
|
+
}
|
|
10192
|
+
console.log("\u{1F7E2} STEP 4.1: Completing merchant validation");
|
|
10193
|
+
event.complete(merchantSession);
|
|
10194
|
+
console.log("\u{1F7E2} STEP 4.2: Completed merchant validation");
|
|
10195
|
+
} catch (err) {
|
|
10196
|
+
console.log("\u274C Merchant validation failed:", err == null ? void 0 : err.message);
|
|
10197
|
+
event.complete(null);
|
|
10198
|
+
}
|
|
10199
|
+
}
|
|
10200
|
+
async function authorizePayment(paymentResponse) {
|
|
10201
|
+
console.log("\u{1F7E1} STEP 5: Authorizing payment");
|
|
10202
|
+
try {
|
|
10203
|
+
const token = paymentResponse.details.token.paymentData;
|
|
10204
|
+
console.log("\u{1F7E2} STEP 6: Got token");
|
|
10205
|
+
await completeFractalFlow(token, null, "apple_pay");
|
|
10206
|
+
await paymentResponse.complete("success");
|
|
10207
|
+
console.log("\u2705 Payment completed successfully");
|
|
10208
|
+
} catch (err) {
|
|
10209
|
+
console.log("\u274C Authorization failed:", err == null ? void 0 : err.message);
|
|
10210
|
+
await paymentResponse.complete("fail");
|
|
10211
|
+
}
|
|
10212
|
+
}
|
|
10213
|
+
async function handleApplePayClick() {
|
|
10214
|
+
console.log("\u{1F7E1} STEP A: Click detected");
|
|
10215
|
+
try {
|
|
10216
|
+
const request = new PaymentRequest(
|
|
10217
|
+
paymentRequestMethods,
|
|
10218
|
+
buildPaymentDetails(),
|
|
10219
|
+
paymentRequestOptions
|
|
10220
|
+
);
|
|
10221
|
+
request.onmerchantvalidation = validateMerchant;
|
|
10222
|
+
console.log("\u{1F7E1} STEP B: Calling show()");
|
|
10223
|
+
const response = await request.show();
|
|
10224
|
+
console.log("\u{1F7E2} STEP C: Payment sheet opened");
|
|
10225
|
+
await authorizePayment(response);
|
|
10226
|
+
} catch (err) {
|
|
10227
|
+
console.log("\u274C Apple Pay flow failed:", err == null ? void 0 : err.message);
|
|
10228
|
+
}
|
|
10229
|
+
}
|
|
10230
|
+
useEffect15(() => {
|
|
10231
|
+
if (window.ApplePaySession && window.ApplePaySession.canMakePayments()) {
|
|
10232
|
+
console.log("\u2705 Apple Pay is available");
|
|
10233
|
+
} else {
|
|
10234
|
+
console.log("\u274C Apple Pay NOT available");
|
|
10235
|
+
}
|
|
10236
|
+
}, []);
|
|
10237
|
+
useEffect15(() => {
|
|
10238
|
+
const btn = applePayRef.current;
|
|
10239
|
+
if (!btn) return;
|
|
10240
|
+
const handleClick = () => handleApplePayClick();
|
|
10241
|
+
btn.addEventListener("click", handleClick);
|
|
10242
|
+
return () => btn.removeEventListener("click", handleClick);
|
|
10243
|
+
}, [applePayMerchantId2, applePayAmount, applePayMerchantName]);
|
|
10244
|
+
return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(
|
|
10245
|
+
"apple-pay-button",
|
|
10246
|
+
{
|
|
10247
|
+
ref: applePayRef,
|
|
10248
|
+
buttonstyle: "black",
|
|
10249
|
+
type: "pay",
|
|
10250
|
+
locale: "en-US",
|
|
10251
|
+
style: { width: "100%" }
|
|
10252
|
+
}
|
|
10253
|
+
) });
|
|
10254
|
+
}
|
|
10255
|
+
|
|
9935
10256
|
// src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
|
|
9936
|
-
import { Fragment as Fragment19, jsx as
|
|
9937
|
-
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
|
|
10257
|
+
import { Fragment as Fragment19, jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
10258
|
+
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 }) => {
|
|
9938
10259
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
9939
|
-
const hasRunRef =
|
|
9940
|
-
const cardFormRef =
|
|
9941
|
-
const bankFormRef =
|
|
9942
|
-
const expiryYearRef =
|
|
9943
|
-
const expiryMonthRef =
|
|
9944
|
-
const cardListRunRef =
|
|
9945
|
-
const threeDSContainerRef =
|
|
10260
|
+
const hasRunRef = useRef11(false);
|
|
10261
|
+
const cardFormRef = useRef11(null);
|
|
10262
|
+
const bankFormRef = useRef11(null);
|
|
10263
|
+
const expiryYearRef = useRef11(null);
|
|
10264
|
+
const expiryMonthRef = useRef11(null);
|
|
10265
|
+
const cardListRunRef = useRef11(false);
|
|
10266
|
+
const threeDSContainerRef = useRef11(null);
|
|
9946
10267
|
const [activetab, setActive] = useState10("card");
|
|
9947
10268
|
const [activeList, setActiveList] = useState10("card");
|
|
9948
10269
|
const [cardData, setCardData] = useState10();
|
|
@@ -9982,6 +10303,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9982
10303
|
const [isBankConsentChecked, setIsBankConsentChecked] = useState10(false);
|
|
9983
10304
|
const [errorBankConsent, setErrorBankConsent] = useState10("");
|
|
9984
10305
|
const [errorBankConsentOther, setErrorBankConsentOther] = useState10("");
|
|
10306
|
+
const [isTokenizerReady, setTokenizerReady] = useState10(false);
|
|
9985
10307
|
let mastercard2 = S3Url + "widget/mc-img.svg";
|
|
9986
10308
|
let visa2 = S3Url + "widget/visa-img.svg";
|
|
9987
10309
|
let americanexp2 = S3Url + "widget/ae-img.svg";
|
|
@@ -10009,7 +10331,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10009
10331
|
const bankFeeAmount = Number(bankSurcharge || 0);
|
|
10010
10332
|
const bankSavingsAmount = Math.max(bankFeeAmount > 0 ? cardFeeAmount - bankFeeAmount : cardFeeAmount, 0);
|
|
10011
10333
|
const bankSavingsText = bankSavingsAmount > 0 ? `Save ${formatUSD(bankSavingsAmount.toFixed(2))}` : "";
|
|
10012
|
-
const tokenizerRef =
|
|
10334
|
+
const tokenizerRef = useRef11(null);
|
|
10013
10335
|
const fractalStyles = {
|
|
10014
10336
|
input: {
|
|
10015
10337
|
"font-family": "'Inter', sans-serif",
|
|
@@ -10189,8 +10511,13 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10189
10511
|
return Object.keys(errors).length > 0;
|
|
10190
10512
|
};
|
|
10191
10513
|
const completeFractalFlow = async (tokenizeData, intentid, typeoftoken) => {
|
|
10192
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2
|
|
10514
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
10193
10515
|
try {
|
|
10516
|
+
console.log({
|
|
10517
|
+
tokenizeData,
|
|
10518
|
+
intentid,
|
|
10519
|
+
typeoftoken
|
|
10520
|
+
});
|
|
10194
10521
|
if (typeoftoken == "google_pay" || typeoftoken == "apple_pay") {
|
|
10195
10522
|
handleCharge({
|
|
10196
10523
|
Token: tokenizeData,
|
|
@@ -10198,39 +10525,28 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10198
10525
|
typeoftoken
|
|
10199
10526
|
});
|
|
10200
10527
|
return;
|
|
10201
|
-
}
|
|
10202
|
-
let token = tokenizeData;
|
|
10203
|
-
let verifyandsaveresp = await axios9.post(`${masterBaseUrl}api/v1/gateway/verify-and-save/${session_token}`, {
|
|
10204
|
-
token,
|
|
10205
|
-
require3ds,
|
|
10206
|
-
pass_fee,
|
|
10207
|
-
typeoftoken
|
|
10208
|
-
});
|
|
10209
|
-
if ((verifyandsaveresp == null ? void 0 : verifyandsaveresp.status) == 200) {
|
|
10210
|
-
let responsetemp = (_a2 = verifyandsaveresp == null ? void 0 : verifyandsaveresp.data) == null ? void 0 : _a2.data;
|
|
10211
|
-
let respData = {
|
|
10212
|
-
Token: responsetemp.gateway_token,
|
|
10213
|
-
Brand: responsetemp.card_data.brand,
|
|
10214
|
-
ExpirationMonth: responsetemp.card_data.expire_mm,
|
|
10215
|
-
ExpirationYear: responsetemp.card_data.expire_yy,
|
|
10216
|
-
Last4: responsetemp.card_data.last4,
|
|
10217
|
-
Bin: responsetemp.card_data.bin,
|
|
10218
|
-
postalCode: cardData == null ? void 0 : cardData.zipCode,
|
|
10219
|
-
stripe_3ds_auth_id: intentid
|
|
10220
|
-
};
|
|
10528
|
+
} else {
|
|
10221
10529
|
if (isPreAuth) {
|
|
10222
|
-
handlePreAuth(
|
|
10530
|
+
handlePreAuth(__spreadValues({
|
|
10531
|
+
Token: tokenizeData,
|
|
10532
|
+
postalCode: cardData == null ? void 0 : cardData.zipCode,
|
|
10533
|
+
typeoftoken: "token"
|
|
10534
|
+
}, intentid && { stripe_3ds_auth_id: intentid }));
|
|
10223
10535
|
} else {
|
|
10224
|
-
handleCharge(
|
|
10536
|
+
handleCharge(__spreadValues({
|
|
10537
|
+
Token: tokenizeData,
|
|
10538
|
+
postalCode: cardData == null ? void 0 : cardData.zipCode,
|
|
10539
|
+
typeoftoken: "token"
|
|
10540
|
+
}, intentid && { stripe_3ds_auth_id: intentid }));
|
|
10225
10541
|
}
|
|
10226
10542
|
}
|
|
10227
10543
|
} catch (error2) {
|
|
10228
10544
|
console.log(error2, "error");
|
|
10229
|
-
setError(((
|
|
10545
|
+
setError(((_b2 = (_a2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "Something went wrong!");
|
|
10230
10546
|
callback({
|
|
10231
|
-
error: ((
|
|
10232
|
-
result: (
|
|
10233
|
-
statusCode: (
|
|
10547
|
+
error: ((_d2 = (_c2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || "Something went wrong!",
|
|
10548
|
+
result: (_f2 = (_e2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _e2.data) == null ? void 0 : _f2.result,
|
|
10549
|
+
statusCode: (_g2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _g2.status
|
|
10234
10550
|
});
|
|
10235
10551
|
hideLoader();
|
|
10236
10552
|
}
|
|
@@ -10875,13 +11191,13 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10875
11191
|
setOrderLoader(false);
|
|
10876
11192
|
}
|
|
10877
11193
|
};
|
|
10878
|
-
|
|
11194
|
+
useEffect16(() => {
|
|
10879
11195
|
if (!show && !autoTrigger) {
|
|
10880
11196
|
hasRunRef.current = false;
|
|
10881
11197
|
cardListRunRef.current = false;
|
|
10882
11198
|
}
|
|
10883
11199
|
}, [show, autoTrigger]);
|
|
10884
|
-
|
|
11200
|
+
useEffect16(() => {
|
|
10885
11201
|
if (!hasRunRef.current && (show || autoTrigger) && onLoad) {
|
|
10886
11202
|
getPaymentDetails();
|
|
10887
11203
|
if (isPartial && !partialRef) {
|
|
@@ -10889,7 +11205,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10889
11205
|
}
|
|
10890
11206
|
}
|
|
10891
11207
|
}, [show, autoTrigger, isPartial, onLoad]);
|
|
10892
|
-
|
|
11208
|
+
useEffect16(() => {
|
|
10893
11209
|
if ((show || autoTrigger) && pass_fee_amount) {
|
|
10894
11210
|
let cashdisc = Number(amount) - Number(pass_fee_amount);
|
|
10895
11211
|
if (cashdisc && !isNaN(cashdisc)) {
|
|
@@ -10951,7 +11267,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10951
11267
|
console.error("3DS Auth failed \u274C", status);
|
|
10952
11268
|
setError(`3DS Authentication ${status}`);
|
|
10953
11269
|
};
|
|
10954
|
-
|
|
11270
|
+
useEffect16(() => {
|
|
10955
11271
|
if (setHandleCloseRef) {
|
|
10956
11272
|
setHandleCloseRef(() => handleClose);
|
|
10957
11273
|
}
|
|
@@ -10969,18 +11285,18 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10969
11285
|
setPartialError("");
|
|
10970
11286
|
}
|
|
10971
11287
|
};
|
|
10972
|
-
|
|
11288
|
+
useEffect16(() => {
|
|
10973
11289
|
if (typeof FractalTokenizer === "undefined") return;
|
|
10974
11290
|
const tokenizer = new FractalTokenizer({
|
|
10975
11291
|
styles: {}
|
|
10976
11292
|
});
|
|
10977
11293
|
}, []);
|
|
10978
|
-
const stateRef =
|
|
11294
|
+
const stateRef = useRef11({
|
|
10979
11295
|
activeinBank,
|
|
10980
11296
|
activeinCard,
|
|
10981
11297
|
activetab
|
|
10982
11298
|
});
|
|
10983
|
-
|
|
11299
|
+
useEffect16(() => {
|
|
10984
11300
|
stateRef.current = {
|
|
10985
11301
|
activeinBank,
|
|
10986
11302
|
activeinCard,
|
|
@@ -11004,7 +11320,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11004
11320
|
}
|
|
11005
11321
|
}
|
|
11006
11322
|
}, []);
|
|
11007
|
-
|
|
11323
|
+
useEffect16(() => {
|
|
11008
11324
|
onSubmit == null ? void 0 : onSubmit(submit);
|
|
11009
11325
|
}, [onSubmit, submit]);
|
|
11010
11326
|
function detectCardType(cardinput) {
|
|
@@ -11030,34 +11346,48 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11030
11346
|
const cardType = detectCardType(cardInput);
|
|
11031
11347
|
switch (cardType) {
|
|
11032
11348
|
case "visa":
|
|
11033
|
-
return /* @__PURE__ */
|
|
11349
|
+
return /* @__PURE__ */ jsx35("img", { src: visa2, alt: "visa", width: 33 });
|
|
11034
11350
|
case "mastercard":
|
|
11035
|
-
return /* @__PURE__ */
|
|
11351
|
+
return /* @__PURE__ */ jsx35("img", { src: mastercard2, width: 33, alt: "mastercard" });
|
|
11036
11352
|
case "amex":
|
|
11037
|
-
return /* @__PURE__ */
|
|
11353
|
+
return /* @__PURE__ */ jsx35("img", { src: americanexp2, alt: "amex", width: 33 });
|
|
11038
11354
|
case "discover":
|
|
11039
|
-
return /* @__PURE__ */
|
|
11355
|
+
return /* @__PURE__ */ jsx35("img", { src: discover2, width: 33, alt: "discover" });
|
|
11040
11356
|
case "diners":
|
|
11041
|
-
return /* @__PURE__ */
|
|
11357
|
+
return /* @__PURE__ */ jsx35("img", { src: dinersicon, alt: "Diners Club" });
|
|
11042
11358
|
case "jcb":
|
|
11043
|
-
return /* @__PURE__ */
|
|
11359
|
+
return /* @__PURE__ */ jsx35("img", { src: jcbicon, alt: "JCB" });
|
|
11044
11360
|
case "unionpay":
|
|
11045
|
-
return /* @__PURE__ */
|
|
11361
|
+
return /* @__PURE__ */ jsx35("img", { src: unionicon, alt: "UnionPay" });
|
|
11046
11362
|
default:
|
|
11047
|
-
return /* @__PURE__ */
|
|
11363
|
+
return /* @__PURE__ */ jsx35("img", { src: defualtcardborder, alt: "card" });
|
|
11048
11364
|
}
|
|
11049
11365
|
}
|
|
11050
11366
|
return /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11051
|
-
(initialLoader || !onLoad) && /* @__PURE__ */
|
|
11052
|
-
|
|
11053
|
-
|
|
11367
|
+
(initialLoader || !onLoad) && /* @__PURE__ */ jsx35(Loader_default, { intensity: "dark", loading: initialLoader || !onLoad }),
|
|
11368
|
+
paymentGateway == 32 && /* @__PURE__ */ jsx35(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
11369
|
+
paymentGateway == 31 && /* @__PURE__ */ jsx35(
|
|
11370
|
+
DataCapScriptLoader,
|
|
11371
|
+
{
|
|
11372
|
+
onReady: () => {
|
|
11373
|
+
console.log("SDK Ready");
|
|
11374
|
+
},
|
|
11375
|
+
onError: (err) => {
|
|
11376
|
+
setLoading(false);
|
|
11377
|
+
setLoadingIframe(false);
|
|
11378
|
+
setError(DcLoadingError);
|
|
11379
|
+
}
|
|
11380
|
+
}
|
|
11381
|
+
),
|
|
11382
|
+
error && /* @__PURE__ */ jsx35("div", { children: /* @__PURE__ */ jsx35(ErrorCardOverlay_default, { error, onClose: handleClose, autoTrigger }) }),
|
|
11383
|
+
errorIframe && /* @__PURE__ */ jsx35("div", { children: /* @__PURE__ */ jsx35(ErrorCardOverlay_default, { error: errorIframe, onClose: () => {
|
|
11054
11384
|
setErrorIframe("");
|
|
11055
11385
|
}, autoTrigger: onSubmit ? !onSubmit : autoTrigger }) }),
|
|
11056
11386
|
/* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11057
|
-
(loading || loading2 || loadingIframe) && /* @__PURE__ */
|
|
11387
|
+
(loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx35(Loader_default, { intensity: "light", loading: loading || loading2 || loadingPrev || orderLoader || loadingIframe }),
|
|
11058
11388
|
/* @__PURE__ */ jsxs20("div", { className: "frac-card-payment-page frac-form frac-new-form", children: [
|
|
11059
|
-
/* @__PURE__ */
|
|
11060
|
-
(stripeResponse == null ? void 0 : stripeResponse.challenge_url) ? /* @__PURE__ */
|
|
11389
|
+
/* @__PURE__ */ jsx35("div", { ref: threeDSContainerRef, style: { width: "100%", height: "100%" } }),
|
|
11390
|
+
(stripeResponse == null ? void 0 : stripeResponse.challenge_url) ? /* @__PURE__ */ jsx35(
|
|
11061
11391
|
ThreeDSChallenge,
|
|
11062
11392
|
{
|
|
11063
11393
|
containerRef: threeDSContainerRef,
|
|
@@ -11068,32 +11398,32 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11068
11398
|
onError: handleError
|
|
11069
11399
|
}
|
|
11070
11400
|
) : /* @__PURE__ */ jsxs20("div", { className: "parent-pay-container", children: [
|
|
11071
|
-
/* @__PURE__ */
|
|
11072
|
-
/* @__PURE__ */
|
|
11073
|
-
/* @__PURE__ */
|
|
11401
|
+
/* @__PURE__ */ jsx35("span", { style: { display: autoTrigger ? "none" : "block" }, className: "request-payment-close-popup", onClick: handleClose, children: /* @__PURE__ */ jsxs20("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
|
|
11402
|
+
/* @__PURE__ */ jsx35("g", { clipPath: "url(#clip0_12425_52336)", children: /* @__PURE__ */ jsx35("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" }) }),
|
|
11403
|
+
/* @__PURE__ */ jsx35("defs", { children: /* @__PURE__ */ jsx35("clipPath", { id: "clip0_12425_52336", children: /* @__PURE__ */ jsx35("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
11074
11404
|
] }) }),
|
|
11075
|
-
/* @__PURE__ */
|
|
11405
|
+
/* @__PURE__ */ jsx35("div", { className: "pay-main-logo-res" }),
|
|
11076
11406
|
/* @__PURE__ */ jsxs20("div", { className: onSubmit ? "pay-container frac-pay-container " : "pay-container", children: [
|
|
11077
11407
|
!onSubmit && /* @__PURE__ */ jsxs20("div", { className: "pay-header pay-conatiner-one", children: [
|
|
11078
11408
|
/* @__PURE__ */ jsxs20("div", { className: "pay-conatiner-one-first", children: [
|
|
11079
11409
|
/* @__PURE__ */ jsxs20("div", { className: "pay-logo-container", children: [
|
|
11080
|
-
/* @__PURE__ */
|
|
11081
|
-
/* @__PURE__ */
|
|
11410
|
+
/* @__PURE__ */ jsx35("div", { className: "pay-main-logo" }),
|
|
11411
|
+
/* @__PURE__ */ jsx35("h1", { className: "pay-heading", children: "Pay" }),
|
|
11082
11412
|
(cardList == null ? void 0 : cardList.length) > 0 && activetab !== "cardList" && /* @__PURE__ */ jsxs20("button", { className: "res-charge-payment-back-btn ", onClick: () => setActive("cardList"), children: [
|
|
11083
11413
|
" ",
|
|
11084
|
-
/* @__PURE__ */
|
|
11414
|
+
/* @__PURE__ */ jsx35(IoArrowBack4, {}),
|
|
11085
11415
|
" Back"
|
|
11086
11416
|
] })
|
|
11087
11417
|
] }),
|
|
11088
|
-
/* @__PURE__ */
|
|
11089
|
-
/* @__PURE__ */
|
|
11418
|
+
/* @__PURE__ */ jsx35("div", { className: "amt-pay-con", children: /* @__PURE__ */ jsxs20("div", { className: "pay-amount-conatiner", children: [
|
|
11419
|
+
/* @__PURE__ */ jsx35("small", { className: "pay-payment-amount", children: "Select payment type" }),
|
|
11090
11420
|
/* @__PURE__ */ jsxs20("div", { className: "frac-card-bank-radio-main", children: [
|
|
11091
|
-
/* @__PURE__ */
|
|
11092
|
-
!isPreAuth && isBankActive && !isPartial && /* @__PURE__ */
|
|
11421
|
+
/* @__PURE__ */ jsx35(CardBankRadio, { label: "Card", amount: (_a = Number(amount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
|
|
11422
|
+
!isPreAuth && isBankActive && !isPartial && /* @__PURE__ */ jsx35(CardBankRadio, { label: "Bank", amount: (_b = Number(bankAmount)) == null ? void 0 : _b.toFixed(2), value: "ach", onChange: handletabchange, activetab, savingsText: bankSavingsText })
|
|
11093
11423
|
] }),
|
|
11094
11424
|
isPartial && /* @__PURE__ */ jsxs20("div", { className: "frac-partial-payment-input", children: [
|
|
11095
|
-
/* @__PURE__ */
|
|
11096
|
-
/* @__PURE__ */
|
|
11425
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
|
|
11426
|
+
/* @__PURE__ */ jsx35(
|
|
11097
11427
|
NumericFormat2,
|
|
11098
11428
|
{
|
|
11099
11429
|
prefix: "$",
|
|
@@ -11117,25 +11447,25 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11117
11447
|
}
|
|
11118
11448
|
}
|
|
11119
11449
|
),
|
|
11120
|
-
partialError && /* @__PURE__ */
|
|
11450
|
+
partialError && /* @__PURE__ */ jsx35("span", { className: "error-span", children: partialError })
|
|
11121
11451
|
] })
|
|
11122
11452
|
] }) })
|
|
11123
11453
|
] }),
|
|
11124
11454
|
/* @__PURE__ */ jsxs20("div", { className: "pay-conatiner-one-last", children: [
|
|
11125
|
-
/* @__PURE__ */
|
|
11126
|
-
/* @__PURE__ */
|
|
11455
|
+
/* @__PURE__ */ jsx35("img", { src: secure2, alt: "" }),
|
|
11456
|
+
/* @__PURE__ */ jsx35("img", { src: pov2, alt: "" }),
|
|
11127
11457
|
"Secure payments powered by Fractal"
|
|
11128
11458
|
] })
|
|
11129
11459
|
] }),
|
|
11130
|
-
/* @__PURE__ */
|
|
11131
|
-
onSubmit && /* @__PURE__ */
|
|
11460
|
+
/* @__PURE__ */ jsx35("div", { className: "pay-tab pay-conatiner-two", children: /* @__PURE__ */ jsx35("div", { className: "col-md-12", children: /* @__PURE__ */ jsxs20("div", { id: "payment-form-div ", className: onSubmit ? "frac-payment-form-div" : "", children: [
|
|
11461
|
+
onSubmit && /* @__PURE__ */ jsx35("div", { className: "amt-pay-con", children: /* @__PURE__ */ jsxs20("div", { className: "pay-amount-conatiner", children: [
|
|
11132
11462
|
/* @__PURE__ */ jsxs20("div", { className: "frac-card-bank-radio-main", children: [
|
|
11133
|
-
/* @__PURE__ */
|
|
11134
|
-
!isPreAuth && isBankActive && !isPartial && /* @__PURE__ */
|
|
11463
|
+
/* @__PURE__ */ jsx35(CardBankRadio, { skydesign: true, label: "Card", amount: (_c = Number(amount)) == null ? void 0 : _c.toFixed(2), value: "card", onChange: handletabchange, activetab }),
|
|
11464
|
+
!isPreAuth && isBankActive && !isPartial && /* @__PURE__ */ jsx35(CardBankRadio, { skydesign: true, label: "Bank", amount: (_d = Number(bankAmount)) == null ? void 0 : _d.toFixed(2), value: "ach", onChange: handletabchange, activetab, savingsText: bankSavingsText })
|
|
11135
11465
|
] }),
|
|
11136
11466
|
isPartial && /* @__PURE__ */ jsxs20("div", { className: "frac-partial-payment-input", children: [
|
|
11137
|
-
/* @__PURE__ */
|
|
11138
|
-
/* @__PURE__ */
|
|
11467
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
|
|
11468
|
+
/* @__PURE__ */ jsx35(
|
|
11139
11469
|
NumericFormat2,
|
|
11140
11470
|
{
|
|
11141
11471
|
prefix: "$",
|
|
@@ -11152,33 +11482,45 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11152
11482
|
fixedDecimalScale: true
|
|
11153
11483
|
}
|
|
11154
11484
|
),
|
|
11155
|
-
partialError && /* @__PURE__ */
|
|
11485
|
+
partialError && /* @__PURE__ */ jsx35("span", { className: "error-span", children: partialError })
|
|
11156
11486
|
] })
|
|
11157
11487
|
] }) }),
|
|
11158
|
-
is3DSEnable ? clientSecret && /* @__PURE__ */
|
|
11488
|
+
is3DSEnable ? clientSecret && /* @__PURE__ */ jsx35(CheckoutWrapper, { onSuccess, clientSecret, amount, showLoader, hideLoader, callback, session_token, handleClose, setError, isPreAuth }) : /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11159
11489
|
/* @__PURE__ */ jsxs20("div", { id: "ach", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent", children: [
|
|
11160
11490
|
!onSubmit && /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11161
11491
|
/* @__PURE__ */ jsxs20("div", { className: "frac-heading-card-wrap", children: [
|
|
11162
|
-
/* @__PURE__ */
|
|
11492
|
+
/* @__PURE__ */ jsx35("div", { className: "frac-backarrow", children: (cardList == null ? void 0 : cardList.length) > 0 && activeinCard === "form" && /* @__PURE__ */ jsxs20("button", { className: "charge-payment-back-btn ", onClick: () => setActiveinCard("list"), children: [
|
|
11163
11493
|
" ",
|
|
11164
|
-
/* @__PURE__ */
|
|
11494
|
+
/* @__PURE__ */ jsx35(IoArrowBack4, {})
|
|
11165
11495
|
] }) }),
|
|
11166
|
-
/* @__PURE__ */
|
|
11496
|
+
/* @__PURE__ */ jsx35("h6", { className: "frac-card-payment-heading", children: "Card Payment" })
|
|
11167
11497
|
] }),
|
|
11168
11498
|
/* @__PURE__ */ jsxs20("div", { style: { display: "flex", gap: "8px", margin: "8px 0px 19px 0px" }, children: [
|
|
11169
|
-
/* @__PURE__ */
|
|
11170
|
-
/* @__PURE__ */
|
|
11171
|
-
/* @__PURE__ */
|
|
11172
|
-
/* @__PURE__ */
|
|
11499
|
+
/* @__PURE__ */ jsx35("img", { src: visa2, alt: "", width: 33 }),
|
|
11500
|
+
/* @__PURE__ */ jsx35("img", { src: mastercard2, width: 33, alt: "" }),
|
|
11501
|
+
/* @__PURE__ */ jsx35("img", { src: americanexp2, alt: "", width: 33 }),
|
|
11502
|
+
/* @__PURE__ */ jsx35("img", { src: discover2, width: 33, alt: "" })
|
|
11173
11503
|
] })
|
|
11174
11504
|
] }),
|
|
11175
11505
|
activeinCard === "list" && (cardList == null ? void 0 : cardList.length) > 0 ? /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11176
|
-
/* @__PURE__ */
|
|
11506
|
+
/* @__PURE__ */ jsx35(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Card", ListItems: cardList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Card", otherButtonAction: () => {
|
|
11177
11507
|
setActiveinCard("form");
|
|
11178
11508
|
} }),
|
|
11179
|
-
/* @__PURE__ */
|
|
11509
|
+
/* @__PURE__ */ jsx35("div", { className: "form-group-frac", style: { padding: "0", display: onSubmit ? "none" : "block" }, children: /* @__PURE__ */ jsx35("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)) }) })
|
|
11180
11510
|
] }) : paymentGateway == 32 ? /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11181
|
-
onSubmit && /* @__PURE__ */
|
|
11511
|
+
onSubmit && /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11512
|
+
/* @__PURE__ */ jsx35(
|
|
11513
|
+
ApplePayButton,
|
|
11514
|
+
{
|
|
11515
|
+
applePayAmount: partialAmount ? partialAmount : amount,
|
|
11516
|
+
applePayMerchantId,
|
|
11517
|
+
applePayMerchantName: merchantName,
|
|
11518
|
+
completeFractalFlow,
|
|
11519
|
+
showLoader
|
|
11520
|
+
}
|
|
11521
|
+
),
|
|
11522
|
+
/* @__PURE__ */ jsx35("div", { id: "digital-wallet-or", className: "frac-or", children: /* @__PURE__ */ jsx35("span", { children: "or" }) })
|
|
11523
|
+
] }),
|
|
11182
11524
|
/* @__PURE__ */ jsxs20("form", { id: "paymentForm", style: { textAlign: "start" }, ref: cardFormRef, onSubmit: submitFunc, onKeyDown: (e) => {
|
|
11183
11525
|
if (e.key === "Enter" && loading) {
|
|
11184
11526
|
e.preventDefault();
|
|
@@ -11187,18 +11529,18 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11187
11529
|
}, children: [
|
|
11188
11530
|
/* @__PURE__ */ jsxs20("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
|
|
11189
11531
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11190
|
-
/* @__PURE__ */
|
|
11191
|
-
/* @__PURE__ */
|
|
11532
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
|
|
11533
|
+
/* @__PURE__ */ jsx35("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
|
|
11192
11534
|
const value = e.target.value;
|
|
11193
11535
|
if (/^[a-zA-Z\s]*$/.test(value)) {
|
|
11194
11536
|
handleCardChange("cardName", value);
|
|
11195
11537
|
}
|
|
11196
11538
|
} }),
|
|
11197
|
-
(cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */
|
|
11539
|
+
(cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
|
|
11198
11540
|
] }),
|
|
11199
11541
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11200
|
-
/* @__PURE__ */
|
|
11201
|
-
/* @__PURE__ */
|
|
11542
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "cardNumber", children: "CARD NUMBER" }),
|
|
11543
|
+
/* @__PURE__ */ jsx35("div", { className: "toggle-num-wrapper toggle-num-wrapper-new", children: (show || autoTrigger) && paymentGateway === 32 && isTokenizerReady && /* @__PURE__ */ jsx35(
|
|
11202
11544
|
FractalFields_default,
|
|
11203
11545
|
{
|
|
11204
11546
|
fractalStyles,
|
|
@@ -11208,17 +11550,17 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11208
11550
|
) })
|
|
11209
11551
|
] }),
|
|
11210
11552
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11211
|
-
/* @__PURE__ */
|
|
11212
|
-
/* @__PURE__ */
|
|
11213
|
-
(cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */
|
|
11553
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "zip", children: "ZIP" }),
|
|
11554
|
+
/* @__PURE__ */ jsx35("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) }),
|
|
11555
|
+
(cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode }),
|
|
11214
11556
|
pass_fee && cardFeeAmount > 0 && /* @__PURE__ */ jsxs20("small", { className: "frac-fee-text", children: [
|
|
11215
11557
|
"Cards include a fee amount of ",
|
|
11216
|
-
/* @__PURE__ */
|
|
11558
|
+
/* @__PURE__ */ jsx35("span", { className: "frac-fee-amount", children: formatUSD(cardFeeAmount.toFixed(2)) }),
|
|
11217
11559
|
"."
|
|
11218
11560
|
] })
|
|
11219
11561
|
] }),
|
|
11220
|
-
customerId && /* @__PURE__ */
|
|
11221
|
-
/* @__PURE__ */
|
|
11562
|
+
customerId && /* @__PURE__ */ jsx35("div", { className: "form-group-frac", children: /* @__PURE__ */ jsxs20("div", { className: "frac-tooltip-mn", style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
|
|
11563
|
+
/* @__PURE__ */ jsx35(
|
|
11222
11564
|
"input",
|
|
11223
11565
|
{
|
|
11224
11566
|
type: "checkbox",
|
|
@@ -11228,10 +11570,10 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11228
11570
|
onChange: (e) => setSaveCardInfo(e.target.checked)
|
|
11229
11571
|
}
|
|
11230
11572
|
),
|
|
11231
|
-
/* @__PURE__ */
|
|
11232
|
-
/* @__PURE__ */
|
|
11573
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "save_card", className: "toggle-label" }),
|
|
11574
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "save_card", children: "Save card for future payments " }),
|
|
11233
11575
|
/* @__PURE__ */ jsxs20("div", { className: "frac-tooltip-wrapper", children: [
|
|
11234
|
-
/* @__PURE__ */
|
|
11576
|
+
/* @__PURE__ */ jsx35("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs20(
|
|
11235
11577
|
"svg",
|
|
11236
11578
|
{
|
|
11237
11579
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -11240,8 +11582,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11240
11582
|
viewBox: "0 0 20 20",
|
|
11241
11583
|
fill: "none",
|
|
11242
11584
|
children: [
|
|
11243
|
-
/* @__PURE__ */
|
|
11244
|
-
/* @__PURE__ */
|
|
11585
|
+
/* @__PURE__ */ jsx35("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
|
|
11586
|
+
/* @__PURE__ */ jsx35(
|
|
11245
11587
|
"path",
|
|
11246
11588
|
{
|
|
11247
11589
|
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",
|
|
@@ -11251,15 +11593,15 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11251
11593
|
]
|
|
11252
11594
|
}
|
|
11253
11595
|
) }),
|
|
11254
|
-
/* @__PURE__ */
|
|
11596
|
+
/* @__PURE__ */ jsx35("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs20("p", { children: [
|
|
11255
11597
|
"If checked, I agree to give the ",
|
|
11256
|
-
/* @__PURE__ */
|
|
11598
|
+
/* @__PURE__ */ jsx35("b", { children: merchantName || "merchant" }),
|
|
11257
11599
|
" permission to charge this credit card for agreed-upon purchases in the future."
|
|
11258
11600
|
] }) })
|
|
11259
11601
|
] })
|
|
11260
11602
|
] }) })
|
|
11261
11603
|
] }),
|
|
11262
|
-
/* @__PURE__ */
|
|
11604
|
+
/* @__PURE__ */ jsx35("div", { className: "form-group-frac", style: { marginTop: "20px", padding: "0" }, children: /* @__PURE__ */ jsx35("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)) }) })
|
|
11263
11605
|
] })
|
|
11264
11606
|
] }) : /* @__PURE__ */ jsxs20("form", { id: "PaymentForm", style: { textAlign: "start" }, ref: cardFormRef, onSubmit: submitFunc, onKeyDown: (e) => {
|
|
11265
11607
|
if (e.key === "Enter" && loading) {
|
|
@@ -11269,37 +11611,37 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11269
11611
|
}, children: [
|
|
11270
11612
|
/* @__PURE__ */ jsxs20("div", { className: "ach-scrl", style: { minHeight: "398px", maxHeight: "398px", overflow: "auto", marginRight: "5px" }, children: [
|
|
11271
11613
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11272
|
-
/* @__PURE__ */
|
|
11273
|
-
/* @__PURE__ */
|
|
11614
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "cardHolderName", children: "NAME ON CARD " }),
|
|
11615
|
+
/* @__PURE__ */ jsx35("input", { type: "text", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
|
|
11274
11616
|
const value = e.target.value;
|
|
11275
11617
|
if (/^[a-zA-Z\s]*$/.test(value)) {
|
|
11276
11618
|
handleCardChange("cardName", value);
|
|
11277
11619
|
}
|
|
11278
11620
|
} }),
|
|
11279
|
-
(cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */
|
|
11621
|
+
(cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: cardError == null ? void 0 : cardError.cardName })
|
|
11280
11622
|
] }),
|
|
11281
|
-
/* @__PURE__ */
|
|
11623
|
+
/* @__PURE__ */ jsx35("div", { className: "form-group-frac", children: /* @__PURE__ */ jsx35(
|
|
11282
11624
|
DataCapFields,
|
|
11283
11625
|
{
|
|
11284
11626
|
isOpen: show || autoTrigger,
|
|
11285
11627
|
tokenKey: dcToken,
|
|
11286
11628
|
setLoader: activeinCard === "form" ? setLoadingIframe : null,
|
|
11287
11629
|
isEmbedded: onSubmit ? true : false,
|
|
11288
|
-
customCSS
|
|
11630
|
+
customCSS
|
|
11289
11631
|
}
|
|
11290
11632
|
) }),
|
|
11291
11633
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11292
|
-
/* @__PURE__ */
|
|
11293
|
-
/* @__PURE__ */
|
|
11294
|
-
(cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */
|
|
11634
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "zip", children: "ZIP" }),
|
|
11635
|
+
/* @__PURE__ */ jsx35("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) }),
|
|
11636
|
+
(cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: cardError == null ? void 0 : cardError.zipCode }),
|
|
11295
11637
|
pass_fee && cardFeeAmount > 0 && /* @__PURE__ */ jsxs20("small", { className: "frac-fee-text", children: [
|
|
11296
11638
|
"Cards include a fee amount of ",
|
|
11297
|
-
/* @__PURE__ */
|
|
11639
|
+
/* @__PURE__ */ jsx35("span", { className: "frac-fee-amount", children: formatUSD(cardFeeAmount.toFixed(2)) }),
|
|
11298
11640
|
"."
|
|
11299
11641
|
] })
|
|
11300
11642
|
] }),
|
|
11301
|
-
customerId && /* @__PURE__ */
|
|
11302
|
-
/* @__PURE__ */
|
|
11643
|
+
customerId && /* @__PURE__ */ jsx35("div", { className: "form-group-frac", children: /* @__PURE__ */ jsxs20("div", { className: "frac-tooltip-mn", style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" }, children: [
|
|
11644
|
+
/* @__PURE__ */ jsx35(
|
|
11303
11645
|
"input",
|
|
11304
11646
|
{
|
|
11305
11647
|
type: "checkbox",
|
|
@@ -11309,10 +11651,10 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11309
11651
|
onChange: (e) => setSaveCardInfo(e.target.checked)
|
|
11310
11652
|
}
|
|
11311
11653
|
),
|
|
11312
|
-
/* @__PURE__ */
|
|
11313
|
-
/* @__PURE__ */
|
|
11654
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "save_card", className: "toggle-label" }),
|
|
11655
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "save_card", children: "Save card for future payments " }),
|
|
11314
11656
|
/* @__PURE__ */ jsxs20("div", { className: "frac-tooltip-wrapper", children: [
|
|
11315
|
-
/* @__PURE__ */
|
|
11657
|
+
/* @__PURE__ */ jsx35("div", { className: "frac-tooltip-icon", children: /* @__PURE__ */ jsxs20(
|
|
11316
11658
|
"svg",
|
|
11317
11659
|
{
|
|
11318
11660
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -11321,8 +11663,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11321
11663
|
viewBox: "0 0 20 20",
|
|
11322
11664
|
fill: "none",
|
|
11323
11665
|
children: [
|
|
11324
|
-
/* @__PURE__ */
|
|
11325
|
-
/* @__PURE__ */
|
|
11666
|
+
/* @__PURE__ */ jsx35("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }),
|
|
11667
|
+
/* @__PURE__ */ jsx35(
|
|
11326
11668
|
"path",
|
|
11327
11669
|
{
|
|
11328
11670
|
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",
|
|
@@ -11332,30 +11674,30 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11332
11674
|
]
|
|
11333
11675
|
}
|
|
11334
11676
|
) }),
|
|
11335
|
-
/* @__PURE__ */
|
|
11677
|
+
/* @__PURE__ */ jsx35("div", { className: "frac-tooltip-text", children: /* @__PURE__ */ jsxs20("p", { children: [
|
|
11336
11678
|
"If checked, I agree to give the ",
|
|
11337
|
-
/* @__PURE__ */
|
|
11679
|
+
/* @__PURE__ */ jsx35("b", { children: merchantName || "merchant" }),
|
|
11338
11680
|
" permission to charge this credit card for agreed-upon purchases in the future."
|
|
11339
11681
|
] }) })
|
|
11340
11682
|
] })
|
|
11341
11683
|
] }) })
|
|
11342
11684
|
] }),
|
|
11343
|
-
/* @__PURE__ */
|
|
11685
|
+
/* @__PURE__ */ jsx35("div", { className: "form-group-frac", style: { marginTop: "20px", padding: "0" }, children: /* @__PURE__ */ jsx35("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)) }) })
|
|
11344
11686
|
] })
|
|
11345
11687
|
] }),
|
|
11346
|
-
/* @__PURE__ */
|
|
11688
|
+
/* @__PURE__ */ jsx35("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent", children: /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11347
11689
|
!onSubmit && /* @__PURE__ */ jsxs20("div", { className: "frac-heading-card-wrap", children: [
|
|
11348
|
-
/* @__PURE__ */
|
|
11690
|
+
/* @__PURE__ */ jsx35("div", { className: "frac-backarrow", children: (bankList == null ? void 0 : bankList.length) > 0 && activeinBank === "form" && /* @__PURE__ */ jsxs20("button", { className: "charge-payment-back-btn ", onClick: () => setActiveinBank("list"), children: [
|
|
11349
11691
|
" ",
|
|
11350
|
-
/* @__PURE__ */
|
|
11692
|
+
/* @__PURE__ */ jsx35(IoArrowBack4, {})
|
|
11351
11693
|
] }) }),
|
|
11352
|
-
/* @__PURE__ */
|
|
11694
|
+
/* @__PURE__ */ jsx35("h6", { className: "frac-card-payment-heading", children: "Bank Payment" })
|
|
11353
11695
|
] }),
|
|
11354
11696
|
activeinBank === "list" && (bankList == null ? void 0 : bankList.length) > 0 ? /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11355
|
-
/* @__PURE__ */
|
|
11697
|
+
/* @__PURE__ */ jsx35(CardList, { headingClass: "card-ach-heading-frac", listHeading: "Banks", ListItems: bankList, selectedCard, setSelectedCard, handleDeleteCard, otherButtonLabel: "Pay With Other Bank", otherButtonAction: () => {
|
|
11356
11698
|
setActiveinBank("form");
|
|
11357
11699
|
} }),
|
|
11358
|
-
/* @__PURE__ */
|
|
11700
|
+
/* @__PURE__ */ jsx35("div", { className: "form-group-frac", style: { padding: "0", display: onSubmit ? "none" : "block" }, children: /* @__PURE__ */ jsx35("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer, children: formatUSD((_m = Number(bankAmount)) == null ? void 0 : _m.toFixed(2)) }) })
|
|
11359
11701
|
] }) : /* @__PURE__ */ jsxs20("form", { id: "ACHPaymentForm", style: { textAlign: "start" }, ref: bankFormRef, onSubmit: submitFunc, autoComplete: "off", onKeyDown: (e) => {
|
|
11360
11702
|
if (e.key === "Enter" && loading) {
|
|
11361
11703
|
e.preventDefault();
|
|
@@ -11367,13 +11709,13 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11367
11709
|
maxHeight: "444px"
|
|
11368
11710
|
}, children: [
|
|
11369
11711
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11370
|
-
/* @__PURE__ */
|
|
11371
|
-
/* @__PURE__ */
|
|
11372
|
-
(achError == null ? void 0 : achError.name) && /* @__PURE__ */
|
|
11712
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "nameonaccount", children: "Name on account" }),
|
|
11713
|
+
/* @__PURE__ */ jsx35("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 }),
|
|
11714
|
+
(achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
|
|
11373
11715
|
] }),
|
|
11374
11716
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11375
|
-
/* @__PURE__ */
|
|
11376
|
-
/* @__PURE__ */
|
|
11717
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "routingnumber", children: "Routing number" }),
|
|
11718
|
+
/* @__PURE__ */ jsx35(
|
|
11377
11719
|
"input",
|
|
11378
11720
|
{
|
|
11379
11721
|
type: "text",
|
|
@@ -11386,11 +11728,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11386
11728
|
onChange: handleChangeAch
|
|
11387
11729
|
}
|
|
11388
11730
|
),
|
|
11389
|
-
(achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */
|
|
11731
|
+
(achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: achError == null ? void 0 : achError.routingNumber })
|
|
11390
11732
|
] }),
|
|
11391
11733
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11392
|
-
/* @__PURE__ */
|
|
11393
|
-
/* @__PURE__ */
|
|
11734
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "accountnumber", children: "Account number" }),
|
|
11735
|
+
/* @__PURE__ */ jsx35(
|
|
11394
11736
|
"input",
|
|
11395
11737
|
{
|
|
11396
11738
|
type: "text",
|
|
@@ -11403,11 +11745,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11403
11745
|
onChange: handleChangeAch
|
|
11404
11746
|
}
|
|
11405
11747
|
),
|
|
11406
|
-
(achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */
|
|
11748
|
+
(achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: achError == null ? void 0 : achError.accountNumber })
|
|
11407
11749
|
] }),
|
|
11408
11750
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11409
|
-
/* @__PURE__ */
|
|
11410
|
-
/* @__PURE__ */
|
|
11751
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "confirmaccountnumber", children: "Confirm account number" }),
|
|
11752
|
+
/* @__PURE__ */ jsx35(
|
|
11411
11753
|
"input",
|
|
11412
11754
|
{
|
|
11413
11755
|
type: "text",
|
|
@@ -11420,11 +11762,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11420
11762
|
onChange: handleChangeAch
|
|
11421
11763
|
}
|
|
11422
11764
|
),
|
|
11423
|
-
(achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */
|
|
11765
|
+
(achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: achError == null ? void 0 : achError.confirmAccountNumber })
|
|
11424
11766
|
] }),
|
|
11425
11767
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11426
|
-
/* @__PURE__ */
|
|
11427
|
-
/* @__PURE__ */
|
|
11768
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "bankname", children: "Bank name" }),
|
|
11769
|
+
/* @__PURE__ */ jsx35(
|
|
11428
11770
|
"input",
|
|
11429
11771
|
{
|
|
11430
11772
|
type: "text",
|
|
@@ -11437,11 +11779,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11437
11779
|
onChange: handleChangeAch
|
|
11438
11780
|
}
|
|
11439
11781
|
),
|
|
11440
|
-
(achError == null ? void 0 : achError.bankName) && /* @__PURE__ */
|
|
11782
|
+
(achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: achError == null ? void 0 : achError.bankName })
|
|
11441
11783
|
] }),
|
|
11442
11784
|
((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11443
|
-
/* @__PURE__ */
|
|
11444
|
-
/* @__PURE__ */
|
|
11785
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "companyName", children: "Company name" }),
|
|
11786
|
+
/* @__PURE__ */ jsx35(
|
|
11445
11787
|
"input",
|
|
11446
11788
|
{
|
|
11447
11789
|
type: "text",
|
|
@@ -11454,44 +11796,44 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11454
11796
|
onChange: handleChangeAch
|
|
11455
11797
|
}
|
|
11456
11798
|
),
|
|
11457
|
-
(achError == null ? void 0 : achError.companyName) && /* @__PURE__ */
|
|
11799
|
+
(achError == null ? void 0 : achError.companyName) && /* @__PURE__ */ jsx35("span", { className: "error-span", children: achError == null ? void 0 : achError.companyName })
|
|
11458
11800
|
] }),
|
|
11459
11801
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11460
|
-
/* @__PURE__ */
|
|
11802
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: "accounttype", children: "Select account type" }),
|
|
11461
11803
|
/* @__PURE__ */ jsxs20("select", { name: "accountType", id: "accounttype", className: "form-control-frac", value: (_t = achData == null ? void 0 : achData.accountType) != null ? _t : "", onChange: handleChangeAch, children: [
|
|
11462
|
-
/* @__PURE__ */
|
|
11463
|
-
accountTypes.map((type) => /* @__PURE__ */
|
|
11804
|
+
/* @__PURE__ */ jsx35("option", { value: "", children: "Select account" }),
|
|
11805
|
+
accountTypes.map((type) => /* @__PURE__ */ jsx35("option", { value: type.value, children: type.label }, type.value))
|
|
11464
11806
|
] }),
|
|
11465
11807
|
bankFeeAmount > 0 && /* @__PURE__ */ jsxs20("small", { className: "frac-fee-text", children: [
|
|
11466
11808
|
"There is a processing fee of ",
|
|
11467
|
-
/* @__PURE__ */
|
|
11809
|
+
/* @__PURE__ */ jsx35("span", { className: "frac-fee-amount", children: formatUSD(bankFeeAmount.toFixed(2)) }),
|
|
11468
11810
|
"."
|
|
11469
11811
|
] }),
|
|
11470
11812
|
!saveACHinfo && /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11471
11813
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
11472
|
-
/* @__PURE__ */
|
|
11814
|
+
/* @__PURE__ */ jsx35("input", { type: "checkbox", id: "achconsent", className: "", checked: isBankConsentChecked, onChange: (e) => {
|
|
11473
11815
|
setIsBankConsentChecked(e.target.checked);
|
|
11474
11816
|
if (e.target.checked) {
|
|
11475
11817
|
setErrorBankConsent("");
|
|
11476
11818
|
}
|
|
11477
11819
|
} }),
|
|
11478
|
-
/* @__PURE__ */
|
|
11820
|
+
/* @__PURE__ */ jsx35("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.` })
|
|
11479
11821
|
] }),
|
|
11480
|
-
errorBankConsent && /* @__PURE__ */
|
|
11822
|
+
errorBankConsent && /* @__PURE__ */ jsx35("span", { className: "error-span", children: errorBankConsent })
|
|
11481
11823
|
] }),
|
|
11482
11824
|
customerId && /* @__PURE__ */ jsxs20("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
11483
|
-
/* @__PURE__ */
|
|
11825
|
+
/* @__PURE__ */ jsx35("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => {
|
|
11484
11826
|
setSaveACHinfo(e.target.checked);
|
|
11485
11827
|
if (!e.target.checked) {
|
|
11486
11828
|
setSaveACHConsent1(false);
|
|
11487
11829
|
setErrorBankConsentOther("");
|
|
11488
11830
|
}
|
|
11489
11831
|
} }),
|
|
11490
|
-
/* @__PURE__ */
|
|
11832
|
+
/* @__PURE__ */ jsx35("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save for future use" })
|
|
11491
11833
|
] }),
|
|
11492
11834
|
saveACHinfo && /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11493
11835
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
11494
|
-
/* @__PURE__ */
|
|
11836
|
+
/* @__PURE__ */ jsx35("input", { type: "checkbox", id: "saveACHConsent1", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHConsent1, onChange: (e) => {
|
|
11495
11837
|
setSaveACHConsent1(e.target.checked);
|
|
11496
11838
|
if (e.target.checked) {
|
|
11497
11839
|
setErrorBankConsentOther("");
|
|
@@ -11503,11 +11845,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11503
11845
|
" to store my bank account details for future ACH payments. I understand that future payments may be initiated using this saved account in accordance with my instructions. I confirm I am authorized to use this bank account."
|
|
11504
11846
|
] })
|
|
11505
11847
|
] }),
|
|
11506
|
-
errorBankConsentOther && /* @__PURE__ */
|
|
11848
|
+
errorBankConsentOther && /* @__PURE__ */ jsx35("span", { className: "error-span", children: errorBankConsentOther })
|
|
11507
11849
|
] })
|
|
11508
11850
|
] })
|
|
11509
11851
|
] }),
|
|
11510
|
-
/* @__PURE__ */
|
|
11852
|
+
/* @__PURE__ */ jsx35("div", { className: "form-group-frac ", children: /* @__PURE__ */ jsx35("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)) }) })
|
|
11511
11853
|
] })
|
|
11512
11854
|
] }) })
|
|
11513
11855
|
] })
|
|
@@ -11522,7 +11864,7 @@ var ModelContentSky_default = ModelContentSky;
|
|
|
11522
11864
|
|
|
11523
11865
|
// src/app/components/Skysystemz/PayButtonWithForm.tsx
|
|
11524
11866
|
import axios10 from "axios";
|
|
11525
|
-
import { Fragment as Fragment20, jsx as
|
|
11867
|
+
import { Fragment as Fragment20, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
11526
11868
|
var PaymentWidget = ({
|
|
11527
11869
|
amount,
|
|
11528
11870
|
bankAmount,
|
|
@@ -11543,7 +11885,7 @@ var PaymentWidget = ({
|
|
|
11543
11885
|
isPartial,
|
|
11544
11886
|
bankSurcharge,
|
|
11545
11887
|
partialRef,
|
|
11546
|
-
customCSS
|
|
11888
|
+
customCSS,
|
|
11547
11889
|
disableSubmitBtn = false
|
|
11548
11890
|
}) => {
|
|
11549
11891
|
const [show, setShow] = useState11(autoTrigger || false);
|
|
@@ -11575,7 +11917,7 @@ var PaymentWidget = ({
|
|
|
11575
11917
|
isPartial,
|
|
11576
11918
|
bankSurcharge,
|
|
11577
11919
|
partialRef,
|
|
11578
|
-
customCSS
|
|
11920
|
+
customCSS,
|
|
11579
11921
|
disableSubmitBtn
|
|
11580
11922
|
}),
|
|
11581
11923
|
[
|
|
@@ -11602,7 +11944,7 @@ var PaymentWidget = ({
|
|
|
11602
11944
|
]
|
|
11603
11945
|
);
|
|
11604
11946
|
const [commonProps, setCommonProps] = useState11(initialCommonProps);
|
|
11605
|
-
|
|
11947
|
+
useEffect17(() => {
|
|
11606
11948
|
if (show) {
|
|
11607
11949
|
setCommonProps(initialCommonProps);
|
|
11608
11950
|
}
|
|
@@ -11633,35 +11975,33 @@ var PaymentWidget = ({
|
|
|
11633
11975
|
setLoading(false);
|
|
11634
11976
|
}
|
|
11635
11977
|
};
|
|
11636
|
-
|
|
11978
|
+
useEffect17(() => {
|
|
11637
11979
|
if (show && isPartial && partialRef) {
|
|
11638
11980
|
getskyosOrderDetails();
|
|
11639
11981
|
}
|
|
11640
11982
|
}, [show, isPartial, partialRef]);
|
|
11641
11983
|
return /* @__PURE__ */ jsxs21(Fragment20, { children: [
|
|
11642
|
-
/* @__PURE__ */
|
|
11643
|
-
/* @__PURE__ */
|
|
11644
|
-
/* @__PURE__ */
|
|
11645
|
-
/* @__PURE__ */
|
|
11646
|
-
/* @__PURE__ */
|
|
11647
|
-
/* @__PURE__ */ jsx35(CustomModal2styles_default, {}),
|
|
11648
|
-
/* @__PURE__ */ jsx35(DataCapScriptLoader, {}),
|
|
11984
|
+
/* @__PURE__ */ jsx36("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
|
|
11985
|
+
/* @__PURE__ */ jsx36(DataScript, {}),
|
|
11986
|
+
/* @__PURE__ */ jsx36(SkyChargewidgetstyles, {}),
|
|
11987
|
+
/* @__PURE__ */ jsx36(CardBankRadioStyles, {}),
|
|
11988
|
+
/* @__PURE__ */ jsx36(CustomModal2styles_default, {}),
|
|
11649
11989
|
!autoTrigger && /* @__PURE__ */ jsxs21("button", { className: submitBtnClass || "paymentBtn", disabled: disableSubmitBtn, onClick: () => setShow(true), children: [
|
|
11650
11990
|
submitBtnText,
|
|
11651
11991
|
submitBtnIcon
|
|
11652
11992
|
] }),
|
|
11653
|
-
!autoTrigger ? /* @__PURE__ */
|
|
11993
|
+
!autoTrigger ? /* @__PURE__ */ jsx36(CustomModal2_default, { open: show, onClose: childHandleClose, children: /* @__PURE__ */ jsx36(ModelContentSky_default, __spreadProps(__spreadValues({ show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount })) }) : /* @__PURE__ */ jsx36(ModelContentSky_default, __spreadProps(__spreadValues({ show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount }))
|
|
11654
11994
|
] });
|
|
11655
11995
|
};
|
|
11656
11996
|
|
|
11657
11997
|
// src/app/components/Skysystemz/EmbeddedCheckout.tsx
|
|
11658
|
-
import { useEffect as
|
|
11998
|
+
import { useEffect as useEffect19, useState as useState12, useMemo as useMemo2 } from "react";
|
|
11659
11999
|
import axios11 from "axios";
|
|
11660
12000
|
|
|
11661
12001
|
// src/app/components/Skysystemz/EmbeddedCheckoutStyles.tsx
|
|
11662
|
-
import { jsx as
|
|
12002
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
11663
12003
|
function EmbeddedCheckoutStyles({ extraCustomCSS }) {
|
|
11664
|
-
return /* @__PURE__ */
|
|
12004
|
+
return /* @__PURE__ */ jsx37("style", { children: `
|
|
11665
12005
|
|
|
11666
12006
|
.pay-amount-conatiner{
|
|
11667
12007
|
margin-top: 20px !important;
|
|
@@ -12007,27 +12347,27 @@ padding:0px !important;
|
|
|
12007
12347
|
}
|
|
12008
12348
|
|
|
12009
12349
|
// src/app/components/Atoms/Applepay/ApplePayScriptLoader.tsx
|
|
12010
|
-
import { useEffect as
|
|
12350
|
+
import { useEffect as useEffect18 } from "react";
|
|
12011
12351
|
var applePayScriptLoaded = false;
|
|
12012
12352
|
var ApplePayScriptLoader = () => {
|
|
12013
|
-
|
|
12353
|
+
useEffect18(() => {
|
|
12014
12354
|
if (applePayScriptLoaded) return;
|
|
12015
12355
|
const existingScript = document.querySelector(
|
|
12016
12356
|
`script[src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js"]`
|
|
12017
12357
|
);
|
|
12018
12358
|
if (!existingScript) {
|
|
12019
|
-
const
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12359
|
+
const script = document.createElement("script");
|
|
12360
|
+
script.src = "https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js";
|
|
12361
|
+
script.async = true;
|
|
12362
|
+
script.onload = () => {
|
|
12023
12363
|
console.log("\u2705 Apple Pay script loaded");
|
|
12024
12364
|
applePayScriptLoaded = true;
|
|
12025
12365
|
console.log("ApplePaySession:", window.ApplePaySession);
|
|
12026
12366
|
};
|
|
12027
|
-
|
|
12367
|
+
script.onerror = (err) => {
|
|
12028
12368
|
console.error("\u274C Apple Pay script failed", err);
|
|
12029
12369
|
};
|
|
12030
|
-
document.head.appendChild(
|
|
12370
|
+
document.head.appendChild(script);
|
|
12031
12371
|
} else {
|
|
12032
12372
|
applePayScriptLoaded = true;
|
|
12033
12373
|
}
|
|
@@ -12036,7 +12376,7 @@ var ApplePayScriptLoader = () => {
|
|
|
12036
12376
|
};
|
|
12037
12377
|
|
|
12038
12378
|
// src/app/components/Skysystemz/EmbeddedCheckout.tsx
|
|
12039
|
-
import { Fragment as Fragment21, jsx as
|
|
12379
|
+
import { Fragment as Fragment21, jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
12040
12380
|
var EmbeddedCheckout = ({
|
|
12041
12381
|
amount,
|
|
12042
12382
|
bankAmount,
|
|
@@ -12059,7 +12399,7 @@ var EmbeddedCheckout = ({
|
|
|
12059
12399
|
partialRef,
|
|
12060
12400
|
onSubmit,
|
|
12061
12401
|
onLoad,
|
|
12062
|
-
customCSS
|
|
12402
|
+
customCSS
|
|
12063
12403
|
}) => {
|
|
12064
12404
|
const [show, setShow] = useState12(false);
|
|
12065
12405
|
const [loading, setLoading] = useState12(false);
|
|
@@ -12067,6 +12407,7 @@ var EmbeddedCheckout = ({
|
|
|
12067
12407
|
});
|
|
12068
12408
|
const [orderGuid, setOrderGuid] = useState12(null);
|
|
12069
12409
|
const [remainingAmount, setRemainingAmount] = useState12(null);
|
|
12410
|
+
const [isTokenizerReady, setTokenizerReady] = useState12(false);
|
|
12070
12411
|
const initialCommonProps = useMemo2(
|
|
12071
12412
|
() => ({
|
|
12072
12413
|
amount,
|
|
@@ -12114,7 +12455,7 @@ var EmbeddedCheckout = ({
|
|
|
12114
12455
|
]
|
|
12115
12456
|
);
|
|
12116
12457
|
const [commonProps, setCommonProps] = useState12(initialCommonProps);
|
|
12117
|
-
|
|
12458
|
+
useEffect19(() => {
|
|
12118
12459
|
if (show) {
|
|
12119
12460
|
setCommonProps(initialCommonProps);
|
|
12120
12461
|
}
|
|
@@ -12145,13 +12486,13 @@ var EmbeddedCheckout = ({
|
|
|
12145
12486
|
setLoading(false);
|
|
12146
12487
|
}
|
|
12147
12488
|
};
|
|
12148
|
-
|
|
12149
|
-
if (
|
|
12489
|
+
useEffect19(() => {
|
|
12490
|
+
if (autoTrigger && isPartial && partialRef) {
|
|
12150
12491
|
getskyosOrderDetails();
|
|
12151
12492
|
}
|
|
12152
|
-
}, [
|
|
12493
|
+
}, [autoTrigger, isPartial, partialRef]);
|
|
12153
12494
|
console.log(onLoad, "onLoad");
|
|
12154
|
-
|
|
12495
|
+
useEffect19(() => {
|
|
12155
12496
|
const supported = !!window.ApplePaySession;
|
|
12156
12497
|
let canPay = false;
|
|
12157
12498
|
if (supported) {
|
|
@@ -12163,20 +12504,18 @@ var EmbeddedCheckout = ({
|
|
|
12163
12504
|
console.log(`ApplePaySession: ${supported}, canMakePayments: ${canPay}`);
|
|
12164
12505
|
}, []);
|
|
12165
12506
|
return /* @__PURE__ */ jsxs22(Fragment21, { children: [
|
|
12166
|
-
/* @__PURE__ */
|
|
12167
|
-
/* @__PURE__ */
|
|
12168
|
-
/* @__PURE__ */
|
|
12169
|
-
/* @__PURE__ */
|
|
12170
|
-
/* @__PURE__ */
|
|
12171
|
-
/* @__PURE__ */
|
|
12172
|
-
/* @__PURE__ */
|
|
12173
|
-
/* @__PURE__ */ jsx37(ApplePayScriptLoader, {}),
|
|
12174
|
-
/* @__PURE__ */ jsx37(EmbeddedCheckoutStyles, { extraCustomCSS: customCSS2 }),
|
|
12507
|
+
/* @__PURE__ */ jsx38("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
|
|
12508
|
+
/* @__PURE__ */ jsx38(DataScript, {}),
|
|
12509
|
+
/* @__PURE__ */ jsx38(SkyChargewidgetstyles, {}),
|
|
12510
|
+
/* @__PURE__ */ jsx38(CardBankRadioStyles, {}),
|
|
12511
|
+
/* @__PURE__ */ jsx38(CustomModal2styles_default, {}),
|
|
12512
|
+
/* @__PURE__ */ jsx38(ApplePayScriptLoader, {}),
|
|
12513
|
+
/* @__PURE__ */ jsx38(EmbeddedCheckoutStyles, { extraCustomCSS: customCSS }),
|
|
12175
12514
|
!autoTrigger && /* @__PURE__ */ jsxs22("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
|
|
12176
12515
|
submitBtnText,
|
|
12177
12516
|
submitBtnIcon
|
|
12178
12517
|
] }),
|
|
12179
|
-
!autoTrigger ? /* @__PURE__ */
|
|
12518
|
+
!autoTrigger ? /* @__PURE__ */ jsx38(CustomModal2_default, { open: show, onClose: childHandleClose, children: /* @__PURE__ */ jsx38(ModelContentSky_default, __spreadProps(__spreadValues({ onLoad, onSubmit, show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount })) }) : /* @__PURE__ */ jsx38(ModelContentSky_default, __spreadProps(__spreadValues({ onLoad, onSubmit, show, loadingPrev: loading }, commonProps), { orderGuid, remainingAmount }))
|
|
12180
12519
|
] });
|
|
12181
12520
|
};
|
|
12182
12521
|
export {
|