@pinerohit11/testwidget 0.1.96 → 0.1.98
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 +0 -3
- package/dist/index.d.ts +0 -3
- package/dist/index.js +157 -89
- package/dist/index.mjs +157 -89
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1890,8 +1890,27 @@ function SuccessMszStyle() {
|
|
1890
1890
|
}`);
|
1891
1891
|
}
|
1892
1892
|
|
1893
|
+
// src/app/components/SuccessMessage/HandleSubmit.tsx
|
1894
|
+
function HandleSubmit(event, key, tranId) {
|
1895
|
+
event.preventDefault();
|
1896
|
+
const status = key === "close";
|
1897
|
+
const message = {
|
1898
|
+
type: "preview.compiledcheck",
|
1899
|
+
other: {
|
1900
|
+
msg: "Payment success!",
|
1901
|
+
status,
|
1902
|
+
data: {
|
1903
|
+
tran_id: tranId,
|
1904
|
+
key
|
1905
|
+
}
|
1906
|
+
}
|
1907
|
+
};
|
1908
|
+
console.log("message:", message);
|
1909
|
+
window.parent.postMessage(message, "*");
|
1910
|
+
}
|
1911
|
+
|
1893
1912
|
// src/app/components/SuccessMessage/SuccessMsz.tsx
|
1894
|
-
function SuccessMsz({ onClose }) {
|
1913
|
+
function SuccessMsz({ onClose, tranId }) {
|
1895
1914
|
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(SuccessMszStyle, null), /* @__PURE__ */ React10.createElement("div", { className: "payment-msg-container" }, /* @__PURE__ */ React10.createElement("div", { className: "charge-payment-success-container" }, /* @__PURE__ */ React10.createElement("div", { className: "charge-payment-success-tick-div" }, /* @__PURE__ */ React10.createElement("div", { className: "charge-payment-success-tick" }, /* @__PURE__ */ React10.createElement(
|
1896
1915
|
"svg",
|
1897
1916
|
{
|
@@ -1908,7 +1927,7 @@ function SuccessMsz({ onClose }) {
|
|
1908
1927
|
fill: "#61C699"
|
1909
1928
|
}
|
1910
1929
|
)
|
1911
|
-
))), /* @__PURE__ */ React10.createElement("p", { className: "charge-payment-success-text" }, "Your charge", /* @__PURE__ */ React10.createElement("br", null), "was successful"), /* @__PURE__ */ React10.createElement("p", { className: "charge-payment-success-subtext" }, "We\u2019ve processed your charge"), /* @__PURE__ */ React10.createElement("div", { className: "charge-success-payment-button-div" }, /* @__PURE__ */ React10.createElement("button", { className: "charge-success-btn1" }, /* @__PURE__ */ React10.createElement(
|
1930
|
+
))), /* @__PURE__ */ React10.createElement("p", { className: "charge-payment-success-text" }, "Your charge", /* @__PURE__ */ React10.createElement("br", null), "was successful"), /* @__PURE__ */ React10.createElement("p", { className: "charge-payment-success-subtext" }, "We\u2019ve processed your charge"), /* @__PURE__ */ React10.createElement("div", { className: "charge-success-payment-button-div" }, /* @__PURE__ */ React10.createElement("button", { className: "charge-success-btn1", onClick: (e) => HandleSubmit(e, "print", tranId) }, /* @__PURE__ */ React10.createElement(
|
1912
1931
|
"svg",
|
1913
1932
|
{
|
1914
1933
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1931,7 +1950,7 @@ function SuccessMsz({ onClose }) {
|
|
1931
1950
|
fill: "#161616"
|
1932
1951
|
}
|
1933
1952
|
)
|
1934
|
-
), "Print receipt"), /* @__PURE__ */ React10.createElement("button", { className: "charge-success-btn1" }, /* @__PURE__ */ React10.createElement(
|
1953
|
+
), "Print receipt"), /* @__PURE__ */ React10.createElement("button", { className: "charge-success-btn1", onClick: (e) => HandleSubmit(e, "share", tranId) }, /* @__PURE__ */ React10.createElement(
|
1935
1954
|
"svg",
|
1936
1955
|
{
|
1937
1956
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1956,7 +1975,10 @@ function SuccessMsz({ onClose }) {
|
|
1956
1975
|
transform: "translate(0.5)"
|
1957
1976
|
}
|
1958
1977
|
)))
|
1959
|
-
), "Send receipt"))), /* @__PURE__ */ React10.createElement("div", { className: "charge-payment-success-btn-div" }, /* @__PURE__ */ React10.createElement("button", { className: "charge-payment-success-btn1" }, "Go to Transactions"), /* @__PURE__ */ React10.createElement("button", { className: "charge-payment-success-btn2", onClick:
|
1978
|
+
), "Send receipt"))), /* @__PURE__ */ React10.createElement("div", { className: "charge-payment-success-btn-div" }, /* @__PURE__ */ React10.createElement("button", { className: "charge-payment-success-btn1", onClick: (e) => HandleSubmit(e, "tran", tranId) }, "Go to Transactions"), /* @__PURE__ */ React10.createElement("button", { className: "charge-payment-success-btn2", onClick: (e) => {
|
1979
|
+
onClose();
|
1980
|
+
HandleSubmit(e, "close", tranId);
|
1981
|
+
} }, "Close"))));
|
1960
1982
|
}
|
1961
1983
|
|
1962
1984
|
// src/app/components/Charge/GetPaymentPage.tsx
|
@@ -2029,24 +2051,68 @@ function GetPaymentPage(props) {
|
|
2029
2051
|
const [cardList, setCardList] = useState3([]);
|
2030
2052
|
const [selectedCard, setSelectedCard] = useState3();
|
2031
2053
|
const [paymentData, setPaymentData] = useState3();
|
2054
|
+
let [tranId, setTranId] = useState3("");
|
2032
2055
|
const showLoader = () => setLoading(true);
|
2033
2056
|
const hideLoader = () => setLoading(false);
|
2034
2057
|
const showError = (msz) => {
|
2035
2058
|
Swal.fire({
|
2036
2059
|
icon: "error",
|
2037
|
-
title: "Oops...",
|
2038
2060
|
text: msz
|
2039
2061
|
});
|
2040
2062
|
};
|
2041
2063
|
const handleClose = () => {
|
2042
2064
|
setShow(false);
|
2043
2065
|
setActive("card");
|
2044
|
-
};
|
2045
|
-
const handleShow = () => setShow(true);
|
2046
|
-
const handleCloseSeccess = () => {
|
2047
2066
|
setSuccess(false);
|
2048
|
-
|
2067
|
+
setTranId("");
|
2068
|
+
setAchData({
|
2069
|
+
name: "",
|
2070
|
+
routingNumber: "",
|
2071
|
+
accountNumber: "",
|
2072
|
+
confirmAccountNumber: "",
|
2073
|
+
bankName: "",
|
2074
|
+
accountType: ""
|
2075
|
+
});
|
2076
|
+
setAchError({
|
2077
|
+
name: "",
|
2078
|
+
routingNumber: "",
|
2079
|
+
accountNumber: "",
|
2080
|
+
confirmAccountNumber: "",
|
2081
|
+
bankName: "",
|
2082
|
+
accountType: ""
|
2083
|
+
});
|
2084
|
+
setCardData({
|
2085
|
+
cardName: "",
|
2086
|
+
cardNumber: "",
|
2087
|
+
expiryMonth: "",
|
2088
|
+
expiryYear: "",
|
2089
|
+
cvv: "",
|
2090
|
+
orderId: "",
|
2091
|
+
zipCode: ""
|
2092
|
+
});
|
2093
|
+
setCardError({
|
2094
|
+
cardName: "",
|
2095
|
+
cardNumber: "",
|
2096
|
+
expiryMonth: "",
|
2097
|
+
expiryYear: "",
|
2098
|
+
cvv: "",
|
2099
|
+
orderId: "",
|
2100
|
+
zipCode: ""
|
2101
|
+
});
|
2102
|
+
setSaveACHinfo(false);
|
2103
|
+
setSaveCardInfo(false);
|
2104
|
+
setSelectedCard({
|
2105
|
+
card_type: "",
|
2106
|
+
cardlastfourdigit: "",
|
2107
|
+
expmonth: 1,
|
2108
|
+
expyear: 2025,
|
2109
|
+
primary_card: 0,
|
2110
|
+
firstname: "",
|
2111
|
+
id: "",
|
2112
|
+
lastname: ""
|
2113
|
+
});
|
2049
2114
|
};
|
2115
|
+
const handleShow = () => setShow(true);
|
2050
2116
|
const handletabchange = (id) => {
|
2051
2117
|
setActive(id);
|
2052
2118
|
};
|
@@ -2067,7 +2133,6 @@ function GetPaymentPage(props) {
|
|
2067
2133
|
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2068
2134
|
[name]: ""
|
2069
2135
|
}));
|
2070
|
-
console.log(value, name);
|
2071
2136
|
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2072
2137
|
[name]: value
|
2073
2138
|
}));
|
@@ -2124,7 +2189,6 @@ function GetPaymentPage(props) {
|
|
2124
2189
|
setAchError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2125
2190
|
[name]: ""
|
2126
2191
|
}));
|
2127
|
-
console.log(value, name);
|
2128
2192
|
setAchData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2129
2193
|
[name]: value
|
2130
2194
|
}));
|
@@ -2179,11 +2243,10 @@ function GetPaymentPage(props) {
|
|
2179
2243
|
}
|
2180
2244
|
}
|
2181
2245
|
setAchError(errors);
|
2182
|
-
console.log(errors);
|
2183
2246
|
return Object.keys(errors).length > 0;
|
2184
2247
|
};
|
2185
2248
|
const submitFunc = async (e) => {
|
2186
|
-
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;
|
2249
|
+
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;
|
2187
2250
|
e.preventDefault();
|
2188
2251
|
if (activetab !== "ach") {
|
2189
2252
|
const hasError = validateCardData();
|
@@ -2210,11 +2273,9 @@ function GetPaymentPage(props) {
|
|
2210
2273
|
tax: props == null ? void 0 : props.tax
|
2211
2274
|
});
|
2212
2275
|
const result = await axios3.post(`${baseUrl}create-widget-order`, formData);
|
2213
|
-
console.log(result);
|
2214
2276
|
let tokenCallback = async function(response) {
|
2215
|
-
var _a3, _b3;
|
2277
|
+
var _a3, _b3, _c3;
|
2216
2278
|
if (response.Error) {
|
2217
|
-
console.log(response == null ? void 0 : response.Error);
|
2218
2279
|
showError(response.Error);
|
2219
2280
|
hideLoader();
|
2220
2281
|
} else {
|
@@ -2225,7 +2286,6 @@ function GetPaymentPage(props) {
|
|
2225
2286
|
response.isCardSave = `${saveCardInfo}`;
|
2226
2287
|
try {
|
2227
2288
|
let apiResponse = await axios3.post(`${masterBaseUrl}quick-pay/${result == null ? void 0 : result.data.data.posSalesIdEncode}`, response);
|
2228
|
-
console.log(apiResponse);
|
2229
2289
|
setCardData({
|
2230
2290
|
cardName: "",
|
2231
2291
|
cardNumber: "",
|
@@ -2236,12 +2296,12 @@ function GetPaymentPage(props) {
|
|
2236
2296
|
zipCode: ""
|
2237
2297
|
});
|
2238
2298
|
setSaveCardInfo(false);
|
2299
|
+
setTranId((_a3 = apiResponse == null ? void 0 : apiResponse.data) == null ? void 0 : _a3.transactionId);
|
2239
2300
|
setSuccess(true);
|
2240
2301
|
hideLoader();
|
2241
2302
|
} catch (err) {
|
2242
|
-
console.log(err);
|
2243
2303
|
hideLoader();
|
2244
|
-
showError(((
|
2304
|
+
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..");
|
2245
2305
|
}
|
2246
2306
|
}
|
2247
2307
|
};
|
@@ -2300,22 +2360,22 @@ function GetPaymentPage(props) {
|
|
2300
2360
|
headers: myHeaders2
|
2301
2361
|
}
|
2302
2362
|
);
|
2303
|
-
console.log(paymentRes);
|
2304
2363
|
if ((_k = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _k.result) {
|
2364
|
+
setTranId((_m = (_l = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _l.data) == null ? void 0 : _m.transactionId);
|
2305
2365
|
setSuccess(true);
|
2306
2366
|
hideLoader();
|
2307
2367
|
}
|
2308
2368
|
} catch (err) {
|
2309
2369
|
hideLoader();
|
2310
|
-
showError(((
|
2370
|
+
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");
|
2311
2371
|
}
|
2312
2372
|
} catch (err) {
|
2313
2373
|
hideLoader();
|
2314
|
-
showError(((
|
2374
|
+
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");
|
2315
2375
|
}
|
2316
2376
|
} catch (err) {
|
2317
2377
|
hideLoader();
|
2318
|
-
showError(((
|
2378
|
+
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");
|
2319
2379
|
}
|
2320
2380
|
} else {
|
2321
2381
|
if (typeof DatacapWebToken !== "undefined") {
|
@@ -2324,7 +2384,7 @@ function GetPaymentPage(props) {
|
|
2324
2384
|
}
|
2325
2385
|
} catch (err) {
|
2326
2386
|
hideLoader();
|
2327
|
-
showError(((
|
2387
|
+
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");
|
2328
2388
|
}
|
2329
2389
|
}
|
2330
2390
|
}
|
@@ -2332,7 +2392,6 @@ function GetPaymentPage(props) {
|
|
2332
2392
|
const hasError = validateAchData();
|
2333
2393
|
if (hasError) return;
|
2334
2394
|
else {
|
2335
|
-
console.log(achData);
|
2336
2395
|
let dataForm = {
|
2337
2396
|
fractalpayPublicKey: fractalpayClientKey,
|
2338
2397
|
label: (achData == null ? void 0 : achData.name) || "John Doe",
|
@@ -2352,17 +2411,19 @@ function GetPaymentPage(props) {
|
|
2352
2411
|
try {
|
2353
2412
|
let result = await axios3.post(`${baseUrl}ach-incoming`, dataForm);
|
2354
2413
|
hideLoader();
|
2355
|
-
console.log(result);
|
2356
2414
|
Swal.fire({
|
2357
2415
|
icon: "success",
|
2358
2416
|
title: "Congrats...",
|
2359
|
-
text: (
|
2417
|
+
text: (_v = result == null ? void 0 : result.data) == null ? void 0 : _v.message
|
2418
|
+
}).then((res) => {
|
2419
|
+
if (res.isConfirmed) {
|
2420
|
+
handleClose();
|
2421
|
+
}
|
2360
2422
|
});
|
2361
2423
|
} catch (error) {
|
2362
2424
|
if (axios3.isAxiosError(error)) {
|
2363
|
-
console.log(error);
|
2364
2425
|
hideLoader();
|
2365
|
-
showError((
|
2426
|
+
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");
|
2366
2427
|
} else {
|
2367
2428
|
console.error("Unexpected error", error);
|
2368
2429
|
}
|
@@ -2379,7 +2440,6 @@ function GetPaymentPage(props) {
|
|
2379
2440
|
"customer_id": props == null ? void 0 : props.customerId
|
2380
2441
|
};
|
2381
2442
|
let paymentData2 = await axios3.post(`${baseUrl}get-payment-details`, data);
|
2382
|
-
console.log(paymentData2);
|
2383
2443
|
setPaymentData((_a2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _a2.data);
|
2384
2444
|
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) {
|
2385
2445
|
setCardList((_h2 = (_g2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _g2.data) == null ? void 0 : _h2.card_list);
|
@@ -2389,14 +2449,12 @@ function GetPaymentPage(props) {
|
|
2389
2449
|
}
|
2390
2450
|
hideLoader();
|
2391
2451
|
} catch (err) {
|
2392
|
-
console.log(err);
|
2393
2452
|
setActive("card");
|
2394
2453
|
hideLoader();
|
2395
2454
|
}
|
2396
2455
|
};
|
2397
2456
|
const handlechargeCustomer = async () => {
|
2398
|
-
var _b2, _c2, _d2, _e2, _f2;
|
2399
|
-
console.log("selected", selectedCard);
|
2457
|
+
var _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
2400
2458
|
let customer_id = props == null ? void 0 : props.customerId;
|
2401
2459
|
let discount = props == null ? void 0 : props.discount;
|
2402
2460
|
let surcharge = props == null ? void 0 : props.surcharge;
|
@@ -2429,15 +2487,14 @@ function GetPaymentPage(props) {
|
|
2429
2487
|
showLoader();
|
2430
2488
|
try {
|
2431
2489
|
let result = await axios3.post(chargeurl, card_type == "Bank" ? rest : chargeobj, { headers });
|
2432
|
-
console.log(result);
|
2433
2490
|
if ((_b2 = result == null ? void 0 : result.data) == null ? void 0 : _b2.result) {
|
2491
|
+
setTranId((_d2 = (_c2 = result == null ? void 0 : result.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.transaction_id);
|
2434
2492
|
setSuccess(true);
|
2435
2493
|
hideLoader();
|
2436
2494
|
}
|
2437
2495
|
} catch (err) {
|
2438
2496
|
hideLoader();
|
2439
|
-
|
2440
|
-
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");
|
2497
|
+
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");
|
2441
2498
|
}
|
2442
2499
|
} else {
|
2443
2500
|
showError("Please Select A Card/ACH");
|
@@ -2481,7 +2538,6 @@ function GetPaymentPage(props) {
|
|
2481
2538
|
const res = await axios3.post(`${baseUrl}delete-customer-card`, obj);
|
2482
2539
|
hideLoader();
|
2483
2540
|
getPaymentDetails();
|
2484
|
-
console.log("Deleted:", res);
|
2485
2541
|
Swal.fire({
|
2486
2542
|
icon: "success",
|
2487
2543
|
title: "Deleted!",
|
@@ -2497,7 +2553,6 @@ function GetPaymentPage(props) {
|
|
2497
2553
|
});
|
2498
2554
|
} catch (err) {
|
2499
2555
|
hideLoader();
|
2500
|
-
console.log("Error:", err);
|
2501
2556
|
Swal.fire({
|
2502
2557
|
icon: "error",
|
2503
2558
|
title: "Error!",
|
@@ -2536,7 +2591,7 @@ function GetPaymentPage(props) {
|
|
2536
2591
|
onClose: handleClose
|
2537
2592
|
},
|
2538
2593
|
/* @__PURE__ */ React11.createElement(Loader_default, { loading }),
|
2539
|
-
success ? /* @__PURE__ */ React11.createElement(SuccessMsz, { onClose:
|
2594
|
+
success ? /* @__PURE__ */ React11.createElement(SuccessMsz, { onClose: handleClose, tranId }) : /* @__PURE__ */ React11.createElement("div", null, /* @__PURE__ */ React11.createElement("div", { className: "parent-pay-container" }, /* @__PURE__ */ React11.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ React11.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ React11.createElement("g", { clipPath: "url(#clip0_12425_52336)" }, /* @__PURE__ */ React11.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__ */ React11.createElement("defs", null, /* @__PURE__ */ React11.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ React11.createElement("rect", { width: "16", height: "16", fill: "white" }))))), /* @__PURE__ */ React11.createElement("div", { className: "pay-main-logo-res" }, /* @__PURE__ */ React11.createElement("img", { src: "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/uploaded/merchant_logo/20250311131124_merchant_logo.png", id: "pay-logos" })), /* @__PURE__ */ React11.createElement("div", { className: "pay-container" }, /* @__PURE__ */ React11.createElement("div", { className: "pay-header pay-conatiner-one" }, /* @__PURE__ */ React11.createElement("div", { className: "pay-conatiner-one-first" }, /* @__PURE__ */ React11.createElement("div", { className: "pay-logo-container" }, /* @__PURE__ */ React11.createElement("div", { className: "pay-main-logo" }, /* @__PURE__ */ React11.createElement("img", { src: "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/uploaded/merchant_logo/20250311131124_merchant_logo.png", id: "pay-logos" })), /* @__PURE__ */ React11.createElement("h1", { className: "pay-heading" }, "Pay")), /* @__PURE__ */ React11.createElement("div", { className: "pay-amount-conatiner" }, /* @__PURE__ */ React11.createElement("small", { className: "pay-payment-amount" }, "Payment Amount"), /* @__PURE__ */ React11.createElement("strong", { className: "pay-amount" }, "$", props == null ? void 0 : props.amount)), activetab != "ach" && /* @__PURE__ */ React11.createElement("div", { style: { display: "flex", gap: "8px", margin: "8px 0" } }, /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/visa-img.svg", alt: "", width: 33 }), /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/mc-img.svg", width: 33, alt: "" }), /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/ae-img.svg", alt: "", width: 33 }), /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/discover-img.svg", width: 33, alt: "" }))), /* @__PURE__ */ React11.createElement("div", { className: "pay-conatiner-one-last" }, /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/secure-img.png", alt: "" }), /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/pov-by.png", alt: "" }), "Secure payments powered by Fractal"), /* @__PURE__ */ React11.createElement("div", null)), /* @__PURE__ */ React11.createElement("div", { className: "pay-tab pay-conatiner-two" }, /* @__PURE__ */ React11.createElement("div", { className: "col-md-12" }, /* @__PURE__ */ React11.createElement("div", { id: "payment-form-div" }, activetab !== "cardList" ? /* @__PURE__ */ React11.createElement("div", null, (cardList == null ? void 0 : cardList.length) > 0 && /* @__PURE__ */ React11.createElement("button", { className: "charge-payment-back-btn ", onClick: () => setActive("cardList") }, " ", /* @__PURE__ */ React11.createElement(IoArrowBack, null), " Back"), (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && /* @__PURE__ */ React11.createElement("div", { className: "tab" }, /* @__PURE__ */ React11.createElement("button", { className: "tablinks", onClick: (e) => {
|
2540
2595
|
handletabchange("card");
|
2541
2596
|
}, style: { border: activetab === "card" ? "1px solid" : "" } }, /* @__PURE__ */ React11.createElement("i", { className: "fas fa-credit-card me-2", style: { marginRight: "8px", fontSize: "15px" } }), "Card"), /* @__PURE__ */ React11.createElement("button", { className: "tablinks", onClick: (e) => {
|
2542
2597
|
handletabchange("ach");
|
@@ -2550,7 +2605,7 @@ function GetPaymentPage(props) {
|
|
2550
2605
|
checked: selectedCard === card,
|
2551
2606
|
onChange: (e) => setSelectedCard(card)
|
2552
2607
|
}
|
2553
|
-
), /* @__PURE__ */ React11.createElement("label", { htmlFor: "", className: "card-number-last-four" }, "**** ", card == null ? void 0 : card.cardlastfourdigit), /* @__PURE__ */ React11.createElement("h6", { className: "card-expiry-date" }, card == null ? void 0 : card.expmonth, "/", card == null ? void 0 : card.expyear)), /* @__PURE__ */ React11.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ React11.createElement("span", { className: "visa-card" }, /* @__PURE__ */ React11.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__ */ React11.createElement("span", { className: "visa-card", style: { cursor: "pointer" }, onClick: () => handleDeleteCard(card == null ? void 0 : card.id) }, /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/Trash.svg", alt: "" }))))))), /* @__PURE__ */ React11.createElement("div", { className: "pay-with-other-card ", onClick: () => setActive("card") }, "Pay With Other Card", /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/card.svg", alt: "" }))), /* @__PURE__ */ React11.createElement("div", { className: "form-group", style: { padding: "0" } }, /* @__PURE__ */ React11.createElement("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer }, "$", props == null ? void 0 : props.amount))), /* @__PURE__ */ React11.createElement("div", { id: "card", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ React11.createElement("form", { id: "PaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ React11.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__ */ React11.createElement("div", { className: "form-group" }, /* @__PURE__ */ React11.createElement("label", { htmlFor: "cardHolderName" }, "NAME ON CARD "), /* @__PURE__ */ React11.createElement("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
|
2608
|
+
), /* @__PURE__ */ React11.createElement("label", { htmlFor: "", className: "card-number-last-four" }, "**** ", card == null ? void 0 : card.cardlastfourdigit), /* @__PURE__ */ React11.createElement("h6", { className: "card-expiry-date" }, card == null ? void 0 : card.expmonth, "/", card == null ? void 0 : card.expyear)), /* @__PURE__ */ React11.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ React11.createElement("span", { className: "visa-card" }, /* @__PURE__ */ React11.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__ */ React11.createElement("span", { className: "visa-card", style: { cursor: "pointer" }, onClick: () => handleDeleteCard(card == null ? void 0 : card.id) }, /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/Trash.svg", alt: "" }))))))), /* @__PURE__ */ React11.createElement("div", { className: "pay-with-other-card ", onClick: () => setActive("card") }, "Pay With Other Card", /* @__PURE__ */ React11.createElement("img", { src: "https://dev-widget.fractalpay.com/images/card.svg", alt: "" }))), /* @__PURE__ */ React11.createElement("div", { className: "form-group", style: { padding: "0" } }, /* @__PURE__ */ React11.createElement("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer }, "$", props == null ? void 0 : props.amount))), /* @__PURE__ */ React11.createElement("div", { id: "card", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ React11.createElement("form", { id: "PaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ React11.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__ */ React11.createElement("div", { className: "form-group" }, /* @__PURE__ */ React11.createElement("label", { htmlFor: "cardHolderName" }, "NAME ON CARD "), /* @__PURE__ */ React11.createElement("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "John Doe", value: (cardData == null ? void 0 : cardData.cardName) || "", onChange: (e) => {
|
2554
2609
|
const value = e.target.value;
|
2555
2610
|
if (/^[a-zA-Z\s]*$/.test(value)) {
|
2556
2611
|
handleCardChange("cardName", value);
|
@@ -2620,7 +2675,11 @@ function GetPaymentPage(props) {
|
|
2620
2675
|
checked: saveCardInfo,
|
2621
2676
|
onChange: (e) => setSaveCardInfo(e.target.checked)
|
2622
2677
|
}
|
2623
|
-
), /* @__PURE__ */ React11.createElement("label", { htmlFor: "save_card", className: "toggle-label" }), /* @__PURE__ */ React11.createElement("label", { htmlFor: "save_card" }, "Save card for future payments "), /* @__PURE__ */ React11.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, /* @__PURE__ */ React11.createElement("g", { clipPath: "url(#clip0_12420_50192)" }, /* @__PURE__ */ React11.createElement("rect", { width: "20", height: "20", fill: "white" }), /* @__PURE__ */ React11.createElement("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }), /* @__PURE__ */ React11.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__ */ React11.createElement("defs", null, /* @__PURE__ */ React11.createElement("clipPath", { id: "clip0_12420_50192" }, /* @__PURE__ */ React11.createElement("rect", { width: "20", height: "20", fill: "white" }))))))), /* @__PURE__ */ React11.createElement("div", { className: "form-group", style: { marginTop: "20px", padding: "0" } }, /* @__PURE__ */ React11.createElement("button", { type: "submit", style: { margin: 0 }, className: "pay-button" }, "$", props == null ? void 0 : props.amount)))), /* @__PURE__ */ React11.createElement("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ React11.createElement("form", { id: "ACHPaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ React11.createElement("div", { className: "ach-scrl", style: {
|
2678
|
+
), /* @__PURE__ */ React11.createElement("label", { htmlFor: "save_card", className: "toggle-label" }), /* @__PURE__ */ React11.createElement("label", { htmlFor: "save_card" }, "Save card for future payments "), /* @__PURE__ */ React11.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, /* @__PURE__ */ React11.createElement("g", { clipPath: "url(#clip0_12420_50192)" }, /* @__PURE__ */ React11.createElement("rect", { width: "20", height: "20", fill: "white" }), /* @__PURE__ */ React11.createElement("circle", { cx: "10", cy: "10", r: "10", fill: "#E0DFE2" }), /* @__PURE__ */ React11.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__ */ React11.createElement("defs", null, /* @__PURE__ */ React11.createElement("clipPath", { id: "clip0_12420_50192" }, /* @__PURE__ */ React11.createElement("rect", { width: "20", height: "20", fill: "white" }))))))), /* @__PURE__ */ React11.createElement("div", { className: "form-group", style: { marginTop: "20px", padding: "0" } }, /* @__PURE__ */ React11.createElement("button", { type: "submit", style: { margin: 0 }, className: "pay-button" }, "$", props == null ? void 0 : props.amount)))), /* @__PURE__ */ React11.createElement("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ React11.createElement("form", { id: "ACHPaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ React11.createElement("div", { className: "ach-scrl", style: {
|
2679
|
+
// minHeight: paymentData?.isSkyFiAccount && cardList?.length > 0 ? "378px" : cardList?.length > 0 ? '442px': '500px', overflow: 'auto', marginRight: '5px',
|
2680
|
+
maxHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "378px" : (cardList == null ? void 0 : cardList.length) > 0 ? "380" : "380",
|
2681
|
+
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"
|
2682
|
+
} }, /* @__PURE__ */ React11.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ React11.createElement("label", { htmlFor: "nameonaccount" }, "Name on account"), /* @__PURE__ */ React11.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__ */ React11.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.name)), /* @__PURE__ */ React11.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ React11.createElement("label", { htmlFor: "routingnumber" }, "Routing number"), /* @__PURE__ */ React11.createElement(
|
2624
2683
|
"input",
|
2625
2684
|
{
|
2626
2685
|
type: "text",
|
@@ -2690,6 +2749,7 @@ function PreAuthPayment(props) {
|
|
2690
2749
|
const [cardList, setCardList] = useState4([]);
|
2691
2750
|
const [selectedCard, setSelectedCard] = useState4();
|
2692
2751
|
const [paymentData, setPaymentData] = useState4();
|
2752
|
+
let [tranId, setTranId] = useState4("");
|
2693
2753
|
const showLoader = () => setLoading(true);
|
2694
2754
|
const hideLoader = () => setLoading(false);
|
2695
2755
|
const showError = (msz) => {
|
@@ -2702,15 +2762,39 @@ function PreAuthPayment(props) {
|
|
2702
2762
|
const handleClose = () => {
|
2703
2763
|
setShow(false);
|
2704
2764
|
setActive("card");
|
2705
|
-
};
|
2706
|
-
const handleShow = () => setShow(true);
|
2707
|
-
const handleCloseSeccess = () => {
|
2708
2765
|
setSuccess(false);
|
2709
|
-
|
2710
|
-
|
2711
|
-
|
2712
|
-
|
2766
|
+
setTranId("");
|
2767
|
+
setCardData({
|
2768
|
+
cardName: "",
|
2769
|
+
cardNumber: "",
|
2770
|
+
expiryMonth: "",
|
2771
|
+
expiryYear: "",
|
2772
|
+
cvv: "",
|
2773
|
+
orderId: "",
|
2774
|
+
zipCode: ""
|
2775
|
+
});
|
2776
|
+
setCardError({
|
2777
|
+
cardName: "",
|
2778
|
+
cardNumber: "",
|
2779
|
+
expiryMonth: "",
|
2780
|
+
expiryYear: "",
|
2781
|
+
cvv: "",
|
2782
|
+
orderId: "",
|
2783
|
+
zipCode: ""
|
2784
|
+
});
|
2785
|
+
setSaveCardInfo(false);
|
2786
|
+
setSelectedCard({
|
2787
|
+
card_type: "",
|
2788
|
+
cardlastfourdigit: "",
|
2789
|
+
expmonth: 1,
|
2790
|
+
expyear: 2025,
|
2791
|
+
primary_card: 0,
|
2792
|
+
firstname: "",
|
2793
|
+
id: "",
|
2794
|
+
lastname: ""
|
2795
|
+
});
|
2713
2796
|
};
|
2797
|
+
const handleShow = () => setShow(true);
|
2714
2798
|
const handleCardChange = (field, value) => {
|
2715
2799
|
const name = field;
|
2716
2800
|
const numericFields = ["expiryMonth", "expiryYear", "zipCode", "cvv"];
|
@@ -2728,7 +2812,6 @@ function PreAuthPayment(props) {
|
|
2728
2812
|
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2729
2813
|
[name]: ""
|
2730
2814
|
}));
|
2731
|
-
console.log(value, name);
|
2732
2815
|
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2733
2816
|
[name]: value
|
2734
2817
|
}));
|
@@ -2786,7 +2869,7 @@ function PreAuthPayment(props) {
|
|
2786
2869
|
return Object.keys(errors).length > 0;
|
2787
2870
|
};
|
2788
2871
|
const submitFunc = async (e) => {
|
2789
|
-
var _a2, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
2872
|
+
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;
|
2790
2873
|
e.preventDefault();
|
2791
2874
|
if (activetab == "card") {
|
2792
2875
|
const hasError = validateCardData();
|
@@ -2801,13 +2884,11 @@ function PreAuthPayment(props) {
|
|
2801
2884
|
if (!validCVV) errors.cvv = "Invalid CVV";
|
2802
2885
|
setCardError(errors);
|
2803
2886
|
if (validCard && validCVV && validExpirationDate) {
|
2804
|
-
console.log(props == null ? void 0 : props.customerId);
|
2805
2887
|
showLoader();
|
2806
2888
|
try {
|
2807
2889
|
let tokenCallback = async function(response) {
|
2808
|
-
var _a3, _b3;
|
2890
|
+
var _a3, _b3, _c3;
|
2809
2891
|
if (response.Error) {
|
2810
|
-
console.log(response == null ? void 0 : response.Error);
|
2811
2892
|
showError(response.Error);
|
2812
2893
|
hideLoader();
|
2813
2894
|
} else {
|
@@ -2823,10 +2904,8 @@ function PreAuthPayment(props) {
|
|
2823
2904
|
response.customer_id = props == null ? void 0 : props.customerId;
|
2824
2905
|
response.link_token = "";
|
2825
2906
|
response.gateway_id = paymentData == null ? void 0 : paymentData.paymentGateway;
|
2826
|
-
console.log("Response :", response);
|
2827
2907
|
try {
|
2828
2908
|
let apiResponse = await axios4.post(`${baseUrl}preauth`, response);
|
2829
|
-
console.log(apiResponse);
|
2830
2909
|
setCardData({
|
2831
2910
|
cardName: "",
|
2832
2911
|
cardNumber: "",
|
@@ -2837,11 +2916,12 @@ function PreAuthPayment(props) {
|
|
2837
2916
|
zipCode: ""
|
2838
2917
|
});
|
2839
2918
|
setSuccess(true);
|
2919
|
+
setTranId((_a3 = apiResponse == null ? void 0 : apiResponse.data) == null ? void 0 : _a3.transactionId);
|
2840
2920
|
hideLoader();
|
2841
2921
|
} catch (err) {
|
2842
2922
|
console.log(err);
|
2843
2923
|
hideLoader();
|
2844
|
-
showError(((
|
2924
|
+
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..");
|
2845
2925
|
}
|
2846
2926
|
}
|
2847
2927
|
};
|
@@ -2908,30 +2988,30 @@ function PreAuthPayment(props) {
|
|
2908
2988
|
headers: myHeaders2
|
2909
2989
|
}
|
2910
2990
|
);
|
2911
|
-
console.log(paymentRes);
|
2912
2991
|
if ((_n = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _n.result) {
|
2992
|
+
setTranId((_p = (_o = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _o.data) == null ? void 0 : _p.transaction_id);
|
2913
2993
|
setSuccess(true);
|
2914
2994
|
hideLoader();
|
2915
2995
|
}
|
2916
2996
|
} catch (err) {
|
2917
2997
|
hideLoader();
|
2918
|
-
showError(((
|
2998
|
+
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");
|
2919
2999
|
}
|
2920
3000
|
} catch (err) {
|
2921
3001
|
console.log(err);
|
2922
3002
|
hideLoader();
|
2923
|
-
showError(((
|
3003
|
+
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");
|
2924
3004
|
}
|
2925
3005
|
} catch (err) {
|
2926
3006
|
hideLoader();
|
2927
|
-
showError(((
|
3007
|
+
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");
|
2928
3008
|
}
|
2929
3009
|
} else {
|
2930
3010
|
DatacapWebToken.requestToken(paymentData == null ? void 0 : paymentData.dctoken, "PaymentForm", tokenCallback);
|
2931
3011
|
}
|
2932
3012
|
} catch (err) {
|
2933
3013
|
hideLoader();
|
2934
|
-
showError(((
|
3014
|
+
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");
|
2935
3015
|
}
|
2936
3016
|
}
|
2937
3017
|
}
|
@@ -2947,7 +3027,6 @@ function PreAuthPayment(props) {
|
|
2947
3027
|
preauth: true
|
2948
3028
|
};
|
2949
3029
|
let paymentData2 = await axios4.post(`${baseUrl}get-payment-details`, data);
|
2950
|
-
console.log(paymentData2);
|
2951
3030
|
setPaymentData((_a2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _a2.data);
|
2952
3031
|
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) {
|
2953
3032
|
setCardList((_h = (_g = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _g.data) == null ? void 0 : _h.card_list);
|
@@ -2963,8 +3042,7 @@ function PreAuthPayment(props) {
|
|
2963
3042
|
}
|
2964
3043
|
};
|
2965
3044
|
const handlechargeCustomer = async () => {
|
2966
|
-
var _b2, _c2, _d2, _e, _f;
|
2967
|
-
console.log("selected", selectedCard);
|
3045
|
+
var _b2, _c2, _d2, _e, _f, _g, _h;
|
2968
3046
|
let customer_id = props == null ? void 0 : props.customerId;
|
2969
3047
|
let discount = props == null ? void 0 : props.discount;
|
2970
3048
|
let surcharge = props == null ? void 0 : props.surcharge;
|
@@ -2997,15 +3075,15 @@ function PreAuthPayment(props) {
|
|
2997
3075
|
showLoader();
|
2998
3076
|
try {
|
2999
3077
|
let result = await axios4.post(chargeurl, card_type == "Bank" ? rest : chargeobj, { headers });
|
3000
|
-
console.log(result);
|
3001
3078
|
if ((_b2 = result == null ? void 0 : result.data) == null ? void 0 : _b2.result) {
|
3079
|
+
setTranId((_d2 = (_c2 = result == null ? void 0 : result.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.transaction_id);
|
3002
3080
|
setSuccess(true);
|
3003
3081
|
hideLoader();
|
3004
3082
|
}
|
3005
3083
|
} catch (err) {
|
3006
3084
|
hideLoader();
|
3007
3085
|
console.log(err);
|
3008
|
-
showError(((
|
3086
|
+
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");
|
3009
3087
|
}
|
3010
3088
|
} else {
|
3011
3089
|
showError("Please Select A Card/ACH");
|
@@ -3049,7 +3127,6 @@ function PreAuthPayment(props) {
|
|
3049
3127
|
const res = await axios4.post(`${baseUrl}delete-customer-card`, obj);
|
3050
3128
|
hideLoader();
|
3051
3129
|
getPaymentDetails();
|
3052
|
-
console.log("Deleted:", res);
|
3053
3130
|
Swal2.fire({
|
3054
3131
|
icon: "success",
|
3055
3132
|
title: "Deleted!",
|
@@ -3061,7 +3138,6 @@ function PreAuthPayment(props) {
|
|
3061
3138
|
});
|
3062
3139
|
} catch (err) {
|
3063
3140
|
hideLoader();
|
3064
|
-
console.error("Error:", err);
|
3065
3141
|
Swal2.fire({
|
3066
3142
|
icon: "error",
|
3067
3143
|
title: "Error!",
|
@@ -3089,7 +3165,7 @@ function PreAuthPayment(props) {
|
|
3089
3165
|
onClose: handleClose
|
3090
3166
|
},
|
3091
3167
|
/* @__PURE__ */ React12.createElement(Loader_default, { loading }),
|
3092
|
-
success ? /* @__PURE__ */ React12.createElement(SuccessMsz, { onClose:
|
3168
|
+
success ? /* @__PURE__ */ React12.createElement(SuccessMsz, { onClose: handleClose, tranId }) : /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("div", { className: "parent-pay-container" }, /* @__PURE__ */ React12.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ React12.createElement("g", { clipPath: "url(#clip0_12425_52336)" }, /* @__PURE__ */ React12.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__ */ React12.createElement("defs", null, /* @__PURE__ */ React12.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ React12.createElement("rect", { width: "16", height: "16", fill: "white" }))))), /* @__PURE__ */ React12.createElement("div", { className: "pay-container" }, /* @__PURE__ */ React12.createElement("div", { className: "pay-header pay-conatiner-one" }, /* @__PURE__ */ React12.createElement("div", { className: "pay-conatiner-one-first" }, /* @__PURE__ */ React12.createElement("div", { className: "pay-logo-container" }, /* @__PURE__ */ React12.createElement("div", { className: "pay-main-logo" }, /* @__PURE__ */ React12.createElement("img", { src: "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/uploaded/merchant_logo/20250311131124_merchant_logo.png", id: "pay-logos" })), /* @__PURE__ */ React12.createElement("h1", { className: "pay-heading" }, "Pay")), /* @__PURE__ */ React12.createElement("div", { className: "pay-amount-conatiner" }, /* @__PURE__ */ React12.createElement("small", { className: "pay-payment-amount" }, "Payment Amount"), /* @__PURE__ */ React12.createElement("strong", { className: "pay-amount" }, "$", props == null ? void 0 : props.amount)), activetab != "ach" && /* @__PURE__ */ React12.createElement("div", { style: { display: "flex", gap: "8px", margin: "8px 0" } }, /* @__PURE__ */ React12.createElement("img", { src: "https://dev-widget.fractalpay.com/images/visa-img.svg", alt: "", width: 33 }), /* @__PURE__ */ React12.createElement("img", { src: "https://dev-widget.fractalpay.com/images/mc-img.svg", width: 33, alt: "" }), /* @__PURE__ */ React12.createElement("img", { src: "https://dev-widget.fractalpay.com/images/ae-img.svg", alt: "", width: 33 }), /* @__PURE__ */ React12.createElement("img", { src: "https://dev-widget.fractalpay.com/images/discover-img.svg", width: 33, alt: "" }))), /* @__PURE__ */ React12.createElement("div", { className: "pay-conatiner-one-last" }, /* @__PURE__ */ React12.createElement("img", { src: "https://dev-widget.fractalpay.com/images/secure-img.png", alt: "" }), /* @__PURE__ */ React12.createElement("img", { src: "https://dev-widget.fractalpay.com/images/pov-by.png", alt: "" }), "Secure payments powered by Fractal"), /* @__PURE__ */ React12.createElement("div", null)), /* @__PURE__ */ React12.createElement("div", { className: "pay-tab pay-conatiner-two" }, /* @__PURE__ */ React12.createElement("div", { className: "col-md-12" }, /* @__PURE__ */ React12.createElement("div", { id: "payment-form-div" }, activetab !== "cardList" ? /* @__PURE__ */ React12.createElement("div", null, (cardList == null ? void 0 : cardList.length) > 0 && /* @__PURE__ */ React12.createElement("button", { className: "charge-payment-back-btn ", onClick: () => setActive("cardList") }, " ", /* @__PURE__ */ React12.createElement(IoArrowBack2, null), " Back")) : /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("p", { className: "charge-customer-name" }, " Charge ", paymentData == null ? void 0 : paymentData.customer_name), /* @__PURE__ */ React12.createElement("p", { className: "card-ach-heading" }, " Cards")), /* @__PURE__ */ React12.createElement("div", { style: { display: activetab === "cardList" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ React12.createElement("div", { className: "card-lint-div-in" }, /* @__PURE__ */ React12.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__ */ React12.createElement("div", { className: "card-list-single-div", key: index }, /* @__PURE__ */ React12.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ React12.createElement(
|
3093
3169
|
"input",
|
3094
3170
|
{
|
3095
3171
|
type: "radio",
|
@@ -3459,7 +3535,7 @@ var CustomModal = ({
|
|
3459
3535
|
display: "flex",
|
3460
3536
|
justifyContent: "center",
|
3461
3537
|
alignItems: "center"
|
3462
|
-
} }, /* @__PURE__ */ React14.createElement("div", { style: { background: "white", padding: "20px", borderRadius: "8px", minWidth: "300px" } }, /* @__PURE__ */ React14.createElement("div", { className: "", style: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React14.createElement("button", { onClick: onClose, style: { border: "none", background: "transparent" } }, "X")), /* @__PURE__ */ React14.createElement("div", null, children)));
|
3538
|
+
} }, /* @__PURE__ */ React14.createElement("div", { style: { background: "white", padding: "20px", borderRadius: "8px", minWidth: "300px" } }, /* @__PURE__ */ React14.createElement("div", { className: "", style: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React14.createElement("button", { onClick: onClose, style: { border: "none", background: "transparent", color: "black" } }, "X")), /* @__PURE__ */ React14.createElement("div", null, children)));
|
3463
3539
|
};
|
3464
3540
|
var CustomModal_default = CustomModal;
|
3465
3541
|
|
@@ -3594,11 +3670,17 @@ function AddCard(props) {
|
|
3594
3670
|
orderId: "",
|
3595
3671
|
zipCode: ""
|
3596
3672
|
});
|
3673
|
+
setCardError({
|
3674
|
+
cardName: "",
|
3675
|
+
cardNumber: "",
|
3676
|
+
expiryMonth: "",
|
3677
|
+
expiryYear: "",
|
3678
|
+
cvv: "",
|
3679
|
+
orderId: "",
|
3680
|
+
zipCode: ""
|
3681
|
+
});
|
3597
3682
|
};
|
3598
3683
|
const handleShow = () => setShow(true);
|
3599
|
-
const handleCloseSeccess = () => {
|
3600
|
-
handleClose();
|
3601
|
-
};
|
3602
3684
|
const handleCardChange = (field, value) => {
|
3603
3685
|
const name = field;
|
3604
3686
|
const numericFields = ["expiryMonth", "expiryYear", "zipCode", "cvv"];
|
@@ -3616,7 +3698,6 @@ function AddCard(props) {
|
|
3616
3698
|
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
3617
3699
|
[name]: ""
|
3618
3700
|
}));
|
3619
|
-
console.log(value, name);
|
3620
3701
|
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
3621
3702
|
[name]: value
|
3622
3703
|
}));
|
@@ -3681,7 +3762,7 @@ function AddCard(props) {
|
|
3681
3762
|
return Object.keys(errors).length > 0;
|
3682
3763
|
};
|
3683
3764
|
const getPaymentDetails = async () => {
|
3684
|
-
var _a2
|
3765
|
+
var _a2;
|
3685
3766
|
showLoader();
|
3686
3767
|
try {
|
3687
3768
|
const data = {
|
@@ -3690,14 +3771,9 @@ function AddCard(props) {
|
|
3690
3771
|
addcard: true
|
3691
3772
|
};
|
3692
3773
|
let paymentData2 = await axios5.post(`${baseUrl}get-payment-details`, data);
|
3693
|
-
console.log(paymentData2);
|
3694
3774
|
setPaymentData((_a2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _a2.data);
|
3695
|
-
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) {
|
3696
|
-
} else {
|
3697
|
-
}
|
3698
3775
|
hideLoader();
|
3699
3776
|
} catch (err) {
|
3700
|
-
console.log(err);
|
3701
3777
|
hideLoader();
|
3702
3778
|
}
|
3703
3779
|
};
|
@@ -3710,7 +3786,6 @@ function AddCard(props) {
|
|
3710
3786
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
3711
3787
|
e.preventDefault();
|
3712
3788
|
const hasError = validateCardData();
|
3713
|
-
console.log(cardData);
|
3714
3789
|
if (hasError) return;
|
3715
3790
|
else {
|
3716
3791
|
let validCard = DatacapWebToken.validateCardNumber(cardData == null ? void 0 : cardData.cardNumber.replaceAll(" ", ""));
|
@@ -3726,9 +3801,7 @@ function AddCard(props) {
|
|
3726
3801
|
try {
|
3727
3802
|
let getTokenCallback = async function(token) {
|
3728
3803
|
var _a3, _b2, _c2, _d2, _e2;
|
3729
|
-
console.log(token);
|
3730
3804
|
if (token.Error) {
|
3731
|
-
console.log(token == null ? void 0 : token.Error);
|
3732
3805
|
showError(token.Error);
|
3733
3806
|
hideLoader();
|
3734
3807
|
} else {
|
@@ -3741,7 +3814,6 @@ function AddCard(props) {
|
|
3741
3814
|
};
|
3742
3815
|
try {
|
3743
3816
|
let apiResponse = await axios5.post(`${baseUrl}add-card`, reqData);
|
3744
|
-
console.log(apiResponse);
|
3745
3817
|
let formData = {
|
3746
3818
|
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey,
|
3747
3819
|
wallet_id: "",
|
@@ -3752,7 +3824,6 @@ function AddCard(props) {
|
|
3752
3824
|
};
|
3753
3825
|
try {
|
3754
3826
|
const result = await axios5.post(`${baseUrl}link-wallet`, formData);
|
3755
|
-
console.log(result);
|
3756
3827
|
setSuccess(true);
|
3757
3828
|
hideLoader();
|
3758
3829
|
setCardData({
|
@@ -3765,12 +3836,10 @@ function AddCard(props) {
|
|
3765
3836
|
zipCode: ""
|
3766
3837
|
});
|
3767
3838
|
} catch (err) {
|
3768
|
-
console.log(err);
|
3769
3839
|
hideLoader();
|
3770
3840
|
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..");
|
3771
3841
|
}
|
3772
3842
|
} catch (err) {
|
3773
|
-
console.log(err);
|
3774
3843
|
hideLoader();
|
3775
3844
|
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..");
|
3776
3845
|
}
|
@@ -3824,7 +3893,6 @@ function AddCard(props) {
|
|
3824
3893
|
headers: myHeaders2
|
3825
3894
|
}
|
3826
3895
|
);
|
3827
|
-
console.log(addCardRes);
|
3828
3896
|
if ((_h = addCardRes == null ? void 0 : addCardRes.data) == null ? void 0 : _h.result) {
|
3829
3897
|
setSuccess(true);
|
3830
3898
|
hideLoader();
|
@@ -3867,7 +3935,7 @@ function AddCard(props) {
|
|
3867
3935
|
onClose: handleClose
|
3868
3936
|
},
|
3869
3937
|
/* @__PURE__ */ React17.createElement(Loader_default, { loading }),
|
3870
|
-
success ? /* @__PURE__ */ React17.createElement(SuccessCardMsz_default, { onClose:
|
3938
|
+
success ? /* @__PURE__ */ React17.createElement(SuccessCardMsz_default, { onClose: handleClose }) : /* @__PURE__ */ React17.createElement(
|
3871
3939
|
"div",
|
3872
3940
|
{
|
3873
3941
|
className: "container-creditcard add-card modal-content ",
|