@fractalpay/fractalpay-next-dev 0.0.290 → 0.0.291
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 +302 -108
- 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-dev",
|
|
42
|
-
version: "0.0.
|
|
42
|
+
version: "0.0.291",
|
|
43
43
|
private: false,
|
|
44
44
|
type: "module",
|
|
45
45
|
scripts: {
|
|
@@ -2811,25 +2811,25 @@ import { IoArrowBack } from "react-icons/io5";
|
|
|
2811
2811
|
import { useEffect as useEffect3 } from "react";
|
|
2812
2812
|
function DataScript() {
|
|
2813
2813
|
useEffect3(() => {
|
|
2814
|
-
const
|
|
2814
|
+
const src = datacapUrl;
|
|
2815
2815
|
if (typeof window === "undefined") return;
|
|
2816
2816
|
if (window.DatacapWebToken) {
|
|
2817
2817
|
return;
|
|
2818
2818
|
}
|
|
2819
|
-
if (!document.querySelector(`script[src="${
|
|
2820
|
-
const
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2819
|
+
if (!document.querySelector(`script[src="${src}"]`)) {
|
|
2820
|
+
const script = document.createElement("script");
|
|
2821
|
+
script.src = src;
|
|
2822
|
+
script.async = true;
|
|
2823
|
+
script.onload = () => {
|
|
2824
2824
|
if (window.DatacapWebToken) {
|
|
2825
2825
|
} else {
|
|
2826
2826
|
console.warn("\u26A0\uFE0F Script loaded, but DatacapWebToken not found");
|
|
2827
2827
|
}
|
|
2828
2828
|
};
|
|
2829
|
-
|
|
2829
|
+
script.onerror = (err) => {
|
|
2830
2830
|
console.error("\u274C Failed to load Datacap script", err);
|
|
2831
2831
|
};
|
|
2832
|
-
document.head.appendChild(
|
|
2832
|
+
document.head.appendChild(script);
|
|
2833
2833
|
} else {
|
|
2834
2834
|
}
|
|
2835
2835
|
}, []);
|
|
@@ -3209,21 +3209,31 @@ var PaxList = ({ listHeading = "Readers", ListItems, selectedPax, setSlectedPax,
|
|
|
3209
3209
|
|
|
3210
3210
|
// src/app/components/FractalTokenizer.tsx
|
|
3211
3211
|
import { useEffect as useEffect4 } from "react";
|
|
3212
|
-
function FractalTokenizerScript() {
|
|
3212
|
+
function FractalTokenizerScript({ onLoad }) {
|
|
3213
3213
|
useEffect4(() => {
|
|
3214
3214
|
const src = `${fractalGatewayUrl}tokenizer/static/js/fractal_tokenizer.js`;
|
|
3215
|
-
if (
|
|
3215
|
+
if (window.FractalTokenizer) {
|
|
3216
|
+
onLoad == null ? void 0 : onLoad();
|
|
3217
|
+
return;
|
|
3218
|
+
}
|
|
3219
|
+
const existing = document.querySelector(`script[src="${src}"]`);
|
|
3220
|
+
if (existing) {
|
|
3221
|
+
existing.addEventListener("load", () => onLoad == null ? void 0 : onLoad());
|
|
3222
|
+
return;
|
|
3223
|
+
}
|
|
3216
3224
|
const script = document.createElement("script");
|
|
3217
3225
|
script.src = src;
|
|
3218
3226
|
script.async = true;
|
|
3219
3227
|
script.onload = () => {
|
|
3220
3228
|
try {
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3229
|
+
if (typeof FractalTokenizer !== "undefined") {
|
|
3230
|
+
window.FractalTokenizer = FractalTokenizer;
|
|
3231
|
+
onLoad == null ? void 0 : onLoad();
|
|
3232
|
+
} else {
|
|
3233
|
+
console.error("FractalTokenizer not defined in global scope");
|
|
3224
3234
|
}
|
|
3225
3235
|
} catch (err) {
|
|
3226
|
-
console.error(
|
|
3236
|
+
console.error(err);
|
|
3227
3237
|
}
|
|
3228
3238
|
};
|
|
3229
3239
|
document.head.appendChild(script);
|
|
@@ -3237,8 +3247,12 @@ import { Fragment as Fragment10, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-
|
|
|
3237
3247
|
var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = false }) => {
|
|
3238
3248
|
const instanceRef = useRef(null);
|
|
3239
3249
|
useEffect5(() => {
|
|
3240
|
-
|
|
3241
|
-
|
|
3250
|
+
const Tokenizer = window.FractalTokenizer;
|
|
3251
|
+
if (!Tokenizer) {
|
|
3252
|
+
console.error("Tokenizer not available");
|
|
3253
|
+
return;
|
|
3254
|
+
}
|
|
3255
|
+
const instance = new Tokenizer({
|
|
3242
3256
|
styles: fractalStyles
|
|
3243
3257
|
});
|
|
3244
3258
|
instanceRef.current = instance;
|
|
@@ -3339,30 +3353,62 @@ var FractalFields_default = FractalFields;
|
|
|
3339
3353
|
|
|
3340
3354
|
// src/app/components/Datacap-Payment/DataCapScriptLoader.tsx
|
|
3341
3355
|
import { useEffect as useEffect6 } from "react";
|
|
3342
|
-
var
|
|
3343
|
-
|
|
3356
|
+
var DataCapScriptLoader = ({
|
|
3357
|
+
onReady,
|
|
3358
|
+
onError
|
|
3359
|
+
}) => {
|
|
3344
3360
|
useEffect6(() => {
|
|
3345
|
-
|
|
3361
|
+
const src = `${datacapUrl}/hosted`;
|
|
3362
|
+
if (window.__DATACAP_SCRIPT_LOADED__ && window.DatacapHostedWebToken) {
|
|
3363
|
+
onReady == null ? void 0 : onReady();
|
|
3346
3364
|
return;
|
|
3347
3365
|
}
|
|
3366
|
+
if (window.__DATACAP_SCRIPT_LOADING__) {
|
|
3367
|
+
const interval = setInterval(() => {
|
|
3368
|
+
if (window.DatacapHostedWebToken) {
|
|
3369
|
+
clearInterval(interval);
|
|
3370
|
+
onReady == null ? void 0 : onReady();
|
|
3371
|
+
}
|
|
3372
|
+
}, 100);
|
|
3373
|
+
return () => clearInterval(interval);
|
|
3374
|
+
}
|
|
3375
|
+
window.__DATACAP_SCRIPT_LOADING__ = true;
|
|
3348
3376
|
const existingScript = document.querySelector(
|
|
3349
|
-
`script[src="${
|
|
3377
|
+
`script[src="${src}"]`
|
|
3350
3378
|
);
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3379
|
+
if (existingScript) {
|
|
3380
|
+
waitForSDK();
|
|
3381
|
+
return;
|
|
3382
|
+
}
|
|
3383
|
+
const script = document.createElement("script");
|
|
3384
|
+
script.src = src;
|
|
3385
|
+
script.async = true;
|
|
3386
|
+
script.onload = () => {
|
|
3387
|
+
waitForSDK();
|
|
3388
|
+
};
|
|
3389
|
+
script.onerror = (err) => {
|
|
3390
|
+
console.error("Datacap script failed");
|
|
3391
|
+
window.__DATACAP_SCRIPT_LOADING__ = false;
|
|
3392
|
+
onError == null ? void 0 : onError(err);
|
|
3393
|
+
};
|
|
3394
|
+
document.head.appendChild(script);
|
|
3395
|
+
function waitForSDK() {
|
|
3396
|
+
let attempts = 0;
|
|
3397
|
+
const interval = setInterval(() => {
|
|
3398
|
+
attempts++;
|
|
3399
|
+
if (window.DatacapHostedWebToken) {
|
|
3400
|
+
clearInterval(interval);
|
|
3401
|
+
window.__DATACAP_SCRIPT_LOADING__ = false;
|
|
3402
|
+
window.__DATACAP_SCRIPT_LOADED__ = true;
|
|
3403
|
+
console.log("\u2705 Datacap SDK Ready");
|
|
3404
|
+
onReady == null ? void 0 : onReady();
|
|
3405
|
+
}
|
|
3406
|
+
if (attempts > 100) {
|
|
3407
|
+
clearInterval(interval);
|
|
3408
|
+
window.__DATACAP_SCRIPT_LOADING__ = false;
|
|
3409
|
+
onError == null ? void 0 : onError("SDK bootstrap timeout");
|
|
3410
|
+
}
|
|
3411
|
+
}, 100);
|
|
3366
3412
|
}
|
|
3367
3413
|
}, []);
|
|
3368
3414
|
return null;
|
|
@@ -3371,7 +3417,7 @@ var DataCapScriptLoader = () => {
|
|
|
3371
3417
|
// src/app/components/Datacap-Payment/DataCapFields.tsx
|
|
3372
3418
|
import { useEffect as useEffect7, useRef as useRef2, useState as useState3 } from "react";
|
|
3373
3419
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
3374
|
-
var
|
|
3420
|
+
var baseCSS = `
|
|
3375
3421
|
body {
|
|
3376
3422
|
margin: 0;
|
|
3377
3423
|
font-family: 'IBM Plex Mono', monospace !important;
|
|
@@ -3448,6 +3494,8 @@ var customCSS = `
|
|
|
3448
3494
|
}
|
|
3449
3495
|
|
|
3450
3496
|
`;
|
|
3497
|
+
var datacapInitializing = false;
|
|
3498
|
+
var datacapInitialized = false;
|
|
3451
3499
|
var DataCapFields = ({
|
|
3452
3500
|
isOpen,
|
|
3453
3501
|
tokenKey,
|
|
@@ -3460,6 +3508,7 @@ var DataCapFields = ({
|
|
|
3460
3508
|
const iframeId = "datacap-iframe";
|
|
3461
3509
|
const resolverRef = useRef2(null);
|
|
3462
3510
|
const [iframeReady, setIframeReady] = useState3(false);
|
|
3511
|
+
let customCSS = baseCSS;
|
|
3463
3512
|
useEffect7(() => {
|
|
3464
3513
|
if (!isOpen || !tokenKey) return;
|
|
3465
3514
|
if (isAddCard) {
|
|
@@ -3504,11 +3553,13 @@ var DataCapFields = ({
|
|
|
3504
3553
|
const waitForSDK = () => new Promise((resolve, reject) => {
|
|
3505
3554
|
let attempts = 0;
|
|
3506
3555
|
const interval = setInterval(() => {
|
|
3556
|
+
attempts++;
|
|
3507
3557
|
if (window.DatacapHostedWebToken) {
|
|
3508
3558
|
clearInterval(interval);
|
|
3559
|
+
console.log("\u2705 Datacap SDK Ready");
|
|
3509
3560
|
resolve();
|
|
3510
3561
|
}
|
|
3511
|
-
if (attempts
|
|
3562
|
+
if (attempts > 100) {
|
|
3512
3563
|
clearInterval(interval);
|
|
3513
3564
|
reject("Datacap SDK not loaded");
|
|
3514
3565
|
}
|
|
@@ -3516,10 +3567,28 @@ var DataCapFields = ({
|
|
|
3516
3567
|
});
|
|
3517
3568
|
await waitForSDK();
|
|
3518
3569
|
const sdk = window.DatacapHostedWebToken;
|
|
3570
|
+
if (datacapInitializing || datacapInitialized) {
|
|
3571
|
+
console.log("\u{1F7E1} Datacap already initializing/initialized");
|
|
3572
|
+
return;
|
|
3573
|
+
}
|
|
3574
|
+
datacapInitializing = true;
|
|
3575
|
+
const initTimeout = setTimeout(() => {
|
|
3576
|
+
var _a, _b;
|
|
3577
|
+
console.error("\u274C Datacap iframe load timeout");
|
|
3578
|
+
datacapInitializing = false;
|
|
3579
|
+
setLoader == null ? void 0 : setLoader(false);
|
|
3580
|
+
(_b = (_a = resolverRef.current) == null ? void 0 : _a.reject) == null ? void 0 : _b.call(
|
|
3581
|
+
_a,
|
|
3582
|
+
"Unable to load payment form"
|
|
3583
|
+
);
|
|
3584
|
+
}, 15e3);
|
|
3519
3585
|
sdk.init(
|
|
3520
3586
|
tokenKey,
|
|
3521
3587
|
iframeId,
|
|
3522
3588
|
(response) => {
|
|
3589
|
+
clearTimeout(initTimeout);
|
|
3590
|
+
datacapInitializing = false;
|
|
3591
|
+
datacapInitialized = true;
|
|
3523
3592
|
setLoader == null ? void 0 : setLoader(false);
|
|
3524
3593
|
if (!resolverRef.current) return;
|
|
3525
3594
|
if ((response == null ? void 0 : response.Error) || (response == null ? void 0 : response.Errors)) {
|
|
@@ -3533,6 +3602,9 @@ var DataCapFields = ({
|
|
|
3533
3602
|
);
|
|
3534
3603
|
};
|
|
3535
3604
|
initialize();
|
|
3605
|
+
return () => {
|
|
3606
|
+
resolverRef.current = null;
|
|
3607
|
+
};
|
|
3536
3608
|
}, [isOpen, tokenKey]);
|
|
3537
3609
|
useEffect7(() => {
|
|
3538
3610
|
const uniqueId = Math.random();
|
|
@@ -3540,7 +3612,15 @@ var DataCapFields = ({
|
|
|
3540
3612
|
return new Promise((resolve, reject) => {
|
|
3541
3613
|
setLoader == null ? void 0 : setLoader(true);
|
|
3542
3614
|
resolverRef.current = { resolve, reject };
|
|
3543
|
-
window.DatacapHostedWebToken
|
|
3615
|
+
if (!window.DatacapHostedWebToken) {
|
|
3616
|
+
reject("Datacap SDK unavailable");
|
|
3617
|
+
return;
|
|
3618
|
+
}
|
|
3619
|
+
try {
|
|
3620
|
+
window.DatacapHostedWebToken.requestToken();
|
|
3621
|
+
} catch (err) {
|
|
3622
|
+
reject(err);
|
|
3623
|
+
}
|
|
3544
3624
|
});
|
|
3545
3625
|
};
|
|
3546
3626
|
window.requestDcToken = fn;
|
|
@@ -3548,26 +3628,71 @@ var DataCapFields = ({
|
|
|
3548
3628
|
delete window.requestDcToken;
|
|
3549
3629
|
};
|
|
3550
3630
|
}, []);
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3631
|
+
useEffect7(() => {
|
|
3632
|
+
if (!isOpen) {
|
|
3633
|
+
datacapInitializing = false;
|
|
3634
|
+
datacapInitialized = false;
|
|
3635
|
+
}
|
|
3636
|
+
}, [isOpen]);
|
|
3637
|
+
return (
|
|
3638
|
+
// <iframe
|
|
3639
|
+
// id={iframeId}
|
|
3640
|
+
// onLoad={() => {
|
|
3641
|
+
// console.log("🟢 Iframe visually loaded");
|
|
3642
|
+
// setIframeReady(true);
|
|
3643
|
+
// setLoader?.(false);
|
|
3644
|
+
// }}
|
|
3645
|
+
// style={{
|
|
3646
|
+
// width: "100%",
|
|
3647
|
+
// height: `${height || "250px"}`,
|
|
3648
|
+
// border: "none",
|
|
3649
|
+
// opacity: iframeReady ? 1 : 0,
|
|
3650
|
+
// transition: "opacity 0.3s ease",
|
|
3651
|
+
// }}
|
|
3652
|
+
// />
|
|
3653
|
+
/* @__PURE__ */ jsx18(
|
|
3654
|
+
"iframe",
|
|
3655
|
+
{
|
|
3656
|
+
id: iframeId,
|
|
3657
|
+
onLoad: () => {
|
|
3658
|
+
console.log("\u{1F7E2} Iframe visually loaded");
|
|
3659
|
+
setIframeReady(true);
|
|
3660
|
+
setLoader == null ? void 0 : setLoader(false);
|
|
3661
|
+
},
|
|
3662
|
+
onError: () => {
|
|
3663
|
+
var _a, _b;
|
|
3664
|
+
console.error("\u274C iframe failed");
|
|
3665
|
+
setLoader == null ? void 0 : setLoader(false);
|
|
3666
|
+
(_b = (_a = resolverRef.current) == null ? void 0 : _a.reject) == null ? void 0 : _b.call(
|
|
3667
|
+
_a,
|
|
3668
|
+
"Payment form failed to load"
|
|
3669
|
+
);
|
|
3670
|
+
},
|
|
3671
|
+
style: {
|
|
3672
|
+
width: "100%",
|
|
3673
|
+
height: `${height || "250px"}`,
|
|
3674
|
+
border: "none",
|
|
3675
|
+
opacity: iframeReady ? 1 : 0,
|
|
3676
|
+
transition: "opacity 0.3s ease"
|
|
3677
|
+
}
|
|
3566
3678
|
}
|
|
3567
|
-
|
|
3679
|
+
)
|
|
3568
3680
|
);
|
|
3569
3681
|
};
|
|
3570
3682
|
|
|
3683
|
+
// src/app/utils/Constant.js
|
|
3684
|
+
var PaymentMethodKeys = {
|
|
3685
|
+
PROPAYKEY: "25",
|
|
3686
|
+
PAYARCKEY: "26",
|
|
3687
|
+
STRIPEKEYCC: "27",
|
|
3688
|
+
PAYRIXKEY: "28",
|
|
3689
|
+
SKYFIACHKEY: "29",
|
|
3690
|
+
JUSTIFIKEY: "30",
|
|
3691
|
+
INFINICEPTKEY: "31",
|
|
3692
|
+
FRACTALKEY: "32"
|
|
3693
|
+
};
|
|
3694
|
+
var DcLoadingError = "Something went wrong while loading the payment form. Please try again after some time.";
|
|
3695
|
+
|
|
3571
3696
|
// src/app/components/Charge/GetPaymentPage.tsx
|
|
3572
3697
|
import { Fragment as Fragment11, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3573
3698
|
function GetPaymentPage(props) {
|
|
@@ -3590,6 +3715,7 @@ function GetPaymentPage(props) {
|
|
|
3590
3715
|
const [errorBankConsent, setErrorBankConsent] = useState4("");
|
|
3591
3716
|
const [saveACHConsent1, setSaveACHConsent1] = useState4(false);
|
|
3592
3717
|
const [errorBankConsentOther, setErrorBankConsentOther] = useState4("");
|
|
3718
|
+
const [isTokenizerReady, setTokenizerReady] = useState4(false);
|
|
3593
3719
|
const fractalpayClientKey = props.merchantPublicKey;
|
|
3594
3720
|
let mastercard2 = S3Url + "widget/mc-img.svg";
|
|
3595
3721
|
let visa2 = S3Url + "widget/visa-img.svg";
|
|
@@ -4294,8 +4420,20 @@ function GetPaymentPage(props) {
|
|
|
4294
4420
|
}, []);
|
|
4295
4421
|
return /* @__PURE__ */ jsxs11(Fragment11, { children: [
|
|
4296
4422
|
/* @__PURE__ */ jsx19(DataScript, {}),
|
|
4297
|
-
/* @__PURE__ */ jsx19(FractalTokenizerScript, {}),
|
|
4298
|
-
/* @__PURE__ */ jsx19(
|
|
4423
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx19(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
4424
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx19(
|
|
4425
|
+
DataCapScriptLoader,
|
|
4426
|
+
{
|
|
4427
|
+
onReady: () => {
|
|
4428
|
+
console.log("SDK Ready");
|
|
4429
|
+
},
|
|
4430
|
+
onError: (err) => {
|
|
4431
|
+
setLoading(false);
|
|
4432
|
+
setLoadingIframe(false);
|
|
4433
|
+
setError(DcLoadingError);
|
|
4434
|
+
}
|
|
4435
|
+
}
|
|
4436
|
+
),
|
|
4299
4437
|
/* @__PURE__ */ jsx19(Chargewidgetstyles, {}),
|
|
4300
4438
|
/* @__PURE__ */ jsx19(CardBankRadioStyles, {}),
|
|
4301
4439
|
/* @__PURE__ */ jsxs11(Fragment11, { children: [
|
|
@@ -4499,7 +4637,7 @@ function GetPaymentPage(props) {
|
|
|
4499
4637
|
] }),
|
|
4500
4638
|
/* @__PURE__ */ jsxs11("div", { className: "form-group", children: [
|
|
4501
4639
|
/* @__PURE__ */ jsx19("label", { children: "CARD NUMBER" }),
|
|
4502
|
-
/* @__PURE__ */ jsx19("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx19(
|
|
4640
|
+
/* @__PURE__ */ jsx19("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx19(
|
|
4503
4641
|
FractalFields_default,
|
|
4504
4642
|
{
|
|
4505
4643
|
fractalStyles,
|
|
@@ -4853,6 +4991,7 @@ function PreAuthPayment(_a) {
|
|
|
4853
4991
|
const [activeinCard, setActiveinCard] = useState5("form");
|
|
4854
4992
|
const fractalpayClientKey = props.merchantPublicKey;
|
|
4855
4993
|
const [selectedReader, setSelectedReader] = useState5(void 0);
|
|
4994
|
+
const [isTokenizerReady, setTokenizerReady] = useState5(false);
|
|
4856
4995
|
const tokenizerRef = useRef4(null);
|
|
4857
4996
|
const fractalStyles = {
|
|
4858
4997
|
input: {
|
|
@@ -5389,10 +5528,22 @@ function PreAuthPayment(_a) {
|
|
|
5389
5528
|
}, []);
|
|
5390
5529
|
return /* @__PURE__ */ jsxs12(Fragment12, { children: [
|
|
5391
5530
|
/* @__PURE__ */ jsx20(DataScript, {}),
|
|
5392
|
-
/* @__PURE__ */ jsx20(FractalTokenizerScript, {}),
|
|
5531
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx20(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
5532
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx20(
|
|
5533
|
+
DataCapScriptLoader,
|
|
5534
|
+
{
|
|
5535
|
+
onReady: () => {
|
|
5536
|
+
console.log("SDK Ready");
|
|
5537
|
+
},
|
|
5538
|
+
onError: (err) => {
|
|
5539
|
+
setLoading(false);
|
|
5540
|
+
setLoadingIframe(false);
|
|
5541
|
+
setError(DcLoadingError);
|
|
5542
|
+
}
|
|
5543
|
+
}
|
|
5544
|
+
),
|
|
5393
5545
|
/* @__PURE__ */ jsx20(Chargewidgetstyles, {}),
|
|
5394
5546
|
/* @__PURE__ */ jsx20(CardBankRadioStyles, {}),
|
|
5395
|
-
/* @__PURE__ */ jsx20(DataCapScriptLoader, {}),
|
|
5396
5547
|
/* @__PURE__ */ jsxs12(Fragment12, { children: [
|
|
5397
5548
|
showButton && /* @__PURE__ */ jsx20(
|
|
5398
5549
|
"button",
|
|
@@ -5545,7 +5696,7 @@ function PreAuthPayment(_a) {
|
|
|
5545
5696
|
] }),
|
|
5546
5697
|
/* @__PURE__ */ jsxs12("div", { className: "form-group", children: [
|
|
5547
5698
|
/* @__PURE__ */ jsx20("label", { children: "CARD NUMBER" }),
|
|
5548
|
-
/* @__PURE__ */ jsx20("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx20(
|
|
5699
|
+
/* @__PURE__ */ jsx20("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx20(
|
|
5549
5700
|
FractalFields_default,
|
|
5550
5701
|
{
|
|
5551
5702
|
fractalStyles,
|
|
@@ -6137,6 +6288,7 @@ function AddCardEasyPay(props) {
|
|
|
6137
6288
|
const exp_year_ref = useRef5(null);
|
|
6138
6289
|
const cvv_ref = useRef5(null);
|
|
6139
6290
|
const name_ref = useRef5(null);
|
|
6291
|
+
const [isTokenizerReady, setTokenizerReady] = useState6(false);
|
|
6140
6292
|
const tokenizerRef = useRef5(null);
|
|
6141
6293
|
const fractalStyles = {
|
|
6142
6294
|
input: {
|
|
@@ -6409,8 +6561,20 @@ function AddCardEasyPay(props) {
|
|
|
6409
6561
|
}, []);
|
|
6410
6562
|
return /* @__PURE__ */ jsxs14(Fragment14, { children: [
|
|
6411
6563
|
/* @__PURE__ */ jsx24(DataScript, {}),
|
|
6412
|
-
/* @__PURE__ */ jsx24(FractalTokenizerScript, {}),
|
|
6413
|
-
/* @__PURE__ */ jsx24(
|
|
6564
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx24(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
6565
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx24(
|
|
6566
|
+
DataCapScriptLoader,
|
|
6567
|
+
{
|
|
6568
|
+
onReady: () => {
|
|
6569
|
+
console.log("SDK Ready");
|
|
6570
|
+
},
|
|
6571
|
+
onError: (err) => {
|
|
6572
|
+
setLoading(false);
|
|
6573
|
+
setLoadingIframe(false);
|
|
6574
|
+
setError(DcLoadingError);
|
|
6575
|
+
}
|
|
6576
|
+
}
|
|
6577
|
+
),
|
|
6414
6578
|
/* @__PURE__ */ jsx24(AddCardStyle, {}),
|
|
6415
6579
|
/* @__PURE__ */ jsx24(Loader_default, { loading: loading || loadingIframe }),
|
|
6416
6580
|
error && /* @__PURE__ */ jsx24("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx24(ErrorCardMessage_default, { error, onClose: handleClose }) }),
|
|
@@ -6439,7 +6603,7 @@ function AddCardEasyPay(props) {
|
|
|
6439
6603
|
/* @__PURE__ */ jsxs14("div", { style: { maxHeight: "350px", minHeight: "0" }, className: "card-scrl", children: [
|
|
6440
6604
|
/* @__PURE__ */ jsxs14("div", { className: "form-group", style: { marginTop: "0", marginBottom: "10px" }, children: [
|
|
6441
6605
|
/* @__PURE__ */ jsx24("label", { htmlFor: "cardNumber", children: "Card Number" }),
|
|
6442
|
-
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx24(
|
|
6606
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx24(
|
|
6443
6607
|
FractalFields_default,
|
|
6444
6608
|
{
|
|
6445
6609
|
fractalStyles,
|
|
@@ -6574,18 +6738,6 @@ function AddCardEasyPay(props) {
|
|
|
6574
6738
|
import { useEffect as useEffect12, useRef as useRef7, useState as useState7 } from "react";
|
|
6575
6739
|
import axios6 from "axios";
|
|
6576
6740
|
|
|
6577
|
-
// src/app/utils/Constant.js
|
|
6578
|
-
var PaymentMethodKeys = {
|
|
6579
|
-
PROPAYKEY: "25",
|
|
6580
|
-
PAYARCKEY: "26",
|
|
6581
|
-
STRIPEKEYCC: "27",
|
|
6582
|
-
PAYRIXKEY: "28",
|
|
6583
|
-
SKYFIACHKEY: "29",
|
|
6584
|
-
JUSTIFIKEY: "30",
|
|
6585
|
-
INFINICEPTKEY: "31",
|
|
6586
|
-
FRACTALKEY: "32"
|
|
6587
|
-
};
|
|
6588
|
-
|
|
6589
6741
|
// src/app/components/AddCard/AddCardSkyStyle.tsx
|
|
6590
6742
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
6591
6743
|
function AddCardSkyStyle({}) {
|
|
@@ -6793,8 +6945,12 @@ import { Fragment as Fragment15, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-
|
|
|
6793
6945
|
var FractalFieldsAddCardSky = ({ fractalStyles, tokenizerRef, extraInputs }) => {
|
|
6794
6946
|
const instanceRef = useRef6(null);
|
|
6795
6947
|
useEffect11(() => {
|
|
6796
|
-
|
|
6797
|
-
|
|
6948
|
+
const Tokenizer = window.FractalTokenizer;
|
|
6949
|
+
if (!Tokenizer) {
|
|
6950
|
+
console.error("Tokenizer not available");
|
|
6951
|
+
return;
|
|
6952
|
+
}
|
|
6953
|
+
const instance = new Tokenizer({
|
|
6798
6954
|
styles: fractalStyles
|
|
6799
6955
|
});
|
|
6800
6956
|
instanceRef.current = instance;
|
|
@@ -6879,7 +7035,7 @@ var FractalFieldsAddCardSky_default = FractalFieldsAddCardSky;
|
|
|
6879
7035
|
|
|
6880
7036
|
// src/app/components/AddCard/AddCardSky.tsx
|
|
6881
7037
|
import { Fragment as Fragment16, jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6882
|
-
function CardOnFile({ session_token, callback, isloading, onCancel, showChecks, merchantName, signCheckbox, checkedSignCheckbox, onCheckSign, cancelbtnClass, savebtnClass, inputClass, isDual, customCSS
|
|
7038
|
+
function CardOnFile({ session_token, callback, isloading, onCancel, showChecks, merchantName, signCheckbox, checkedSignCheckbox, onCheckSign, cancelbtnClass, savebtnClass, inputClass, isDual, customCSS, height }) {
|
|
6883
7039
|
var _a, _b;
|
|
6884
7040
|
const [loading, setLoading] = useState7(false);
|
|
6885
7041
|
const [errorIframe, setErrorIframe] = useState7("");
|
|
@@ -6890,10 +7046,11 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
6890
7046
|
const [error, setError] = useState7("");
|
|
6891
7047
|
const showLoader = () => setLoading(true);
|
|
6892
7048
|
const hideLoader = () => setLoading(false);
|
|
6893
|
-
const [passFee, setPassFee] = useState7(
|
|
7049
|
+
const [passFee, setPassFee] = useState7(null);
|
|
6894
7050
|
const [paymentGateway, setPaymentGateway] = useState7();
|
|
6895
7051
|
const [dcToken, setDCToken] = useState7();
|
|
6896
7052
|
const tokenizerRef = useRef7(null);
|
|
7053
|
+
const [isTokenizerReady, setTokenizerReady] = useState7(false);
|
|
6897
7054
|
const fractalStyles = {
|
|
6898
7055
|
input: {
|
|
6899
7056
|
"font-family": "'Inter', sans-serif",
|
|
@@ -7156,8 +7313,20 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7156
7313
|
}, []);
|
|
7157
7314
|
return /* @__PURE__ */ jsxs16(Fragment16, { children: [
|
|
7158
7315
|
/* @__PURE__ */ jsx27(DataScript, {}),
|
|
7159
|
-
/* @__PURE__ */ jsx27(FractalTokenizerScript, {}),
|
|
7160
|
-
/* @__PURE__ */ jsx27(
|
|
7316
|
+
paymentGateway == 32 && /* @__PURE__ */ jsx27(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
7317
|
+
paymentGateway == 31 && /* @__PURE__ */ jsx27(
|
|
7318
|
+
DataCapScriptLoader,
|
|
7319
|
+
{
|
|
7320
|
+
onReady: () => {
|
|
7321
|
+
console.log("SDK Ready");
|
|
7322
|
+
},
|
|
7323
|
+
onError: (err) => {
|
|
7324
|
+
setLoading(false);
|
|
7325
|
+
setLoadingIframe(false);
|
|
7326
|
+
setError(DcLoadingError);
|
|
7327
|
+
}
|
|
7328
|
+
}
|
|
7329
|
+
),
|
|
7161
7330
|
/* @__PURE__ */ jsx27(AddCardSkyStyle, {}),
|
|
7162
7331
|
/* @__PURE__ */ jsx27(Loader_default, { loading: loading || isloading || loadingIframe }),
|
|
7163
7332
|
error && /* @__PURE__ */ jsx27("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx27(ErrorCardMessage_default, { error, onClose: handleClose }) }),
|
|
@@ -7218,7 +7387,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7218
7387
|
(cardError == null ? void 0 : cardError.lastName) && /* @__PURE__ */ jsx27("small", { className: "error", children: cardError == null ? void 0 : cardError.lastName })
|
|
7219
7388
|
] })
|
|
7220
7389
|
] }),
|
|
7221
|
-
/* @__PURE__ */ jsx27(
|
|
7390
|
+
isTokenizerReady && /* @__PURE__ */ jsx27(
|
|
7222
7391
|
FractalFieldsAddCardSky_default,
|
|
7223
7392
|
{
|
|
7224
7393
|
fractalStyles,
|
|
@@ -7250,7 +7419,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7250
7419
|
type: "checkbox",
|
|
7251
7420
|
id: "pass_fee",
|
|
7252
7421
|
className: "toggle-checkbox",
|
|
7253
|
-
checked: passFee,
|
|
7422
|
+
checked: passFee != null ? passFee : false,
|
|
7254
7423
|
onChange: (e) => {
|
|
7255
7424
|
setPassFee(e.target.checked);
|
|
7256
7425
|
}
|
|
@@ -7393,7 +7562,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7393
7562
|
isOpen: true,
|
|
7394
7563
|
tokenKey: dcToken,
|
|
7395
7564
|
setLoader: setLoadingIframe,
|
|
7396
|
-
customCSS
|
|
7565
|
+
customCSS,
|
|
7397
7566
|
height
|
|
7398
7567
|
}
|
|
7399
7568
|
) }),
|
|
@@ -7422,7 +7591,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7422
7591
|
type: "checkbox",
|
|
7423
7592
|
id: "pass_fee",
|
|
7424
7593
|
className: "toggle-checkbox",
|
|
7425
|
-
checked: passFee,
|
|
7594
|
+
checked: passFee != null ? passFee : false,
|
|
7426
7595
|
onChange: (e) => {
|
|
7427
7596
|
setPassFee(e.target.checked);
|
|
7428
7597
|
}
|
|
@@ -7567,6 +7736,7 @@ function PartialPayment(props) {
|
|
|
7567
7736
|
const [errorBankConsent, setErrorBankConsent] = useState8("");
|
|
7568
7737
|
const [saveACHConsent1, setSaveACHConsent1] = useState8(false);
|
|
7569
7738
|
const [errorBankConsentOther, setErrorBankConsentOther] = useState8("");
|
|
7739
|
+
const [isTokenizerReady, setTokenizerReady] = useState8(false);
|
|
7570
7740
|
const tokenizerRef = useRef8(null);
|
|
7571
7741
|
const fractalStyles = {
|
|
7572
7742
|
input: {
|
|
@@ -8280,8 +8450,20 @@ function PartialPayment(props) {
|
|
|
8280
8450
|
/* @__PURE__ */ jsx28(DataScript, {}),
|
|
8281
8451
|
/* @__PURE__ */ jsx28(Chargewidgetstyles, {}),
|
|
8282
8452
|
/* @__PURE__ */ jsx28(CardBankRadioStyles, {}),
|
|
8283
|
-
/* @__PURE__ */ jsx28(FractalTokenizerScript, {}),
|
|
8284
|
-
/* @__PURE__ */ jsx28(
|
|
8453
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx28(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
8454
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 31 && /* @__PURE__ */ jsx28(
|
|
8455
|
+
DataCapScriptLoader,
|
|
8456
|
+
{
|
|
8457
|
+
onReady: () => {
|
|
8458
|
+
console.log("SDK Ready");
|
|
8459
|
+
},
|
|
8460
|
+
onError: (err) => {
|
|
8461
|
+
setLoading(false);
|
|
8462
|
+
setLoadingIframe(false);
|
|
8463
|
+
setError(DcLoadingError);
|
|
8464
|
+
}
|
|
8465
|
+
}
|
|
8466
|
+
),
|
|
8285
8467
|
/* @__PURE__ */ jsxs17(Fragment17, { children: [
|
|
8286
8468
|
/* @__PURE__ */ jsx28("button", { ref: buttonRef, style: { display: "none" }, className: "paymentBtn", onClick: handleShow, children: "Pay" }),
|
|
8287
8469
|
/* @__PURE__ */ jsxs17(
|
|
@@ -8488,7 +8670,7 @@ function PartialPayment(props) {
|
|
|
8488
8670
|
] }),
|
|
8489
8671
|
/* @__PURE__ */ jsxs17("div", { className: "form-group", children: [
|
|
8490
8672
|
/* @__PURE__ */ jsx28("label", { children: "CARD NUMBER" }),
|
|
8491
|
-
/* @__PURE__ */ jsx28("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx28(
|
|
8673
|
+
/* @__PURE__ */ jsx28("div", { className: "toggle-num-wrapper", children: show && (paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx28(
|
|
8492
8674
|
FractalFields_default,
|
|
8493
8675
|
{
|
|
8494
8676
|
fractalStyles,
|
|
@@ -9930,7 +10112,7 @@ var ErrorCardOverlay_default = ErrorCardOverlay;
|
|
|
9930
10112
|
|
|
9931
10113
|
// src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
|
|
9932
10114
|
import { Fragment as Fragment19, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
9933
|
-
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
|
|
10115
|
+
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 }) => {
|
|
9934
10116
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
9935
10117
|
const hasRunRef = useRef10(false);
|
|
9936
10118
|
const cardFormRef = useRef10(null);
|
|
@@ -9978,6 +10160,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9978
10160
|
const [isBankConsentChecked, setIsBankConsentChecked] = useState10(false);
|
|
9979
10161
|
const [errorBankConsent, setErrorBankConsent] = useState10("");
|
|
9980
10162
|
const [errorBankConsentOther, setErrorBankConsentOther] = useState10("");
|
|
10163
|
+
const [isTokenizerReady, setTokenizerReady] = useState10(false);
|
|
9981
10164
|
let mastercard2 = S3Url + "widget/mc-img.svg";
|
|
9982
10165
|
let visa2 = S3Url + "widget/visa-img.svg";
|
|
9983
10166
|
let americanexp2 = S3Url + "widget/ae-img.svg";
|
|
@@ -10201,11 +10384,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10201
10384
|
return;
|
|
10202
10385
|
} else {
|
|
10203
10386
|
if (isPreAuth) {
|
|
10204
|
-
handlePreAuth({
|
|
10387
|
+
handlePreAuth(__spreadValues({
|
|
10205
10388
|
Token: tokenizeData,
|
|
10206
10389
|
postalCode: cardData == null ? void 0 : cardData.zipCode,
|
|
10207
10390
|
typeoftoken: "token"
|
|
10208
|
-
});
|
|
10391
|
+
}, intentid && { stripe_3ds_auth_id: intentid }));
|
|
10209
10392
|
} else {
|
|
10210
10393
|
handleCharge(__spreadValues({
|
|
10211
10394
|
Token: tokenizeData,
|
|
@@ -11039,6 +11222,20 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11039
11222
|
}
|
|
11040
11223
|
return /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11041
11224
|
(initialLoader || !onLoad) && /* @__PURE__ */ jsx34(Loader_default, { intensity: "dark", loading: initialLoader || !onLoad }),
|
|
11225
|
+
paymentGateway == 32 && /* @__PURE__ */ jsx34(FractalTokenizerScript, { onLoad: () => setTokenizerReady(true) }),
|
|
11226
|
+
paymentGateway == 31 && /* @__PURE__ */ jsx34(
|
|
11227
|
+
DataCapScriptLoader,
|
|
11228
|
+
{
|
|
11229
|
+
onReady: () => {
|
|
11230
|
+
console.log("SDK Ready");
|
|
11231
|
+
},
|
|
11232
|
+
onError: (err) => {
|
|
11233
|
+
setLoading(false);
|
|
11234
|
+
setLoadingIframe(false);
|
|
11235
|
+
setError(DcLoadingError);
|
|
11236
|
+
}
|
|
11237
|
+
}
|
|
11238
|
+
),
|
|
11042
11239
|
error && /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(ErrorCardOverlay_default, { error, onClose: handleClose, autoTrigger }) }),
|
|
11043
11240
|
errorIframe && /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(ErrorCardOverlay_default, { error: errorIframe, onClose: () => {
|
|
11044
11241
|
setErrorIframe("");
|
|
@@ -11188,7 +11385,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11188
11385
|
] }),
|
|
11189
11386
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11190
11387
|
/* @__PURE__ */ jsx34("label", { htmlFor: "cardNumber", children: "CARD NUMBER" }),
|
|
11191
|
-
/* @__PURE__ */ jsx34("div", { className: "toggle-num-wrapper toggle-num-wrapper-new", children: (show || autoTrigger) && paymentGateway === 32 && /* @__PURE__ */ jsx34(
|
|
11388
|
+
/* @__PURE__ */ jsx34("div", { className: "toggle-num-wrapper toggle-num-wrapper-new", children: (show || autoTrigger) && paymentGateway === 32 && isTokenizerReady && /* @__PURE__ */ jsx34(
|
|
11192
11389
|
FractalFields_default,
|
|
11193
11390
|
{
|
|
11194
11391
|
fractalStyles,
|
|
@@ -11275,7 +11472,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11275
11472
|
tokenKey: dcToken,
|
|
11276
11473
|
setLoader: activeinCard === "form" ? setLoadingIframe : null,
|
|
11277
11474
|
isEmbedded: onSubmit ? true : false,
|
|
11278
|
-
customCSS
|
|
11475
|
+
customCSS
|
|
11279
11476
|
}
|
|
11280
11477
|
) }),
|
|
11281
11478
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
@@ -11533,7 +11730,7 @@ var PaymentWidget = ({
|
|
|
11533
11730
|
isPartial,
|
|
11534
11731
|
bankSurcharge,
|
|
11535
11732
|
partialRef,
|
|
11536
|
-
customCSS
|
|
11733
|
+
customCSS,
|
|
11537
11734
|
disableSubmitBtn = false
|
|
11538
11735
|
}) => {
|
|
11539
11736
|
const [show, setShow] = useState11(autoTrigger || false);
|
|
@@ -11565,7 +11762,7 @@ var PaymentWidget = ({
|
|
|
11565
11762
|
isPartial,
|
|
11566
11763
|
bankSurcharge,
|
|
11567
11764
|
partialRef,
|
|
11568
|
-
customCSS
|
|
11765
|
+
customCSS,
|
|
11569
11766
|
disableSubmitBtn
|
|
11570
11767
|
}),
|
|
11571
11768
|
[
|
|
@@ -11631,11 +11828,9 @@ var PaymentWidget = ({
|
|
|
11631
11828
|
return /* @__PURE__ */ jsxs21(Fragment20, { children: [
|
|
11632
11829
|
/* @__PURE__ */ jsx35("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
|
|
11633
11830
|
/* @__PURE__ */ jsx35(DataScript, {}),
|
|
11634
|
-
/* @__PURE__ */ jsx35(FractalTokenizerScript, {}),
|
|
11635
11831
|
/* @__PURE__ */ jsx35(SkyChargewidgetstyles, {}),
|
|
11636
11832
|
/* @__PURE__ */ jsx35(CardBankRadioStyles, {}),
|
|
11637
11833
|
/* @__PURE__ */ jsx35(CustomModal2styles_default, {}),
|
|
11638
|
-
/* @__PURE__ */ jsx35(DataCapScriptLoader, {}),
|
|
11639
11834
|
!autoTrigger && /* @__PURE__ */ jsxs21("button", { className: submitBtnClass || "paymentBtn", disabled: disableSubmitBtn, onClick: () => setShow(true), children: [
|
|
11640
11835
|
submitBtnText,
|
|
11641
11836
|
submitBtnIcon
|
|
@@ -12006,18 +12201,18 @@ var ApplePayScriptLoader = () => {
|
|
|
12006
12201
|
`script[src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js"]`
|
|
12007
12202
|
);
|
|
12008
12203
|
if (!existingScript) {
|
|
12009
|
-
const
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
|
|
12204
|
+
const script = document.createElement("script");
|
|
12205
|
+
script.src = "https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js";
|
|
12206
|
+
script.async = true;
|
|
12207
|
+
script.onload = () => {
|
|
12013
12208
|
console.log("\u2705 Apple Pay script loaded");
|
|
12014
12209
|
applePayScriptLoaded = true;
|
|
12015
12210
|
console.log("ApplePaySession:", window.ApplePaySession);
|
|
12016
12211
|
};
|
|
12017
|
-
|
|
12212
|
+
script.onerror = (err) => {
|
|
12018
12213
|
console.error("\u274C Apple Pay script failed", err);
|
|
12019
12214
|
};
|
|
12020
|
-
document.head.appendChild(
|
|
12215
|
+
document.head.appendChild(script);
|
|
12021
12216
|
} else {
|
|
12022
12217
|
applePayScriptLoaded = true;
|
|
12023
12218
|
}
|
|
@@ -12049,7 +12244,7 @@ var EmbeddedCheckout = ({
|
|
|
12049
12244
|
partialRef,
|
|
12050
12245
|
onSubmit,
|
|
12051
12246
|
onLoad,
|
|
12052
|
-
customCSS
|
|
12247
|
+
customCSS
|
|
12053
12248
|
}) => {
|
|
12054
12249
|
const [show, setShow] = useState12(false);
|
|
12055
12250
|
const [loading, setLoading] = useState12(false);
|
|
@@ -12057,6 +12252,7 @@ var EmbeddedCheckout = ({
|
|
|
12057
12252
|
});
|
|
12058
12253
|
const [orderGuid, setOrderGuid] = useState12(null);
|
|
12059
12254
|
const [remainingAmount, setRemainingAmount] = useState12(null);
|
|
12255
|
+
const [isTokenizerReady, setTokenizerReady] = useState12(false);
|
|
12060
12256
|
const initialCommonProps = useMemo2(
|
|
12061
12257
|
() => ({
|
|
12062
12258
|
amount,
|
|
@@ -12155,13 +12351,11 @@ var EmbeddedCheckout = ({
|
|
|
12155
12351
|
return /* @__PURE__ */ jsxs22(Fragment21, { children: [
|
|
12156
12352
|
/* @__PURE__ */ jsx37("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
|
|
12157
12353
|
/* @__PURE__ */ jsx37(DataScript, {}),
|
|
12158
|
-
/* @__PURE__ */ jsx37(FractalTokenizerScript, {}),
|
|
12159
12354
|
/* @__PURE__ */ jsx37(SkyChargewidgetstyles, {}),
|
|
12160
12355
|
/* @__PURE__ */ jsx37(CardBankRadioStyles, {}),
|
|
12161
12356
|
/* @__PURE__ */ jsx37(CustomModal2styles_default, {}),
|
|
12162
|
-
/* @__PURE__ */ jsx37(DataCapScriptLoader, {}),
|
|
12163
12357
|
/* @__PURE__ */ jsx37(ApplePayScriptLoader, {}),
|
|
12164
|
-
/* @__PURE__ */ jsx37(EmbeddedCheckoutStyles, { extraCustomCSS:
|
|
12358
|
+
/* @__PURE__ */ jsx37(EmbeddedCheckoutStyles, { extraCustomCSS: customCSS }),
|
|
12165
12359
|
!autoTrigger && /* @__PURE__ */ jsxs22("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
|
|
12166
12360
|
submitBtnText,
|
|
12167
12361
|
submitBtnIcon
|