@pinerohit11/testwidget 0.1.92 → 0.1.94
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 +32 -7
- package/dist/index.d.ts +32 -7
- package/dist/index.js +1396 -33
- package/dist/index.mjs +1394 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -59,7 +59,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
59
59
|
// src/app/index.ts
|
60
60
|
var index_exports = {};
|
61
61
|
__export(index_exports, {
|
62
|
+
AddCard: () => AddCard,
|
62
63
|
GetPaymentPage: () => GetPaymentPage,
|
64
|
+
PreAuthPayment: () => PreAuthPayment,
|
63
65
|
RequestPayment: () => RequestPayment,
|
64
66
|
RequestPreAuthPayment: () => RequestPreAuthPayment
|
65
67
|
});
|
@@ -87,7 +89,7 @@ var LoaderStyle = (props) => {
|
|
87
89
|
justify-content: center;
|
88
90
|
align-items: center;
|
89
91
|
/* background: rgba(255, 255, 0, 0.01); Adjust the blur effect */
|
90
|
-
background-color: rgba(
|
92
|
+
background-color: rgba(31, 29, 29, 0.52); /* Semi-transparent black background */
|
91
93
|
|
92
94
|
backdrop-filter: blur(.5px); /* Blur effect */
|
93
95
|
z-index: 999999999999; /* Ensure it's on top of other elements */
|
@@ -168,8 +170,8 @@ var Loader = (props) => {
|
|
168
170
|
var Loader_default = Loader;
|
169
171
|
|
170
172
|
// src/app/components/baseurl.ts
|
171
|
-
var baseUrl = "http://192.168.1.62:8082/";
|
172
173
|
var masterBaseUrl = "https://dev-sky-node.fractalpay.com/";
|
174
|
+
var baseUrl = "https://dev-widget.fractalpay.com/";
|
173
175
|
|
174
176
|
// src/app/components/Errortext.ts
|
175
177
|
var ErrorText = {
|
@@ -904,7 +906,7 @@ function RequestPayment(props) {
|
|
904
906
|
open: show,
|
905
907
|
onClose: () => setShow(false)
|
906
908
|
},
|
907
|
-
/* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-amount-detail" }, /* @__PURE__ */ import_react6.default.createElement("p", { className: "request-payment-merchantname" }, "Pay ", props == null ? void 0 : props.webname), /* @__PURE__ */ import_react6.default.createElement("p", { className: "request-payment-amount" }, formatAmount(props == null ? void 0 : props.amount)), (props == null ? void 0 : props.from) === "merchant" && /* @__PURE__ */ import_react6.default.createElement("p", { className: "request-payment-orderid" }, requestDetails == null ? void 0 : requestDetails.order_id), /* @__PURE__ */ import_react6.default.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ import_react6.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react6.default.createElement("g", {
|
909
|
+
/* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-amount-detail" }, /* @__PURE__ */ import_react6.default.createElement("p", { className: "request-payment-merchantname" }, "Pay ", props == null ? void 0 : props.webname), /* @__PURE__ */ import_react6.default.createElement("p", { className: "request-payment-amount" }, formatAmount(props == null ? void 0 : props.amount)), (props == null ? void 0 : props.from) === "merchant" && /* @__PURE__ */ import_react6.default.createElement("p", { className: "request-payment-orderid" }, requestDetails == null ? void 0 : requestDetails.order_id), /* @__PURE__ */ import_react6.default.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ import_react6.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react6.default.createElement("g", { clipPath: "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react6.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_react6.default.createElement("defs", null, /* @__PURE__ */ import_react6.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react6.default.createElement("rect", { width: "16", height: "16", fill: "white" })))))),
|
908
910
|
/* @__PURE__ */ import_react6.default.createElement("form", { className: "request-payment-input-form" }, /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react6.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "FULL NAME"), /* @__PURE__ */ import_react6.default.createElement(
|
909
911
|
"input",
|
910
912
|
{
|
@@ -952,7 +954,7 @@ function RequestPayment(props) {
|
|
952
954
|
open: showConfirmationModal,
|
953
955
|
onClose: handleCloseConfirmationModal
|
954
956
|
},
|
955
|
-
/* @__PURE__ */ import_react6.default.createElement("div", { className: "fractal-popup-content", style: { padding: "0px" } }, /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-success-container" }, /* @__PURE__ */ import_react6.default.createElement("span", { className: "request-payment-close-popup", onClick: handleCloseConfirmationModal }, /* @__PURE__ */ import_react6.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react6.default.createElement("g", {
|
957
|
+
/* @__PURE__ */ import_react6.default.createElement("div", { className: "fractal-popup-content", style: { padding: "0px" } }, /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-success-container" }, /* @__PURE__ */ import_react6.default.createElement("span", { className: "request-payment-close-popup", onClick: handleCloseConfirmationModal }, /* @__PURE__ */ import_react6.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react6.default.createElement("g", { clipPath: "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react6.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_react6.default.createElement("defs", null, /* @__PURE__ */ import_react6.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react6.default.createElement("rect", { width: "16", height: "16", fill: "white" }))))), /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-success-tick-div" }, /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-success-tick" }, /* @__PURE__ */ import_react6.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react6.default.createElement("path", { d: "M6.12669 13.9774C5.97396 14.131 5.76558 14.2167 5.54913 14.2167C5.33267 14.2167 5.1243 14.131 4.97157 13.9774L0.359012 9.36408C-0.119671 8.8854 -0.119671 8.10919 0.359012 7.6314L0.936573 7.05369C1.4154 6.57501 2.19072 6.57501 2.6694 7.05369L5.54913 9.93357L13.3306 2.15198C13.8094 1.6733 14.5855 1.6733 15.0634 2.15198L15.641 2.72969C16.1196 3.20837 16.1196 3.98444 15.641 4.46237L6.12669 13.9774Z", fill: "#61C699" })))), /* @__PURE__ */ import_react6.default.createElement("h6", { className: "request-payment-success-text" }, "The request ", /* @__PURE__ */ import_react6.default.createElement("br", null), "was sent"), /* @__PURE__ */ import_react6.default.createElement("h6", { className: "request-payment-success-subtext" }, "Please wait for the customer to pay"), /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-success-btn-div" }, /* @__PURE__ */ import_react6.default.createElement("button", { onClick: handleCloseConfirmationModal, className: "request-payment-success-btn2" }, "Close"))))
|
956
958
|
)));
|
957
959
|
}
|
958
960
|
|
@@ -1141,7 +1143,7 @@ function RequestPreAuthPayment(props) {
|
|
1141
1143
|
open: show,
|
1142
1144
|
onClose: () => setShow(false)
|
1143
1145
|
},
|
1144
|
-
/* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-amount-detail" }, /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-merchantname" }, "Authorization Request"), /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-pre-auth-merchantname" }, "Pay ", props == null ? void 0 : props.webname), /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-amount" }, formatAmount(props == null ? void 0 : props.amount)), (props == null ? void 0 : props.from) === "merchant" && /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-orderid" }, requestDetails == null ? void 0 : requestDetails.order_id), /* @__PURE__ */ import_react7.default.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("g", {
|
1146
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-amount-detail" }, /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-merchantname" }, "Authorization Request"), /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-pre-auth-merchantname" }, "Pay ", props == null ? void 0 : props.webname), /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-amount" }, formatAmount(props == null ? void 0 : props.amount)), (props == null ? void 0 : props.from) === "merchant" && /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-orderid" }, requestDetails == null ? void 0 : requestDetails.order_id), /* @__PURE__ */ import_react7.default.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("g", { clipPath: "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react7.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_react7.default.createElement("defs", null, /* @__PURE__ */ import_react7.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react7.default.createElement("rect", { width: "16", height: "16", fill: "white" })))))),
|
1145
1147
|
/* @__PURE__ */ import_react7.default.createElement("form", { className: "request-payment-input-form" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react7.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "FULL NAME"), /* @__PURE__ */ import_react7.default.createElement(
|
1146
1148
|
"input",
|
1147
1149
|
{
|
@@ -1189,7 +1191,7 @@ function RequestPreAuthPayment(props) {
|
|
1189
1191
|
open: showConfirmationModal,
|
1190
1192
|
onClose: handleCloseConfirmationModal
|
1191
1193
|
},
|
1192
|
-
/* @__PURE__ */ import_react7.default.createElement("div", { className: "fractal-popup-content", style: { padding: "0px" } }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-success-container" }, /* @__PURE__ */ import_react7.default.createElement("span", { className: "request-payment-close-popup", onClick: handleCloseConfirmationModal }, /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("g", {
|
1194
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { className: "fractal-popup-content", style: { padding: "0px" } }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-success-container" }, /* @__PURE__ */ import_react7.default.createElement("span", { className: "request-payment-close-popup", onClick: handleCloseConfirmationModal }, /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("g", { clipPath: "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react7.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_react7.default.createElement("defs", null, /* @__PURE__ */ import_react7.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react7.default.createElement("rect", { width: "16", height: "16", fill: "white" }))))), /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-success-tick-div" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-success-tick" }, /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: "M6.12669 13.9774C5.97396 14.131 5.76558 14.2167 5.54913 14.2167C5.33267 14.2167 5.1243 14.131 4.97157 13.9774L0.359012 9.36408C-0.119671 8.8854 -0.119671 8.10919 0.359012 7.6314L0.936573 7.05369C1.4154 6.57501 2.19072 6.57501 2.6694 7.05369L5.54913 9.93357L13.3306 2.15198C13.8094 1.6733 14.5855 1.6733 15.0634 2.15198L15.641 2.72969C16.1196 3.20837 16.1196 3.98444 15.641 4.46237L6.12669 13.9774Z", fill: "#61C699" })))), /* @__PURE__ */ import_react7.default.createElement("h6", { className: "request-payment-success-text" }, "The request ", /* @__PURE__ */ import_react7.default.createElement("br", null), "was sent"), /* @__PURE__ */ import_react7.default.createElement("h6", { className: "request-payment-success-subtext" }, "Please wait for the customer to pay"), /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-success-btn-div" }, /* @__PURE__ */ import_react7.default.createElement("button", { onClick: handleCloseConfirmationModal, className: "request-payment-success-btn2" }, "Close"))))
|
1193
1195
|
)));
|
1194
1196
|
}
|
1195
1197
|
|
@@ -1277,7 +1279,6 @@ function Chargewidgetstyles() {
|
|
1277
1279
|
}
|
1278
1280
|
.tab {
|
1279
1281
|
overflow: hidden;
|
1280
|
-
background-color: #E0DFE2;
|
1281
1282
|
padding: 5px;
|
1282
1283
|
border-radius: 8px;
|
1283
1284
|
display: flex;
|
@@ -1291,10 +1292,11 @@ function Chargewidgetstyles() {
|
|
1291
1292
|
border: none;
|
1292
1293
|
outline: none;
|
1293
1294
|
cursor: pointer;
|
1295
|
+
background:white;
|
1294
1296
|
padding: 11px 16px;
|
1295
1297
|
transition: 0.3s;
|
1296
1298
|
font-size: 16px;
|
1297
|
-
width:
|
1299
|
+
width: 143px;
|
1298
1300
|
border-radius: 5px;
|
1299
1301
|
box-shadow: inherit;
|
1300
1302
|
outline: none;
|
@@ -1303,22 +1305,24 @@ function Chargewidgetstyles() {
|
|
1303
1305
|
|
1304
1306
|
/* Change background color of buttons on hover */
|
1305
1307
|
.tab button:hover {
|
1306
|
-
background-color: #
|
1308
|
+
background-color: #f0f0f0;
|
1307
1309
|
}
|
1308
1310
|
|
1309
1311
|
/* Create an active/current tablink class */
|
1310
|
-
.tab button.active {
|
1311
|
-
|
1312
|
-
}
|
1312
|
+
// .tab button.active {
|
1313
|
+
// background-color: #ccc;
|
1314
|
+
// }
|
1313
1315
|
|
1314
1316
|
/* Style the tab content */
|
1315
1317
|
|
1316
1318
|
|
1317
|
-
|
1319
|
+
.parent-pay-container{
|
1320
|
+
padding: 20px 10% ;
|
1321
|
+
}
|
1318
1322
|
.pay-container{
|
1319
1323
|
display: grid;
|
1320
1324
|
grid-template-columns: 2fr 3fr;
|
1321
|
-
|
1325
|
+
|
1322
1326
|
}
|
1323
1327
|
.pay-main{
|
1324
1328
|
padding-y: 20px}
|
@@ -1332,6 +1336,20 @@ function Chargewidgetstyles() {
|
|
1332
1336
|
.pay-conatiner-one{
|
1333
1337
|
border-right: 1px solid #E0DFE2;
|
1334
1338
|
}
|
1339
|
+
.pay-conatiner-one-first{
|
1340
|
+
min-height:530px
|
1341
|
+
}
|
1342
|
+
.pay-conatiner-one-last{
|
1343
|
+
display:flex;
|
1344
|
+
font-size:12px;
|
1345
|
+
gap:5px;
|
1346
|
+
max-width:250px;
|
1347
|
+
align-items:center
|
1348
|
+
}
|
1349
|
+
.pay-conatiner-one-last img{
|
1350
|
+
width : 17px;
|
1351
|
+
height:17px
|
1352
|
+
}
|
1335
1353
|
.pay-conatiner-two{
|
1336
1354
|
padding: 0 5% 0;
|
1337
1355
|
}
|
@@ -1351,6 +1369,11 @@ function Chargewidgetstyles() {
|
|
1351
1369
|
.pay-main-logo > img{
|
1352
1370
|
width: 50%;
|
1353
1371
|
}
|
1372
|
+
.pay-main-logo-res > img{
|
1373
|
+
width: 50%;
|
1374
|
+
display : none
|
1375
|
+
}
|
1376
|
+
|
1354
1377
|
.pay-payment-amount{
|
1355
1378
|
display: block;
|
1356
1379
|
font-size: 12px;
|
@@ -1511,7 +1534,8 @@ function Chargewidgetstyles() {
|
|
1511
1534
|
left: 18px;
|
1512
1535
|
}
|
1513
1536
|
.ach-scrl {
|
1514
|
-
max-height:
|
1537
|
+
max-height: 380px;
|
1538
|
+
min-height: 380px;
|
1515
1539
|
overflow-y: auto;
|
1516
1540
|
padding-right: 6px;
|
1517
1541
|
}
|
@@ -1534,10 +1558,32 @@ function Chargewidgetstyles() {
|
|
1534
1558
|
|
1535
1559
|
|
1536
1560
|
@media (max-width: 768px) {
|
1561
|
+
.parent-pay-container{
|
1562
|
+
padding: 20px 5%;
|
1563
|
+
}
|
1537
1564
|
.pay-container {
|
1538
1565
|
grid-template-columns: 1fr;
|
1539
|
-
padding:
|
1566
|
+
padding: 10px 5%;
|
1567
|
+
border:1px solid #E0DFE2;
|
1568
|
+
border-radius : 12px
|
1540
1569
|
}
|
1570
|
+
.pay-conatiner-one{
|
1571
|
+
border-right: none;
|
1572
|
+
}
|
1573
|
+
.pay-conatiner-one-first{
|
1574
|
+
min-height:0
|
1575
|
+
}
|
1576
|
+
.pay-main-logo > img{
|
1577
|
+
display: none;
|
1578
|
+
}
|
1579
|
+
.pay-main-logo-res > img {
|
1580
|
+
display:block;
|
1581
|
+
margin:auto
|
1582
|
+
}
|
1583
|
+
|
1584
|
+
.pay-logo-container{
|
1585
|
+
border :none
|
1586
|
+
}
|
1541
1587
|
}
|
1542
1588
|
.charge-customer-name{
|
1543
1589
|
color: #161616;
|
@@ -1589,7 +1635,7 @@ function Chargewidgetstyles() {
|
|
1589
1635
|
border-bottom: none;
|
1590
1636
|
}
|
1591
1637
|
.card-lint-div-in{
|
1592
|
-
min-height:
|
1638
|
+
min-height:444px}
|
1593
1639
|
.card-number-radio{
|
1594
1640
|
display:flex;
|
1595
1641
|
gap:12px;
|
@@ -1931,7 +1977,7 @@ function SuccessMsz({ onClose }) {
|
|
1931
1977
|
viewBox: "0 0 17 16",
|
1932
1978
|
fill: "none"
|
1933
1979
|
},
|
1934
|
-
/* @__PURE__ */ import_react10.default.createElement("g", {
|
1980
|
+
/* @__PURE__ */ import_react10.default.createElement("g", { clipPath: "url(#clip0_12420_50683)" }, /* @__PURE__ */ import_react10.default.createElement(
|
1935
1981
|
"path",
|
1936
1982
|
{
|
1937
1983
|
d: "M9.30194 4.78664V2.31152C9.30194 2.09629 9.3862 1.88988 9.53631 1.73768C9.68634 1.5855 9.8899 1.5 10.1021 1.5C10.312 1.50089 10.5132 1.58542 10.6622 1.73534L16.2633 7.41595C16.3383 7.49142 16.3978 7.58117 16.4385 7.68001C16.4791 7.77894 16.5 7.885 16.5 7.99212C16.5 8.09924 16.4791 8.20531 16.4385 8.30423C16.3978 8.40307 16.3383 8.49283 16.2633 8.5683L10.6622 14.2489C10.5499 14.3606 10.4076 14.4362 10.2531 14.4663C10.0987 14.4964 9.93887 14.4797 9.79372 14.4182C9.64857 14.3568 9.52455 14.2532 9.43701 14.1206C9.34955 13.9881 9.30258 13.8323 9.30194 13.6727V11.157H8.62181C7.35764 11.1379 6.10443 11.3981 4.94932 11.9193C3.79422 12.4406 2.76481 13.2107 1.93249 14.1759C1.83215 14.3113 1.6926 14.4115 1.53337 14.4624C1.37406 14.5134 1.20306 14.5125 1.04431 14.4599C0.882759 14.4046 0.742811 14.2984 0.644952 14.1568C0.547092 14.0152 0.496363 13.8456 0.500203 13.6727C0.500203 6.27171 6.96548 5.00575 9.30194 4.78664ZM8.62181 9.51777C9.15695 9.51607 9.69162 9.55129 10.2221 9.62327C10.4115 9.6524 10.5844 9.74954 10.7092 9.89699C10.834 10.0444 10.9025 10.2324 10.9023 10.4267V11.717L14.567 7.99212L10.9023 4.26727V5.55758C10.9023 5.77281 10.8179 5.97922 10.6679 6.13141C10.5178 6.28359 10.3143 6.36909 10.1021 6.36909C9.37396 6.36909 3.61282 6.5314 2.36457 11.5871C4.17637 10.2324 6.3708 9.50665 8.62181 9.51777Z",
|
@@ -2090,6 +2136,17 @@ function GetPaymentPage(props) {
|
|
2090
2136
|
const handleChangeAch = (e) => {
|
2091
2137
|
const { name, value } = e.target;
|
2092
2138
|
const numericFields = ["routingNumber", "accountNumber", "confirmAccountNumber"];
|
2139
|
+
if (name == "name") {
|
2140
|
+
if (/^[a-zA-Z\s]*$/.test(value)) {
|
2141
|
+
setAchError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2142
|
+
[name]: ""
|
2143
|
+
}));
|
2144
|
+
setAchData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2145
|
+
[name]: value
|
2146
|
+
}));
|
2147
|
+
}
|
2148
|
+
return;
|
2149
|
+
}
|
2093
2150
|
if (numericFields.includes(name)) {
|
2094
2151
|
if (value === "" || /^[0-9]+$/.test(value)) {
|
2095
2152
|
setAchError((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -2182,7 +2239,12 @@ function GetPaymentPage(props) {
|
|
2182
2239
|
try {
|
2183
2240
|
const formData = __spreadProps(__spreadValues({}, cardData), {
|
2184
2241
|
amount: `${props.amount || 0}`,
|
2185
|
-
fractalpayPublicKey: fractalpayClientKey
|
2242
|
+
fractalpayPublicKey: fractalpayClientKey,
|
2243
|
+
orderId: props == null ? void 0 : props.orderID,
|
2244
|
+
customer_id: props == null ? void 0 : props.customerId,
|
2245
|
+
discount: props == null ? void 0 : props.discount,
|
2246
|
+
surcharge: props == null ? void 0 : props.surcharge,
|
2247
|
+
tax: props == null ? void 0 : props.tax
|
2186
2248
|
});
|
2187
2249
|
const result = await import_axios3.default.post(`${baseUrl}create-widget-order`, formData);
|
2188
2250
|
console.log(result);
|
@@ -2193,13 +2255,11 @@ function GetPaymentPage(props) {
|
|
2193
2255
|
showError(response.Error);
|
2194
2256
|
hideLoader();
|
2195
2257
|
} else {
|
2196
|
-
var token = response.Token;
|
2197
|
-
var jsonResponse = JSON.stringify(response, null, 2);
|
2198
2258
|
let name = cardData == null ? void 0 : cardData.cardName;
|
2199
2259
|
let postal_code = cardData == null ? void 0 : cardData.zipCode;
|
2200
2260
|
response.name = name;
|
2201
2261
|
response.postal_code = postal_code;
|
2202
|
-
|
2262
|
+
response.isCardSave = `${saveCardInfo}`;
|
2203
2263
|
try {
|
2204
2264
|
let apiResponse = await import_axios3.default.post(`${masterBaseUrl}quick-pay/${result == null ? void 0 : result.data.data.posSalesIdEncode}`, response);
|
2205
2265
|
console.log(apiResponse);
|
@@ -2212,6 +2272,7 @@ function GetPaymentPage(props) {
|
|
2212
2272
|
orderId: "",
|
2213
2273
|
zipCode: ""
|
2214
2274
|
});
|
2275
|
+
setSaveCardInfo(false);
|
2215
2276
|
setSuccess(true);
|
2216
2277
|
hideLoader();
|
2217
2278
|
} catch (err) {
|
@@ -2460,15 +2521,19 @@ function GetPaymentPage(props) {
|
|
2460
2521
|
import_sweetalert2.default.fire({
|
2461
2522
|
icon: "success",
|
2462
2523
|
title: "Deleted!",
|
2463
|
-
text: "
|
2524
|
+
text: "Card deleted.",
|
2464
2525
|
confirmButtonText: "OK",
|
2526
|
+
showConfirmButton: true,
|
2527
|
+
timer: 1e3,
|
2528
|
+
// auto-close after 1 second
|
2529
|
+
timerProgressBar: true,
|
2465
2530
|
customClass: {
|
2466
2531
|
confirmButton: "btn btn-dark"
|
2467
2532
|
}
|
2468
2533
|
});
|
2469
2534
|
} catch (err) {
|
2470
2535
|
hideLoader();
|
2471
|
-
console.
|
2536
|
+
console.log("Error:", err);
|
2472
2537
|
import_sweetalert2.default.fire({
|
2473
2538
|
icon: "error",
|
2474
2539
|
title: "Error!",
|
@@ -2479,6 +2544,17 @@ function GetPaymentPage(props) {
|
|
2479
2544
|
}
|
2480
2545
|
});
|
2481
2546
|
}
|
2547
|
+
} else if (result.dismiss === import_sweetalert2.default.DismissReason.cancel) {
|
2548
|
+
import_sweetalert2.default.fire({
|
2549
|
+
icon: "info",
|
2550
|
+
text: "Card not deleted",
|
2551
|
+
confirmButtonText: "OK",
|
2552
|
+
buttonsStyling: false,
|
2553
|
+
customClass: {
|
2554
|
+
confirmButton: "btn btn-dark float-end",
|
2555
|
+
actions: "swal2-actions-end"
|
2556
|
+
}
|
2557
|
+
});
|
2482
2558
|
}
|
2483
2559
|
});
|
2484
2560
|
};
|
@@ -2496,11 +2572,11 @@ function GetPaymentPage(props) {
|
|
2496
2572
|
onClose: handleClose
|
2497
2573
|
},
|
2498
2574
|
/* @__PURE__ */ import_react12.default.createElement(Loader_default, { loading }),
|
2499
|
-
success ? /* @__PURE__ */ import_react12.default.createElement(SuccessMsz, { onClose: handleCloseSeccess }) : /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("div",
|
2575
|
+
success ? /* @__PURE__ */ import_react12.default.createElement(SuccessMsz, { onClose: handleCloseSeccess }) : /* @__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) => {
|
2500
2576
|
handletabchange("card");
|
2501
|
-
}, style: {
|
2577
|
+
}, 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) => {
|
2502
2578
|
handletabchange("ach");
|
2503
|
-
}, style: {
|
2579
|
+
}, style: { border: activetab === "ach" ? "1px solid" : "" } }, /* @__PURE__ */ import_react12.default.createElement("i", { className: "fas fa-university me-2", style: { marginRight: "8px", fontSize: "15px" } }), "Bank"))) : /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("p", { className: "charge-customer-name" }, " Charge ", paymentData == null ? void 0 : paymentData.customer_name), /* @__PURE__ */ import_react12.default.createElement("p", { className: "card-ach-heading" }, " Cards/ACH")), /* @__PURE__ */ import_react12.default.createElement("div", { id: "ach", style: { display: activetab === "cardList" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-lint-div-in" }, /* @__PURE__ */ import_react12.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_react12.default.createElement("div", { className: "card-list-single-div", key: index }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ import_react12.default.createElement(
|
2504
2580
|
"input",
|
2505
2581
|
{
|
2506
2582
|
type: "radio",
|
@@ -2510,7 +2586,12 @@ function GetPaymentPage(props) {
|
|
2510
2586
|
checked: selectedCard === card,
|
2511
2587
|
onChange: (e) => setSelectedCard(card)
|
2512
2588
|
}
|
2513
|
-
), /* @__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" }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer }, "$
|
2589
|
+
), /* @__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) => {
|
2590
|
+
const value = e.target.value;
|
2591
|
+
if (/^[a-zA-Z\s]*$/.test(value)) {
|
2592
|
+
handleCardChange("cardName", value);
|
2593
|
+
}
|
2594
|
+
} }), (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cardName)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "cardNumber" }, "CARD NUMBER"), /* @__PURE__ */ import_react12.default.createElement("div", { className: "toggle-num-wrapper" }, /* @__PURE__ */ import_react12.default.createElement(
|
2514
2595
|
"input",
|
2515
2596
|
{
|
2516
2597
|
className: "form-control card-number-new",
|
@@ -2563,11 +2644,10 @@ function GetPaymentPage(props) {
|
|
2563
2644
|
maxLength: 100,
|
2564
2645
|
placeholder: "OID123456",
|
2565
2646
|
disabled: true,
|
2566
|
-
value: (_c =
|
2567
|
-
onChange: (e) => handleCardChange("orderId", e.target.value),
|
2647
|
+
value: (_c = props == null ? void 0 : props.orderID) != null ? _c : "",
|
2568
2648
|
style: { background: "#F6F6F7", color: "#727272" }
|
2569
2649
|
}
|
2570
|
-
)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "zip" }, "ZIP"), /* @__PURE__ */ import_react12.default.createElement("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (_d = cardData == null ? void 0 : cardData.zipCode) != null ? _d : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }), (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.zipCode)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" } }, /* @__PURE__ */ import_react12.default.createElement(
|
2650
|
+
)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "zip" }, "ZIP"), /* @__PURE__ */ import_react12.default.createElement("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (_d = cardData == null ? void 0 : cardData.zipCode) != null ? _d : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }), (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.zipCode)), (props == null ? void 0 : props.customerId) && /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" } }, /* @__PURE__ */ import_react12.default.createElement(
|
2571
2651
|
"input",
|
2572
2652
|
{
|
2573
2653
|
type: "checkbox",
|
@@ -2576,7 +2656,7 @@ function GetPaymentPage(props) {
|
|
2576
2656
|
checked: saveCardInfo,
|
2577
2657
|
onChange: (e) => setSaveCardInfo(e.target.checked)
|
2578
2658
|
}
|
2579
|
-
), /* @__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("div", { className: "form-group", style: { marginTop: "20px" } }, /* @__PURE__ */ import_react12.default.createElement("button", { type: "submit", style: { margin: 0 }, className: "pay-button" }, "$
|
2659
|
+
), /* @__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: { 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", maxHeight: (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && (cardList == null ? void 0 : cardList.length) > 0 ? "378px" : (cardList == null ? void 0 : cardList.length) > 0 ? "380" : "380" } }, /* @__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(
|
2580
2660
|
"input",
|
2581
2661
|
{
|
2582
2662
|
type: "text",
|
@@ -2624,12 +2704,1295 @@ function GetPaymentPage(props) {
|
|
2624
2704
|
value: (_i = achData == null ? void 0 : achData.bankName) != null ? _i : "",
|
2625
2705
|
onChange: handleChangeAch
|
2626
2706
|
}
|
2627
|
-
), (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.bankName)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "accounttype" }, "Select account type"), /* @__PURE__ */ import_react12.default.createElement("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_j = achData == null ? void 0 : achData.accountType) != null ? _j : "", onChange: handleChangeAch }, /* @__PURE__ */ import_react12.default.createElement("option", { value: "" }, "Select account"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Personal Saving" }, "Personal Saving"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Business Saving" }, "Business Saving"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Personal Checking" }, "Personal Checking"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Business Checking" }, "Business Checking"))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4", style: { paddingTop: "5px" } }, /* @__PURE__ */ import_react12.default.createElement("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "saveACH" }, "Save ACH")), saveACHinfo && /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4", style: { fontSize: "12px", color: "#727272" } }, /* @__PURE__ */ import_react12.default.createElement("p", null, "If checked, I agree for ", /* @__PURE__ */ import_react12.default.createElement("b", null, "ecommerce"), " to have my permission to charge this credit card for agreed upon purchases in the future."))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit" }, "$
|
2707
|
+
), (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.bankName)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "accounttype" }, "Select account type"), /* @__PURE__ */ import_react12.default.createElement("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_j = achData == null ? void 0 : achData.accountType) != null ? _j : "", onChange: handleChangeAch }, /* @__PURE__ */ import_react12.default.createElement("option", { value: "" }, "Select account"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Personal Saving" }, "Personal Saving"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Business Saving" }, "Business Saving"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Personal Checking" }, "Personal Checking"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Business Checking" }, "Business Checking"))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4", style: { paddingTop: "5px" } }, /* @__PURE__ */ import_react12.default.createElement("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "saveACH" }, "Save ACH")), saveACHinfo && /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4", style: { fontSize: "12px", color: "#727272" } }, /* @__PURE__ */ import_react12.default.createElement("p", null, "If checked, I agree for ", /* @__PURE__ */ import_react12.default.createElement("b", null, "ecommerce"), " to have my permission to charge this credit card for agreed upon purchases in the future."))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group " }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit" }, "$", props == null ? void 0 : props.amount))))))))))
|
2628
2708
|
)));
|
2629
2709
|
}
|
2710
|
+
|
2711
|
+
// src/app/components/PreAuthCharge/PreAuthPaymentPage.tsx
|
2712
|
+
var import_react13 = __toESM(require("react"));
|
2713
|
+
var import_axios4 = __toESM(require("axios"));
|
2714
|
+
var import_sweetalert22 = __toESM(require("sweetalert2"));
|
2715
|
+
var import_io52 = require("react-icons/io5");
|
2716
|
+
function PreAuthPayment(props) {
|
2717
|
+
var _a, _b, _c, _d;
|
2718
|
+
const [loading, setLoading] = (0, import_react13.useState)(false);
|
2719
|
+
const [success, setSuccess] = (0, import_react13.useState)(false);
|
2720
|
+
const [show, setShow] = (0, import_react13.useState)(false);
|
2721
|
+
const [activetab, setActive] = (0, import_react13.useState)("cardList");
|
2722
|
+
const [saveCardInfo, setSaveCardInfo] = (0, import_react13.useState)(false);
|
2723
|
+
const fractalpayClientKey = props.fractalpayClientKey;
|
2724
|
+
const [cardData, setCardData] = (0, import_react13.useState)();
|
2725
|
+
const [cardError, setCardError] = (0, import_react13.useState)({});
|
2726
|
+
const [cardList, setCardList] = (0, import_react13.useState)([]);
|
2727
|
+
const [selectedCard, setSelectedCard] = (0, import_react13.useState)();
|
2728
|
+
const [paymentData, setPaymentData] = (0, import_react13.useState)();
|
2729
|
+
const showLoader = () => setLoading(true);
|
2730
|
+
const hideLoader = () => setLoading(false);
|
2731
|
+
const showError = (msz) => {
|
2732
|
+
import_sweetalert22.default.fire({
|
2733
|
+
icon: "error",
|
2734
|
+
title: "Oops...",
|
2735
|
+
text: msz
|
2736
|
+
});
|
2737
|
+
};
|
2738
|
+
const handleClose = () => {
|
2739
|
+
setShow(false);
|
2740
|
+
setActive("cardList");
|
2741
|
+
};
|
2742
|
+
const handleShow = () => setShow(true);
|
2743
|
+
const handleCloseSeccess = () => {
|
2744
|
+
setSuccess(false);
|
2745
|
+
handleClose();
|
2746
|
+
};
|
2747
|
+
const handletabchange = (id) => {
|
2748
|
+
setActive(id);
|
2749
|
+
};
|
2750
|
+
const handleCardChange = (field, value) => {
|
2751
|
+
const name = field;
|
2752
|
+
const numericFields = ["expiryMonth", "expiryYear", "zipCode", "cvv"];
|
2753
|
+
if (numericFields.includes(name)) {
|
2754
|
+
if (value === "" || /^[0-9]+$/.test(value)) {
|
2755
|
+
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2756
|
+
[name]: ""
|
2757
|
+
}));
|
2758
|
+
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2759
|
+
[name]: value
|
2760
|
+
}));
|
2761
|
+
}
|
2762
|
+
return;
|
2763
|
+
}
|
2764
|
+
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2765
|
+
[name]: ""
|
2766
|
+
}));
|
2767
|
+
console.log(value, name);
|
2768
|
+
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2769
|
+
[name]: value
|
2770
|
+
}));
|
2771
|
+
};
|
2772
|
+
const handleCardNumberChange = (e) => {
|
2773
|
+
const input = e.target;
|
2774
|
+
const rawValue = input.value.replace(/\D/g, "");
|
2775
|
+
let formatted = "";
|
2776
|
+
if (/^3[47]/.test(rawValue)) {
|
2777
|
+
const trimmed = rawValue.slice(0, 15);
|
2778
|
+
formatted = trimmed.replace(
|
2779
|
+
/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,
|
2780
|
+
(_, g1, g2, g3) => [g1, g2, g3].filter(Boolean).join(" ")
|
2781
|
+
);
|
2782
|
+
} else {
|
2783
|
+
const trimmed = rawValue.slice(0, 16);
|
2784
|
+
formatted = trimmed.replace(
|
2785
|
+
/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,
|
2786
|
+
(_, g1, g2, g3, g4) => [g1, g2, g3, g4].filter(Boolean).join(" ")
|
2787
|
+
);
|
2788
|
+
}
|
2789
|
+
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
2790
|
+
cardNumber: ""
|
2791
|
+
}));
|
2792
|
+
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
2793
|
+
cardNumber: formatted
|
2794
|
+
}));
|
2795
|
+
};
|
2796
|
+
const validateCardData = () => {
|
2797
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
2798
|
+
const errors = {};
|
2799
|
+
const data = cardData;
|
2800
|
+
const month = parseInt((data == null ? void 0 : data.expiryMonth) || "", 10);
|
2801
|
+
const year = (data == null ? void 0 : data.expiryYear) || "";
|
2802
|
+
if (!((_a2 = data == null ? void 0 : data.cardName) == null ? void 0 : _a2.trim())) errors.cardName = "Card name is required";
|
2803
|
+
if (!((_b2 = data == null ? void 0 : data.cardNumber) == null ? void 0 : _b2.trim())) errors.cardNumber = "Card number is required";
|
2804
|
+
if (!((_c2 = data == null ? void 0 : data.expiryMonth) == null ? void 0 : _c2.trim()) || !((_d2 = data == null ? void 0 : data.expiryYear) == null ? void 0 : _d2.trim())) {
|
2805
|
+
errors.expiryMonth = "Invalid Expiration Date.";
|
2806
|
+
} else if (isNaN(month) || month < 1 || month > 12 || year.length !== 4) {
|
2807
|
+
errors.expiryMonth = "Invalid Expiration Date.";
|
2808
|
+
}
|
2809
|
+
if (!((_e = data == null ? void 0 : data.cvv) == null ? void 0 : _e.trim())) errors.cvv = "CVV is required";
|
2810
|
+
if (!((_f = data == null ? void 0 : data.zipCode) == null ? void 0 : _f.trim())) errors.zipCode = "ZIP code is required";
|
2811
|
+
if ((data == null ? void 0 : data.expiryMonth) && (data == null ? void 0 : data.expiryYear) && data.expiryMonth.length <= 2 && data.expiryYear.length === 4) {
|
2812
|
+
const month2 = parseInt(data.expiryMonth, 10);
|
2813
|
+
const year2 = parseInt(data.expiryYear, 10);
|
2814
|
+
const now = /* @__PURE__ */ new Date();
|
2815
|
+
const currentMonth = now.getMonth() + 1;
|
2816
|
+
const currentYear = now.getFullYear();
|
2817
|
+
if (year2 < currentYear || year2 === currentYear && month2 < currentMonth) {
|
2818
|
+
errors.expiryMonth = "Card is expired";
|
2819
|
+
}
|
2820
|
+
}
|
2821
|
+
setCardError(errors);
|
2822
|
+
return Object.keys(errors).length > 0;
|
2823
|
+
};
|
2824
|
+
const submitFunc = async (e) => {
|
2825
|
+
var _a2, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
2826
|
+
e.preventDefault();
|
2827
|
+
if (activetab == "card") {
|
2828
|
+
const hasError = validateCardData();
|
2829
|
+
if (hasError) return;
|
2830
|
+
else {
|
2831
|
+
let validCard = DatacapWebToken.validateCardNumber(cardData == null ? void 0 : cardData.cardNumber.replaceAll(" ", ""));
|
2832
|
+
let validExpirationDate = DatacapWebToken.validateExpirationDate(cardData == null ? void 0 : cardData.expiryMonth, cardData == null ? void 0 : cardData.expiryYear);
|
2833
|
+
let validCVV = DatacapWebToken.validateCVV(cardData == null ? void 0 : cardData.cvv);
|
2834
|
+
let errors = {};
|
2835
|
+
if (!validCard) errors.cardNumber = "Invalid card Number";
|
2836
|
+
if (!validExpirationDate) errors.expiryMonth = "Invalid Expiration Date.";
|
2837
|
+
if (!validCVV) errors.cvv = "Invalid CVV";
|
2838
|
+
setCardError(errors);
|
2839
|
+
if (validCard && validCVV && validExpirationDate) {
|
2840
|
+
console.log(props == null ? void 0 : props.customerId);
|
2841
|
+
showLoader();
|
2842
|
+
try {
|
2843
|
+
let tokenCallback = async function(response) {
|
2844
|
+
var _a3, _b3;
|
2845
|
+
if (response.Error) {
|
2846
|
+
console.log(response == null ? void 0 : response.Error);
|
2847
|
+
showError(response.Error);
|
2848
|
+
hideLoader();
|
2849
|
+
} else {
|
2850
|
+
let name = cardData == null ? void 0 : cardData.cardName;
|
2851
|
+
let postal_code = cardData == null ? void 0 : cardData.zipCode;
|
2852
|
+
response.name = name;
|
2853
|
+
response.postal_code = postal_code;
|
2854
|
+
response.fractalpayPublicKey = props == null ? void 0 : props.fractalpayClientKey;
|
2855
|
+
response.amount = props == null ? void 0 : props.amount;
|
2856
|
+
response.order_id = props == null ? void 0 : props.orderID;
|
2857
|
+
response.preAuth_id = "";
|
2858
|
+
response.isCardSave = saveCardInfo;
|
2859
|
+
response.customer_id = props == null ? void 0 : props.customerId;
|
2860
|
+
response.link_token = "";
|
2861
|
+
response.gateway_id = paymentData == null ? void 0 : paymentData.paymentGateway;
|
2862
|
+
console.log("Response :", response);
|
2863
|
+
try {
|
2864
|
+
let apiResponse = await import_axios4.default.post(`${baseUrl}preauth`, response);
|
2865
|
+
console.log(apiResponse);
|
2866
|
+
setCardData({
|
2867
|
+
cardName: "",
|
2868
|
+
cardNumber: "",
|
2869
|
+
expiryMonth: "",
|
2870
|
+
expiryYear: "",
|
2871
|
+
cvv: "",
|
2872
|
+
orderId: "",
|
2873
|
+
zipCode: ""
|
2874
|
+
});
|
2875
|
+
setSuccess(true);
|
2876
|
+
hideLoader();
|
2877
|
+
} catch (err) {
|
2878
|
+
console.log(err);
|
2879
|
+
hideLoader();
|
2880
|
+
showError(((_b3 = (_a3 = err == null ? void 0 : err.response) == null ? void 0 : _a3.data) == null ? void 0 : _b3.message) || (err == null ? void 0 : err.message) || "Something went wrong..");
|
2881
|
+
}
|
2882
|
+
}
|
2883
|
+
};
|
2884
|
+
if ((paymentData == null ? void 0 : paymentData.paymentGateway) === 32) {
|
2885
|
+
const requestOptions = {
|
2886
|
+
method: "POST",
|
2887
|
+
redirect: "follow"
|
2888
|
+
};
|
2889
|
+
try {
|
2890
|
+
let sesionResult = await import_axios4.default.post(`${masterBaseUrl}api/v1/widget/generate-session`, requestOptions);
|
2891
|
+
let expYear = Number(cardData == null ? void 0 : cardData.expiryYear) % 100;
|
2892
|
+
let cardNumber = cardData == null ? void 0 : cardData.cardNumber;
|
2893
|
+
cardNumber = cardNumber == null ? void 0 : cardNumber.replace(/\s+/g, "");
|
2894
|
+
let track2_data = `${cardNumber}=${expYear}${cardData == null ? void 0 : cardData.expiryMonth} ${cardData == null ? void 0 : cardData.cvv}`;
|
2895
|
+
const publicKey = forge.pki.publicKeyFromPem((_b2 = (_a2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.publicKeyPem);
|
2896
|
+
const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
|
2897
|
+
md: forge.md.sha1.create(),
|
2898
|
+
mgf1: {
|
2899
|
+
md: forge.md.sha1.create()
|
2900
|
+
}
|
2901
|
+
});
|
2902
|
+
const encryptedBase64 = forge.util.encode64(encrypted);
|
2903
|
+
const myHeaders = {
|
2904
|
+
"Content-Type": "application/json",
|
2905
|
+
"x-app-session-key": (_d2 = (_c2 = sesionResult.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.session_key
|
2906
|
+
};
|
2907
|
+
const raw = JSON.stringify({
|
2908
|
+
"enc_track2_data": `${encryptedBase64}`,
|
2909
|
+
"algorithm": "RSAES_OAEP_SHA_1",
|
2910
|
+
session_key: `${(_f = (_e = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _e.data) == null ? void 0 : _f.session_key}`
|
2911
|
+
});
|
2912
|
+
try {
|
2913
|
+
const tokenizeData = await import_axios4.default.post("https://api-dev.merchant-trends.com/tokenizer/tokenize", raw, { headers: myHeaders });
|
2914
|
+
const reqData = JSON.stringify(__spreadProps(__spreadValues({}, (_g = tokenizeData == null ? void 0 : tokenizeData.data) == null ? void 0 : _g.data), {
|
2915
|
+
// isSaveCardChecked: saveCardInfo,
|
2916
|
+
name: cardData == null ? void 0 : cardData.cardName,
|
2917
|
+
postal_code: cardData == null ? void 0 : cardData.zipCode,
|
2918
|
+
customer_id: props == null ? void 0 : props.customerId,
|
2919
|
+
"amount": props == null ? void 0 : props.amount,
|
2920
|
+
"Token": `${(_i = (_h = tokenizeData == null ? void 0 : tokenizeData.data) == null ? void 0 : _h.data) == null ? void 0 : _i.token}`,
|
2921
|
+
"fractalpayPublicKey": fractalpayClientKey,
|
2922
|
+
"order_id": props == null ? void 0 : props.orderID,
|
2923
|
+
"preAuth_id": "",
|
2924
|
+
"isCardSave": saveCardInfo,
|
2925
|
+
"discount": props == null ? void 0 : props.discount,
|
2926
|
+
"surcharge": props == null ? void 0 : props.surcharge,
|
2927
|
+
"tax": props == null ? void 0 : props.tax,
|
2928
|
+
"link_token": "",
|
2929
|
+
"ExpirationYear": cardData == null ? void 0 : cardData.expiryYear,
|
2930
|
+
"ExpirationMonth": cardData == null ? void 0 : cardData.expiryMonth,
|
2931
|
+
"CVV": cardData == null ? void 0 : cardData.cvv,
|
2932
|
+
"Last4": (_k = (_j = tokenizeData == null ? void 0 : tokenizeData.data) == null ? void 0 : _j.data) == null ? void 0 : _k.last4,
|
2933
|
+
"Brand": (_m = (_l = tokenizeData == null ? void 0 : tokenizeData.data) == null ? void 0 : _l.data) == null ? void 0 : _m.brand,
|
2934
|
+
"gateway_id": paymentData == null ? void 0 : paymentData.paymentGateway
|
2935
|
+
}));
|
2936
|
+
let myHeaders2 = {
|
2937
|
+
"Content-Type": "application/json"
|
2938
|
+
};
|
2939
|
+
try {
|
2940
|
+
let paymentRes = await import_axios4.default.post(
|
2941
|
+
`${baseUrl}preauth`,
|
2942
|
+
reqData,
|
2943
|
+
{
|
2944
|
+
headers: myHeaders2
|
2945
|
+
}
|
2946
|
+
);
|
2947
|
+
console.log(paymentRes);
|
2948
|
+
if ((_n = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _n.result) {
|
2949
|
+
setSuccess(true);
|
2950
|
+
hideLoader();
|
2951
|
+
}
|
2952
|
+
} catch (err) {
|
2953
|
+
hideLoader();
|
2954
|
+
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");
|
2955
|
+
}
|
2956
|
+
} catch (err) {
|
2957
|
+
console.log(err);
|
2958
|
+
hideLoader();
|
2959
|
+
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");
|
2960
|
+
}
|
2961
|
+
} catch (err) {
|
2962
|
+
hideLoader();
|
2963
|
+
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");
|
2964
|
+
}
|
2965
|
+
} else {
|
2966
|
+
DatacapWebToken.requestToken(paymentData == null ? void 0 : paymentData.dctoken, "PaymentForm", tokenCallback);
|
2967
|
+
}
|
2968
|
+
} catch (err) {
|
2969
|
+
hideLoader();
|
2970
|
+
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");
|
2971
|
+
}
|
2972
|
+
}
|
2973
|
+
}
|
2974
|
+
}
|
2975
|
+
};
|
2976
|
+
const getPaymentDetails = async () => {
|
2977
|
+
var _a2, _b2, _c2, _d2, _e, _f, _g, _h;
|
2978
|
+
showLoader();
|
2979
|
+
try {
|
2980
|
+
const data = {
|
2981
|
+
fractalpayPublicKey: fractalpayClientKey,
|
2982
|
+
"customer_id": props == null ? void 0 : props.customerId,
|
2983
|
+
preauth: true
|
2984
|
+
};
|
2985
|
+
let paymentData2 = await import_axios4.default.post(`${baseUrl}get-payment-details`, data);
|
2986
|
+
console.log(paymentData2);
|
2987
|
+
setPaymentData((_a2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _a2.data);
|
2988
|
+
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) {
|
2989
|
+
setCardList((_h = (_g = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _g.data) == null ? void 0 : _h.card_list);
|
2990
|
+
} else {
|
2991
|
+
setActive("card");
|
2992
|
+
}
|
2993
|
+
hideLoader();
|
2994
|
+
} catch (err) {
|
2995
|
+
console.log(err);
|
2996
|
+
setActive("card");
|
2997
|
+
hideLoader();
|
2998
|
+
}
|
2999
|
+
};
|
3000
|
+
const handlechargeCustomer = async () => {
|
3001
|
+
var _b2, _c2, _d2, _e, _f;
|
3002
|
+
console.log("selected", selectedCard);
|
3003
|
+
let customer_id = props == null ? void 0 : props.customerId;
|
3004
|
+
let discount = props == null ? void 0 : props.discount;
|
3005
|
+
let surcharge = props == null ? void 0 : props.surcharge;
|
3006
|
+
let tax = props == null ? void 0 : props.tax;
|
3007
|
+
let fractalpayPublicKey = props == null ? void 0 : props.fractalpayClientKey;
|
3008
|
+
let order_id = props == null ? void 0 : props.orderID;
|
3009
|
+
let amount = props == null ? void 0 : props.amount;
|
3010
|
+
let card_id = selectedCard == null ? void 0 : selectedCard.id;
|
3011
|
+
let card_type = selectedCard == null ? void 0 : selectedCard.card_type;
|
3012
|
+
if (fractalpayPublicKey && order_id && amount) {
|
3013
|
+
if (customer_id) {
|
3014
|
+
if (card_id) {
|
3015
|
+
let chargeobj = {
|
3016
|
+
amount,
|
3017
|
+
order_id,
|
3018
|
+
customer_id,
|
3019
|
+
card_id,
|
3020
|
+
fractalpayPublicKey,
|
3021
|
+
isCardSave: card_type != "Bank",
|
3022
|
+
discount,
|
3023
|
+
surcharge,
|
3024
|
+
tax
|
3025
|
+
};
|
3026
|
+
let _a2 = chargeobj, { isCardSave } = _a2, rest = __objRest(_a2, ["isCardSave"]);
|
3027
|
+
let endpoint = card_type === "Bank" ? "charge-ach" : "charge-by-card";
|
3028
|
+
let chargeurl = baseUrl + endpoint;
|
3029
|
+
const headers = {
|
3030
|
+
"Content-Type": "application/json"
|
3031
|
+
};
|
3032
|
+
showLoader();
|
3033
|
+
try {
|
3034
|
+
let result = await import_axios4.default.post(chargeurl, card_type == "Bank" ? rest : chargeobj, { headers });
|
3035
|
+
console.log(result);
|
3036
|
+
if ((_b2 = result == null ? void 0 : result.data) == null ? void 0 : _b2.result) {
|
3037
|
+
setSuccess(true);
|
3038
|
+
hideLoader();
|
3039
|
+
}
|
3040
|
+
} catch (err) {
|
3041
|
+
hideLoader();
|
3042
|
+
console.log(err);
|
3043
|
+
showError(((_d2 = (_c2 = err == null ? void 0 : err.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || ((_f = (_e = err == null ? void 0 : err.response) == null ? void 0 : _e.data) == null ? void 0 : _f.status) || "Something went erong");
|
3044
|
+
}
|
3045
|
+
} else {
|
3046
|
+
showError("Please Select A Card/ACH");
|
3047
|
+
}
|
3048
|
+
} else {
|
3049
|
+
showError("Please Select Customer");
|
3050
|
+
}
|
3051
|
+
} else {
|
3052
|
+
showError("Something went wrong , Please try again later !!!");
|
3053
|
+
}
|
3054
|
+
};
|
3055
|
+
(0, import_react13.useEffect)(() => {
|
3056
|
+
if (show && fractalpayClientKey) {
|
3057
|
+
getPaymentDetails();
|
3058
|
+
}
|
3059
|
+
}, [fractalpayClientKey, show]);
|
3060
|
+
const handleDeleteCard = async (cardId) => {
|
3061
|
+
import_sweetalert22.default.fire({
|
3062
|
+
icon: "warning",
|
3063
|
+
text: "Do you want to delete the card?",
|
3064
|
+
showCancelButton: true,
|
3065
|
+
confirmButtonText: "Yes",
|
3066
|
+
cancelButtonText: "No",
|
3067
|
+
reverseButtons: true,
|
3068
|
+
buttonsStyling: false,
|
3069
|
+
customClass: {
|
3070
|
+
confirmButton: "swal2-confirm btn btn-dark",
|
3071
|
+
cancelButton: "swal2-cancel btn btn-dark",
|
3072
|
+
popup: "custom-swal-popup",
|
3073
|
+
icon: "custom-swal-icon"
|
3074
|
+
}
|
3075
|
+
}).then(async (result) => {
|
3076
|
+
if (result.isConfirmed) {
|
3077
|
+
showLoader();
|
3078
|
+
try {
|
3079
|
+
let obj = {
|
3080
|
+
card_id: cardId,
|
3081
|
+
customer_id: props == null ? void 0 : props.customerId,
|
3082
|
+
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey
|
3083
|
+
};
|
3084
|
+
const res = await import_axios4.default.post(`${baseUrl}delete-customer-card`, obj);
|
3085
|
+
hideLoader();
|
3086
|
+
getPaymentDetails();
|
3087
|
+
console.log("Deleted:", res);
|
3088
|
+
import_sweetalert22.default.fire({
|
3089
|
+
icon: "success",
|
3090
|
+
title: "Deleted!",
|
3091
|
+
text: "The card has been deleted.",
|
3092
|
+
confirmButtonText: "OK",
|
3093
|
+
customClass: {
|
3094
|
+
confirmButton: "btn btn-dark"
|
3095
|
+
}
|
3096
|
+
});
|
3097
|
+
} catch (err) {
|
3098
|
+
hideLoader();
|
3099
|
+
console.error("Error:", err);
|
3100
|
+
import_sweetalert22.default.fire({
|
3101
|
+
icon: "error",
|
3102
|
+
title: "Error!",
|
3103
|
+
text: "Failed to delete the card.",
|
3104
|
+
confirmButtonText: "OK",
|
3105
|
+
customClass: {
|
3106
|
+
confirmButton: "btn btn-dark"
|
3107
|
+
}
|
3108
|
+
});
|
3109
|
+
}
|
3110
|
+
}
|
3111
|
+
});
|
3112
|
+
};
|
3113
|
+
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(DataScript, null), /* @__PURE__ */ import_react13.default.createElement(Chargewidgetstyles, null), /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
3114
|
+
"button",
|
3115
|
+
{
|
3116
|
+
className: "paymentBtn",
|
3117
|
+
onClick: handleShow
|
3118
|
+
},
|
3119
|
+
"Pre Auth Pay"
|
3120
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
3121
|
+
CustomModal2_default,
|
3122
|
+
{
|
3123
|
+
open: show,
|
3124
|
+
onClose: handleClose
|
3125
|
+
},
|
3126
|
+
/* @__PURE__ */ import_react13.default.createElement(Loader_default, { loading }),
|
3127
|
+
success ? /* @__PURE__ */ import_react13.default.createElement(SuccessMsz, { onClose: handleCloseSeccess }) : /* @__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(
|
3128
|
+
"input",
|
3129
|
+
{
|
3130
|
+
type: "radio",
|
3131
|
+
className: "cardRadio",
|
3132
|
+
name: "selected_card",
|
3133
|
+
id: "",
|
3134
|
+
checked: selectedCard === card,
|
3135
|
+
onChange: (e) => setSelectedCard(card)
|
3136
|
+
}
|
3137
|
+
), /* @__PURE__ */ import_react13.default.createElement("label", { htmlFor: "", className: "card-number-last-four" }, "**** ", card == null ? void 0 : card.cardlastfourdigit), /* @__PURE__ */ import_react13.default.createElement("h6", { className: "card-expiry-date" }, card == null ? void 0 : card.expmonth, "/", card == null ? void 0 : card.expyear)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ import_react13.default.createElement("span", { className: "visa-card" }, /* @__PURE__ */ import_react13.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_react13.default.createElement("span", { className: "visa-card", style: { cursor: "pointer" }, onClick: () => handleDeleteCard(card == null ? void 0 : card.id) }, /* @__PURE__ */ import_react13.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/Trash.svg", alt: "" }))))))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "pay-with-other-card ", onClick: () => setActive("card") }, "Authorize With Other Card", /* @__PURE__ */ import_react13.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/card.svg", alt: "" }))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react13.default.createElement("button", { className: "pay-button", style: { margin: "0px" }, type: "submit", onClick: handlechargeCustomer }, "$", props == null ? void 0 : props.amount))), /* @__PURE__ */ import_react13.default.createElement("div", { id: "card", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react13.default.createElement("form", { id: "PaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "ach-scrl", style: { minHeight: (cardList == null ? void 0 : cardList.length) > 0 ? "442px" : "500px", overflow: "auto", marginRight: "5px" } }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react13.default.createElement("label", { htmlFor: "cardHolderName" }, "Name on Card"), /* @__PURE__ */ import_react13.default.createElement(
|
3138
|
+
"input",
|
3139
|
+
{
|
3140
|
+
type: "text",
|
3141
|
+
className: "form-control",
|
3142
|
+
placeholder: "John Doe",
|
3143
|
+
value: (cardData == null ? void 0 : cardData.cardName) || "",
|
3144
|
+
onChange: (e) => {
|
3145
|
+
const value = e.target.value;
|
3146
|
+
if (/^[a-zA-Z\s]*$/.test(value)) {
|
3147
|
+
handleCardChange("cardName", value);
|
3148
|
+
}
|
3149
|
+
}
|
3150
|
+
}
|
3151
|
+
), (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ import_react13.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cardName)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react13.default.createElement("label", { htmlFor: "cardNumber" }, "Card Number"), /* @__PURE__ */ import_react13.default.createElement("div", { className: "toggle-num-wrapper" }, /* @__PURE__ */ import_react13.default.createElement(
|
3152
|
+
"input",
|
3153
|
+
{
|
3154
|
+
className: "form-control card-number-new",
|
3155
|
+
type: "text",
|
3156
|
+
maxLength: 19,
|
3157
|
+
inputMode: "numeric",
|
3158
|
+
placeholder: "0000 0000 0000 0000",
|
3159
|
+
value: (cardData == null ? void 0 : cardData.cardNumber) || "",
|
3160
|
+
onChange: (e) => handleCardNumberChange(e),
|
3161
|
+
"data-token": "card_number"
|
3162
|
+
}
|
3163
|
+
), /* @__PURE__ */ import_react13.default.createElement("div", { className: "card-crdi card-expiry-new" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "exp-date-year-container" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "exp-date form-group" }, /* @__PURE__ */ import_react13.default.createElement(
|
3164
|
+
"input",
|
3165
|
+
{
|
3166
|
+
"data-token": "exp_month",
|
3167
|
+
className: "form-control required",
|
3168
|
+
type: "text",
|
3169
|
+
placeholder: "MM",
|
3170
|
+
maxLength: 2,
|
3171
|
+
value: (cardData == null ? void 0 : cardData.expiryMonth) || "",
|
3172
|
+
onChange: (e) => handleCardChange("expiryMonth", e.target.value)
|
3173
|
+
}
|
3174
|
+
)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "exp-year form-group" }, /* @__PURE__ */ import_react13.default.createElement(
|
3175
|
+
"input",
|
3176
|
+
{
|
3177
|
+
"data-token": "exp_year",
|
3178
|
+
className: "form-control required",
|
3179
|
+
type: "text",
|
3180
|
+
placeholder: "YYYY",
|
3181
|
+
maxLength: 4,
|
3182
|
+
value: (cardData == null ? void 0 : cardData.expiryYear) || "",
|
3183
|
+
onChange: (e) => handleCardChange("expiryYear", e.target.value)
|
3184
|
+
}
|
3185
|
+
)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "security-digit form-group" }, /* @__PURE__ */ import_react13.default.createElement(
|
3186
|
+
"input",
|
3187
|
+
{
|
3188
|
+
"data-token": "cvv",
|
3189
|
+
className: "form-control required",
|
3190
|
+
type: "text",
|
3191
|
+
maxLength: 4,
|
3192
|
+
placeholder: "CVC",
|
3193
|
+
value: (cardData == null ? void 0 : cardData.cvv) || "",
|
3194
|
+
onChange: (e) => handleCardChange("cvv", e.target.value)
|
3195
|
+
}
|
3196
|
+
)))), (cardError == null ? void 0 : cardError.cardNumber) && /* @__PURE__ */ import_react13.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cardNumber), /* @__PURE__ */ import_react13.default.createElement("p", { style: { margin: "0" } }, (cardError == null ? void 0 : cardError.expiryMonth) || (cardError == null ? void 0 : cardError.expiryYear) ? /* @__PURE__ */ import_react13.default.createElement("span", { className: "error-span", style: { paddingRight: "4px" } }, cardError == null ? void 0 : cardError.expiryMonth) : "", (cardError == null ? void 0 : cardError.cvv) && /* @__PURE__ */ import_react13.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cvv)))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react13.default.createElement("label", { htmlFor: "OrderId" }, "Order ID / Description"), /* @__PURE__ */ import_react13.default.createElement(
|
3197
|
+
"input",
|
3198
|
+
{
|
3199
|
+
type: "text",
|
3200
|
+
className: "form-control",
|
3201
|
+
maxLength: 100,
|
3202
|
+
placeholder: "OID123456",
|
3203
|
+
disabled: true,
|
3204
|
+
value: (_c = cardData == null ? void 0 : cardData.orderId) != null ? _c : "OID123456",
|
3205
|
+
onChange: (e) => handleCardChange("orderId", e.target.value),
|
3206
|
+
style: { background: "#F6F6F7", color: "#727272" }
|
3207
|
+
}
|
3208
|
+
)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react13.default.createElement("label", { htmlFor: "zip" }, "ZIP"), /* @__PURE__ */ import_react13.default.createElement("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (_d = cardData == null ? void 0 : cardData.zipCode) != null ? _d : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }), (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ import_react13.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.zipCode)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react13.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" } }, /* @__PURE__ */ import_react13.default.createElement(
|
3209
|
+
"input",
|
3210
|
+
{
|
3211
|
+
type: "checkbox",
|
3212
|
+
id: "save_card",
|
3213
|
+
className: "toggle-checkbox",
|
3214
|
+
checked: saveCardInfo,
|
3215
|
+
onChange: (e) => setSaveCardInfo(e.target.checked)
|
3216
|
+
}
|
3217
|
+
), /* @__PURE__ */ import_react13.default.createElement("label", { htmlFor: "save_card", className: "toggle-label" }), /* @__PURE__ */ import_react13.default.createElement("label", { htmlFor: "save_card" }, "Save card for future payments")))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group", style: { marginTop: "20px", padding: 0 } }, /* @__PURE__ */ import_react13.default.createElement("button", { type: "submit", style: { margin: 0 }, className: "pay-button" }, "$", props == null ? void 0 : props.amount)))))))))))
|
3218
|
+
)));
|
3219
|
+
}
|
3220
|
+
|
3221
|
+
// src/app/components/AddCard/AddCard.tsx
|
3222
|
+
var import_react18 = __toESM(require("react"));
|
3223
|
+
var import_sweetalert23 = __toESM(require("sweetalert2"));
|
3224
|
+
var import_axios5 = __toESM(require("axios"));
|
3225
|
+
|
3226
|
+
// src/app/components/AddCard/AddCardStyles.tsx
|
3227
|
+
var import_react14 = __toESM(require("react"));
|
3228
|
+
function AddCardStyle() {
|
3229
|
+
const primarycolor = "#000";
|
3230
|
+
const primarybgcolor = "#fff";
|
3231
|
+
const primarybodycolor = "#212529";
|
3232
|
+
const primarybordercolor = "#dee2e6";
|
3233
|
+
return /* @__PURE__ */ import_react14.default.createElement("style", null, `
|
3234
|
+
.add-card {
|
3235
|
+
max-width:380px;
|
3236
|
+
padding: 0 20px
|
3237
|
+
}
|
3238
|
+
.add-card .form-group {
|
3239
|
+
margin-bottom: 5px;
|
3240
|
+
}
|
3241
|
+
|
3242
|
+
.add-card .idle-green-btn {
|
3243
|
+
color: white;
|
3244
|
+
background-color: rgba(97, 198, 153, 1);
|
3245
|
+
border-radius: 100px;
|
3246
|
+
border: none !important;
|
3247
|
+
padding: 12px 24px 12px 24px;
|
3248
|
+
width: 100%;
|
3249
|
+
cursor:pointer
|
3250
|
+
}
|
3251
|
+
|
3252
|
+
.add-card .idle-green-btn:hover {
|
3253
|
+
background-color: rgba(65, 164, 120, 1) !important;
|
3254
|
+
}
|
3255
|
+
|
3256
|
+
.add-card .idle-green-btn:focus {
|
3257
|
+
border: 2px solid rgba(90, 172, 136, 1) !important;
|
3258
|
+
background-color: rgba(97, 198, 153, 1) !important;
|
3259
|
+
padding: 10px 24px 10px 24px;
|
3260
|
+
}
|
3261
|
+
|
3262
|
+
.add-card .container-creditcard {
|
3263
|
+
width: 426px;
|
3264
|
+
padding: 24px;
|
3265
|
+
background-color: #FFFFFF;
|
3266
|
+
border-radius: 24px;
|
3267
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
3268
|
+
}
|
3269
|
+
.add-card .container-creditcard .request-payment-close-popup{
|
3270
|
+
position:absolute;
|
3271
|
+
// background:red
|
3272
|
+
}
|
3273
|
+
|
3274
|
+
.add-card h2 {
|
3275
|
+
font-size: 24px;
|
3276
|
+
line-height: 32px;
|
3277
|
+
font-weight: 500;
|
3278
|
+
color: #35254D;
|
3279
|
+
margin-bottom: 24px;
|
3280
|
+
text-align: center;
|
3281
|
+
}
|
3282
|
+
.add-card .form-group {
|
3283
|
+
margin-top: 20px;
|
3284
|
+
margin-bottom : 10px
|
3285
|
+
}
|
3286
|
+
|
3287
|
+
.add-card .credit-card {
|
3288
|
+
display: flex;
|
3289
|
+
flex-direction: column;
|
3290
|
+
justify-content: space-between;
|
3291
|
+
align-items: flex-start;
|
3292
|
+
padding: 20px;
|
3293
|
+
background-color: #35254D;
|
3294
|
+
color: #FFFFFF;
|
3295
|
+
border-radius: 15px;
|
3296
|
+
margin-bottom: 20px;
|
3297
|
+
}
|
3298
|
+
|
3299
|
+
.add-card .credit-card .chip {
|
3300
|
+
width: 50px;
|
3301
|
+
height: 30px;
|
3302
|
+
background-image: url('https://raw.githubusercontent.com/danieldasilvaa/creditcard-html-css/main/chip.png');
|
3303
|
+
background-size: cover;
|
3304
|
+
margin-bottom: 10px;
|
3305
|
+
}
|
3306
|
+
|
3307
|
+
.add-card .credit-card .card-number {
|
3308
|
+
font-size: 18px;
|
3309
|
+
letter-spacing: 2px;
|
3310
|
+
margin-bottom: 10px;
|
3311
|
+
}
|
3312
|
+
|
3313
|
+
.add-card .credit-card .card-info {
|
3314
|
+
font-size: 14px;
|
3315
|
+
margin-bottom: 5px;
|
3316
|
+
}
|
3317
|
+
|
3318
|
+
.add-card label {
|
3319
|
+
font-size: 12px;
|
3320
|
+
font-family: 'IBM Plex Mono', monospace;
|
3321
|
+
font-weight: 400;
|
3322
|
+
text-transform: uppercase;
|
3323
|
+
color: #35254D;
|
3324
|
+
margin-bottom: 6px;
|
3325
|
+
}
|
3326
|
+
|
3327
|
+
.add-card input[type="text"],
|
3328
|
+
.add-card input[type="number"],
|
3329
|
+
.add-card input[type="date"],
|
3330
|
+
.add-card input[type="email"],
|
3331
|
+
.add-card select {
|
3332
|
+
width: 100%;
|
3333
|
+
padding: 12px;
|
3334
|
+
font-size: 14px;
|
3335
|
+
font-weight: 500;
|
3336
|
+
color: #35254D;
|
3337
|
+
border: 1px solid #D4CDDF;
|
3338
|
+
border-radius: 6px;
|
3339
|
+
background-color: #FFFFFF;
|
3340
|
+
box-sizing: border-box;
|
3341
|
+
// margin-bottom: 20px;
|
3342
|
+
}
|
3343
|
+
|
3344
|
+
.add-card input[type="text"]::placeholder {
|
3345
|
+
color: #867C94;
|
3346
|
+
}
|
3347
|
+
|
3348
|
+
// .add-card input[type="submit"] {
|
3349
|
+
// width: 100%;
|
3350
|
+
// padding: 12px;
|
3351
|
+
// background-color: #161616;
|
3352
|
+
// color: #FFFFFF;
|
3353
|
+
// font-size: 14px;
|
3354
|
+
// font-weight: 500;
|
3355
|
+
// border: none;
|
3356
|
+
// border-radius: 1000px;
|
3357
|
+
// cursor: pointer;
|
3358
|
+
// text-align: center;
|
3359
|
+
// }
|
3360
|
+
|
3361
|
+
.add-card input[type="submit"]:hover {
|
3362
|
+
background-color: #000000;
|
3363
|
+
}
|
3364
|
+
|
3365
|
+
.add-card .error {
|
3366
|
+
font-size: 12px;
|
3367
|
+
color: red;
|
3368
|
+
margin-top: -15px;
|
3369
|
+
margin-bottom: 15px;
|
3370
|
+
}
|
3371
|
+
|
3372
|
+
/* Tab Styling */
|
3373
|
+
.add-card .tabs {
|
3374
|
+
display: flex;
|
3375
|
+
gap: 4px;
|
3376
|
+
margin-bottom: 24px;
|
3377
|
+
justify-content: center;
|
3378
|
+
}
|
3379
|
+
|
3380
|
+
.add-card .tab {
|
3381
|
+
display: flex;
|
3382
|
+
justify-content: center;
|
3383
|
+
align-items: center;
|
3384
|
+
padding: 6px 16px;
|
3385
|
+
font-size: 14px;
|
3386
|
+
font-weight: 500;
|
3387
|
+
border: 1px solid #D4CDDF;
|
3388
|
+
border-radius: 1000px;
|
3389
|
+
cursor: pointer;
|
3390
|
+
}
|
3391
|
+
|
3392
|
+
.add-card .tab.active {
|
3393
|
+
border-color: #35254D;
|
3394
|
+
color: #35254D;
|
3395
|
+
}
|
3396
|
+
|
3397
|
+
.add-card .tab:hover {
|
3398
|
+
border-color: #867C94;
|
3399
|
+
}
|
3400
|
+
|
3401
|
+
/* Buttons */
|
3402
|
+
.add-card .button-close {
|
3403
|
+
display: inline-block;
|
3404
|
+
background-color: #161616;
|
3405
|
+
color: #FFFFFF;
|
3406
|
+
font-size: 14px;
|
3407
|
+
font-weight: 500;
|
3408
|
+
padding: 12px 32px;
|
3409
|
+
border-radius: 1000px;
|
3410
|
+
text-align: center;
|
3411
|
+
cursor: pointer;
|
3412
|
+
width: 48%;
|
3413
|
+
box-sizing: border-box;
|
3414
|
+
}
|
3415
|
+
|
3416
|
+
.add-card .button-close:hover {
|
3417
|
+
background-color: #000000;
|
3418
|
+
}
|
3419
|
+
|
3420
|
+
.add-card .btn-add1 {
|
3421
|
+
display: inline-block;
|
3422
|
+
background-color: #61c699;
|
3423
|
+
color: #FFFFFF;
|
3424
|
+
font-size: 14px;
|
3425
|
+
font-weight: 500;
|
3426
|
+
padding: 12px 32px;
|
3427
|
+
border-radius: 1000px;
|
3428
|
+
text-align: center;
|
3429
|
+
cursor: pointer;
|
3430
|
+
width: 48%;
|
3431
|
+
box-sizing: border-box;
|
3432
|
+
}
|
3433
|
+
|
3434
|
+
.add-card .btn-add1:hover {
|
3435
|
+
background-color: #B5E1CB;
|
3436
|
+
}
|
3437
|
+
|
3438
|
+
/* Combined Expiration Date and CVC Row */
|
3439
|
+
.add-card .exp-cvc-container {
|
3440
|
+
display: flex;
|
3441
|
+
justify-content: space-between;
|
3442
|
+
gap: 16px;
|
3443
|
+
margin-bottom: 5px;
|
3444
|
+
}
|
3445
|
+
|
3446
|
+
.add-card .exp-cvc-container input {
|
3447
|
+
flex: 1;
|
3448
|
+
padding: 12px;
|
3449
|
+
font-size: 14px;
|
3450
|
+
font-weight: 500;
|
3451
|
+
color: #35254D;
|
3452
|
+
border: 1px solid #D4CDDF;
|
3453
|
+
border-radius: 6px;
|
3454
|
+
background-color: #FFFFFF;
|
3455
|
+
box-sizing: border-box;
|
3456
|
+
}
|
3457
|
+
|
3458
|
+
.add-card .exp-cvc-container input::placeholder {
|
3459
|
+
color: #867C94;
|
3460
|
+
}
|
3461
|
+
|
3462
|
+
/* Responsive Design */
|
3463
|
+
@media screen and (max-width: 768px) {
|
3464
|
+
.add-card .container-creditcard {
|
3465
|
+
width: 90%;
|
3466
|
+
padding: 20px;
|
3467
|
+
}
|
3468
|
+
|
3469
|
+
.add-card input[type="submit"] {
|
3470
|
+
font-size: 12px;
|
3471
|
+
padding: 10px;
|
3472
|
+
}
|
3473
|
+
}
|
3474
|
+
|
3475
|
+
`);
|
3476
|
+
}
|
3477
|
+
|
3478
|
+
// src/app/components/CustomModal/CustomModal.tsx
|
3479
|
+
var import_react15 = __toESM(require("react"));
|
3480
|
+
var CustomModal = ({
|
3481
|
+
open,
|
3482
|
+
onClose,
|
3483
|
+
children
|
3484
|
+
}) => {
|
3485
|
+
if (!open) return null;
|
3486
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", { style: {
|
3487
|
+
position: "fixed",
|
3488
|
+
top: 0,
|
3489
|
+
left: 0,
|
3490
|
+
width: "100%",
|
3491
|
+
height: "100%",
|
3492
|
+
zIndex: 5,
|
3493
|
+
backgroundColor: "rgba(0,0,0,0.5)",
|
3494
|
+
display: "flex",
|
3495
|
+
justifyContent: "center",
|
3496
|
+
alignItems: "center"
|
3497
|
+
} }, /* @__PURE__ */ import_react15.default.createElement("div", { style: { background: "white", padding: "20px", borderRadius: "8px", minWidth: "300px" } }, /* @__PURE__ */ import_react15.default.createElement("div", { className: "", style: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ import_react15.default.createElement("button", { onClick: onClose, style: { border: "none", background: "transparent" } }, "X")), /* @__PURE__ */ import_react15.default.createElement("div", null, children)));
|
3498
|
+
};
|
3499
|
+
var CustomModal_default = CustomModal;
|
3500
|
+
|
3501
|
+
// src/app/components/SuccessCardMessage/SuccessCardMsz.tsx
|
3502
|
+
var import_react17 = __toESM(require("react"));
|
3503
|
+
|
3504
|
+
// src/app/components/SuccessCardMessage/SuccessCardMszStyle.tsx
|
3505
|
+
var import_react16 = __toESM(require("react"));
|
3506
|
+
function SuccessCardMszStyle() {
|
3507
|
+
return /* @__PURE__ */ import_react16.default.createElement("style", null, `
|
3508
|
+
.card-success .logo-container {
|
3509
|
+
display: flex;
|
3510
|
+
justify-content: center;
|
3511
|
+
align-items: center;
|
3512
|
+
margin-bottom: -50px; /* Adjust this to overlap the content */
|
3513
|
+
z-index: 10;
|
3514
|
+
}
|
3515
|
+
|
3516
|
+
.card-success .client-logo {
|
3517
|
+
max-width: 100px;
|
3518
|
+
height: auto;
|
3519
|
+
object-fit: contain;
|
3520
|
+
display: block;
|
3521
|
+
}
|
3522
|
+
|
3523
|
+
.card-success .payment-success-container {
|
3524
|
+
display: flex;
|
3525
|
+
flex-direction: column;
|
3526
|
+
align-items: center;
|
3527
|
+
padding: 18px 20px 24px;
|
3528
|
+
width: 335px;
|
3529
|
+
height: 400px; /* Fixed height */
|
3530
|
+
background: #FFFFFF;
|
3531
|
+
border-radius: 12px;
|
3532
|
+
position: relative;
|
3533
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
3534
|
+
border: 1px solid #e3e3e3;
|
3535
|
+
justify-content: center;
|
3536
|
+
text-align: center;
|
3537
|
+
margin-top: 50px; /* Adjust this to move the content down */
|
3538
|
+
}
|
3539
|
+
|
3540
|
+
.card-success .success-icon {
|
3541
|
+
display: flex;
|
3542
|
+
flex-direction: column;
|
3543
|
+
align-items: center;
|
3544
|
+
gap: 12px;
|
3545
|
+
width: 227px;
|
3546
|
+
height: 116px;
|
3547
|
+
z-index: 2;
|
3548
|
+
}
|
3549
|
+
|
3550
|
+
.card-success .circle {
|
3551
|
+
width: 40px;
|
3552
|
+
height: 40px;
|
3553
|
+
border: 1px solid #49B182;
|
3554
|
+
border-radius: 50%;
|
3555
|
+
display: flex;
|
3556
|
+
justify-content: center;
|
3557
|
+
align-items: center;
|
3558
|
+
}
|
3559
|
+
|
3560
|
+
.card-success .circle .fa-check-circle {
|
3561
|
+
font-size: 20px;
|
3562
|
+
color: #49B182;
|
3563
|
+
}
|
3564
|
+
|
3565
|
+
.card-success .success-text {
|
3566
|
+
display: flex;
|
3567
|
+
flex-direction: column;
|
3568
|
+
justify-content: center;
|
3569
|
+
align-items: center;
|
3570
|
+
gap: 4px;
|
3571
|
+
width: 227px;
|
3572
|
+
}
|
3573
|
+
|
3574
|
+
.card-success .payment-success-text {
|
3575
|
+
font-family: 'Inter', sans-serif;
|
3576
|
+
font-weight: 500;
|
3577
|
+
font-size: 18px;
|
3578
|
+
line-height: 21px;
|
3579
|
+
text-align: center;
|
3580
|
+
letter-spacing: -0.02em;
|
3581
|
+
color: #161616;
|
3582
|
+
}
|
3583
|
+
|
3584
|
+
.card-success .thank-you-text {
|
3585
|
+
font-family: 'Inter', sans-serif;
|
3586
|
+
font-weight: 500;
|
3587
|
+
font-size: 14px;
|
3588
|
+
line-height: 18px;
|
3589
|
+
text-align: center;
|
3590
|
+
letter-spacing: -0.02em;
|
3591
|
+
color: #161616;
|
3592
|
+
opacity: 0.5;
|
3593
|
+
}
|
3594
|
+
`);
|
3595
|
+
}
|
3596
|
+
|
3597
|
+
// src/app/components/SuccessCardMessage/SuccessCardMsz.tsx
|
3598
|
+
var SuccessCardMsz = ({ onClose }) => {
|
3599
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, /* @__PURE__ */ import_react17.default.createElement(SuccessCardMszStyle, null), /* @__PURE__ */ import_react17.default.createElement("div", { className: "card-success" }, /* @__PURE__ */ import_react17.default.createElement("div", { className: "logo-container" }, /* @__PURE__ */ import_react17.default.createElement("img", { src: "<%= merchant_logo %>", alt: "", className: "client-logo" })), /* @__PURE__ */ import_react17.default.createElement("div", { className: "payment-success-container" }, /* @__PURE__ */ import_react17.default.createElement("div", { className: "success-icon" }, /* @__PURE__ */ import_react17.default.createElement("div", { className: "circle" }, /* @__PURE__ */ import_react17.default.createElement("i", { className: "fa fa-check-circle", "aria-hidden": "true" })), /* @__PURE__ */ import_react17.default.createElement("div", { className: "success-text" }, /* @__PURE__ */ import_react17.default.createElement("div", { className: "payment-success-text" }, "Your card was added successfully."), /* @__PURE__ */ import_react17.default.createElement("div", { className: "thank-you-text" }, "Thank you "))))));
|
3600
|
+
};
|
3601
|
+
var SuccessCardMsz_default = SuccessCardMsz;
|
3602
|
+
|
3603
|
+
// src/app/components/AddCard/AddCard.tsx
|
3604
|
+
function AddCard(props) {
|
3605
|
+
var _a;
|
3606
|
+
const [loading, setLoading] = (0, import_react18.useState)(false);
|
3607
|
+
const [success, setSuccess] = (0, import_react18.useState)(false);
|
3608
|
+
const [show, setShow] = (0, import_react18.useState)(false);
|
3609
|
+
const [cardData, setCardData] = (0, import_react18.useState)();
|
3610
|
+
const [cardError, setCardError] = (0, import_react18.useState)({});
|
3611
|
+
const [paymentData, setPaymentData] = (0, import_react18.useState)();
|
3612
|
+
const showLoader = () => setLoading(true);
|
3613
|
+
const hideLoader = () => setLoading(false);
|
3614
|
+
const showError = (msz) => {
|
3615
|
+
import_sweetalert23.default.fire({
|
3616
|
+
icon: "error",
|
3617
|
+
text: msz
|
3618
|
+
});
|
3619
|
+
};
|
3620
|
+
const handleClose = () => {
|
3621
|
+
setShow(false);
|
3622
|
+
setSuccess(false);
|
3623
|
+
setCardData({
|
3624
|
+
cardName: "",
|
3625
|
+
cardNumber: "",
|
3626
|
+
expiryMonth: "",
|
3627
|
+
expiryYear: "",
|
3628
|
+
cvv: "",
|
3629
|
+
orderId: "",
|
3630
|
+
zipCode: ""
|
3631
|
+
});
|
3632
|
+
};
|
3633
|
+
const handleShow = () => setShow(true);
|
3634
|
+
const handleCloseSeccess = () => {
|
3635
|
+
handleClose();
|
3636
|
+
};
|
3637
|
+
const handleCardChange = (field, value) => {
|
3638
|
+
const name = field;
|
3639
|
+
const numericFields = ["expiryMonth", "expiryYear", "zipCode", "cvv"];
|
3640
|
+
if (numericFields.includes(name)) {
|
3641
|
+
if (value === "" || /^[0-9]+$/.test(value)) {
|
3642
|
+
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
3643
|
+
[name]: ""
|
3644
|
+
}));
|
3645
|
+
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
3646
|
+
[name]: value
|
3647
|
+
}));
|
3648
|
+
}
|
3649
|
+
return;
|
3650
|
+
}
|
3651
|
+
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
3652
|
+
[name]: ""
|
3653
|
+
}));
|
3654
|
+
console.log(value, name);
|
3655
|
+
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
3656
|
+
[name]: value
|
3657
|
+
}));
|
3658
|
+
};
|
3659
|
+
const handleCardNumberChange = (e) => {
|
3660
|
+
const input = e.target;
|
3661
|
+
const rawValue = input.value.replace(/\D/g, "");
|
3662
|
+
let formatted = "";
|
3663
|
+
if (/^3[47]/.test(rawValue)) {
|
3664
|
+
const trimmed = rawValue.slice(0, 15);
|
3665
|
+
formatted = trimmed.replace(
|
3666
|
+
/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,
|
3667
|
+
(_, g1, g2, g3) => [g1, g2, g3].filter(Boolean).join(" ")
|
3668
|
+
);
|
3669
|
+
} else {
|
3670
|
+
const trimmed = rawValue.slice(0, 16);
|
3671
|
+
formatted = trimmed.replace(
|
3672
|
+
/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,
|
3673
|
+
(_, g1, g2, g3, g4) => [g1, g2, g3, g4].filter(Boolean).join(" ")
|
3674
|
+
);
|
3675
|
+
}
|
3676
|
+
setCardError((prev) => __spreadProps(__spreadValues({}, prev), {
|
3677
|
+
cardNumber: ""
|
3678
|
+
}));
|
3679
|
+
setCardData((prev) => __spreadProps(__spreadValues({}, prev), {
|
3680
|
+
cardNumber: formatted
|
3681
|
+
}));
|
3682
|
+
};
|
3683
|
+
const validateCardData = () => {
|
3684
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
3685
|
+
const errors = {};
|
3686
|
+
const data = cardData;
|
3687
|
+
const month = parseInt((data == null ? void 0 : data.expiryMonth) || "", 10);
|
3688
|
+
const year = (data == null ? void 0 : data.expiryYear) || "";
|
3689
|
+
if (!((_a2 = data == null ? void 0 : data.cardName) == null ? void 0 : _a2.trim())) errors.cardName = "Card name is required";
|
3690
|
+
if (!((_b = data == null ? void 0 : data.cardNumber) == null ? void 0 : _b.trim())) errors.cardNumber = "Card number is required";
|
3691
|
+
if (!((_c = data == null ? void 0 : data.expiryMonth) == null ? void 0 : _c.trim())) {
|
3692
|
+
errors.expiryMonth = "Expiration month is required";
|
3693
|
+
} else if (Number(data == null ? void 0 : data.expiryMonth) > 12 || Number(data == null ? void 0 : data.expiryMonth) < 1) {
|
3694
|
+
errors.expiryMonth = "Invalid Expiration Month.";
|
3695
|
+
}
|
3696
|
+
if (!((_d = data == null ? void 0 : data.expiryYear) == null ? void 0 : _d.trim())) {
|
3697
|
+
errors.expiryYear = "Expiration year is required";
|
3698
|
+
} else if (((_e = data == null ? void 0 : data.expiryYear) == null ? void 0 : _e.trim().length) !== 4 || Number(data == null ? void 0 : data.expiryYear) < 2025) {
|
3699
|
+
errors.expiryYear = "Invalid Expiration Year.";
|
3700
|
+
} else if (isNaN(month) || month < 1 || month > 12 || year.length !== 4) {
|
3701
|
+
errors.expiryMonth = "Invalid Expiration Date.";
|
3702
|
+
}
|
3703
|
+
if (!((_f = data == null ? void 0 : data.cvv) == null ? void 0 : _f.trim())) errors.cvv = "CVC is required";
|
3704
|
+
if (!((_g = data == null ? void 0 : data.zipCode) == null ? void 0 : _g.trim())) errors.zipCode = "ZIP code is required";
|
3705
|
+
if ((data == null ? void 0 : data.expiryMonth) && (data == null ? void 0 : data.expiryYear) && data.expiryMonth.length <= 2 && data.expiryYear.length === 4) {
|
3706
|
+
const month2 = parseInt(data.expiryMonth, 10);
|
3707
|
+
const year2 = parseInt(data.expiryYear, 10);
|
3708
|
+
const now = /* @__PURE__ */ new Date();
|
3709
|
+
const currentMonth = now.getMonth() + 1;
|
3710
|
+
const currentYear = now.getFullYear();
|
3711
|
+
if (year2 < currentYear || year2 === currentYear && month2 < currentMonth) {
|
3712
|
+
errors.expiryMonth = "Card is expired";
|
3713
|
+
}
|
3714
|
+
}
|
3715
|
+
setCardError(errors);
|
3716
|
+
return Object.keys(errors).length > 0;
|
3717
|
+
};
|
3718
|
+
const getPaymentDetails = async () => {
|
3719
|
+
var _a2, _b, _c, _d, _e, _f;
|
3720
|
+
showLoader();
|
3721
|
+
try {
|
3722
|
+
const data = {
|
3723
|
+
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey,
|
3724
|
+
"customer_id": props == null ? void 0 : props.customerId,
|
3725
|
+
addcard: true
|
3726
|
+
};
|
3727
|
+
let paymentData2 = await import_axios5.default.post(`${baseUrl}get-payment-details`, data);
|
3728
|
+
console.log(paymentData2);
|
3729
|
+
setPaymentData((_a2 = paymentData2 == null ? void 0 : paymentData2.data) == null ? void 0 : _a2.data);
|
3730
|
+
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) {
|
3731
|
+
} else {
|
3732
|
+
}
|
3733
|
+
hideLoader();
|
3734
|
+
} catch (err) {
|
3735
|
+
console.log(err);
|
3736
|
+
hideLoader();
|
3737
|
+
}
|
3738
|
+
};
|
3739
|
+
(0, import_react18.useEffect)(() => {
|
3740
|
+
if (show && props.fractalpayClientKey) {
|
3741
|
+
getPaymentDetails();
|
3742
|
+
}
|
3743
|
+
}, [props == null ? void 0 : props.fractalpayClientKey, show]);
|
3744
|
+
const addCardFunc = async (e) => {
|
3745
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
3746
|
+
e.preventDefault();
|
3747
|
+
const hasError = validateCardData();
|
3748
|
+
console.log(cardData);
|
3749
|
+
if (hasError) return;
|
3750
|
+
else {
|
3751
|
+
let validCard = DatacapWebToken.validateCardNumber(cardData == null ? void 0 : cardData.cardNumber.replaceAll(" ", ""));
|
3752
|
+
let validExpirationDate = DatacapWebToken.validateExpirationDate(cardData == null ? void 0 : cardData.expiryMonth, cardData == null ? void 0 : cardData.expiryYear);
|
3753
|
+
let validCVV = DatacapWebToken.validateCVV(cardData == null ? void 0 : cardData.cvv);
|
3754
|
+
let errors = {};
|
3755
|
+
if (!validCard) errors.cardNumber = "Invalid card Number";
|
3756
|
+
if (!validExpirationDate) errors.expiryMonth = "Invalid Expiration Date.";
|
3757
|
+
if (!validCVV) errors.cvv = "Invalid CVV";
|
3758
|
+
setCardError(errors);
|
3759
|
+
if (validCard && validCVV && validExpirationDate) {
|
3760
|
+
showLoader();
|
3761
|
+
try {
|
3762
|
+
let getTokenCallback = async function(token) {
|
3763
|
+
var _a3, _b2, _c2, _d2, _e2;
|
3764
|
+
console.log(token);
|
3765
|
+
if (token.Error) {
|
3766
|
+
console.log(token == null ? void 0 : token.Error);
|
3767
|
+
showError(token.Error);
|
3768
|
+
hideLoader();
|
3769
|
+
} else {
|
3770
|
+
const reqData = {
|
3771
|
+
userId: props == null ? void 0 : props.customerId,
|
3772
|
+
cardName: cardData == null ? void 0 : cardData.cardName,
|
3773
|
+
zip: cardData == null ? void 0 : cardData.zipCode,
|
3774
|
+
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey,
|
3775
|
+
token
|
3776
|
+
};
|
3777
|
+
try {
|
3778
|
+
let apiResponse = await import_axios5.default.post(`${baseUrl}add-card`, reqData);
|
3779
|
+
console.log(apiResponse);
|
3780
|
+
let formData = {
|
3781
|
+
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey,
|
3782
|
+
wallet_id: "",
|
3783
|
+
card_number: cardData == null ? void 0 : cardData.cardNumber.replaceAll(" ", ""),
|
3784
|
+
exp_month: cardData == null ? void 0 : cardData.expiryMonth,
|
3785
|
+
exp_year: (_a3 = cardData == null ? void 0 : cardData.expiryYear) == null ? void 0 : _a3.slice(-2),
|
3786
|
+
cvv: cardData == null ? void 0 : cardData.cvv
|
3787
|
+
};
|
3788
|
+
try {
|
3789
|
+
const result = await import_axios5.default.post(`${baseUrl}link-wallet`, formData);
|
3790
|
+
console.log(result);
|
3791
|
+
setSuccess(true);
|
3792
|
+
hideLoader();
|
3793
|
+
setCardData({
|
3794
|
+
cardName: "",
|
3795
|
+
cardNumber: "",
|
3796
|
+
expiryMonth: "",
|
3797
|
+
expiryYear: "",
|
3798
|
+
cvv: "",
|
3799
|
+
orderId: "",
|
3800
|
+
zipCode: ""
|
3801
|
+
});
|
3802
|
+
} catch (err) {
|
3803
|
+
console.log(err);
|
3804
|
+
hideLoader();
|
3805
|
+
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..");
|
3806
|
+
}
|
3807
|
+
} catch (err) {
|
3808
|
+
console.log(err);
|
3809
|
+
hideLoader();
|
3810
|
+
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..");
|
3811
|
+
}
|
3812
|
+
}
|
3813
|
+
};
|
3814
|
+
if ((paymentData == null ? void 0 : paymentData.paymentGateway) === 32) {
|
3815
|
+
const requestOptions = {
|
3816
|
+
method: "POST",
|
3817
|
+
redirect: "follow"
|
3818
|
+
};
|
3819
|
+
try {
|
3820
|
+
let sesionResult = await import_axios5.default.post(`${masterBaseUrl}api/v1/widget/generate-session`, requestOptions);
|
3821
|
+
let expYear = Number(cardData == null ? void 0 : cardData.expiryYear) % 100;
|
3822
|
+
let cardNumber = cardData == null ? void 0 : cardData.cardNumber;
|
3823
|
+
cardNumber = cardNumber == null ? void 0 : cardNumber.replace(/\s+/g, "");
|
3824
|
+
let track2_data = `${cardNumber}=${expYear}${cardData == null ? void 0 : cardData.expiryMonth} ${cardData == null ? void 0 : cardData.cvv}`;
|
3825
|
+
const publicKey = forge.pki.publicKeyFromPem((_b = (_a2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _a2.data) == null ? void 0 : _b.publicKeyPem);
|
3826
|
+
const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
|
3827
|
+
md: forge.md.sha1.create(),
|
3828
|
+
mgf1: {
|
3829
|
+
md: forge.md.sha1.create()
|
3830
|
+
}
|
3831
|
+
});
|
3832
|
+
const encryptedBase64 = forge.util.encode64(encrypted);
|
3833
|
+
const myHeaders = {
|
3834
|
+
"Content-Type": "application/json",
|
3835
|
+
"x-app-session-key": (_d = (_c = sesionResult.data) == null ? void 0 : _c.data) == null ? void 0 : _d.session_key
|
3836
|
+
};
|
3837
|
+
const raw = JSON.stringify({
|
3838
|
+
"enc_track2_data": `${encryptedBase64}`,
|
3839
|
+
"algorithm": "RSAES_OAEP_SHA_1",
|
3840
|
+
session_key: `${(_f = (_e = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _e.data) == null ? void 0 : _f.session_key}`
|
3841
|
+
});
|
3842
|
+
try {
|
3843
|
+
const tokenizeData = await import_axios5.default.post("https://api-dev.merchant-trends.com/tokenizer/tokenize", raw, { headers: myHeaders });
|
3844
|
+
const reqData = JSON.stringify(__spreadProps(__spreadValues({}, (_g = tokenizeData == null ? void 0 : tokenizeData.data) == null ? void 0 : _g.data), {
|
3845
|
+
cvv: cardData == null ? void 0 : cardData.cvv,
|
3846
|
+
cardName: cardData == null ? void 0 : cardData.cardName,
|
3847
|
+
zip: cardData == null ? void 0 : cardData.zipCode,
|
3848
|
+
userId: props == null ? void 0 : props.customerId,
|
3849
|
+
fractalpayPublicKey: props == null ? void 0 : props.fractalpayClientKey
|
3850
|
+
}));
|
3851
|
+
let myHeaders2 = {
|
3852
|
+
"Content-Type": "application/json"
|
3853
|
+
};
|
3854
|
+
try {
|
3855
|
+
let addCardRes = await import_axios5.default.post(
|
3856
|
+
`${baseUrl}add-card`,
|
3857
|
+
reqData,
|
3858
|
+
{
|
3859
|
+
headers: myHeaders2
|
3860
|
+
}
|
3861
|
+
);
|
3862
|
+
console.log(addCardRes);
|
3863
|
+
if ((_h = addCardRes == null ? void 0 : addCardRes.data) == null ? void 0 : _h.result) {
|
3864
|
+
setSuccess(true);
|
3865
|
+
hideLoader();
|
3866
|
+
}
|
3867
|
+
} catch (err) {
|
3868
|
+
hideLoader();
|
3869
|
+
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");
|
3870
|
+
}
|
3871
|
+
} catch (err) {
|
3872
|
+
hideLoader();
|
3873
|
+
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");
|
3874
|
+
}
|
3875
|
+
} catch (err) {
|
3876
|
+
hideLoader();
|
3877
|
+
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");
|
3878
|
+
}
|
3879
|
+
} else {
|
3880
|
+
if (typeof DatacapWebToken !== "undefined") {
|
3881
|
+
DatacapWebToken.requestToken(paymentData == null ? void 0 : paymentData.dctoken, "creditCardForm", getTokenCallback);
|
3882
|
+
}
|
3883
|
+
}
|
3884
|
+
} catch (err) {
|
3885
|
+
hideLoader();
|
3886
|
+
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");
|
3887
|
+
}
|
3888
|
+
}
|
3889
|
+
}
|
3890
|
+
};
|
3891
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(DataScript, null), /* @__PURE__ */ import_react18.default.createElement(AddCardStyle, null), /* @__PURE__ */ import_react18.default.createElement(
|
3892
|
+
"button",
|
3893
|
+
{
|
3894
|
+
className: "paymentBtn",
|
3895
|
+
onClick: handleShow
|
3896
|
+
},
|
3897
|
+
"Pay"
|
3898
|
+
), /* @__PURE__ */ import_react18.default.createElement(
|
3899
|
+
CustomModal_default,
|
3900
|
+
{
|
3901
|
+
open: show,
|
3902
|
+
onClose: handleClose
|
3903
|
+
},
|
3904
|
+
/* @__PURE__ */ import_react18.default.createElement(Loader_default, { loading }),
|
3905
|
+
success ? /* @__PURE__ */ import_react18.default.createElement(SuccessCardMsz_default, { onClose: handleCloseSeccess }) : /* @__PURE__ */ import_react18.default.createElement(
|
3906
|
+
"div",
|
3907
|
+
{
|
3908
|
+
className: "container-creditcard add-card modal-content ",
|
3909
|
+
id: "add-credit-card-panel"
|
3910
|
+
},
|
3911
|
+
/* @__PURE__ */ import_react18.default.createElement("form", { id: "creditCardForm", onSubmit: addCardFunc }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "form-group", style: { marginTop: "0" } }, /* @__PURE__ */ import_react18.default.createElement("label", { htmlFor: "cardNumber" }, "Card Number"), /* @__PURE__ */ import_react18.default.createElement(
|
3912
|
+
"input",
|
3913
|
+
{
|
3914
|
+
type: "text",
|
3915
|
+
"data-token": "card_number",
|
3916
|
+
placeholder: "Enter card number",
|
3917
|
+
maxLength: 19,
|
3918
|
+
inputMode: "numeric",
|
3919
|
+
value: (cardData == null ? void 0 : cardData.cardNumber) || "",
|
3920
|
+
onChange: (e) => handleCardNumberChange(e)
|
3921
|
+
}
|
3922
|
+
), (cardError == null ? void 0 : cardError.cardNumber) && /* @__PURE__ */ import_react18.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cardNumber), /* @__PURE__ */ import_react18.default.createElement("br", null)), /* @__PURE__ */ import_react18.default.createElement("div", { className: "card-dtl" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "exp-cvc-container" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react18.default.createElement("label", { htmlFor: "expMonth" }, "MM"), /* @__PURE__ */ import_react18.default.createElement(
|
3923
|
+
"input",
|
3924
|
+
{
|
3925
|
+
"data-token": "exp_month",
|
3926
|
+
className: "form-control required",
|
3927
|
+
type: "text",
|
3928
|
+
placeholder: "MM",
|
3929
|
+
maxLength: 2,
|
3930
|
+
value: (cardData == null ? void 0 : cardData.expiryMonth) || "",
|
3931
|
+
onChange: (e) => handleCardChange("expiryMonth", e.target.value)
|
3932
|
+
}
|
3933
|
+
), (cardError == null ? void 0 : cardError.expiryMonth) && /* @__PURE__ */ import_react18.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.expiryMonth)), /* @__PURE__ */ import_react18.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react18.default.createElement("label", { htmlFor: "expYear" }, "YYYY"), /* @__PURE__ */ import_react18.default.createElement(
|
3934
|
+
"input",
|
3935
|
+
{
|
3936
|
+
"data-token": "exp_year",
|
3937
|
+
className: "form-control required",
|
3938
|
+
type: "text",
|
3939
|
+
placeholder: "YYYY",
|
3940
|
+
maxLength: 4,
|
3941
|
+
value: (cardData == null ? void 0 : cardData.expiryYear) || "",
|
3942
|
+
onChange: (e) => handleCardChange("expiryYear", e.target.value)
|
3943
|
+
}
|
3944
|
+
), (cardError == null ? void 0 : cardError.expiryYear) && /* @__PURE__ */ import_react18.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.expiryYear)), /* @__PURE__ */ import_react18.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react18.default.createElement("label", { htmlFor: "cvc" }, "CVC"), /* @__PURE__ */ import_react18.default.createElement(
|
3945
|
+
"input",
|
3946
|
+
{
|
3947
|
+
"data-token": "cvv",
|
3948
|
+
className: "form-control required",
|
3949
|
+
type: "text",
|
3950
|
+
placeholder: "CVC",
|
3951
|
+
maxLength: 4,
|
3952
|
+
value: (cardData == null ? void 0 : cardData.cvv) || "",
|
3953
|
+
onChange: (e) => handleCardChange("cvv", e.target.value)
|
3954
|
+
}
|
3955
|
+
), (cardError == null ? void 0 : cardError.cvv) && /* @__PURE__ */ import_react18.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cvv)))), /* @__PURE__ */ import_react18.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react18.default.createElement("label", { htmlFor: "cardholderName" }, "Name on card"), /* @__PURE__ */ import_react18.default.createElement(
|
3956
|
+
"input",
|
3957
|
+
{
|
3958
|
+
type: "text",
|
3959
|
+
id: "cardholderName",
|
3960
|
+
name: "cardholderName",
|
3961
|
+
placeholder: "Name on card required",
|
3962
|
+
value: (cardData == null ? void 0 : cardData.cardName) || "",
|
3963
|
+
onChange: (e) => {
|
3964
|
+
const value = e.target.value;
|
3965
|
+
if (/^[a-zA-Z\s]*$/.test(value)) {
|
3966
|
+
handleCardChange("cardName", value);
|
3967
|
+
}
|
3968
|
+
}
|
3969
|
+
}
|
3970
|
+
), (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ import_react18.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cardName)), /* @__PURE__ */ import_react18.default.createElement("div", { className: "form-group", style: { marginBottom: "20px" } }, /* @__PURE__ */ import_react18.default.createElement("label", { htmlFor: "zipcode" }, "Zip"), /* @__PURE__ */ import_react18.default.createElement(
|
3971
|
+
"input",
|
3972
|
+
{
|
3973
|
+
type: "text",
|
3974
|
+
id: "zipcode",
|
3975
|
+
name: "zipcode",
|
3976
|
+
placeholder: "Zip",
|
3977
|
+
value: (_a = cardData == null ? void 0 : cardData.zipCode) != null ? _a : "",
|
3978
|
+
onChange: (e) => handleCardChange("zipCode", e.target.value)
|
3979
|
+
}
|
3980
|
+
), (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ import_react18.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.zipCode)), /* @__PURE__ */ import_react18.default.createElement(
|
3981
|
+
"input",
|
3982
|
+
{
|
3983
|
+
type: "submit",
|
3984
|
+
className: "idle-green-btn w-100",
|
3985
|
+
defaultValue: "Submit"
|
3986
|
+
}
|
3987
|
+
))
|
3988
|
+
)
|
3989
|
+
));
|
3990
|
+
}
|
2630
3991
|
// Annotate the CommonJS export names for ESM import in node:
|
2631
3992
|
0 && (module.exports = {
|
3993
|
+
AddCard,
|
2632
3994
|
GetPaymentPage,
|
3995
|
+
PreAuthPayment,
|
2633
3996
|
RequestPayment,
|
2634
3997
|
RequestPreAuthPayment
|
2635
3998
|
});
|