@fractalpay/fractalpay-next 0.0.26 → 0.0.28
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 +98 -150
- package/dist/index.js.map +1 -1
- package/package.json +3 -8
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.28",
|
|
43
43
|
private: false,
|
|
44
44
|
type: "module",
|
|
45
45
|
scripts: {
|
|
@@ -97,12 +97,7 @@ var require_package = __commonJS({
|
|
|
97
97
|
},
|
|
98
98
|
author: "Mukul",
|
|
99
99
|
license: "MIT",
|
|
100
|
-
keywords: [
|
|
101
|
-
"nextjs",
|
|
102
|
-
"next",
|
|
103
|
-
"typescript",
|
|
104
|
-
"tailwindcss"
|
|
105
|
-
],
|
|
100
|
+
keywords: ["nextjs", "next", "typescript", "tailwindcss"],
|
|
106
101
|
publishConfig: {
|
|
107
102
|
access: "public"
|
|
108
103
|
}
|
|
@@ -3173,7 +3168,7 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
|
|
|
3173
3168
|
{
|
|
3174
3169
|
id: "card_number",
|
|
3175
3170
|
className: "form-control card-number-new",
|
|
3176
|
-
style: { height: "46px" }
|
|
3171
|
+
style: { height: "46px", display: "inline-block" }
|
|
3177
3172
|
}
|
|
3178
3173
|
),
|
|
3179
3174
|
/* @__PURE__ */ jsx17("div", { className: "card-dtl", children: /* @__PURE__ */ jsxs10("div", { className: "exp-cvc-container exp-cvc-container-wrap", style: { margin: 0 }, children: [
|
|
@@ -3214,32 +3209,32 @@ var FractalFields = ({ fractalStyles, tokenizerRef, isAddCard = false, isSky = f
|
|
|
3214
3209
|
{
|
|
3215
3210
|
id: "card_number",
|
|
3216
3211
|
className: "form-control card-number-new",
|
|
3217
|
-
style: { height: `${isSky ? "36px" : "46px"}
|
|
3212
|
+
style: { height: `${isSky ? "36px" : "46px"}`, display: "inline-block" }
|
|
3218
3213
|
}
|
|
3219
3214
|
),
|
|
3220
3215
|
/* @__PURE__ */ jsx17("div", { className: "card-crdi card-expiry-new", children: /* @__PURE__ */ jsxs10("div", { className: "exp-date-year-container", children: [
|
|
3221
|
-
/* @__PURE__ */ jsx17("div", { className: "exp-date form-group", children: /* @__PURE__ */ jsx17(
|
|
3216
|
+
/* @__PURE__ */ jsx17("div", { className: "exp-date form-group input-main-wrap-frac", children: /* @__PURE__ */ jsx17(
|
|
3222
3217
|
"div",
|
|
3223
3218
|
{
|
|
3224
3219
|
id: "exp_month",
|
|
3225
3220
|
className: "form-control required card-cvv-in",
|
|
3226
|
-
style: { height: "36px" }
|
|
3221
|
+
style: { height: "36px", display: "inline-block" }
|
|
3227
3222
|
}
|
|
3228
3223
|
) }),
|
|
3229
|
-
/* @__PURE__ */ jsx17("div", { className: "exp-year form-group", children: /* @__PURE__ */ jsx17(
|
|
3224
|
+
/* @__PURE__ */ jsx17("div", { className: "exp-year form-group input-main-wrap-frac", children: /* @__PURE__ */ jsx17(
|
|
3230
3225
|
"div",
|
|
3231
3226
|
{
|
|
3232
3227
|
id: "exp_year",
|
|
3233
3228
|
className: "form-control required card-cvv-in",
|
|
3234
|
-
style: { height: "36px" }
|
|
3229
|
+
style: { height: "36px", display: "inline-block" }
|
|
3235
3230
|
}
|
|
3236
3231
|
) }),
|
|
3237
|
-
/* @__PURE__ */ jsx17("div", { className: "security-digit form-group", children: /* @__PURE__ */ jsx17(
|
|
3232
|
+
/* @__PURE__ */ jsx17("div", { className: "security-digit form-group input-main-wrap-frac", children: /* @__PURE__ */ jsx17(
|
|
3238
3233
|
"div",
|
|
3239
3234
|
{
|
|
3240
3235
|
id: "cvv",
|
|
3241
3236
|
className: "form-control card-cvv-in required",
|
|
3242
|
-
style: { height: "36px" }
|
|
3237
|
+
style: { height: "36px", display: "inline-block" }
|
|
3243
3238
|
}
|
|
3244
3239
|
) })
|
|
3245
3240
|
] }) })
|
|
@@ -3252,10 +3247,7 @@ import { useEffect as useEffect6 } from "react";
|
|
|
3252
3247
|
var scriptLoaded = false;
|
|
3253
3248
|
var DataCapScriptLoader = () => {
|
|
3254
3249
|
useEffect6(() => {
|
|
3255
|
-
console.log("\u{1F535} DataCapScriptLoader mounted");
|
|
3256
|
-
console.log("\u{1F535} scriptLoaded flag:", scriptLoaded);
|
|
3257
3250
|
if (scriptLoaded) {
|
|
3258
|
-
console.log("\u{1F7E1} Script already marked as loaded. Skipping injection.");
|
|
3259
3251
|
return;
|
|
3260
3252
|
}
|
|
3261
3253
|
const existingScript = document.querySelector(
|
|
@@ -3263,25 +3255,19 @@ var DataCapScriptLoader = () => {
|
|
|
3263
3255
|
);
|
|
3264
3256
|
console.log("\u{1F535} existingScript found:", !!existingScript);
|
|
3265
3257
|
if (!existingScript) {
|
|
3266
|
-
console.log("\u{1F7E2} Injecting DataCap hosted script...");
|
|
3267
3258
|
const script2 = document.createElement("script");
|
|
3268
3259
|
script2.src = `${datacapUrl}/hosted`;
|
|
3269
3260
|
script2.async = true;
|
|
3270
3261
|
script2.onload = () => {
|
|
3271
3262
|
console.log("\u2705 DataCap script loaded successfully");
|
|
3272
3263
|
scriptLoaded = true;
|
|
3273
|
-
console.log("\u{1F535} scriptLoaded flag updated to:", scriptLoaded);
|
|
3274
|
-
console.log("\u{1F535} window.dcap:", window.DatacapHostedWebToken);
|
|
3275
3264
|
};
|
|
3276
3265
|
script2.onerror = (err) => {
|
|
3277
3266
|
console.error("\u274C DataCap script failed to load", err);
|
|
3278
3267
|
};
|
|
3279
3268
|
document.head.appendChild(script2);
|
|
3280
3269
|
} else {
|
|
3281
|
-
console.log("\u{1F7E1} Script already exists in DOM.");
|
|
3282
3270
|
scriptLoaded = true;
|
|
3283
|
-
console.log("\u{1F535} scriptLoaded flag updated to:", scriptLoaded);
|
|
3284
|
-
console.log("\u{1F535} window.dcap:", window.dcap);
|
|
3285
3271
|
}
|
|
3286
3272
|
}, []);
|
|
3287
3273
|
return null;
|
|
@@ -3391,7 +3377,6 @@ var DataCapFields = ({
|
|
|
3391
3377
|
}
|
|
3392
3378
|
`;
|
|
3393
3379
|
}
|
|
3394
|
-
console.log(customCSS, "customcss");
|
|
3395
3380
|
const initialize = async () => {
|
|
3396
3381
|
setLoader == null ? void 0 : setLoader(true);
|
|
3397
3382
|
setIframeReady(false);
|
|
@@ -6636,7 +6621,8 @@ var FractalFieldsAddCardSky = ({ fractalStyles, tokenizerRef, extraInputs }) =>
|
|
|
6636
6621
|
"div",
|
|
6637
6622
|
{
|
|
6638
6623
|
id: "card_number",
|
|
6639
|
-
className: "form-control card-number-new"
|
|
6624
|
+
className: "form-control card-number-new",
|
|
6625
|
+
style: { display: "inline-block" }
|
|
6640
6626
|
}
|
|
6641
6627
|
)
|
|
6642
6628
|
] }) }),
|
|
@@ -6650,7 +6636,8 @@ var FractalFieldsAddCardSky = ({ fractalStyles, tokenizerRef, extraInputs }) =>
|
|
|
6650
6636
|
"div",
|
|
6651
6637
|
{
|
|
6652
6638
|
id: "exp_month",
|
|
6653
|
-
className: "form-control required card-cvv-in"
|
|
6639
|
+
className: "form-control required card-cvv-in",
|
|
6640
|
+
style: { display: "inline-block" }
|
|
6654
6641
|
}
|
|
6655
6642
|
)
|
|
6656
6643
|
] }),
|
|
@@ -6663,7 +6650,8 @@ var FractalFieldsAddCardSky = ({ fractalStyles, tokenizerRef, extraInputs }) =>
|
|
|
6663
6650
|
"div",
|
|
6664
6651
|
{
|
|
6665
6652
|
id: "exp_year",
|
|
6666
|
-
className: "form-control required card-cvv-in"
|
|
6653
|
+
className: "form-control required card-cvv-in",
|
|
6654
|
+
style: { display: "inline-block" }
|
|
6667
6655
|
}
|
|
6668
6656
|
)
|
|
6669
6657
|
] }),
|
|
@@ -6676,7 +6664,8 @@ var FractalFieldsAddCardSky = ({ fractalStyles, tokenizerRef, extraInputs }) =>
|
|
|
6676
6664
|
"div",
|
|
6677
6665
|
{
|
|
6678
6666
|
id: "cvv",
|
|
6679
|
-
className: "form-control card-cvv-in required"
|
|
6667
|
+
className: "form-control card-cvv-in required",
|
|
6668
|
+
style: { display: "inline-block" }
|
|
6680
6669
|
}
|
|
6681
6670
|
)
|
|
6682
6671
|
] }),
|
|
@@ -8574,7 +8563,6 @@ function SkyChargewidgetstyles() {
|
|
|
8574
8563
|
font-family: 'Inter', sans-serif !important;
|
|
8575
8564
|
}
|
|
8576
8565
|
.frac-form .form-group-frac{
|
|
8577
|
-
margin:0 !important;
|
|
8578
8566
|
padding: 5px 0;
|
|
8579
8567
|
}
|
|
8580
8568
|
.frac-form .mb-4{
|
|
@@ -8898,7 +8886,6 @@ function SkyChargewidgetstyles() {
|
|
|
8898
8886
|
.form-control-frac{box-sizing: border-box ;}
|
|
8899
8887
|
#PaymentForm .form-group-frac{
|
|
8900
8888
|
padding:5px 0 ;
|
|
8901
|
-
matgin: 0 !important
|
|
8902
8889
|
}
|
|
8903
8890
|
|
|
8904
8891
|
.toggle-label {
|
|
@@ -9339,7 +9326,10 @@ position:relative;
|
|
|
9339
9326
|
.exp-date-year-container .form-group {
|
|
9340
9327
|
flex: 1;
|
|
9341
9328
|
}
|
|
9342
|
-
|
|
9329
|
+
.input-main-wrap-frac{
|
|
9330
|
+
margin:0px !important;
|
|
9331
|
+
padding:0px !important;
|
|
9332
|
+
}
|
|
9343
9333
|
|
|
9344
9334
|
|
|
9345
9335
|
|
|
@@ -9571,9 +9561,9 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9571
9561
|
}
|
|
9572
9562
|
};
|
|
9573
9563
|
const handleCharge = async (data) => {
|
|
9574
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2
|
|
9564
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
|
|
9575
9565
|
try {
|
|
9576
|
-
let dataObj = {
|
|
9566
|
+
let dataObj = __spreadValues({
|
|
9577
9567
|
pass_fee_amount: Number(amount) - cashDiscount,
|
|
9578
9568
|
pass_fee,
|
|
9579
9569
|
Token: data == null ? void 0 : data.Token,
|
|
@@ -9582,106 +9572,69 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9582
9572
|
require3ds,
|
|
9583
9573
|
isPartial,
|
|
9584
9574
|
orderGuid: orderGuid || ordGuid
|
|
9585
|
-
}
|
|
9575
|
+
}, saveCardInfo ? {
|
|
9576
|
+
card: {
|
|
9577
|
+
postal_code: cardData == null ? void 0 : cardData.zipCode,
|
|
9578
|
+
customer_id: customerId,
|
|
9579
|
+
gateway_token: (data == null ? void 0 : data.Token) || (data == null ? void 0 : data.gateway_token),
|
|
9580
|
+
name: cardData == null ? void 0 : cardData.cardName
|
|
9581
|
+
}
|
|
9582
|
+
} : null);
|
|
9586
9583
|
if (require3ds && (data == null ? void 0 : data.stripe_3ds_auth_id)) {
|
|
9587
9584
|
dataObj.stripe_3ds_auth_id = data == null ? void 0 : data.stripe_3ds_auth_id;
|
|
9588
9585
|
}
|
|
9589
9586
|
const chargeResponse = await axios9.post(`${masterBaseUrl}api/v1/gateway/charge/${session_token}`, dataObj);
|
|
9590
9587
|
if ((_a2 = chargeResponse == null ? void 0 : chargeResponse.data) == null ? void 0 : _a2.result) {
|
|
9591
|
-
let addCard;
|
|
9592
|
-
if (saveCardInfo && customerId) {
|
|
9593
|
-
try {
|
|
9594
|
-
let obj = {
|
|
9595
|
-
postal_code: cardData == null ? void 0 : cardData.zipCode,
|
|
9596
|
-
customer_id: customerId,
|
|
9597
|
-
gateway_token: (data == null ? void 0 : data.gateway_token) || (data == null ? void 0 : data.Token)
|
|
9598
|
-
};
|
|
9599
|
-
addCard = await axios9.post(`${masterBaseUrl}api/v1/gateway/add-card/${session_token}`, obj);
|
|
9600
|
-
if ((_b2 = addCard == null ? void 0 : addCard.data) == null ? void 0 : _b2.result) {
|
|
9601
|
-
addCard = (_c2 = addCard == null ? void 0 : addCard.data) == null ? void 0 : _c2.data;
|
|
9602
|
-
}
|
|
9603
|
-
} catch (error2) {
|
|
9604
|
-
console.log(error2, "error");
|
|
9605
|
-
hideLoader();
|
|
9606
|
-
callback({
|
|
9607
|
-
error: ((_e2 = (_d2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _d2.data) == null ? void 0 : _e2.message) || "Something went wrong!",
|
|
9608
|
-
result: (_g2 = (_f2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _f2.data) == null ? void 0 : _g2.result,
|
|
9609
|
-
statusCode: (_h2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _h2.status
|
|
9610
|
-
});
|
|
9611
|
-
setError(((_j2 = (_i2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _i2.data) == null ? void 0 : _j2.message) || "Something went wrong!");
|
|
9612
|
-
}
|
|
9613
|
-
}
|
|
9614
9588
|
let callbackdata = {
|
|
9615
|
-
cardDetails:
|
|
9616
|
-
callback: __spreadProps(__spreadValues({}, (
|
|
9589
|
+
// cardDetails: { ...addCard, ...data },
|
|
9590
|
+
callback: __spreadProps(__spreadValues({}, (_b2 = chargeResponse == null ? void 0 : chargeResponse.data) == null ? void 0 : _b2.data), { name: cardData == null ? void 0 : cardData.cardName, isPreAuth })
|
|
9617
9591
|
};
|
|
9618
|
-
if (!saveCardInfo) {
|
|
9619
|
-
delete callbackdata.cardDetails;
|
|
9620
|
-
}
|
|
9621
9592
|
callback(callbackdata);
|
|
9622
9593
|
hideLoader();
|
|
9623
9594
|
handleClose();
|
|
9624
9595
|
}
|
|
9625
9596
|
} catch (error2) {
|
|
9626
|
-
setError(((
|
|
9597
|
+
setError(((_d2 = (_c2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || "Something went wrong!");
|
|
9627
9598
|
callback({
|
|
9628
|
-
error: ((
|
|
9629
|
-
result: (
|
|
9630
|
-
statusCode: (
|
|
9599
|
+
error: ((_f2 = (_e2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _e2.data) == null ? void 0 : _f2.message) || "Something went wrong!",
|
|
9600
|
+
result: (_h2 = (_g2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _g2.data) == null ? void 0 : _h2.result,
|
|
9601
|
+
statusCode: (_i2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _i2.status
|
|
9631
9602
|
});
|
|
9632
9603
|
hideLoader();
|
|
9633
9604
|
}
|
|
9634
9605
|
};
|
|
9635
9606
|
const handlePreAuth = async (data) => {
|
|
9636
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2
|
|
9607
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
|
|
9637
9608
|
try {
|
|
9638
|
-
let dataObj = {
|
|
9609
|
+
let dataObj = __spreadValues({
|
|
9639
9610
|
Token: data == null ? void 0 : data.Token,
|
|
9640
9611
|
amount,
|
|
9641
9612
|
postal_code: data == null ? void 0 : data.postalCode
|
|
9642
|
-
}
|
|
9613
|
+
}, saveCardInfo ? {
|
|
9614
|
+
card: {
|
|
9615
|
+
postal_code: cardData == null ? void 0 : cardData.zipCode,
|
|
9616
|
+
customer_id: customerId,
|
|
9617
|
+
gateway_token: (data == null ? void 0 : data.Token) || (data == null ? void 0 : data.gateway_token),
|
|
9618
|
+
name: cardData == null ? void 0 : cardData.cardName
|
|
9619
|
+
}
|
|
9620
|
+
} : null);
|
|
9643
9621
|
const preAuthResponse = await axios9.post(`${masterBaseUrl}api/v1/gateway/preauth/${session_token}`, dataObj);
|
|
9644
9622
|
if ((_a2 = preAuthResponse == null ? void 0 : preAuthResponse.data) == null ? void 0 : _a2.result) {
|
|
9645
9623
|
let addCard;
|
|
9646
|
-
if (saveCardInfo && customerId) {
|
|
9647
|
-
try {
|
|
9648
|
-
let obj = {
|
|
9649
|
-
postal_code: cardData == null ? void 0 : cardData.zipCode,
|
|
9650
|
-
customer_id: customerId,
|
|
9651
|
-
gateway_token: (data == null ? void 0 : data.Token) || (data == null ? void 0 : data.gateway_token)
|
|
9652
|
-
};
|
|
9653
|
-
addCard = await axios9.post(`${masterBaseUrl}api/v1/gateway/add-card/${session_token}`, obj);
|
|
9654
|
-
if ((_b2 = addCard == null ? void 0 : addCard.data) == null ? void 0 : _b2.result) {
|
|
9655
|
-
addCard = (_c2 = addCard == null ? void 0 : addCard.data) == null ? void 0 : _c2.data;
|
|
9656
|
-
}
|
|
9657
|
-
} catch (error2) {
|
|
9658
|
-
console.log(error2, "error");
|
|
9659
|
-
hideLoader();
|
|
9660
|
-
setError(((_e2 = (_d2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _d2.data) == null ? void 0 : _e2.message) || "Something went wrong!");
|
|
9661
|
-
callback({
|
|
9662
|
-
error: ((_g2 = (_f2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _f2.data) == null ? void 0 : _g2.message) || "Something went wrong!",
|
|
9663
|
-
result: (_i2 = (_h2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _h2.data) == null ? void 0 : _i2.result,
|
|
9664
|
-
statusCode: (_j2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _j2.status
|
|
9665
|
-
});
|
|
9666
|
-
}
|
|
9667
|
-
}
|
|
9668
9624
|
let callbackdata = {
|
|
9669
|
-
cardDetails:
|
|
9670
|
-
callback: __spreadProps(__spreadValues({}, (
|
|
9625
|
+
// cardDetails: { ...addCard, ...data },
|
|
9626
|
+
callback: __spreadProps(__spreadValues({}, (_b2 = preAuthResponse == null ? void 0 : preAuthResponse.data) == null ? void 0 : _b2.data), { name: cardData == null ? void 0 : cardData.cardName, isPreAuth })
|
|
9671
9627
|
};
|
|
9672
|
-
if (!saveCardInfo) {
|
|
9673
|
-
delete callbackdata.cardDetails;
|
|
9674
|
-
}
|
|
9675
9628
|
callback(callbackdata);
|
|
9676
9629
|
hideLoader();
|
|
9677
9630
|
handleClose();
|
|
9678
9631
|
}
|
|
9679
9632
|
} catch (error2) {
|
|
9680
|
-
setError(((
|
|
9633
|
+
setError(((_d2 = (_c2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || "Something went wrong!");
|
|
9681
9634
|
callback({
|
|
9682
|
-
error: ((
|
|
9683
|
-
result: (
|
|
9684
|
-
statusCode: (
|
|
9635
|
+
error: ((_f2 = (_e2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _e2.data) == null ? void 0 : _f2.message) || "Something went wrong!",
|
|
9636
|
+
result: (_h2 = (_g2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _g2.data) == null ? void 0 : _h2.result,
|
|
9637
|
+
statusCode: (_i2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _i2.status
|
|
9685
9638
|
});
|
|
9686
9639
|
hideLoader();
|
|
9687
9640
|
}
|
|
@@ -9802,11 +9755,12 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9802
9755
|
public_key_pem: ((_b2 = (_a2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.publicKeyPem) || ((_d2 = (_c2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.public_key_pem),
|
|
9803
9756
|
session_key: (_f2 = (_e2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _e2.data) == null ? void 0 : _f2.session_key
|
|
9804
9757
|
};
|
|
9758
|
+
let three_ds_data = null;
|
|
9805
9759
|
if (require3ds) {
|
|
9806
9760
|
if (typeof window !== "undefined" && typeof navigator !== "undefined") {
|
|
9807
9761
|
const languages = (_g2 = navigator.languages) != null ? _g2 : [navigator.language];
|
|
9808
9762
|
const language = Array.isArray(languages) ? languages[0] : languages;
|
|
9809
|
-
|
|
9763
|
+
three_ds_data = {
|
|
9810
9764
|
amount: partialAmount ? Math.round(parseFloat(partialAmount) * 100) : Math.round(parseFloat(amount) * 100),
|
|
9811
9765
|
// convert dollars → cents
|
|
9812
9766
|
currency: "usd",
|
|
@@ -9826,7 +9780,10 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9826
9780
|
}
|
|
9827
9781
|
let tokenizeData;
|
|
9828
9782
|
try {
|
|
9829
|
-
tokenizeData = await tokenizerRef.current.createToken(
|
|
9783
|
+
tokenizeData = await tokenizerRef.current.createToken(
|
|
9784
|
+
objtokenize,
|
|
9785
|
+
three_ds_data
|
|
9786
|
+
);
|
|
9830
9787
|
} catch (error2) {
|
|
9831
9788
|
setErrorIframe(error2);
|
|
9832
9789
|
hideLoader();
|
|
@@ -9892,7 +9849,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9892
9849
|
return validCard && validCVV && validExpirationDate;
|
|
9893
9850
|
};
|
|
9894
9851
|
const submitFunc = async (e) => {
|
|
9895
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2
|
|
9852
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2;
|
|
9896
9853
|
e.preventDefault();
|
|
9897
9854
|
const el = document.activeElement;
|
|
9898
9855
|
if (el instanceof HTMLElement) {
|
|
@@ -9942,7 +9899,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9942
9899
|
} else {
|
|
9943
9900
|
let callbackdata;
|
|
9944
9901
|
try {
|
|
9945
|
-
const payByBank = await axios9.post(`${masterBaseUrl}api/v1/gateway/bank-charge/${session_token}`, {
|
|
9902
|
+
const payByBank = await axios9.post(`${masterBaseUrl}api/v1/gateway/bank-charge/${session_token}`, __spreadValues({
|
|
9946
9903
|
label: achData == null ? void 0 : achData.name,
|
|
9947
9904
|
account_number: achData == null ? void 0 : achData.accountNumber,
|
|
9948
9905
|
routing_number: achData == null ? void 0 : achData.routingNumber,
|
|
@@ -9956,36 +9913,20 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9956
9913
|
surcharge: "0.00",
|
|
9957
9914
|
order_id: "",
|
|
9958
9915
|
company_name: (achData == null ? void 0 : achData.companyName) || ""
|
|
9959
|
-
}
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
account_type: achData == null ? void 0 : achData.accountType,
|
|
9969
|
-
customer_id: customerId || "",
|
|
9970
|
-
company_name: (achData == null ? void 0 : achData.companyName) || ""
|
|
9971
|
-
});
|
|
9972
|
-
if (result2.data.result) {
|
|
9973
|
-
callbackdata = {
|
|
9974
|
-
bankDetails: __spreadProps(__spreadValues({}, (_g2 = result2 == null ? void 0 : result2.data) == null ? void 0 : _g2.data), { account_type: achData == null ? void 0 : achData.accountType })
|
|
9975
|
-
};
|
|
9976
|
-
}
|
|
9977
|
-
} catch (error2) {
|
|
9978
|
-
hideLoader();
|
|
9979
|
-
setError(((_i2 = (_h2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _h2.data) == null ? void 0 : _i2.message) || "Something went wrong!");
|
|
9980
|
-
callback({
|
|
9981
|
-
error: ((_k2 = (_j2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _j2.data) == null ? void 0 : _k2.message) || "Something went wrong!",
|
|
9982
|
-
result: (_m2 = (_l2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _l2.data) == null ? void 0 : _m2.result,
|
|
9983
|
-
statusCode: (_n2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _n2.status
|
|
9984
|
-
});
|
|
9985
|
-
}
|
|
9916
|
+
}, saveACHinfo ? {
|
|
9917
|
+
bank: {
|
|
9918
|
+
name: achData == null ? void 0 : achData.name,
|
|
9919
|
+
account_number: achData == null ? void 0 : achData.accountNumber,
|
|
9920
|
+
routing_number: achData == null ? void 0 : achData.routingNumber,
|
|
9921
|
+
bank_name: achData == null ? void 0 : achData.bankName,
|
|
9922
|
+
account_type: achData == null ? void 0 : achData.accountType,
|
|
9923
|
+
customer_id: customerId || "",
|
|
9924
|
+
company_name: (achData == null ? void 0 : achData.companyName) || ""
|
|
9986
9925
|
}
|
|
9926
|
+
} : null));
|
|
9927
|
+
if ((_f2 = payByBank == null ? void 0 : payByBank.data) == null ? void 0 : _f2.result) {
|
|
9987
9928
|
callbackdata = __spreadProps(__spreadValues({}, callbackdata), {
|
|
9988
|
-
callback: __spreadProps(__spreadValues({}, (
|
|
9929
|
+
callback: __spreadProps(__spreadValues({}, (_g2 = payByBank == null ? void 0 : payByBank.data) == null ? void 0 : _g2.data), { name: achData == null ? void 0 : achData.name, isPreAuth })
|
|
9989
9930
|
});
|
|
9990
9931
|
callback(callbackdata);
|
|
9991
9932
|
handleClose();
|
|
@@ -9993,7 +9934,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
9993
9934
|
}
|
|
9994
9935
|
} catch (error2) {
|
|
9995
9936
|
console.log(error2, "errororor");
|
|
9996
|
-
let data = (
|
|
9937
|
+
let data = (_h2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _h2.data;
|
|
9997
9938
|
if (typeof (data == null ? void 0 : data.message) == "object") {
|
|
9998
9939
|
Object.values(data == null ? void 0 : data.message).forEach((message) => {
|
|
9999
9940
|
var _a3;
|
|
@@ -10009,7 +9950,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10009
9950
|
callback({
|
|
10010
9951
|
error: (data == null ? void 0 : data.message) || "Something went wrong!",
|
|
10011
9952
|
result: (data == null ? void 0 : data.result) || false,
|
|
10012
|
-
statusCode: (
|
|
9953
|
+
statusCode: (_i2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _i2.status
|
|
10013
9954
|
});
|
|
10014
9955
|
}
|
|
10015
9956
|
hideLoader();
|
|
@@ -10019,11 +9960,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10019
9960
|
} catch (error2) {
|
|
10020
9961
|
hideLoader();
|
|
10021
9962
|
callback({
|
|
10022
|
-
error: ((
|
|
10023
|
-
result: (
|
|
10024
|
-
statusCode: (
|
|
9963
|
+
error: ((_k2 = (_j2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _j2.data) == null ? void 0 : _k2.message) || "Something went wrong!",
|
|
9964
|
+
result: (_m2 = (_l2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _l2.data) == null ? void 0 : _m2.result,
|
|
9965
|
+
statusCode: (_n2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _n2.status
|
|
10025
9966
|
});
|
|
10026
|
-
setError(((
|
|
9967
|
+
setError(((_p2 = (_o2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _o2.data) == null ? void 0 : _p2.message) || "Something went wrong!");
|
|
10027
9968
|
}
|
|
10028
9969
|
};
|
|
10029
9970
|
const handleCardChange = (field, value) => {
|
|
@@ -10171,6 +10112,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10171
10112
|
setActive("card");
|
|
10172
10113
|
setActiveinCard("list");
|
|
10173
10114
|
setCardList(cardlists);
|
|
10115
|
+
setLoadingIframe(false);
|
|
10174
10116
|
} else {
|
|
10175
10117
|
setActive("card");
|
|
10176
10118
|
setCardList([]);
|
|
@@ -10370,7 +10312,12 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10370
10312
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2;
|
|
10371
10313
|
try {
|
|
10372
10314
|
showLoader();
|
|
10373
|
-
const res = await axios9.get(`${masterBaseUrl}api/v1/gateway/get-payment-details/${session_token}
|
|
10315
|
+
const res = await axios9.get(`${masterBaseUrl}api/v1/gateway/get-payment-details/${session_token}`, {
|
|
10316
|
+
params: {
|
|
10317
|
+
require3ds,
|
|
10318
|
+
pass_fee
|
|
10319
|
+
}
|
|
10320
|
+
});
|
|
10374
10321
|
if ((res == null ? void 0 : res.status) == 200) {
|
|
10375
10322
|
setIsBankActive((_b2 = (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.isBankActive);
|
|
10376
10323
|
setProcessingFee(Number((_d2 = (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.fee) || 0);
|
|
@@ -10515,6 +10462,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10515
10462
|
styles: {}
|
|
10516
10463
|
});
|
|
10517
10464
|
}, []);
|
|
10465
|
+
console.log(activeinCard === "list", "activeinCard", activeList);
|
|
10518
10466
|
return /* @__PURE__ */ jsxs19(Fragment18, { children: [
|
|
10519
10467
|
initialLoader && /* @__PURE__ */ jsx32(Loader_default, { loading: initialLoader }),
|
|
10520
10468
|
error && /* @__PURE__ */ jsx32("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx32(ErrorCardMessage_default, { error, onClose: handleClose }) }),
|
|
@@ -10720,7 +10668,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10720
10668
|
{
|
|
10721
10669
|
isOpen: show,
|
|
10722
10670
|
tokenKey: dcToken,
|
|
10723
|
-
setLoader: setLoadingIframe
|
|
10671
|
+
setLoader: activeinCard === "form" ? setLoadingIframe : null
|
|
10724
10672
|
}
|
|
10725
10673
|
) }),
|
|
10726
10674
|
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
|
|
@@ -10796,12 +10744,12 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10796
10744
|
minHeight: "444px",
|
|
10797
10745
|
maxHeight: "444px"
|
|
10798
10746
|
}, children: [
|
|
10799
|
-
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac
|
|
10747
|
+
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
|
|
10800
10748
|
/* @__PURE__ */ jsx32("label", { htmlFor: "nameonaccount", children: "Name on account" }),
|
|
10801
10749
|
/* @__PURE__ */ jsx32("input", { type: "text", id: "nameonaccount", className: "form-control-frac", maxLength: 100, placeholder: "John Doe", name: "name", value: (_l = achData == null ? void 0 : achData.name) != null ? _l : "", onChange: handleChangeAch }),
|
|
10802
10750
|
(achError == null ? void 0 : achError.name) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.name })
|
|
10803
10751
|
] }),
|
|
10804
|
-
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac
|
|
10752
|
+
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
|
|
10805
10753
|
/* @__PURE__ */ jsx32("label", { htmlFor: "routingnumber", children: "Routing number" }),
|
|
10806
10754
|
/* @__PURE__ */ jsx32(
|
|
10807
10755
|
"input",
|
|
@@ -10818,7 +10766,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10818
10766
|
),
|
|
10819
10767
|
(achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.routingNumber })
|
|
10820
10768
|
] }),
|
|
10821
|
-
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac
|
|
10769
|
+
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
|
|
10822
10770
|
/* @__PURE__ */ jsx32("label", { htmlFor: "accountnumber", children: "Account number" }),
|
|
10823
10771
|
/* @__PURE__ */ jsx32(
|
|
10824
10772
|
"input",
|
|
@@ -10835,7 +10783,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10835
10783
|
),
|
|
10836
10784
|
(achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.accountNumber })
|
|
10837
10785
|
] }),
|
|
10838
|
-
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac
|
|
10786
|
+
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
|
|
10839
10787
|
/* @__PURE__ */ jsx32("label", { htmlFor: "confirmaccountnumber", children: "Confirm account number" }),
|
|
10840
10788
|
/* @__PURE__ */ jsx32(
|
|
10841
10789
|
"input",
|
|
@@ -10852,7 +10800,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10852
10800
|
),
|
|
10853
10801
|
(achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.confirmAccountNumber })
|
|
10854
10802
|
] }),
|
|
10855
|
-
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac
|
|
10803
|
+
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
|
|
10856
10804
|
/* @__PURE__ */ jsx32("label", { htmlFor: "bankname", children: "Bank name" }),
|
|
10857
10805
|
/* @__PURE__ */ jsx32(
|
|
10858
10806
|
"input",
|
|
@@ -10869,7 +10817,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10869
10817
|
),
|
|
10870
10818
|
(achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.bankName })
|
|
10871
10819
|
] }),
|
|
10872
|
-
((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac
|
|
10820
|
+
((achData == null ? void 0 : achData.accountType) === "business saving" || (achData == null ? void 0 : achData.accountType) === "business checking") && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
|
|
10873
10821
|
/* @__PURE__ */ jsx32("label", { htmlFor: "companyName", children: "Company name" }),
|
|
10874
10822
|
/* @__PURE__ */ jsx32(
|
|
10875
10823
|
"input",
|
|
@@ -10886,18 +10834,18 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
|
|
|
10886
10834
|
),
|
|
10887
10835
|
(achError == null ? void 0 : achError.companyName) && /* @__PURE__ */ jsx32("span", { className: "error-span", children: achError == null ? void 0 : achError.companyName })
|
|
10888
10836
|
] }),
|
|
10889
|
-
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac
|
|
10837
|
+
/* @__PURE__ */ jsxs19("div", { className: "form-group-frac", children: [
|
|
10890
10838
|
/* @__PURE__ */ jsx32("label", { htmlFor: "accounttype", children: "Select account type" }),
|
|
10891
10839
|
/* @__PURE__ */ jsxs19("select", { name: "accountType", id: "accounttype", className: "form-control-frac", value: (_r = achData == null ? void 0 : achData.accountType) != null ? _r : "", onChange: handleChangeAch, children: [
|
|
10892
10840
|
/* @__PURE__ */ jsx32("option", { value: "", children: "Select account" }),
|
|
10893
10841
|
accountTypes.map((type) => /* @__PURE__ */ jsx32("option", { value: type.value, children: type.label }, type.value))
|
|
10894
10842
|
] })
|
|
10895
10843
|
] }),
|
|
10896
|
-
customerId && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac
|
|
10844
|
+
customerId && /* @__PURE__ */ jsxs19("div", { className: "form-group-frac save-ach-div", style: { paddingTop: "5px" }, children: [
|
|
10897
10845
|
/* @__PURE__ */ jsx32("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }),
|
|
10898
10846
|
/* @__PURE__ */ jsx32("label", { className: "saveachlabel", htmlFor: "saveACH", children: "Save ACH" })
|
|
10899
10847
|
] }),
|
|
10900
|
-
saveACHinfo && /* @__PURE__ */ jsx32("div", { className: "form-group-frac
|
|
10848
|
+
saveACHinfo && /* @__PURE__ */ jsx32("div", { className: "form-group-frac saveachtext", children: /* @__PURE__ */ jsxs19("p", { children: [
|
|
10901
10849
|
"If checked, I agree to give the ",
|
|
10902
10850
|
/* @__PURE__ */ jsx32("b", { children: merchantName || "merchant" }),
|
|
10903
10851
|
" permission to charge this bank account for agreed-upon purchases in the future."
|