@pinerohit11/testwidget 0.1.97 → 0.1.99
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.d.mts +16 -10
- package/dist/index.d.ts +16 -10
- package/dist/index.js +536 -88
- package/dist/index.mjs +535 -88
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -60,6 +60,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
60
60
|
var index_exports = {};
|
61
61
|
__export(index_exports, {
|
62
62
|
AddCard: () => AddCard,
|
63
|
+
AddCardEasyPay: () => AddCardEasyPay,
|
63
64
|
GetPaymentPage: () => GetPaymentPage,
|
64
65
|
PreAuthPayment: () => PreAuthPayment,
|
65
66
|
RequestPayment: () => RequestPayment,
|
@@ -1927,8 +1928,27 @@ function SuccessMszStyle() {
|
|
1927
1928
|
}`);
|
1928
1929
|
}
|
1929
1930
|
|
1931
|
+
// src/app/components/SuccessMessage/HandleSubmit.tsx
|
1932
|
+
function HandleSubmit(event, key, tranId) {
|
1933
|
+
event.preventDefault();
|
1934
|
+
const status = key === "close";
|
1935
|
+
const message = {
|
1936
|
+
type: "preview.compiledcheck",
|
1937
|
+
other: {
|
1938
|
+
msg: "Payment success!",
|
1939
|
+
status,
|
1940
|
+
data: {
|
1941
|
+
tran_id: tranId,
|
1942
|
+
key
|
1943
|
+
}
|
1944
|
+
}
|
1945
|
+
};
|
1946
|
+
console.log("message:", message);
|
1947
|
+
window.parent.postMessage(message, "*");
|
1948
|
+
}
|
1949
|
+
|
1930
1950
|
// src/app/components/SuccessMessage/SuccessMsz.tsx
|
1931
|
-
function SuccessMsz({ onClose }) {
|
1951
|
+
function SuccessMsz({ onClose, tranId }) {
|
1932
1952
|
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, /* @__PURE__ */ import_react10.default.createElement(SuccessMszStyle, null), /* @__PURE__ */ import_react10.default.createElement("div", { className: "payment-msg-container" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "charge-payment-success-container" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "charge-payment-success-tick-div" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "charge-payment-success-tick" }, /* @__PURE__ */ import_react10.default.createElement(
|
1933
1953
|
"svg",
|
1934
1954
|
{
|
@@ -1945,7 +1965,7 @@ function SuccessMsz({ onClose }) {
|
|
1945
1965
|
fill: "#61C699"
|
1946
1966
|
}
|
1947
1967
|
)
|
1948
|
-
))), /* @__PURE__ */ import_react10.default.createElement("p", { className: "charge-payment-success-text" }, "Your charge", /* @__PURE__ */ import_react10.default.createElement("br", null), "was successful"), /* @__PURE__ */ import_react10.default.createElement("p", { className: "charge-payment-success-subtext" }, "We\u2019ve processed your charge"), /* @__PURE__ */ import_react10.default.createElement("div", { className: "charge-success-payment-button-div" }, /* @__PURE__ */ import_react10.default.createElement("button", { className: "charge-success-btn1" }, /* @__PURE__ */ import_react10.default.createElement(
|
1968
|
+
))), /* @__PURE__ */ import_react10.default.createElement("p", { className: "charge-payment-success-text" }, "Your charge", /* @__PURE__ */ import_react10.default.createElement("br", null), "was successful"), /* @__PURE__ */ import_react10.default.createElement("p", { className: "charge-payment-success-subtext" }, "We\u2019ve processed your charge"), /* @__PURE__ */ import_react10.default.createElement("div", { className: "charge-success-payment-button-div" }, /* @__PURE__ */ import_react10.default.createElement("button", { className: "charge-success-btn1", onClick: (e) => HandleSubmit(e, "print", tranId) }, /* @__PURE__ */ import_react10.default.createElement(
|
1949
1969
|
"svg",
|
1950
1970
|
{
|
1951
1971
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1968,7 +1988,7 @@ function SuccessMsz({ onClose }) {
|
|
1968
1988
|
fill: "#161616"
|
1969
1989
|
}
|
1970
1990
|
)
|
1971
|
-
), "Print receipt"), /* @__PURE__ */ import_react10.default.createElement("button", { className: "charge-success-btn1" }, /* @__PURE__ */ import_react10.default.createElement(
|
1991
|
+
), "Print receipt"), /* @__PURE__ */ import_react10.default.createElement("button", { className: "charge-success-btn1", onClick: (e) => HandleSubmit(e, "share", tranId) }, /* @__PURE__ */ import_react10.default.createElement(
|
1972
1992
|
"svg",
|
1973
1993
|
{
|
1974
1994
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1993,7 +2013,10 @@ function SuccessMsz({ onClose }) {
|
|
1993
2013
|
transform: "translate(0.5)"
|
1994
2014
|
}
|
1995
2015
|
)))
|
1996
|
-
), "Send receipt"))), /* @__PURE__ */ import_react10.default.createElement("div", { className: "charge-payment-success-btn-div" }, /* @__PURE__ */ import_react10.default.createElement("button", { className: "charge-payment-success-btn1" }, "Go to Transactions"), /* @__PURE__ */ import_react10.default.createElement("button", { className: "charge-payment-success-btn2", onClick:
|
2016
|
+
), "Send receipt"))), /* @__PURE__ */ import_react10.default.createElement("div", { className: "charge-payment-success-btn-div" }, /* @__PURE__ */ import_react10.default.createElement("button", { className: "charge-payment-success-btn1", onClick: (e) => HandleSubmit(e, "tran", tranId) }, "Go to Transactions"), /* @__PURE__ */ import_react10.default.createElement("button", { className: "charge-payment-success-btn2", onClick: (e) => {
|
2017
|
+
onClose();
|
2018
|
+
HandleSubmit(e, "close", tranId);
|
2019
|
+
} }, "Close"))));
|
1997
2020
|
}
|
1998
2021
|
|
1999
2022
|
// src/app/components/Charge/GetPaymentPage.tsx
|
@@ -2066,24 +2089,68 @@ function GetPaymentPage(props) {
|
|
2066
2089
|
const [cardList, setCardList] = (0, import_react12.useState)([]);
|
2067
2090
|
const [selectedCard, setSelectedCard] = (0, import_react12.useState)();
|
2068
2091
|
const [paymentData, setPaymentData] = (0, import_react12.useState)();
|
2092
|
+
let [tranId, setTranId] = (0, import_react12.useState)("");
|
2069
2093
|
const showLoader = () => setLoading(true);
|
2070
2094
|
const hideLoader = () => setLoading(false);
|
2071
2095
|
const showError = (msz) => {
|
2072
2096
|
import_sweetalert2.default.fire({
|
2073
2097
|
icon: "error",
|
2074
|
-
title: "Oops...",
|
2075
2098
|
text: msz
|
2076
2099
|
});
|
2077
2100
|
};
|
2078
2101
|
const handleClose = () => {
|
2079
2102
|
setShow(false);
|
2080
2103
|
setActive("card");
|
2081
|
-
};
|
2082
|
-
const handleShow = () => setShow(true);
|
2083
|
-
const handleCloseSeccess = () => {
|
2084
2104
|
setSuccess(false);
|
2085
|
-
|
2105
|
+
setTranId("");
|
2106
|
+
setAchData({
|
2107
|
+
name: "",
|
2108
|
+
routingNumber: "",
|
2109
|
+
accountNumber: "",
|
2110
|
+
confirmAccountNumber: "",
|
2111
|
+
bankName: "",
|
2112
|
+
accountType: ""
|
2113
|
+
});
|
2114
|
+
setAchError({
|
2115
|
+
name: "",
|
2116
|
+
routingNumber: "",
|
2117
|
+
accountNumber: "",
|
2118
|
+
confirmAccountNumber: "",
|
2119
|
+
bankName: "",
|
2120
|
+
accountType: ""
|
2121
|
+
});
|
2122
|
+
setCardData({
|
2123
|
+
cardName: "",
|
2124
|
+
cardNumber: "",
|
2125
|
+
expiryMonth: "",
|
2126
|
+
expiryYear: "",
|
2127
|
+
cvv: "",
|
2128
|
+
orderId: "",
|
2129
|
+
zipCode: ""
|
2130
|
+
});
|
2131
|
+
setCardError({
|
2132
|
+
cardName: "",
|
2133
|
+
cardNumber: "",
|
2134
|
+
expiryMonth: "",
|
2135
|
+
expiryYear: "",
|
2136
|
+
cvv: "",
|
2137
|
+
orderId: "",
|
2138
|
+
zipCode: ""
|
2139
|
+
});
|
2140
|
+
setSaveACHinfo(false);
|
2141
|
+
setSaveCardInfo(false);
|
2142
|
+
setSelectedCard({
|
2143
|
+
card_type: "",
|
2144
|
+
cardlastfourdigit: "",
|
2145
|
+
expmonth: 1,
|
2146
|
+
expyear: 2025,
|
2147
|
+
primary_card: 0,
|
2148
|
+
firstname: "",
|
2149
|
+
id: "",
|
2150
|
+
lastname: ""
|
2151
|
+
});
|
2086
2152
|
};
|
2153
|
+
const handleShow = () => setShow(true);
|
2087
2154
|
const handletabchange = (id) => {
|
2088
2155
|
setActive(id);
|
2089
2156
|
};
|
@@ -2104,7 +2171,6 @@ function GetPaymentPage(props) {
|
|
2104
2171
|
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2105
2172
|
[name]: ""
|
2106
2173
|
}));
|
2107
|
-
console.log(value, name);
|
2108
2174
|
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2109
2175
|
[name]: value
|
2110
2176
|
}));
|
@@ -2161,7 +2227,6 @@ function GetPaymentPage(props) {
|
|
2161
2227
|
setAchError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2162
2228
|
[name]: ""
|
2163
2229
|
}));
|
2164
|
-
console.log(value, name);
|
2165
2230
|
setAchData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2166
2231
|
[name]: value
|
2167
2232
|
}));
|
@@ -2216,11 +2281,10 @@ function GetPaymentPage(props) {
|
|
2216
2281
|
}
|
2217
2282
|
}
|
2218
2283
|
setAchError(errors);
|
2219
|
-
console.log(errors);
|
2220
2284
|
return Object.keys(errors).length > 0;
|
2221
2285
|
};
|
2222
2286
|
const submitFunc = async (e) => {
|
2223
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
2287
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
2224
2288
|
e.preventDefault();
|
2225
2289
|
if (activetab !== "ach") {
|
2226
2290
|
const hasError = validateCardData();
|
@@ -2247,11 +2311,9 @@ function GetPaymentPage(props) {
|
|
2247
2311
|
tax: props == null ? void 0 : props.tax
|
2248
2312
|
});
|
2249
2313
|
const result = await import_axios3.default.post(`${baseUrl}create-widget-order`, formData);
|
2250
|
-
console.log(result);
|
2251
2314
|
let tokenCallback = async function(response) {
|
2252
|
-
var _a3, _b3;
|
2315
|
+
var _a3, _b3, _c3;
|
2253
2316
|
if (response.Error) {
|
2254
|
-
console.log(response == null ? void 0 : response.Error);
|
2255
2317
|
showError(response.Error);
|
2256
2318
|
hideLoader();
|
2257
2319
|
} else {
|
@@ -2262,7 +2324,6 @@ function GetPaymentPage(props) {
|
|
2262
2324
|
response.isCardSave = `${saveCardInfo}`;
|
2263
2325
|
try {
|
2264
2326
|
let apiResponse = await import_axios3.default.post(`${masterBaseUrl}quick-pay/${result == null ? void 0 : result.data.data.posSalesIdEncode}`, response);
|
2265
|
-
console.log(apiResponse);
|
2266
2327
|
setCardData({
|
2267
2328
|
cardName: "",
|
2268
2329
|
cardNumber: "",
|
@@ -2273,12 +2334,12 @@ function GetPaymentPage(props) {
|
|
2273
2334
|
zipCode: ""
|
2274
2335
|
});
|
2275
2336
|
setSaveCardInfo(false);
|
2337
|
+
setTranId((_a3 = apiResponse == null ? void 0 : apiResponse.data) == null ? void 0 : _a3.transactionId);
|
2276
2338
|
setSuccess(true);
|
2277
2339
|
hideLoader();
|
2278
2340
|
} catch (err) {
|
2279
|
-
console.log(err);
|
2280
2341
|
hideLoader();
|
2281
|
-
showError(((
|
2342
|
+
showError(((_c3 = (_b3 = err == null ? void 0 : err.response) == null ? void 0 : _b3.data) == null ? void 0 : _c3.message) || (err == null ? void 0 : err.message) || "Something went wrong..");
|
2282
2343
|
}
|
2283
2344
|
}
|
2284
2345
|
};
|
@@ -2337,22 +2398,22 @@ function GetPaymentPage(props) {
|
|
2337
2398
|
headers: myHeaders2
|
2338
2399
|
}
|
2339
2400
|
);
|
2340
|
-
console.log(paymentRes);
|
2341
2401
|
if ((_k = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _k.result) {
|
2402
|
+
setTranId((_m = (_l = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _l.data) == null ? void 0 : _m.transactionId);
|
2342
2403
|
setSuccess(true);
|
2343
2404
|
hideLoader();
|
2344
2405
|
}
|
2345
2406
|
} catch (err) {
|
2346
2407
|
hideLoader();
|
2347
|
-
showError(((
|
2408
|
+
showError(((_o = (_n = err == null ? void 0 : err.response) == null ? void 0 : _n.data) == null ? void 0 : _o.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
2348
2409
|
}
|
2349
2410
|
} catch (err) {
|
2350
2411
|
hideLoader();
|
2351
|
-
showError(((
|
2412
|
+
showError(((_q = (_p = err == null ? void 0 : err.response) == null ? void 0 : _p.data) == null ? void 0 : _q.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
2352
2413
|
}
|
2353
2414
|
} catch (err) {
|
2354
2415
|
hideLoader();
|
2355
|
-
showError(((
|
2416
|
+
showError(((_s = (_r = err == null ? void 0 : err.response) == null ? void 0 : _r.data) == null ? void 0 : _s.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
2356
2417
|
}
|
2357
2418
|
} else {
|
2358
2419
|
if (typeof DatacapWebToken !== "undefined") {
|
@@ -2361,7 +2422,7 @@ function GetPaymentPage(props) {
|
|
2361
2422
|
}
|
2362
2423
|
} catch (err) {
|
2363
2424
|
hideLoader();
|
2364
|
-
showError(((
|
2425
|
+
showError(((_u = (_t = err == null ? void 0 : err.response) == null ? void 0 : _t.data) == null ? void 0 : _u.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
2365
2426
|
}
|
2366
2427
|
}
|
2367
2428
|
}
|
@@ -2369,7 +2430,6 @@ function GetPaymentPage(props) {
|
|
2369
2430
|
const hasError = validateAchData();
|
2370
2431
|
if (hasError) return;
|
2371
2432
|
else {
|
2372
|
-
console.log(achData);
|
2373
2433
|
let dataForm = {
|
2374
2434
|
fractalpayPublicKey: fractalpayClientKey,
|
2375
2435
|
label: (achData == null ? void 0 : achData.name) || "John Doe",
|
@@ -2389,17 +2449,19 @@ function GetPaymentPage(props) {
|
|
2389
2449
|
try {
|
2390
2450
|
let result = await import_axios3.default.post(`${baseUrl}ach-incoming`, dataForm);
|
2391
2451
|
hideLoader();
|
2392
|
-
console.log(result);
|
2393
2452
|
import_sweetalert2.default.fire({
|
2394
2453
|
icon: "success",
|
2395
2454
|
title: "Congrats...",
|
2396
|
-
text: (
|
2455
|
+
text: (_v = result == null ? void 0 : result.data) == null ? void 0 : _v.message
|
2456
|
+
}).then((res) => {
|
2457
|
+
if (res.isConfirmed) {
|
2458
|
+
handleClose();
|
2459
|
+
}
|
2397
2460
|
});
|
2398
2461
|
} catch (error) {
|
2399
2462
|
if (import_axios3.default.isAxiosError(error)) {
|
2400
|
-
console.log(error);
|
2401
2463
|
hideLoader();
|
2402
|
-
showError((
|
2464
|
+
showError((_z = (_y = (_x = (_w = error.response) == null ? void 0 : _w.data) == null ? void 0 : _x.message) == null ? void 0 : _y.error) != null ? _z : "Something went wrong");
|
2403
2465
|
} else {
|
2404
2466
|
console.error("Unexpected error", error);
|
2405
2467
|
}
|
@@ -2416,7 +2478,6 @@ function GetPaymentPage(props) {
|
|
2416
2478
|
"customer_id": props == null ? void 0 : props.customerId
|
2417
2479
|
};
|
2418
2480
|
let paymentData2 = await import_axios3.default.post(`${baseUrl}get-payment-details`, data);
|
2419
|
-
console.log(paymentData2);
|
2420
2481
|
setPaymentData((_a2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _a2.data);
|
2421
2482
|
if (((_c2 = (_b2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _b2.data) == null ? void 0 : _c2.card_list) && ((_f2 = (_e2 = (_d2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _d2.data) == null ? void 0 : _e2.card_list) == null ? void 0 : _f2.length) > 0) {
|
2422
2483
|
setCardList((_h2 = (_g2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _g2.data) == null ? void 0 : _h2.card_list);
|
@@ -2426,14 +2487,12 @@ function GetPaymentPage(props) {
|
|
2426
2487
|
}
|
2427
2488
|
hideLoader();
|
2428
2489
|
} catch (err) {
|
2429
|
-
console.log(err);
|
2430
2490
|
setActive("card");
|
2431
2491
|
hideLoader();
|
2432
2492
|
}
|
2433
2493
|
};
|
2434
2494
|
const handlechargeCustomer = async () => {
|
2435
|
-
var _b2, _c2, _d2, _e2, _f2;
|
2436
|
-
console.log("selected", selectedCard);
|
2495
|
+
var _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
2437
2496
|
let customer_id = props == null ? void 0 : props.customerId;
|
2438
2497
|
let discount = props == null ? void 0 : props.discount;
|
2439
2498
|
let surcharge = props == null ? void 0 : props.surcharge;
|
@@ -2466,15 +2525,14 @@ function GetPaymentPage(props) {
|
|
2466
2525
|
showLoader();
|
2467
2526
|
try {
|
2468
2527
|
let result = await import_axios3.default.post(chargeurl, card_type == "Bank" ? rest : chargeobj, { headers });
|
2469
|
-
console.log(result);
|
2470
2528
|
if ((_b2 = result == null ? void 0 : result.data) == null ? void 0 : _b2.result) {
|
2529
|
+
setTranId((_d2 = (_c2 = result == null ? void 0 : result.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.transaction_id);
|
2471
2530
|
setSuccess(true);
|
2472
2531
|
hideLoader();
|
2473
2532
|
}
|
2474
2533
|
} catch (err) {
|
2475
2534
|
hideLoader();
|
2476
|
-
|
2477
|
-
showError(((_d2 = (_c2 = err == null ? void 0 : err.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || ((_f2 = (_e2 = err == null ? void 0 : err.response) == null ? void 0 : _e2.data) == null ? void 0 : _f2.status) || "Something went erong");
|
2535
|
+
showError(((_f2 = (_e2 = err == null ? void 0 : err.response) == null ? void 0 : _e2.data) == null ? void 0 : _f2.message) || ((_h2 = (_g2 = err == null ? void 0 : err.response) == null ? void 0 : _g2.data) == null ? void 0 : _h2.status) || "Something went erong");
|
2478
2536
|
}
|
2479
2537
|
} else {
|
2480
2538
|
showError("Please Select A Card/ACH");
|
@@ -2518,7 +2576,6 @@ function GetPaymentPage(props) {
|
|
2518
2576
|
const res = await import_axios3.default.post(`${baseUrl}delete-customer-card`, obj);
|
2519
2577
|
hideLoader();
|
2520
2578
|
getPaymentDetails();
|
2521
|
-
console.log("Deleted:", res);
|
2522
2579
|
import_sweetalert2.default.fire({
|
2523
2580
|
icon: "success",
|
2524
2581
|
title: "Deleted!",
|
@@ -2534,7 +2591,6 @@ function GetPaymentPage(props) {
|
|
2534
2591
|
});
|
2535
2592
|
} catch (err) {
|
2536
2593
|
hideLoader();
|
2537
|
-
console.log("Error:", err);
|
2538
2594
|
import_sweetalert2.default.fire({
|
2539
2595
|
icon: "error",
|
2540
2596
|
title: "Error!",
|
@@ -2573,7 +2629,7 @@ function GetPaymentPage(props) {
|
|
2573
2629
|
onClose: handleClose
|
2574
2630
|
},
|
2575
2631
|
/* @__PURE__ */ import_react12.default.createElement(Loader_default, { loading }),
|
2576
|
-
success ? /* @__PURE__ */ import_react12.default.createElement(SuccessMsz, { onClose:
|
2632
|
+
success ? /* @__PURE__ */ import_react12.default.createElement(SuccessMsz, { onClose: handleClose, tranId }) : /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("div", { className: "parent-pay-container" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ import_react12.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react12.default.createElement("g", { clipPath: "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react12.default.createElement("path", { d: "M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z", fill: "#727272" })), /* @__PURE__ */ import_react12.default.createElement("defs", null, /* @__PURE__ */ import_react12.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react12.default.createElement("rect", { width: "16", height: "16", fill: "white" }))))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-main-logo-res" }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/uploaded/merchant_logo/20250311131124_merchant_logo.png", id: "pay-logos" })), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-container" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-header pay-conatiner-one" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-conatiner-one-first" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-logo-container" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-main-logo" }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/uploaded/merchant_logo/20250311131124_merchant_logo.png", id: "pay-logos" })), /* @__PURE__ */ import_react12.default.createElement("h1", { className: "pay-heading" }, "Pay")), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-amount-conatiner" }, /* @__PURE__ */ import_react12.default.createElement("small", { className: "pay-payment-amount" }, "Payment Amount"), /* @__PURE__ */ import_react12.default.createElement("strong", { className: "pay-amount" }, "$", props == null ? void 0 : props.amount)), activetab != "ach" && /* @__PURE__ */ import_react12.default.createElement("div", { style: { display: "flex", gap: "8px", margin: "8px 0" } }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/visa-img.svg", alt: "", width: 33 }), /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/mc-img.svg", width: 33, alt: "" }), /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/ae-img.svg", alt: "", width: 33 }), /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/discover-img.svg", width: 33, alt: "" }))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-conatiner-one-last" }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/secure-img.png", alt: "" }), /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/pov-by.png", alt: "" }), "Secure payments powered by Fractal"), /* @__PURE__ */ import_react12.default.createElement("div", null)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-tab pay-conatiner-two" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "col-md-12" }, /* @__PURE__ */ import_react12.default.createElement("div", { id: "payment-form-div" }, activetab !== "cardList" ? /* @__PURE__ */ import_react12.default.createElement("div", null, (cardList == null ? void 0 : cardList.length) > 0 && /* @__PURE__ */ import_react12.default.createElement("button", { className: "charge-payment-back-btn ", onClick: () => setActive("cardList") }, " ", /* @__PURE__ */ import_react12.default.createElement(import_io5.IoArrowBack, null), " Back"), (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && /* @__PURE__ */ import_react12.default.createElement("div", { className: "tab" }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "tablinks", onClick: (e) => {
|
2577
2633
|
handletabchange("card");
|
2578
2634
|
}, style: { border: activetab === "card" ? "1px solid" : "" } }, /* @__PURE__ */ import_react12.default.createElement("i", { className: "fas fa-credit-card me-2", style: { marginRight: "8px", fontSize: "15px" } }), "Card"), /* @__PURE__ */ import_react12.default.createElement("button", { className: "tablinks", onClick: (e) => {
|
2579
2635
|
handletabchange("ach");
|
@@ -2587,7 +2643,7 @@ function GetPaymentPage(props) {
|
|
2587
2643
|
checked: selectedCard === card,
|
2588
2644
|
onChange: (e) => setSelectedCard(card)
|
2589
2645
|
}
|
2590
|
-
), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "", className: "card-number-last-four" }, "**** ", card == null ? void 0 : card.cardlastfourdigit), /* @__PURE__ */ import_react12.default.createElement("h6", { className: "card-expiry-date" }, card == null ? void 0 : card.expmonth, "/", card == null ? void 0 : card.expyear)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "visa-card" }, /* @__PURE__ */ import_react12.default.createElement("img", { src: (card == null ? void 0 : card.card_type) != "Bank" ? "https://dev-widget.fractalpay.com/images/visa-img.svg" : "https://dev-widget.fractalpay.com/images/bank.svg", alt: "" })), /* @__PURE__ */ import_react12.default.createElement("span", { className: "visa-card", style: { cursor: "pointer" }, onClick: () => handleDeleteCard(card == null ? void 0 : card.id) }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/Trash.svg", alt: "" }))))))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-with-other-card ", onClick: () => setActive("card") }, "Pay With Other Card", /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/card.svg", alt: "" }))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group", style: { padding: "0" } }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer }, "$", props == null ? void 0 : props.amount))), /* @__PURE__ */ import_react12.default.createElement("div", { id: "card", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react12.default.createElement("form", { id: "PaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ach-scrl", style: { minHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "378px" : (cardList == null ? void 0 : cardList.length) > 0 ? "442px" : "500px", overflow: "auto", marginRight: "5px" } }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "cardHolderName" }, "NAME ON CARD "), /* @__PURE__ */ import_react12.default.createElement("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
|
2646
|
+
), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "", className: "card-number-last-four" }, "**** ", card == null ? void 0 : card.cardlastfourdigit), /* @__PURE__ */ import_react12.default.createElement("h6", { className: "card-expiry-date" }, card == null ? void 0 : card.expmonth, "/", card == null ? void 0 : card.expyear)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "visa-card" }, /* @__PURE__ */ import_react12.default.createElement("img", { src: (card == null ? void 0 : card.card_type) != "Bank" ? "https://dev-widget.fractalpay.com/images/visa-img.svg" : "https://dev-widget.fractalpay.com/images/bank.svg", alt: "" })), /* @__PURE__ */ import_react12.default.createElement("span", { className: "visa-card", style: { cursor: "pointer" }, onClick: () => handleDeleteCard(card == null ? void 0 : card.id) }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/Trash.svg", alt: "" }))))))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-with-other-card ", onClick: () => setActive("card") }, "Pay With Other Card", /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/card.svg", alt: "" }))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group", style: { padding: "0" } }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer }, "$", props == null ? void 0 : props.amount))), /* @__PURE__ */ import_react12.default.createElement("div", { id: "card", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react12.default.createElement("form", { id: "PaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ach-scrl", style: { minHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "378px" : (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) == 0 ? "436px" : (cardList == null ? void 0 : cardList.length) > 0 ? "442px" : "500px", overflow: "auto", marginRight: "5px" } }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "cardHolderName" }, "NAME ON CARD "), /* @__PURE__ */ import_react12.default.createElement("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
|
2591
2647
|
const value = e.target.value;
|
2592
2648
|
if (/^[a-zA-Z\s]*$/.test(value)) {
|
2593
2649
|
handleCardChange("cardName", value);
|
@@ -2657,7 +2713,11 @@ function GetPaymentPage(props) {
|
|
2657
2713
|
checked: saveCardInfo,
|
2658
2714
|
onChange: (e) => setSaveCardInfo(e.target.checked)
|
2659
2715
|
}
|
2660
|
-
), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "save_card", className: "toggle-label" }), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "save_card" }, "Save card for future payments "), /* @__PURE__ */ import_react12.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, /* @__PURE__ */ import_react12.default.createElement("g", { clipPath: "url(#clip0_12420_50192)" }, /* @__PURE__ */ import_react12.default.createElement("rect", { width: "20", height: "20", fill: "white" }), /* @__PURE__ */ import_react12.default.createElement("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z", fill: "#161616" })), /* @__PURE__ */ import_react12.default.createElement("defs", null, /* @__PURE__ */ import_react12.default.createElement("clipPath", { id: "clip0_12420_50192" }, /* @__PURE__ */ import_react12.default.createElement("rect", { width: "20", height: "20", fill: "white" }))))))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group", style: { marginTop: "20px", padding: "0" } }, /* @__PURE__ */ import_react12.default.createElement("button", { type: "submit", style: { margin: 0 }, className: "pay-button" }, "$", props == null ? void 0 : props.amount)))), /* @__PURE__ */ import_react12.default.createElement("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react12.default.createElement("form", { id: "ACHPaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ach-scrl", style: {
|
2716
|
+
), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "save_card", className: "toggle-label" }), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "save_card" }, "Save card for future payments "), /* @__PURE__ */ import_react12.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, /* @__PURE__ */ import_react12.default.createElement("g", { clipPath: "url(#clip0_12420_50192)" }, /* @__PURE__ */ import_react12.default.createElement("rect", { width: "20", height: "20", fill: "white" }), /* @__PURE__ */ import_react12.default.createElement("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z", fill: "#161616" })), /* @__PURE__ */ import_react12.default.createElement("defs", null, /* @__PURE__ */ import_react12.default.createElement("clipPath", { id: "clip0_12420_50192" }, /* @__PURE__ */ import_react12.default.createElement("rect", { width: "20", height: "20", fill: "white" }))))))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group", style: { marginTop: "20px", padding: "0" } }, /* @__PURE__ */ import_react12.default.createElement("button", { type: "submit", style: { margin: 0 }, className: "pay-button" }, "$", props == null ? void 0 : props.amount)))), /* @__PURE__ */ import_react12.default.createElement("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react12.default.createElement("form", { id: "ACHPaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ach-scrl", style: {
|
2717
|
+
// minHeight: paymentData?.isSkyFiAccount && cardList?.length > 0 ? "378px" : cardList?.length > 0 ? '442px': '500px', overflow: 'auto', marginRight: '5px',
|
2718
|
+
maxHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "378px" : (cardList == null ? void 0 : cardList.length) > 0 ? "380" : "380",
|
2719
|
+
minHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "378px" : (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) == 0 ? "436px" : (cardList == null ? void 0 : cardList.length) > 0 ? "442px" : "500px"
|
2720
|
+
} }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "nameonaccount" }, "Name on account"), /* @__PURE__ */ import_react12.default.createElement("input", { type: "text", id: "nameonaccount", className: "form-control", maxLength: 100, placeholder: "John Doe", name: "name", value: (_e = achData == null ? void 0 : achData.name) != null ? _e : "", onChange: handleChangeAch }), (achError == null ? void 0 : achError.name) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.name)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "routingnumber" }, "Routing number"), /* @__PURE__ */ import_react12.default.createElement(
|
2661
2721
|
"input",
|
2662
2722
|
{
|
2663
2723
|
type: "text",
|
@@ -2727,6 +2787,7 @@ function PreAuthPayment(props) {
|
|
2727
2787
|
const [cardList, setCardList] = (0, import_react13.useState)([]);
|
2728
2788
|
const [selectedCard, setSelectedCard] = (0, import_react13.useState)();
|
2729
2789
|
const [paymentData, setPaymentData] = (0, import_react13.useState)();
|
2790
|
+
let [tranId, setTranId] = (0, import_react13.useState)("");
|
2730
2791
|
const showLoader = () => setLoading(true);
|
2731
2792
|
const hideLoader = () => setLoading(false);
|
2732
2793
|
const showError = (msz) => {
|
@@ -2739,15 +2800,39 @@ function PreAuthPayment(props) {
|
|
2739
2800
|
const handleClose = () => {
|
2740
2801
|
setShow(false);
|
2741
2802
|
setActive("card");
|
2742
|
-
};
|
2743
|
-
const handleShow = () => setShow(true);
|
2744
|
-
const handleCloseSeccess = () => {
|
2745
2803
|
setSuccess(false);
|
2746
|
-
|
2747
|
-
|
2748
|
-
|
2749
|
-
|
2804
|
+
setTranId("");
|
2805
|
+
setCardData({
|
2806
|
+
cardName: "",
|
2807
|
+
cardNumber: "",
|
2808
|
+
expiryMonth: "",
|
2809
|
+
expiryYear: "",
|
2810
|
+
cvv: "",
|
2811
|
+
orderId: "",
|
2812
|
+
zipCode: ""
|
2813
|
+
});
|
2814
|
+
setCardError({
|
2815
|
+
cardName: "",
|
2816
|
+
cardNumber: "",
|
2817
|
+
expiryMonth: "",
|
2818
|
+
expiryYear: "",
|
2819
|
+
cvv: "",
|
2820
|
+
orderId: "",
|
2821
|
+
zipCode: ""
|
2822
|
+
});
|
2823
|
+
setSaveCardInfo(false);
|
2824
|
+
setSelectedCard({
|
2825
|
+
card_type: "",
|
2826
|
+
cardlastfourdigit: "",
|
2827
|
+
expmonth: 1,
|
2828
|
+
expyear: 2025,
|
2829
|
+
primary_card: 0,
|
2830
|
+
firstname: "",
|
2831
|
+
id: "",
|
2832
|
+
lastname: ""
|
2833
|
+
});
|
2750
2834
|
};
|
2835
|
+
const handleShow = () => setShow(true);
|
2751
2836
|
const handleCardChange = (field, value) => {
|
2752
2837
|
const name = field;
|
2753
2838
|
const numericFields = ["expiryMonth", "expiryYear", "zipCode", "cvv"];
|
@@ -2765,7 +2850,6 @@ function PreAuthPayment(props) {
|
|
2765
2850
|
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2766
2851
|
[name]: ""
|
2767
2852
|
}));
|
2768
|
-
console.log(value, name);
|
2769
2853
|
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2770
2854
|
[name]: value
|
2771
2855
|
}));
|
@@ -2823,7 +2907,7 @@ function PreAuthPayment(props) {
|
|
2823
2907
|
return Object.keys(errors).length > 0;
|
2824
2908
|
};
|
2825
2909
|
const submitFunc = async (e) => {
|
2826
|
-
var _a2, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
2910
|
+
var _a2, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
2827
2911
|
e.preventDefault();
|
2828
2912
|
if (activetab == "card") {
|
2829
2913
|
const hasError = validateCardData();
|
@@ -2838,13 +2922,11 @@ function PreAuthPayment(props) {
|
|
2838
2922
|
if (!validCVV) errors.cvv = "Invalid CVV";
|
2839
2923
|
setCardError(errors);
|
2840
2924
|
if (validCard && validCVV && validExpirationDate) {
|
2841
|
-
console.log(props == null ? void 0 : props.customerId);
|
2842
2925
|
showLoader();
|
2843
2926
|
try {
|
2844
2927
|
let tokenCallback = async function(response) {
|
2845
|
-
var _a3, _b3;
|
2928
|
+
var _a3, _b3, _c3;
|
2846
2929
|
if (response.Error) {
|
2847
|
-
console.log(response == null ? void 0 : response.Error);
|
2848
2930
|
showError(response.Error);
|
2849
2931
|
hideLoader();
|
2850
2932
|
} else {
|
@@ -2860,10 +2942,8 @@ function PreAuthPayment(props) {
|
|
2860
2942
|
response.customer_id = props == null ? void 0 : props.customerId;
|
2861
2943
|
response.link_token = "";
|
2862
2944
|
response.gateway_id = paymentData == null ? void 0 : paymentData.paymentGateway;
|
2863
|
-
console.log("Response :", response);
|
2864
2945
|
try {
|
2865
2946
|
let apiResponse = await import_axios4.default.post(`${baseUrl}preauth`, response);
|
2866
|
-
console.log(apiResponse);
|
2867
2947
|
setCardData({
|
2868
2948
|
cardName: "",
|
2869
2949
|
cardNumber: "",
|
@@ -2874,11 +2954,12 @@ function PreAuthPayment(props) {
|
|
2874
2954
|
zipCode: ""
|
2875
2955
|
});
|
2876
2956
|
setSuccess(true);
|
2957
|
+
setTranId((_a3 = apiResponse == null ? void 0 : apiResponse.data) == null ? void 0 : _a3.transactionId);
|
2877
2958
|
hideLoader();
|
2878
2959
|
} catch (err) {
|
2879
2960
|
console.log(err);
|
2880
2961
|
hideLoader();
|
2881
|
-
showError(((
|
2962
|
+
showError(((_c3 = (_b3 = err == null ? void 0 : err.response) == null ? void 0 : _b3.data) == null ? void 0 : _c3.message) || (err == null ? void 0 : err.message) || "Something went wrong..");
|
2882
2963
|
}
|
2883
2964
|
}
|
2884
2965
|
};
|
@@ -2945,30 +3026,30 @@ function PreAuthPayment(props) {
|
|
2945
3026
|
headers: myHeaders2
|
2946
3027
|
}
|
2947
3028
|
);
|
2948
|
-
console.log(paymentRes);
|
2949
3029
|
if ((_n = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _n.result) {
|
3030
|
+
setTranId((_p = (_o = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _o.data) == null ? void 0 : _p.transaction_id);
|
2950
3031
|
setSuccess(true);
|
2951
3032
|
hideLoader();
|
2952
3033
|
}
|
2953
3034
|
} catch (err) {
|
2954
3035
|
hideLoader();
|
2955
|
-
showError(((
|
3036
|
+
showError(((_r = (_q = err == null ? void 0 : err.response) == null ? void 0 : _q.data) == null ? void 0 : _r.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
2956
3037
|
}
|
2957
3038
|
} catch (err) {
|
2958
3039
|
console.log(err);
|
2959
3040
|
hideLoader();
|
2960
|
-
showError(((
|
3041
|
+
showError(((_t = (_s = err == null ? void 0 : err.response) == null ? void 0 : _s.data) == null ? void 0 : _t.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
2961
3042
|
}
|
2962
3043
|
} catch (err) {
|
2963
3044
|
hideLoader();
|
2964
|
-
showError(((
|
3045
|
+
showError(((_v = (_u = err == null ? void 0 : err.response) == null ? void 0 : _u.data) == null ? void 0 : _v.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
2965
3046
|
}
|
2966
3047
|
} else {
|
2967
3048
|
DatacapWebToken.requestToken(paymentData == null ? void 0 : paymentData.dctoken, "PaymentForm", tokenCallback);
|
2968
3049
|
}
|
2969
3050
|
} catch (err) {
|
2970
3051
|
hideLoader();
|
2971
|
-
showError(((
|
3052
|
+
showError(((_x = (_w = err == null ? void 0 : err.response) == null ? void 0 : _w.data) == null ? void 0 : _x.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
2972
3053
|
}
|
2973
3054
|
}
|
2974
3055
|
}
|
@@ -2984,7 +3065,6 @@ function PreAuthPayment(props) {
|
|
2984
3065
|
preauth: true
|
2985
3066
|
};
|
2986
3067
|
let paymentData2 = await import_axios4.default.post(`${baseUrl}get-payment-details`, data);
|
2987
|
-
console.log(paymentData2);
|
2988
3068
|
setPaymentData((_a2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _a2.data);
|
2989
3069
|
if (((_c2 = (_b2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _b2.data) == null ? void 0 : _c2.card_list) && ((_f = (_e = (_d2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _d2.data) == null ? void 0 : _e.card_list) == null ? void 0 : _f.length) > 0) {
|
2990
3070
|
setCardList((_h = (_g = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _g.data) == null ? void 0 : _h.card_list);
|
@@ -3000,8 +3080,7 @@ function PreAuthPayment(props) {
|
|
3000
3080
|
}
|
3001
3081
|
};
|
3002
3082
|
const handlechargeCustomer = async () => {
|
3003
|
-
var _b2, _c2, _d2, _e, _f;
|
3004
|
-
console.log("selected", selectedCard);
|
3083
|
+
var _b2, _c2, _d2, _e, _f, _g, _h;
|
3005
3084
|
let customer_id = props == null ? void 0 : props.customerId;
|
3006
3085
|
let discount = props == null ? void 0 : props.discount;
|
3007
3086
|
let surcharge = props == null ? void 0 : props.surcharge;
|
@@ -3034,15 +3113,15 @@ function PreAuthPayment(props) {
|
|
3034
3113
|
showLoader();
|
3035
3114
|
try {
|
3036
3115
|
let result = await import_axios4.default.post(chargeurl, card_type == "Bank" ? rest : chargeobj, { headers });
|
3037
|
-
console.log(result);
|
3038
3116
|
if ((_b2 = result == null ? void 0 : result.data) == null ? void 0 : _b2.result) {
|
3117
|
+
setTranId((_d2 = (_c2 = result == null ? void 0 : result.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.transaction_id);
|
3039
3118
|
setSuccess(true);
|
3040
3119
|
hideLoader();
|
3041
3120
|
}
|
3042
3121
|
} catch (err) {
|
3043
3122
|
hideLoader();
|
3044
3123
|
console.log(err);
|
3045
|
-
showError(((
|
3124
|
+
showError(((_f = (_e = err == null ? void 0 : err.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || ((_h = (_g = err == null ? void 0 : err.response) == null ? void 0 : _g.data) == null ? void 0 : _h.status) || "Something went erong");
|
3046
3125
|
}
|
3047
3126
|
} else {
|
3048
3127
|
showError("Please Select A Card/ACH");
|
@@ -3086,7 +3165,6 @@ function PreAuthPayment(props) {
|
|
3086
3165
|
const res = await import_axios4.default.post(`${baseUrl}delete-customer-card`, obj);
|
3087
3166
|
hideLoader();
|
3088
3167
|
getPaymentDetails();
|
3089
|
-
console.log("Deleted:", res);
|
3090
3168
|
import_sweetalert22.default.fire({
|
3091
3169
|
icon: "success",
|
3092
3170
|
title: "Deleted!",
|
@@ -3098,7 +3176,6 @@ function PreAuthPayment(props) {
|
|
3098
3176
|
});
|
3099
3177
|
} catch (err) {
|
3100
3178
|
hideLoader();
|
3101
|
-
console.error("Error:", err);
|
3102
3179
|
import_sweetalert22.default.fire({
|
3103
3180
|
icon: "error",
|
3104
3181
|
title: "Error!",
|
@@ -3126,7 +3203,7 @@ function PreAuthPayment(props) {
|
|
3126
3203
|
onClose: handleClose
|
3127
3204
|
},
|
3128
3205
|
/* @__PURE__ */ import_react13.default.createElement(Loader_default, { loading }),
|
3129
|
-
success ? /* @__PURE__ */ import_react13.default.createElement(SuccessMsz, { onClose:
|
3206
|
+
success ? /* @__PURE__ */ import_react13.default.createElement(SuccessMsz, { onClose: handleClose, tranId }) : /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement("div", { className: "parent-pay-container" }, /* @__PURE__ */ import_react13.default.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ import_react13.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react13.default.createElement("g", { clipPath: "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react13.default.createElement("path", { d: "M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z", fill: "#727272" })), /* @__PURE__ */ import_react13.default.createElement("defs", null, /* @__PURE__ */ import_react13.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react13.default.createElement("rect", { width: "16", height: "16", fill: "white" }))))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "pay-container" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "pay-header pay-conatiner-one" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "pay-conatiner-one-first" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "pay-logo-container" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "pay-main-logo" }, /* @__PURE__ */ import_react13.default.createElement("img", { src: "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/uploaded/merchant_logo/20250311131124_merchant_logo.png", id: "pay-logos" })), /* @__PURE__ */ import_react13.default.createElement("h1", { className: "pay-heading" }, "Pay")), /* @__PURE__ */ import_react13.default.createElement("div", { className: "pay-amount-conatiner" }, /* @__PURE__ */ import_react13.default.createElement("small", { className: "pay-payment-amount" }, "Payment Amount"), /* @__PURE__ */ import_react13.default.createElement("strong", { className: "pay-amount" }, "$", props == null ? void 0 : props.amount)), activetab != "ach" && /* @__PURE__ */ import_react13.default.createElement("div", { style: { display: "flex", gap: "8px", margin: "8px 0" } }, /* @__PURE__ */ import_react13.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/visa-img.svg", alt: "", width: 33 }), /* @__PURE__ */ import_react13.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/mc-img.svg", width: 33, alt: "" }), /* @__PURE__ */ import_react13.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/ae-img.svg", alt: "", width: 33 }), /* @__PURE__ */ import_react13.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/discover-img.svg", width: 33, alt: "" }))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "pay-conatiner-one-last" }, /* @__PURE__ */ import_react13.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/secure-img.png", alt: "" }), /* @__PURE__ */ import_react13.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/pov-by.png", alt: "" }), "Secure payments powered by Fractal"), /* @__PURE__ */ import_react13.default.createElement("div", null)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "pay-tab pay-conatiner-two" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "col-md-12" }, /* @__PURE__ */ import_react13.default.createElement("div", { id: "payment-form-div" }, activetab !== "cardList" ? /* @__PURE__ */ import_react13.default.createElement("div", null, (cardList == null ? void 0 : cardList.length) > 0 && /* @__PURE__ */ import_react13.default.createElement("button", { className: "charge-payment-back-btn ", onClick: () => setActive("cardList") }, " ", /* @__PURE__ */ import_react13.default.createElement(import_io52.IoArrowBack, null), " Back")) : /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement("p", { className: "charge-customer-name" }, " Charge ", paymentData == null ? void 0 : paymentData.customer_name), /* @__PURE__ */ import_react13.default.createElement("p", { className: "card-ach-heading" }, " Cards")), /* @__PURE__ */ import_react13.default.createElement("div", { style: { display: activetab === "cardList" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "card-lint-div-in" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "card-list-div" }, (paymentData == null ? void 0 : paymentData.card_list) && ((_a = paymentData == null ? void 0 : paymentData.card_list) == null ? void 0 : _a.length) > 0 && ((_b = paymentData == null ? void 0 : paymentData.card_list) == null ? void 0 : _b.map((card, index) => /* @__PURE__ */ import_react13.default.createElement("div", { className: "card-list-single-div", key: index }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ import_react13.default.createElement(
|
3130
3207
|
"input",
|
3131
3208
|
{
|
3132
3209
|
type: "radio",
|
@@ -3631,11 +3708,17 @@ function AddCard(props) {
|
|
3631
3708
|
orderId: "",
|
3632
3709
|
zipCode: ""
|
3633
3710
|
});
|
3711
|
+
setCardError({
|
3712
|
+
cardName: "",
|
3713
|
+
cardNumber: "",
|
3714
|
+
expiryMonth: "",
|
3715
|
+
expiryYear: "",
|
3716
|
+
cvv: "",
|
3717
|
+
orderId: "",
|
3718
|
+
zipCode: ""
|
3719
|
+
});
|
3634
3720
|
};
|
3635
3721
|
const handleShow = () => setShow(true);
|
3636
|
-
const handleCloseSeccess = () => {
|
3637
|
-
handleClose();
|
3638
|
-
};
|
3639
3722
|
const handleCardChange = (field, value) => {
|
3640
3723
|
const name = field;
|
3641
3724
|
const numericFields = ["expiryMonth", "expiryYear", "zipCode", "cvv"];
|
@@ -3653,7 +3736,6 @@ function AddCard(props) {
|
|
3653
3736
|
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
3654
3737
|
[name]: ""
|
3655
3738
|
}));
|
3656
|
-
console.log(value, name);
|
3657
3739
|
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
3658
3740
|
[name]: value
|
3659
3741
|
}));
|
@@ -3718,7 +3800,7 @@ function AddCard(props) {
|
|
3718
3800
|
return Object.keys(errors).length > 0;
|
3719
3801
|
};
|
3720
3802
|
const getPaymentDetails = async () => {
|
3721
|
-
var _a2
|
3803
|
+
var _a2;
|
3722
3804
|
showLoader();
|
3723
3805
|
try {
|
3724
3806
|
const data = {
|
@@ -3727,14 +3809,9 @@ function AddCard(props) {
|
|
3727
3809
|
addcard: true
|
3728
3810
|
};
|
3729
3811
|
let paymentData2 = await import_axios5.default.post(`${baseUrl}get-payment-details`, data);
|
3730
|
-
console.log(paymentData2);
|
3731
3812
|
setPaymentData((_a2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _a2.data);
|
3732
|
-
if (((_c = (_b = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _b.data) == null ? void 0 : _c.card_list) && ((_f = (_e = (_d = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _d.data) == null ? void 0 : _e.card_list) == null ? void 0 : _f.length) > 0) {
|
3733
|
-
} else {
|
3734
|
-
}
|
3735
3813
|
hideLoader();
|
3736
3814
|
} catch (err) {
|
3737
|
-
console.log(err);
|
3738
3815
|
hideLoader();
|
3739
3816
|
}
|
3740
3817
|
};
|
@@ -3747,7 +3824,6 @@ function AddCard(props) {
|
|
3747
3824
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
3748
3825
|
e.preventDefault();
|
3749
3826
|
const hasError = validateCardData();
|
3750
|
-
console.log(cardData);
|
3751
3827
|
if (hasError) return;
|
3752
3828
|
else {
|
3753
3829
|
let validCard = DatacapWebToken.validateCardNumber(cardData == null ? void 0 : cardData.cardNumber.replaceAll(" ", ""));
|
@@ -3763,9 +3839,7 @@ function AddCard(props) {
|
|
3763
3839
|
try {
|
3764
3840
|
let getTokenCallback = async function(token) {
|
3765
3841
|
var _a3, _b2, _c2, _d2, _e2;
|
3766
|
-
console.log(token);
|
3767
3842
|
if (token.Error) {
|
3768
|
-
console.log(token == null ? void 0 : token.Error);
|
3769
3843
|
showError(token.Error);
|
3770
3844
|
hideLoader();
|
3771
3845
|
} else {
|
@@ -3778,7 +3852,6 @@ function AddCard(props) {
|
|
3778
3852
|
};
|
3779
3853
|
try {
|
3780
3854
|
let apiResponse = await import_axios5.default.post(`${baseUrl}add-card`, reqData);
|
3781
|
-
console.log(apiResponse);
|
3782
3855
|
let formData = {
|
3783
3856
|
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey,
|
3784
3857
|
wallet_id: "",
|
@@ -3789,7 +3862,6 @@ function AddCard(props) {
|
|
3789
3862
|
};
|
3790
3863
|
try {
|
3791
3864
|
const result = await import_axios5.default.post(`${baseUrl}link-wallet`, formData);
|
3792
|
-
console.log(result);
|
3793
3865
|
setSuccess(true);
|
3794
3866
|
hideLoader();
|
3795
3867
|
setCardData({
|
@@ -3802,12 +3874,10 @@ function AddCard(props) {
|
|
3802
3874
|
zipCode: ""
|
3803
3875
|
});
|
3804
3876
|
} catch (err) {
|
3805
|
-
console.log(err);
|
3806
3877
|
hideLoader();
|
3807
3878
|
showError(((_c2 = (_b2 = err == null ? void 0 : err.response) == null ? void 0 : _b2.data) == null ? void 0 : _c2.message) || (err == null ? void 0 : err.message) || "Something went wrong..");
|
3808
3879
|
}
|
3809
3880
|
} catch (err) {
|
3810
|
-
console.log(err);
|
3811
3881
|
hideLoader();
|
3812
3882
|
showError(((_e2 = (_d2 = err == null ? void 0 : err.response) == null ? void 0 : _d2.data) == null ? void 0 : _e2.message) || (err == null ? void 0 : err.message) || "Something went wrong..");
|
3813
3883
|
}
|
@@ -3861,7 +3931,6 @@ function AddCard(props) {
|
|
3861
3931
|
headers: myHeaders2
|
3862
3932
|
}
|
3863
3933
|
);
|
3864
|
-
console.log(addCardRes);
|
3865
3934
|
if ((_h = addCardRes == null ? void 0 : addCardRes.data) == null ? void 0 : _h.result) {
|
3866
3935
|
setSuccess(true);
|
3867
3936
|
hideLoader();
|
@@ -3904,7 +3973,7 @@ function AddCard(props) {
|
|
3904
3973
|
onClose: handleClose
|
3905
3974
|
},
|
3906
3975
|
/* @__PURE__ */ import_react18.default.createElement(Loader_default, { loading }),
|
3907
|
-
success ? /* @__PURE__ */ import_react18.default.createElement(SuccessCardMsz_default, { onClose:
|
3976
|
+
success ? /* @__PURE__ */ import_react18.default.createElement(SuccessCardMsz_default, { onClose: handleClose }) : /* @__PURE__ */ import_react18.default.createElement(
|
3908
3977
|
"div",
|
3909
3978
|
{
|
3910
3979
|
className: "container-creditcard add-card modal-content ",
|
@@ -3990,9 +4059,388 @@ function AddCard(props) {
|
|
3990
4059
|
)
|
3991
4060
|
));
|
3992
4061
|
}
|
4062
|
+
|
4063
|
+
// src/app/components/AddCard/AddCardEasyPay.tsx
|
4064
|
+
var import_react19 = __toESM(require("react"));
|
4065
|
+
var import_sweetalert24 = __toESM(require("sweetalert2"));
|
4066
|
+
var import_axios6 = __toESM(require("axios"));
|
4067
|
+
function AddCardEasyPay(props) {
|
4068
|
+
var _a;
|
4069
|
+
const [loading, setLoading] = (0, import_react19.useState)(false);
|
4070
|
+
const [success, setSuccess] = (0, import_react19.useState)(false);
|
4071
|
+
const [show, setShow] = (0, import_react19.useState)(false);
|
4072
|
+
const [cardData, setCardData] = (0, import_react19.useState)();
|
4073
|
+
const [cardError, setCardError] = (0, import_react19.useState)({});
|
4074
|
+
const [paymentData, setPaymentData] = (0, import_react19.useState)();
|
4075
|
+
const showLoader = () => setLoading(true);
|
4076
|
+
const hideLoader = () => setLoading(false);
|
4077
|
+
const showError = (msz) => {
|
4078
|
+
import_sweetalert24.default.fire({
|
4079
|
+
icon: "error",
|
4080
|
+
text: msz
|
4081
|
+
});
|
4082
|
+
};
|
4083
|
+
const handleClose = () => {
|
4084
|
+
setShow(false);
|
4085
|
+
setSuccess(false);
|
4086
|
+
setCardData({
|
4087
|
+
cardName: "",
|
4088
|
+
cardNumber: "",
|
4089
|
+
expiryMonth: "",
|
4090
|
+
expiryYear: "",
|
4091
|
+
cvv: "",
|
4092
|
+
orderId: "",
|
4093
|
+
zipCode: ""
|
4094
|
+
});
|
4095
|
+
};
|
4096
|
+
const handleShow = () => setShow(true);
|
4097
|
+
const handleCloseSeccess = () => {
|
4098
|
+
handleClose();
|
4099
|
+
};
|
4100
|
+
const handleCardChange = (field, value) => {
|
4101
|
+
const name = field;
|
4102
|
+
const numericFields = ["expiryMonth", "expiryYear", "zipCode", "cvv"];
|
4103
|
+
if (numericFields.includes(name)) {
|
4104
|
+
if (value === "" || /^[0-9]+$/.test(value)) {
|
4105
|
+
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
4106
|
+
[name]: ""
|
4107
|
+
}));
|
4108
|
+
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
4109
|
+
[name]: value
|
4110
|
+
}));
|
4111
|
+
}
|
4112
|
+
return;
|
4113
|
+
}
|
4114
|
+
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
4115
|
+
[name]: ""
|
4116
|
+
}));
|
4117
|
+
console.log(value, name);
|
4118
|
+
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
4119
|
+
[name]: value
|
4120
|
+
}));
|
4121
|
+
};
|
4122
|
+
const handleCardNumberChange = (e) => {
|
4123
|
+
const input = e.target;
|
4124
|
+
const rawValue = input.value.replace(/\D/g, "");
|
4125
|
+
let formatted = "";
|
4126
|
+
if (/^3[47]/.test(rawValue)) {
|
4127
|
+
const trimmed = rawValue.slice(0, 15);
|
4128
|
+
formatted = trimmed.replace(
|
4129
|
+
/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,
|
4130
|
+
(_, g1, g2, g3) => [g1, g2, g3].filter(Boolean).join(" ")
|
4131
|
+
);
|
4132
|
+
} else {
|
4133
|
+
const trimmed = rawValue.slice(0, 16);
|
4134
|
+
formatted = trimmed.replace(
|
4135
|
+
/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,
|
4136
|
+
(_, g1, g2, g3, g4) => [g1, g2, g3, g4].filter(Boolean).join(" ")
|
4137
|
+
);
|
4138
|
+
}
|
4139
|
+
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
4140
|
+
cardNumber: ""
|
4141
|
+
}));
|
4142
|
+
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
4143
|
+
cardNumber: formatted
|
4144
|
+
}));
|
4145
|
+
};
|
4146
|
+
const validateCardData = () => {
|
4147
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
4148
|
+
const errors = {};
|
4149
|
+
const data = cardData;
|
4150
|
+
const month = parseInt((data == null ? void 0 : data.expiryMonth) || "", 10);
|
4151
|
+
const year = (data == null ? void 0 : data.expiryYear) || "";
|
4152
|
+
if (!((_a2 = data == null ? void 0 : data.cardName) == null ? void 0 : _a2.trim())) errors.cardName = "Card name is required";
|
4153
|
+
if (!((_b = data == null ? void 0 : data.cardNumber) == null ? void 0 : _b.trim())) errors.cardNumber = "Card number is required";
|
4154
|
+
if (!((_c = data == null ? void 0 : data.expiryMonth) == null ? void 0 : _c.trim())) {
|
4155
|
+
errors.expiryMonth = "Expiration month is required";
|
4156
|
+
} else if (Number(data == null ? void 0 : data.expiryMonth) > 12 || Number(data == null ? void 0 : data.expiryMonth) < 1) {
|
4157
|
+
errors.expiryMonth = "Invalid Expiration Month.";
|
4158
|
+
}
|
4159
|
+
if (!((_d = data == null ? void 0 : data.expiryYear) == null ? void 0 : _d.trim())) {
|
4160
|
+
errors.expiryYear = "Expiration year is required";
|
4161
|
+
} else if (((_e = data == null ? void 0 : data.expiryYear) == null ? void 0 : _e.trim().length) !== 4 || Number(data == null ? void 0 : data.expiryYear) < 2025) {
|
4162
|
+
errors.expiryYear = "Invalid Expiration Year.";
|
4163
|
+
} else if (isNaN(month) || month < 1 || month > 12 || year.length !== 4) {
|
4164
|
+
errors.expiryMonth = "Invalid Expiration Date.";
|
4165
|
+
}
|
4166
|
+
if (!((_f = data == null ? void 0 : data.cvv) == null ? void 0 : _f.trim())) errors.cvv = "CVC is required";
|
4167
|
+
if (!((_g = data == null ? void 0 : data.zipCode) == null ? void 0 : _g.trim())) errors.zipCode = "ZIP code is required";
|
4168
|
+
if ((data == null ? void 0 : data.expiryMonth) && (data == null ? void 0 : data.expiryYear) && data.expiryMonth.length <= 2 && data.expiryYear.length === 4) {
|
4169
|
+
const month2 = parseInt(data.expiryMonth, 10);
|
4170
|
+
const year2 = parseInt(data.expiryYear, 10);
|
4171
|
+
const now = /* @__PURE__ */ new Date();
|
4172
|
+
const currentMonth = now.getMonth() + 1;
|
4173
|
+
const currentYear = now.getFullYear();
|
4174
|
+
if (year2 < currentYear || year2 === currentYear && month2 < currentMonth) {
|
4175
|
+
errors.expiryMonth = "Card is expired";
|
4176
|
+
}
|
4177
|
+
}
|
4178
|
+
setCardError(errors);
|
4179
|
+
return Object.keys(errors).length > 0;
|
4180
|
+
};
|
4181
|
+
const getPaymentDetails = async () => {
|
4182
|
+
var _a2, _b, _c, _d, _e, _f;
|
4183
|
+
showLoader();
|
4184
|
+
try {
|
4185
|
+
const data = {
|
4186
|
+
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey,
|
4187
|
+
"customer_id": props == null ? void 0 : props.customerId,
|
4188
|
+
addcard: true
|
4189
|
+
};
|
4190
|
+
let paymentData2 = await import_axios6.default.post(`${baseUrl}get-payment-details`, data);
|
4191
|
+
console.log(paymentData2);
|
4192
|
+
setPaymentData((_a2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _a2.data);
|
4193
|
+
if (((_c = (_b = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _b.data) == null ? void 0 : _c.card_list) && ((_f = (_e = (_d = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _d.data) == null ? void 0 : _e.card_list) == null ? void 0 : _f.length) > 0) {
|
4194
|
+
} else {
|
4195
|
+
}
|
4196
|
+
hideLoader();
|
4197
|
+
} catch (err) {
|
4198
|
+
console.log(err);
|
4199
|
+
hideLoader();
|
4200
|
+
}
|
4201
|
+
};
|
4202
|
+
(0, import_react19.useEffect)(() => {
|
4203
|
+
if (props.fractalpayClientKey) {
|
4204
|
+
getPaymentDetails();
|
4205
|
+
}
|
4206
|
+
}, [props == null ? void 0 : props.fractalpayClientKey]);
|
4207
|
+
const addCardFunc = async (e) => {
|
4208
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
4209
|
+
e.preventDefault();
|
4210
|
+
const hasError = validateCardData();
|
4211
|
+
console.log(cardData);
|
4212
|
+
debugger;
|
4213
|
+
if (hasError) return;
|
4214
|
+
else {
|
4215
|
+
let validCard = DatacapWebToken.validateCardNumber(cardData == null ? void 0 : cardData.cardNumber.replaceAll(" ", ""));
|
4216
|
+
let validExpirationDate = DatacapWebToken.validateExpirationDate(cardData == null ? void 0 : cardData.expiryMonth, cardData == null ? void 0 : cardData.expiryYear);
|
4217
|
+
let validCVV = DatacapWebToken.validateCVV(cardData == null ? void 0 : cardData.cvv);
|
4218
|
+
let errors = {};
|
4219
|
+
if (!validCard) errors.cardNumber = "Invalid card Number";
|
4220
|
+
if (!validExpirationDate) errors.expiryMonth = "Invalid Expiration Date.";
|
4221
|
+
if (!validCVV) errors.cvv = "Invalid CVV";
|
4222
|
+
setCardError(errors);
|
4223
|
+
if (validCard && validCVV && validExpirationDate) {
|
4224
|
+
showLoader();
|
4225
|
+
try {
|
4226
|
+
let getTokenCallback = async function(token) {
|
4227
|
+
var _a3, _b2, _c2, _d2, _e2;
|
4228
|
+
console.log(token);
|
4229
|
+
if (token.Error) {
|
4230
|
+
console.log(token == null ? void 0 : token.Error);
|
4231
|
+
showError(token.Error);
|
4232
|
+
hideLoader();
|
4233
|
+
} else {
|
4234
|
+
const reqData = {
|
4235
|
+
userId: props == null ? void 0 : props.customerId,
|
4236
|
+
cardName: cardData == null ? void 0 : cardData.cardName,
|
4237
|
+
zip: cardData == null ? void 0 : cardData.zipCode,
|
4238
|
+
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey,
|
4239
|
+
token
|
4240
|
+
};
|
4241
|
+
try {
|
4242
|
+
let apiResponse = await import_axios6.default.post(`${baseUrl}add-card`, reqData);
|
4243
|
+
console.log(apiResponse);
|
4244
|
+
let formData = {
|
4245
|
+
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey,
|
4246
|
+
wallet_id: "",
|
4247
|
+
card_number: cardData == null ? void 0 : cardData.cardNumber.replaceAll(" ", ""),
|
4248
|
+
exp_month: cardData == null ? void 0 : cardData.expiryMonth,
|
4249
|
+
exp_year: (_a3 = cardData == null ? void 0 : cardData.expiryYear) == null ? void 0 : _a3.slice(-2),
|
4250
|
+
cvv: cardData == null ? void 0 : cardData.cvv
|
4251
|
+
};
|
4252
|
+
try {
|
4253
|
+
const result = await import_axios6.default.post(`${baseUrl}link-wallet`, formData);
|
4254
|
+
console.log(result);
|
4255
|
+
setSuccess(true);
|
4256
|
+
hideLoader();
|
4257
|
+
setCardData({
|
4258
|
+
cardName: "",
|
4259
|
+
cardNumber: "",
|
4260
|
+
expiryMonth: "",
|
4261
|
+
expiryYear: "",
|
4262
|
+
cvv: "",
|
4263
|
+
orderId: "",
|
4264
|
+
zipCode: ""
|
4265
|
+
});
|
4266
|
+
} catch (err) {
|
4267
|
+
console.log(err);
|
4268
|
+
hideLoader();
|
4269
|
+
showError(((_c2 = (_b2 = err == null ? void 0 : err.response) == null ? void 0 : _b2.data) == null ? void 0 : _c2.message) || (err == null ? void 0 : err.message) || "Something went wrong..");
|
4270
|
+
}
|
4271
|
+
} catch (err) {
|
4272
|
+
console.log(err);
|
4273
|
+
hideLoader();
|
4274
|
+
showError(((_e2 = (_d2 = err == null ? void 0 : err.response) == null ? void 0 : _d2.data) == null ? void 0 : _e2.message) || (err == null ? void 0 : err.message) || "Something went wrong..");
|
4275
|
+
}
|
4276
|
+
}
|
4277
|
+
};
|
4278
|
+
if ((paymentData == null ? void 0 : paymentData.paymentGateway) === 32) {
|
4279
|
+
const requestOptions = {
|
4280
|
+
method: "POST",
|
4281
|
+
redirect: "follow"
|
4282
|
+
};
|
4283
|
+
try {
|
4284
|
+
let sesionResult = await import_axios6.default.post(`${masterBaseUrl}api/v1/widget/generate-session`, requestOptions);
|
4285
|
+
let expYear = Number(cardData == null ? void 0 : cardData.expiryYear) % 100;
|
4286
|
+
let cardNumber = cardData == null ? void 0 : cardData.cardNumber;
|
4287
|
+
cardNumber = cardNumber == null ? void 0 : cardNumber.replace(/\s+/g, "");
|
4288
|
+
let track2_data = `${cardNumber}=${expYear}${cardData == null ? void 0 : cardData.expiryMonth} ${cardData == null ? void 0 : cardData.cvv}`;
|
4289
|
+
const publicKey = forge.pki.publicKeyFromPem((_b = (_a2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _a2.data) == null ? void 0 : _b.publicKeyPem);
|
4290
|
+
const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
|
4291
|
+
md: forge.md.sha1.create(),
|
4292
|
+
mgf1: {
|
4293
|
+
md: forge.md.sha1.create()
|
4294
|
+
}
|
4295
|
+
});
|
4296
|
+
const encryptedBase64 = forge.util.encode64(encrypted);
|
4297
|
+
const myHeaders = {
|
4298
|
+
"Content-Type": "application/json",
|
4299
|
+
"x-app-session-key": (_d = (_c = sesionResult.data) == null ? void 0 : _c.data) == null ? void 0 : _d.session_key
|
4300
|
+
};
|
4301
|
+
const raw = JSON.stringify({
|
4302
|
+
"enc_track2_data": `${encryptedBase64}`,
|
4303
|
+
"algorithm": "RSAES_OAEP_SHA_1",
|
4304
|
+
session_key: `${(_f = (_e = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _e.data) == null ? void 0 : _f.session_key}`
|
4305
|
+
});
|
4306
|
+
try {
|
4307
|
+
const tokenizeData = await import_axios6.default.post("https://api-dev.merchant-trends.com/tokenizer/tokenize", raw, { headers: myHeaders });
|
4308
|
+
const reqData = JSON.stringify(__spreadProps(__spreadValues({}, (_g = tokenizeData == null ? void 0 : tokenizeData.data) == null ? void 0 : _g.data), {
|
4309
|
+
cvv: cardData == null ? void 0 : cardData.cvv,
|
4310
|
+
cardName: cardData == null ? void 0 : cardData.cardName,
|
4311
|
+
zip: cardData == null ? void 0 : cardData.zipCode,
|
4312
|
+
userId: props == null ? void 0 : props.customerId,
|
4313
|
+
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey
|
4314
|
+
}));
|
4315
|
+
let myHeaders2 = {
|
4316
|
+
"Content-Type": "application/json"
|
4317
|
+
};
|
4318
|
+
try {
|
4319
|
+
let addCardRes = await import_axios6.default.post(
|
4320
|
+
`${baseUrl}add-card`,
|
4321
|
+
reqData,
|
4322
|
+
{
|
4323
|
+
headers: myHeaders2
|
4324
|
+
}
|
4325
|
+
);
|
4326
|
+
console.log(addCardRes);
|
4327
|
+
if ((_h = addCardRes == null ? void 0 : addCardRes.data) == null ? void 0 : _h.result) {
|
4328
|
+
setSuccess(true);
|
4329
|
+
hideLoader();
|
4330
|
+
}
|
4331
|
+
} catch (err) {
|
4332
|
+
hideLoader();
|
4333
|
+
showError(((_j = (_i = err == null ? void 0 : err.response) == null ? void 0 : _i.data) == null ? void 0 : _j.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
4334
|
+
}
|
4335
|
+
} catch (err) {
|
4336
|
+
hideLoader();
|
4337
|
+
showError(((_l = (_k = err == null ? void 0 : err.response) == null ? void 0 : _k.data) == null ? void 0 : _l.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
4338
|
+
}
|
4339
|
+
} catch (err) {
|
4340
|
+
hideLoader();
|
4341
|
+
showError(((_n = (_m = err == null ? void 0 : err.response) == null ? void 0 : _m.data) == null ? void 0 : _n.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
4342
|
+
}
|
4343
|
+
} else {
|
4344
|
+
if (typeof DatacapWebToken !== "undefined") {
|
4345
|
+
DatacapWebToken.requestToken(paymentData == null ? void 0 : paymentData.dctoken, "creditCardForm", getTokenCallback);
|
4346
|
+
}
|
4347
|
+
}
|
4348
|
+
} catch (err) {
|
4349
|
+
hideLoader();
|
4350
|
+
showError(((_p = (_o = err == null ? void 0 : err.response) == null ? void 0 : _o.data) == null ? void 0 : _p.message) || (err == null ? void 0 : err.message) || "something wrong..s");
|
4351
|
+
}
|
4352
|
+
}
|
4353
|
+
}
|
4354
|
+
};
|
4355
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement(DataScript, null), /* @__PURE__ */ import_react19.default.createElement(AddCardStyle, null), /* @__PURE__ */ import_react19.default.createElement(Loader_default, { loading }), success ? /* @__PURE__ */ import_react19.default.createElement(SuccessCardMsz_default, { onClose: handleCloseSeccess }) : /* @__PURE__ */ import_react19.default.createElement(
|
4356
|
+
"div",
|
4357
|
+
{
|
4358
|
+
className: "container-creditcard add-card modal-content ",
|
4359
|
+
id: "add-credit-card-panel"
|
4360
|
+
},
|
4361
|
+
/* @__PURE__ */ import_react19.default.createElement("form", { id: "creditCardForm", onSubmit: addCardFunc }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "form-group", style: { marginTop: "0" } }, /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: "cardNumber" }, "Card Number"), /* @__PURE__ */ import_react19.default.createElement(
|
4362
|
+
"input",
|
4363
|
+
{
|
4364
|
+
type: "text",
|
4365
|
+
"data-token": "card_number",
|
4366
|
+
placeholder: "Enter card number",
|
4367
|
+
maxLength: 19,
|
4368
|
+
inputMode: "numeric",
|
4369
|
+
value: (cardData == null ? void 0 : cardData.cardNumber) || "",
|
4370
|
+
onChange: (e) => handleCardNumberChange(e)
|
4371
|
+
}
|
4372
|
+
), (cardError == null ? void 0 : cardError.cardNumber) && /* @__PURE__ */ import_react19.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cardNumber), /* @__PURE__ */ import_react19.default.createElement("br", null)), /* @__PURE__ */ import_react19.default.createElement("div", { className: "card-dtl" }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "exp-cvc-container" }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: "expMonth" }, "MM"), /* @__PURE__ */ import_react19.default.createElement(
|
4373
|
+
"input",
|
4374
|
+
{
|
4375
|
+
"data-token": "exp_month",
|
4376
|
+
className: "form-control required",
|
4377
|
+
type: "text",
|
4378
|
+
placeholder: "MM",
|
4379
|
+
maxLength: 2,
|
4380
|
+
value: (cardData == null ? void 0 : cardData.expiryMonth) || "",
|
4381
|
+
onChange: (e) => handleCardChange("expiryMonth", e.target.value)
|
4382
|
+
}
|
4383
|
+
), (cardError == null ? void 0 : cardError.expiryMonth) && /* @__PURE__ */ import_react19.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.expiryMonth)), /* @__PURE__ */ import_react19.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: "expYear" }, "YYYY"), /* @__PURE__ */ import_react19.default.createElement(
|
4384
|
+
"input",
|
4385
|
+
{
|
4386
|
+
"data-token": "exp_year",
|
4387
|
+
className: "form-control required",
|
4388
|
+
type: "text",
|
4389
|
+
placeholder: "YYYY",
|
4390
|
+
maxLength: 4,
|
4391
|
+
value: (cardData == null ? void 0 : cardData.expiryYear) || "",
|
4392
|
+
onChange: (e) => handleCardChange("expiryYear", e.target.value)
|
4393
|
+
}
|
4394
|
+
), (cardError == null ? void 0 : cardError.expiryYear) && /* @__PURE__ */ import_react19.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.expiryYear)), /* @__PURE__ */ import_react19.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: "cvc" }, "CVC"), /* @__PURE__ */ import_react19.default.createElement(
|
4395
|
+
"input",
|
4396
|
+
{
|
4397
|
+
"data-token": "cvv",
|
4398
|
+
className: "form-control required",
|
4399
|
+
type: "text",
|
4400
|
+
placeholder: "CVC",
|
4401
|
+
maxLength: 4,
|
4402
|
+
value: (cardData == null ? void 0 : cardData.cvv) || "",
|
4403
|
+
onChange: (e) => handleCardChange("cvv", e.target.value)
|
4404
|
+
}
|
4405
|
+
), (cardError == null ? void 0 : cardError.cvv) && /* @__PURE__ */ import_react19.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cvv)))), /* @__PURE__ */ import_react19.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: "cardholderName" }, "Name on card"), /* @__PURE__ */ import_react19.default.createElement(
|
4406
|
+
"input",
|
4407
|
+
{
|
4408
|
+
type: "text",
|
4409
|
+
id: "cardholderName",
|
4410
|
+
name: "cardholderName",
|
4411
|
+
placeholder: "Name on card required",
|
4412
|
+
value: (cardData == null ? void 0 : cardData.cardName) || "",
|
4413
|
+
onChange: (e) => {
|
4414
|
+
const value = e.target.value;
|
4415
|
+
if (/^[a-zA-Z\s]*$/.test(value)) {
|
4416
|
+
handleCardChange("cardName", value);
|
4417
|
+
}
|
4418
|
+
}
|
4419
|
+
}
|
4420
|
+
), (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ import_react19.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cardName)), /* @__PURE__ */ import_react19.default.createElement("div", { className: "form-group", style: { marginBottom: "20px" } }, /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: "zipcode" }, "Zip"), /* @__PURE__ */ import_react19.default.createElement(
|
4421
|
+
"input",
|
4422
|
+
{
|
4423
|
+
type: "text",
|
4424
|
+
id: "zipcode",
|
4425
|
+
name: "zipcode",
|
4426
|
+
placeholder: "Zip",
|
4427
|
+
value: (_a = cardData == null ? void 0 : cardData.zipCode) != null ? _a : "",
|
4428
|
+
onChange: (e) => handleCardChange("zipCode", e.target.value)
|
4429
|
+
}
|
4430
|
+
), (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ import_react19.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.zipCode)), /* @__PURE__ */ import_react19.default.createElement(
|
4431
|
+
"input",
|
4432
|
+
{
|
4433
|
+
type: "submit",
|
4434
|
+
className: "idle-green-btn w-100",
|
4435
|
+
defaultValue: "Submit"
|
4436
|
+
}
|
4437
|
+
))
|
4438
|
+
));
|
4439
|
+
}
|
3993
4440
|
// Annotate the CommonJS export names for ESM import in node:
|
3994
4441
|
0 && (module.exports = {
|
3995
4442
|
AddCard,
|
4443
|
+
AddCardEasyPay,
|
3996
4444
|
GetPaymentPage,
|
3997
4445
|
PreAuthPayment,
|
3998
4446
|
RequestPayment,
|