@fractalpay/fractalpay-next-dev 0.0.289 → 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 +322 -133
- 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";
|
|
@@ -3929,6 +4055,7 @@ function GetPaymentPage(props) {
|
|
|
3929
4055
|
} catch (err) {
|
|
3930
4056
|
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.");
|
|
3931
4057
|
setLoading2(false);
|
|
4058
|
+
return;
|
|
3932
4059
|
}
|
|
3933
4060
|
console.log(tokenizeData, "tokenizeData");
|
|
3934
4061
|
const reqData = JSON.stringify(__spreadProps(__spreadValues({}, tokenizeData), {
|
|
@@ -4293,8 +4420,20 @@ function GetPaymentPage(props) {
|
|
|
4293
4420
|
}, []);
|
|
4294
4421
|
return /* @__PURE__ */ jsxs11(Fragment11, { children: [
|
|
4295
4422
|
/* @__PURE__ */ jsx19(DataScript, {}),
|
|
4296
|
-
/* @__PURE__ */ jsx19(FractalTokenizerScript, {}),
|
|
4297
|
-
/* @__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
|
+
),
|
|
4298
4437
|
/* @__PURE__ */ jsx19(Chargewidgetstyles, {}),
|
|
4299
4438
|
/* @__PURE__ */ jsx19(CardBankRadioStyles, {}),
|
|
4300
4439
|
/* @__PURE__ */ jsxs11(Fragment11, { children: [
|
|
@@ -4498,7 +4637,7 @@ function GetPaymentPage(props) {
|
|
|
4498
4637
|
] }),
|
|
4499
4638
|
/* @__PURE__ */ jsxs11("div", { className: "form-group", children: [
|
|
4500
4639
|
/* @__PURE__ */ jsx19("label", { children: "CARD NUMBER" }),
|
|
4501
|
-
/* @__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(
|
|
4502
4641
|
FractalFields_default,
|
|
4503
4642
|
{
|
|
4504
4643
|
fractalStyles,
|
|
@@ -4852,6 +4991,7 @@ function PreAuthPayment(_a) {
|
|
|
4852
4991
|
const [activeinCard, setActiveinCard] = useState5("form");
|
|
4853
4992
|
const fractalpayClientKey = props.merchantPublicKey;
|
|
4854
4993
|
const [selectedReader, setSelectedReader] = useState5(void 0);
|
|
4994
|
+
const [isTokenizerReady, setTokenizerReady] = useState5(false);
|
|
4855
4995
|
const tokenizerRef = useRef4(null);
|
|
4856
4996
|
const fractalStyles = {
|
|
4857
4997
|
input: {
|
|
@@ -5388,10 +5528,22 @@ function PreAuthPayment(_a) {
|
|
|
5388
5528
|
}, []);
|
|
5389
5529
|
return /* @__PURE__ */ jsxs12(Fragment12, { children: [
|
|
5390
5530
|
/* @__PURE__ */ jsx20(DataScript, {}),
|
|
5391
|
-
/* @__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
|
+
),
|
|
5392
5545
|
/* @__PURE__ */ jsx20(Chargewidgetstyles, {}),
|
|
5393
5546
|
/* @__PURE__ */ jsx20(CardBankRadioStyles, {}),
|
|
5394
|
-
/* @__PURE__ */ jsx20(DataCapScriptLoader, {}),
|
|
5395
5547
|
/* @__PURE__ */ jsxs12(Fragment12, { children: [
|
|
5396
5548
|
showButton && /* @__PURE__ */ jsx20(
|
|
5397
5549
|
"button",
|
|
@@ -5544,7 +5696,7 @@ function PreAuthPayment(_a) {
|
|
|
5544
5696
|
] }),
|
|
5545
5697
|
/* @__PURE__ */ jsxs12("div", { className: "form-group", children: [
|
|
5546
5698
|
/* @__PURE__ */ jsx20("label", { children: "CARD NUMBER" }),
|
|
5547
|
-
/* @__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(
|
|
5548
5700
|
FractalFields_default,
|
|
5549
5701
|
{
|
|
5550
5702
|
fractalStyles,
|
|
@@ -6136,6 +6288,7 @@ function AddCardEasyPay(props) {
|
|
|
6136
6288
|
const exp_year_ref = useRef5(null);
|
|
6137
6289
|
const cvv_ref = useRef5(null);
|
|
6138
6290
|
const name_ref = useRef5(null);
|
|
6291
|
+
const [isTokenizerReady, setTokenizerReady] = useState6(false);
|
|
6139
6292
|
const tokenizerRef = useRef5(null);
|
|
6140
6293
|
const fractalStyles = {
|
|
6141
6294
|
input: {
|
|
@@ -6408,8 +6561,20 @@ function AddCardEasyPay(props) {
|
|
|
6408
6561
|
}, []);
|
|
6409
6562
|
return /* @__PURE__ */ jsxs14(Fragment14, { children: [
|
|
6410
6563
|
/* @__PURE__ */ jsx24(DataScript, {}),
|
|
6411
|
-
/* @__PURE__ */ jsx24(FractalTokenizerScript, {}),
|
|
6412
|
-
/* @__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
|
+
),
|
|
6413
6578
|
/* @__PURE__ */ jsx24(AddCardStyle, {}),
|
|
6414
6579
|
/* @__PURE__ */ jsx24(Loader_default, { loading: loading || loadingIframe }),
|
|
6415
6580
|
error && /* @__PURE__ */ jsx24("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx24(ErrorCardMessage_default, { error, onClose: handleClose }) }),
|
|
@@ -6438,7 +6603,7 @@ function AddCardEasyPay(props) {
|
|
|
6438
6603
|
/* @__PURE__ */ jsxs14("div", { style: { maxHeight: "350px", minHeight: "0" }, className: "card-scrl", children: [
|
|
6439
6604
|
/* @__PURE__ */ jsxs14("div", { className: "form-group", style: { marginTop: "0", marginBottom: "10px" }, children: [
|
|
6440
6605
|
/* @__PURE__ */ jsx24("label", { htmlFor: "cardNumber", children: "Card Number" }),
|
|
6441
|
-
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && /* @__PURE__ */ jsx24(
|
|
6606
|
+
(paymentData == null ? void 0 : paymentData.paymentGateway) === 32 && isTokenizerReady && /* @__PURE__ */ jsx24(
|
|
6442
6607
|
FractalFields_default,
|
|
6443
6608
|
{
|
|
6444
6609
|
fractalStyles,
|
|
@@ -6573,18 +6738,6 @@ function AddCardEasyPay(props) {
|
|
|
6573
6738
|
import { useEffect as useEffect12, useRef as useRef7, useState as useState7 } from "react";
|
|
6574
6739
|
import axios6 from "axios";
|
|
6575
6740
|
|
|
6576
|
-
// src/app/utils/Constant.js
|
|
6577
|
-
var PaymentMethodKeys = {
|
|
6578
|
-
PROPAYKEY: "25",
|
|
6579
|
-
PAYARCKEY: "26",
|
|
6580
|
-
STRIPEKEYCC: "27",
|
|
6581
|
-
PAYRIXKEY: "28",
|
|
6582
|
-
SKYFIACHKEY: "29",
|
|
6583
|
-
JUSTIFIKEY: "30",
|
|
6584
|
-
INFINICEPTKEY: "31",
|
|
6585
|
-
FRACTALKEY: "32"
|
|
6586
|
-
};
|
|
6587
|
-
|
|
6588
6741
|
// src/app/components/AddCard/AddCardSkyStyle.tsx
|
|
6589
6742
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
6590
6743
|
function AddCardSkyStyle({}) {
|
|
@@ -6792,8 +6945,12 @@ import { Fragment as Fragment15, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-
|
|
|
6792
6945
|
var FractalFieldsAddCardSky = ({ fractalStyles, tokenizerRef, extraInputs }) => {
|
|
6793
6946
|
const instanceRef = useRef6(null);
|
|
6794
6947
|
useEffect11(() => {
|
|
6795
|
-
|
|
6796
|
-
|
|
6948
|
+
const Tokenizer = window.FractalTokenizer;
|
|
6949
|
+
if (!Tokenizer) {
|
|
6950
|
+
console.error("Tokenizer not available");
|
|
6951
|
+
return;
|
|
6952
|
+
}
|
|
6953
|
+
const instance = new Tokenizer({
|
|
6797
6954
|
styles: fractalStyles
|
|
6798
6955
|
});
|
|
6799
6956
|
instanceRef.current = instance;
|
|
@@ -6878,7 +7035,7 @@ var FractalFieldsAddCardSky_default = FractalFieldsAddCardSky;
|
|
|
6878
7035
|
|
|
6879
7036
|
// src/app/components/AddCard/AddCardSky.tsx
|
|
6880
7037
|
import { Fragment as Fragment16, jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6881
|
-
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 }) {
|
|
6882
7039
|
var _a, _b;
|
|
6883
7040
|
const [loading, setLoading] = useState7(false);
|
|
6884
7041
|
const [errorIframe, setErrorIframe] = useState7("");
|
|
@@ -6889,10 +7046,11 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
6889
7046
|
const [error, setError] = useState7("");
|
|
6890
7047
|
const showLoader = () => setLoading(true);
|
|
6891
7048
|
const hideLoader = () => setLoading(false);
|
|
6892
|
-
const [passFee, setPassFee] = useState7(
|
|
7049
|
+
const [passFee, setPassFee] = useState7(null);
|
|
6893
7050
|
const [paymentGateway, setPaymentGateway] = useState7();
|
|
6894
7051
|
const [dcToken, setDCToken] = useState7();
|
|
6895
7052
|
const tokenizerRef = useRef7(null);
|
|
7053
|
+
const [isTokenizerReady, setTokenizerReady] = useState7(false);
|
|
6896
7054
|
const fractalStyles = {
|
|
6897
7055
|
input: {
|
|
6898
7056
|
"font-family": "'Inter', sans-serif",
|
|
@@ -7155,8 +7313,20 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7155
7313
|
}, []);
|
|
7156
7314
|
return /* @__PURE__ */ jsxs16(Fragment16, { children: [
|
|
7157
7315
|
/* @__PURE__ */ jsx27(DataScript, {}),
|
|
7158
|
-
/* @__PURE__ */ jsx27(FractalTokenizerScript, {}),
|
|
7159
|
-
/* @__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
|
+
),
|
|
7160
7330
|
/* @__PURE__ */ jsx27(AddCardSkyStyle, {}),
|
|
7161
7331
|
/* @__PURE__ */ jsx27(Loader_default, { loading: loading || isloading || loadingIframe }),
|
|
7162
7332
|
error && /* @__PURE__ */ jsx27("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx27(ErrorCardMessage_default, { error, onClose: handleClose }) }),
|
|
@@ -7217,7 +7387,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7217
7387
|
(cardError == null ? void 0 : cardError.lastName) && /* @__PURE__ */ jsx27("small", { className: "error", children: cardError == null ? void 0 : cardError.lastName })
|
|
7218
7388
|
] })
|
|
7219
7389
|
] }),
|
|
7220
|
-
/* @__PURE__ */ jsx27(
|
|
7390
|
+
isTokenizerReady && /* @__PURE__ */ jsx27(
|
|
7221
7391
|
FractalFieldsAddCardSky_default,
|
|
7222
7392
|
{
|
|
7223
7393
|
fractalStyles,
|
|
@@ -7249,7 +7419,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7249
7419
|
type: "checkbox",
|
|
7250
7420
|
id: "pass_fee",
|
|
7251
7421
|
className: "toggle-checkbox",
|
|
7252
|
-
checked: passFee,
|
|
7422
|
+
checked: passFee != null ? passFee : false,
|
|
7253
7423
|
onChange: (e) => {
|
|
7254
7424
|
setPassFee(e.target.checked);
|
|
7255
7425
|
}
|
|
@@ -7392,7 +7562,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7392
7562
|
isOpen: true,
|
|
7393
7563
|
tokenKey: dcToken,
|
|
7394
7564
|
setLoader: setLoadingIframe,
|
|
7395
|
-
customCSS
|
|
7565
|
+
customCSS,
|
|
7396
7566
|
height
|
|
7397
7567
|
}
|
|
7398
7568
|
) }),
|
|
@@ -7421,7 +7591,7 @@ function CardOnFile({ session_token, callback, isloading, onCancel, showChecks,
|
|
|
7421
7591
|
type: "checkbox",
|
|
7422
7592
|
id: "pass_fee",
|
|
7423
7593
|
className: "toggle-checkbox",
|
|
7424
|
-
checked: passFee,
|
|
7594
|
+
checked: passFee != null ? passFee : false,
|
|
7425
7595
|
onChange: (e) => {
|
|
7426
7596
|
setPassFee(e.target.checked);
|
|
7427
7597
|
}
|
|
@@ -7566,6 +7736,7 @@ function PartialPayment(props) {
|
|
|
7566
7736
|
const [errorBankConsent, setErrorBankConsent] = useState8("");
|
|
7567
7737
|
const [saveACHConsent1, setSaveACHConsent1] = useState8(false);
|
|
7568
7738
|
const [errorBankConsentOther, setErrorBankConsentOther] = useState8("");
|
|
7739
|
+
const [isTokenizerReady, setTokenizerReady] = useState8(false);
|
|
7569
7740
|
const tokenizerRef = useRef8(null);
|
|
7570
7741
|
const fractalStyles = {
|
|
7571
7742
|
input: {
|
|
@@ -8279,8 +8450,20 @@ function PartialPayment(props) {
|
|
|
8279
8450
|
/* @__PURE__ */ jsx28(DataScript, {}),
|
|
8280
8451
|
/* @__PURE__ */ jsx28(Chargewidgetstyles, {}),
|
|
8281
8452
|
/* @__PURE__ */ jsx28(CardBankRadioStyles, {}),
|
|
8282
|
-
/* @__PURE__ */ jsx28(FractalTokenizerScript, {}),
|
|
8283
|
-
/* @__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
|
+
),
|
|
8284
8467
|
/* @__PURE__ */ jsxs17(Fragment17, { children: [
|
|
8285
8468
|
/* @__PURE__ */ jsx28("button", { ref: buttonRef, style: { display: "none" }, className: "paymentBtn", onClick: handleShow, children: "Pay" }),
|
|
8286
8469
|
/* @__PURE__ */ jsxs17(
|
|
@@ -8487,7 +8670,7 @@ function PartialPayment(props) {
|
|
|
8487
8670
|
] }),
|
|
8488
8671
|
/* @__PURE__ */ jsxs17("div", { className: "form-group", children: [
|
|
8489
8672
|
/* @__PURE__ */ jsx28("label", { children: "CARD NUMBER" }),
|
|
8490
|
-
/* @__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(
|
|
8491
8674
|
FractalFields_default,
|
|
8492
8675
|
{
|
|
8493
8676
|
fractalStyles,
|
|
@@ -9929,7 +10112,7 @@ var ErrorCardOverlay_default = ErrorCardOverlay;
|
|
|
9929
10112
|
|
|
9930
10113
|
// src/app/components/Atoms/ModelContentSky/ModelContentSky.tsx
|
|
9931
10114
|
import { Fragment as Fragment19, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
9932
|
-
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 }) => {
|
|
9933
10116
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
9934
10117
|
const hasRunRef = useRef10(false);
|
|
9935
10118
|
const cardFormRef = useRef10(null);
|
|
@@ -9977,6 +10160,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9977
10160
|
const [isBankConsentChecked, setIsBankConsentChecked] = useState10(false);
|
|
9978
10161
|
const [errorBankConsent, setErrorBankConsent] = useState10("");
|
|
9979
10162
|
const [errorBankConsentOther, setErrorBankConsentOther] = useState10("");
|
|
10163
|
+
const [isTokenizerReady, setTokenizerReady] = useState10(false);
|
|
9980
10164
|
let mastercard2 = S3Url + "widget/mc-img.svg";
|
|
9981
10165
|
let visa2 = S3Url + "widget/visa-img.svg";
|
|
9982
10166
|
let americanexp2 = S3Url + "widget/ae-img.svg";
|
|
@@ -10184,8 +10368,13 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10184
10368
|
return Object.keys(errors).length > 0;
|
|
10185
10369
|
};
|
|
10186
10370
|
const completeFractalFlow = async (tokenizeData, intentid, typeoftoken) => {
|
|
10187
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2
|
|
10371
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
10188
10372
|
try {
|
|
10373
|
+
console.log({
|
|
10374
|
+
tokenizeData,
|
|
10375
|
+
intentid,
|
|
10376
|
+
typeoftoken
|
|
10377
|
+
});
|
|
10189
10378
|
if (typeoftoken == "google_pay" || typeoftoken == "apple_pay") {
|
|
10190
10379
|
handleCharge({
|
|
10191
10380
|
Token: tokenizeData,
|
|
@@ -10193,39 +10382,28 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10193
10382
|
typeoftoken
|
|
10194
10383
|
});
|
|
10195
10384
|
return;
|
|
10196
|
-
}
|
|
10197
|
-
let token = tokenizeData;
|
|
10198
|
-
let verifyandsaveresp = await axios9.post(`${masterBaseUrl}api/v1/gateway/verify-and-save/${session_token}`, {
|
|
10199
|
-
token,
|
|
10200
|
-
require3ds,
|
|
10201
|
-
pass_fee,
|
|
10202
|
-
typeoftoken
|
|
10203
|
-
});
|
|
10204
|
-
if ((verifyandsaveresp == null ? void 0 : verifyandsaveresp.status) == 200) {
|
|
10205
|
-
let responsetemp = (_a2 = verifyandsaveresp == null ? void 0 : verifyandsaveresp.data) == null ? void 0 : _a2.data;
|
|
10206
|
-
let respData = {
|
|
10207
|
-
Token: responsetemp.gateway_token,
|
|
10208
|
-
Brand: responsetemp.card_data.brand,
|
|
10209
|
-
ExpirationMonth: responsetemp.card_data.expire_mm,
|
|
10210
|
-
ExpirationYear: responsetemp.card_data.expire_yy,
|
|
10211
|
-
Last4: responsetemp.card_data.last4,
|
|
10212
|
-
Bin: responsetemp.card_data.bin,
|
|
10213
|
-
postalCode: cardData == null ? void 0 : cardData.zipCode,
|
|
10214
|
-
stripe_3ds_auth_id: intentid
|
|
10215
|
-
};
|
|
10385
|
+
} else {
|
|
10216
10386
|
if (isPreAuth) {
|
|
10217
|
-
handlePreAuth(
|
|
10387
|
+
handlePreAuth(__spreadValues({
|
|
10388
|
+
Token: tokenizeData,
|
|
10389
|
+
postalCode: cardData == null ? void 0 : cardData.zipCode,
|
|
10390
|
+
typeoftoken: "token"
|
|
10391
|
+
}, intentid && { stripe_3ds_auth_id: intentid }));
|
|
10218
10392
|
} else {
|
|
10219
|
-
handleCharge(
|
|
10393
|
+
handleCharge(__spreadValues({
|
|
10394
|
+
Token: tokenizeData,
|
|
10395
|
+
postalCode: cardData == null ? void 0 : cardData.zipCode,
|
|
10396
|
+
typeoftoken: "token"
|
|
10397
|
+
}, intentid && { stripe_3ds_auth_id: intentid }));
|
|
10220
10398
|
}
|
|
10221
10399
|
}
|
|
10222
10400
|
} catch (error2) {
|
|
10223
10401
|
console.log(error2, "error");
|
|
10224
|
-
setError(((
|
|
10402
|
+
setError(((_b2 = (_a2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "Something went wrong!");
|
|
10225
10403
|
callback({
|
|
10226
|
-
error: ((
|
|
10227
|
-
result: (
|
|
10228
|
-
statusCode: (
|
|
10404
|
+
error: ((_d2 = (_c2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || "Something went wrong!",
|
|
10405
|
+
result: (_f2 = (_e2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _e2.data) == null ? void 0 : _f2.result,
|
|
10406
|
+
statusCode: (_g2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _g2.status
|
|
10229
10407
|
});
|
|
10230
10408
|
hideLoader();
|
|
10231
10409
|
}
|
|
@@ -11044,6 +11222,20 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11044
11222
|
}
|
|
11045
11223
|
return /* @__PURE__ */ jsxs20(Fragment19, { children: [
|
|
11046
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
|
+
),
|
|
11047
11239
|
error && /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(ErrorCardOverlay_default, { error, onClose: handleClose, autoTrigger }) }),
|
|
11048
11240
|
errorIframe && /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(ErrorCardOverlay_default, { error: errorIframe, onClose: () => {
|
|
11049
11241
|
setErrorIframe("");
|
|
@@ -11193,7 +11385,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11193
11385
|
] }),
|
|
11194
11386
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
11195
11387
|
/* @__PURE__ */ jsx34("label", { htmlFor: "cardNumber", children: "CARD NUMBER" }),
|
|
11196
|
-
/* @__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(
|
|
11197
11389
|
FractalFields_default,
|
|
11198
11390
|
{
|
|
11199
11391
|
fractalStyles,
|
|
@@ -11280,7 +11472,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
11280
11472
|
tokenKey: dcToken,
|
|
11281
11473
|
setLoader: activeinCard === "form" ? setLoadingIframe : null,
|
|
11282
11474
|
isEmbedded: onSubmit ? true : false,
|
|
11283
|
-
customCSS
|
|
11475
|
+
customCSS
|
|
11284
11476
|
}
|
|
11285
11477
|
) }),
|
|
11286
11478
|
/* @__PURE__ */ jsxs20("div", { className: "form-group-frac", children: [
|
|
@@ -11538,7 +11730,7 @@ var PaymentWidget = ({
|
|
|
11538
11730
|
isPartial,
|
|
11539
11731
|
bankSurcharge,
|
|
11540
11732
|
partialRef,
|
|
11541
|
-
customCSS
|
|
11733
|
+
customCSS,
|
|
11542
11734
|
disableSubmitBtn = false
|
|
11543
11735
|
}) => {
|
|
11544
11736
|
const [show, setShow] = useState11(autoTrigger || false);
|
|
@@ -11570,7 +11762,7 @@ var PaymentWidget = ({
|
|
|
11570
11762
|
isPartial,
|
|
11571
11763
|
bankSurcharge,
|
|
11572
11764
|
partialRef,
|
|
11573
|
-
customCSS
|
|
11765
|
+
customCSS,
|
|
11574
11766
|
disableSubmitBtn
|
|
11575
11767
|
}),
|
|
11576
11768
|
[
|
|
@@ -11636,11 +11828,9 @@ var PaymentWidget = ({
|
|
|
11636
11828
|
return /* @__PURE__ */ jsxs21(Fragment20, { children: [
|
|
11637
11829
|
/* @__PURE__ */ jsx35("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
|
|
11638
11830
|
/* @__PURE__ */ jsx35(DataScript, {}),
|
|
11639
|
-
/* @__PURE__ */ jsx35(FractalTokenizerScript, {}),
|
|
11640
11831
|
/* @__PURE__ */ jsx35(SkyChargewidgetstyles, {}),
|
|
11641
11832
|
/* @__PURE__ */ jsx35(CardBankRadioStyles, {}),
|
|
11642
11833
|
/* @__PURE__ */ jsx35(CustomModal2styles_default, {}),
|
|
11643
|
-
/* @__PURE__ */ jsx35(DataCapScriptLoader, {}),
|
|
11644
11834
|
!autoTrigger && /* @__PURE__ */ jsxs21("button", { className: submitBtnClass || "paymentBtn", disabled: disableSubmitBtn, onClick: () => setShow(true), children: [
|
|
11645
11835
|
submitBtnText,
|
|
11646
11836
|
submitBtnIcon
|
|
@@ -12011,18 +12201,18 @@ var ApplePayScriptLoader = () => {
|
|
|
12011
12201
|
`script[src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js"]`
|
|
12012
12202
|
);
|
|
12013
12203
|
if (!existingScript) {
|
|
12014
|
-
const
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
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 = () => {
|
|
12018
12208
|
console.log("\u2705 Apple Pay script loaded");
|
|
12019
12209
|
applePayScriptLoaded = true;
|
|
12020
12210
|
console.log("ApplePaySession:", window.ApplePaySession);
|
|
12021
12211
|
};
|
|
12022
|
-
|
|
12212
|
+
script.onerror = (err) => {
|
|
12023
12213
|
console.error("\u274C Apple Pay script failed", err);
|
|
12024
12214
|
};
|
|
12025
|
-
document.head.appendChild(
|
|
12215
|
+
document.head.appendChild(script);
|
|
12026
12216
|
} else {
|
|
12027
12217
|
applePayScriptLoaded = true;
|
|
12028
12218
|
}
|
|
@@ -12054,7 +12244,7 @@ var EmbeddedCheckout = ({
|
|
|
12054
12244
|
partialRef,
|
|
12055
12245
|
onSubmit,
|
|
12056
12246
|
onLoad,
|
|
12057
|
-
customCSS
|
|
12247
|
+
customCSS
|
|
12058
12248
|
}) => {
|
|
12059
12249
|
const [show, setShow] = useState12(false);
|
|
12060
12250
|
const [loading, setLoading] = useState12(false);
|
|
@@ -12062,6 +12252,7 @@ var EmbeddedCheckout = ({
|
|
|
12062
12252
|
});
|
|
12063
12253
|
const [orderGuid, setOrderGuid] = useState12(null);
|
|
12064
12254
|
const [remainingAmount, setRemainingAmount] = useState12(null);
|
|
12255
|
+
const [isTokenizerReady, setTokenizerReady] = useState12(false);
|
|
12065
12256
|
const initialCommonProps = useMemo2(
|
|
12066
12257
|
() => ({
|
|
12067
12258
|
amount,
|
|
@@ -12160,13 +12351,11 @@ var EmbeddedCheckout = ({
|
|
|
12160
12351
|
return /* @__PURE__ */ jsxs22(Fragment21, { children: [
|
|
12161
12352
|
/* @__PURE__ */ jsx37("link", { href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" }),
|
|
12162
12353
|
/* @__PURE__ */ jsx37(DataScript, {}),
|
|
12163
|
-
/* @__PURE__ */ jsx37(FractalTokenizerScript, {}),
|
|
12164
12354
|
/* @__PURE__ */ jsx37(SkyChargewidgetstyles, {}),
|
|
12165
12355
|
/* @__PURE__ */ jsx37(CardBankRadioStyles, {}),
|
|
12166
12356
|
/* @__PURE__ */ jsx37(CustomModal2styles_default, {}),
|
|
12167
|
-
/* @__PURE__ */ jsx37(DataCapScriptLoader, {}),
|
|
12168
12357
|
/* @__PURE__ */ jsx37(ApplePayScriptLoader, {}),
|
|
12169
|
-
/* @__PURE__ */ jsx37(EmbeddedCheckoutStyles, { extraCustomCSS:
|
|
12358
|
+
/* @__PURE__ */ jsx37(EmbeddedCheckoutStyles, { extraCustomCSS: customCSS }),
|
|
12170
12359
|
!autoTrigger && /* @__PURE__ */ jsxs22("button", { className: submitBtnClass || "paymentBtn", onClick: () => setShow(true), children: [
|
|
12171
12360
|
submitBtnText,
|
|
12172
12361
|
submitBtnIcon
|