@pinerohit11/testwidget 0.1.50 → 0.1.51
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +272 -236
- package/dist/{index.cjs → index.mjs} +236 -272
- package/package.json +2 -3
- /package/dist/{index.d.cts → index.d.mts} +0 -0
package/dist/index.js
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
1
3
|
var __defProp = Object.defineProperty;
|
2
4
|
var __defProps = Object.defineProperties;
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
6
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
5
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
11
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
7
12
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
@@ -17,18 +22,54 @@ var __spreadValues = (a, b) => {
|
|
17
22
|
return a;
|
18
23
|
};
|
19
24
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
25
|
+
var __export = (target, all) => {
|
26
|
+
for (var name in all)
|
27
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
28
|
+
};
|
29
|
+
var __copyProps = (to, from, except, desc) => {
|
30
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
31
|
+
for (let key of __getOwnPropNames(from))
|
32
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
33
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
34
|
+
}
|
35
|
+
return to;
|
36
|
+
};
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
38
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
39
|
+
// file that has been converted to a CommonJS file using a Babel-
|
40
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
41
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
42
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
43
|
+
mod
|
44
|
+
));
|
45
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
46
|
+
|
47
|
+
// src/app/index.ts
|
48
|
+
var app_exports = {};
|
49
|
+
__export(app_exports, {
|
50
|
+
CompletedTransactions: () => CompletedTransactions,
|
51
|
+
GetPaymentDynamic: () => GetPaymentDynamic,
|
52
|
+
Payment: () => Payment,
|
53
|
+
RequestPayment: () => RequestPayment,
|
54
|
+
RequestPaymentAllInput: () => RequestPaymentAllInput,
|
55
|
+
RequestPaymentDynamic: () => RequestPaymentDynamic,
|
56
|
+
RequestPaymentonClick: () => RequestPaymentonClick,
|
57
|
+
RqstPaymntInputField: () => RqstPaymntInputField,
|
58
|
+
TockenizPay: () => TockenizPay
|
59
|
+
});
|
60
|
+
module.exports = __toCommonJS(app_exports);
|
20
61
|
|
21
62
|
// src/app/components/RequestPayment/RequestPayment.tsx
|
22
|
-
|
23
|
-
|
63
|
+
var import_react4 = __toESM(require("react"));
|
64
|
+
var import_axios = __toESM(require("axios"));
|
24
65
|
|
25
66
|
// src/app/components/Loader/Loader.tsx
|
26
|
-
|
67
|
+
var import_react2 = __toESM(require("react"));
|
27
68
|
|
28
69
|
// src/app/components/Loader/LoaderStyle.tsx
|
29
|
-
|
70
|
+
var import_react = __toESM(require("react"));
|
30
71
|
var LoaderStyle = (props) => {
|
31
|
-
return /* @__PURE__ */
|
72
|
+
return /* @__PURE__ */ import_react.default.createElement("style", null, `
|
32
73
|
.loader {
|
33
74
|
position: fixed;
|
34
75
|
/* Fixed position to cover the viewport */
|
@@ -147,17 +188,17 @@ var LoaderStyle_default = LoaderStyle;
|
|
147
188
|
|
148
189
|
// src/app/components/Loader/Loader.tsx
|
149
190
|
var Loader = (props) => {
|
150
|
-
return /* @__PURE__ */
|
191
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement(LoaderStyle_default, null), (props == null ? void 0 : props.loading) && /* @__PURE__ */ import_react2.default.createElement("div", { className: "loader" }, /* @__PURE__ */ import_react2.default.createElement("div", { className: "lds-ellipsis" }, /* @__PURE__ */ import_react2.default.createElement("div", null), /* @__PURE__ */ import_react2.default.createElement("div", null), /* @__PURE__ */ import_react2.default.createElement("div", null), /* @__PURE__ */ import_react2.default.createElement("div", null))));
|
151
192
|
};
|
152
193
|
var Loader_default = Loader;
|
153
194
|
|
154
195
|
// src/app/components/RequestPayment/RequestPayment.tsx
|
155
|
-
|
196
|
+
var import_react_bootstrap = require("react-bootstrap");
|
156
197
|
|
157
198
|
// src/app/components/RequestPayment/RequestPaymentstyles.tsx
|
158
|
-
|
199
|
+
var import_react3 = __toESM(require("react"));
|
159
200
|
var RequestPaymentstyles = (props) => {
|
160
|
-
return /* @__PURE__ */
|
201
|
+
return /* @__PURE__ */ import_react3.default.createElement("style", null, `
|
161
202
|
.paymentBtn {
|
162
203
|
background-color: black;
|
163
204
|
border: none;
|
@@ -1011,10 +1052,10 @@ var ErrorText = {
|
|
1011
1052
|
// src/app/components/RequestPayment/RequestPayment.tsx
|
1012
1053
|
function RequestPayment(props) {
|
1013
1054
|
const fractalpayClientKey = props.fractalpayClientKey;
|
1014
|
-
const [show, setShow] = useState(false);
|
1015
|
-
const [loading, setLoading] = useState(false);
|
1016
|
-
const [errors, setErrors] = useState({});
|
1017
|
-
const [requestDetails, setRequestDetails] = useState({
|
1055
|
+
const [show, setShow] = (0, import_react4.useState)(false);
|
1056
|
+
const [loading, setLoading] = (0, import_react4.useState)(false);
|
1057
|
+
const [errors, setErrors] = (0, import_react4.useState)({});
|
1058
|
+
const [requestDetails, setRequestDetails] = (0, import_react4.useState)({
|
1018
1059
|
email: "",
|
1019
1060
|
amount: "",
|
1020
1061
|
phone_number: "",
|
@@ -1022,7 +1063,7 @@ function RequestPayment(props) {
|
|
1022
1063
|
name: "",
|
1023
1064
|
fractalpayPublicKey: fractalpayClientKey
|
1024
1065
|
});
|
1025
|
-
const [showConfirmationModal, setShowConfirmationModal] = useState(false);
|
1066
|
+
const [showConfirmationModal, setShowConfirmationModal] = (0, import_react4.useState)(false);
|
1026
1067
|
const phoneNumberRegex = (value) => /^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(value);
|
1027
1068
|
const amoutRegex = /[+-]?([0-9]*[.])?[0-9]+/;
|
1028
1069
|
const positiveAmountRegex = /^[+]?\d+(\.\d+)?$/;
|
@@ -1075,7 +1116,7 @@ function RequestPayment(props) {
|
|
1075
1116
|
name: requestDetails.name,
|
1076
1117
|
email: requestDetails.email
|
1077
1118
|
};
|
1078
|
-
let response = await
|
1119
|
+
let response = await import_axios.default.post(`${baseUrl}create-widget-order`, formData);
|
1079
1120
|
if ((response == null ? void 0 : response.status) === 200) {
|
1080
1121
|
setShowConfirmationModal(true);
|
1081
1122
|
setShow(false);
|
@@ -1153,7 +1194,7 @@ function RequestPayment(props) {
|
|
1153
1194
|
setErrors(newErrors);
|
1154
1195
|
return Object.keys(newErrors).length === 0;
|
1155
1196
|
};
|
1156
|
-
useEffect(() => {
|
1197
|
+
(0, import_react4.useEffect)(() => {
|
1157
1198
|
if (props.amount) {
|
1158
1199
|
setRequestDetails((prev) => __spreadProps(__spreadValues({}, prev), { amount: props.amount }));
|
1159
1200
|
}
|
@@ -1163,8 +1204,8 @@ function RequestPayment(props) {
|
|
1163
1204
|
e.preventDefault();
|
1164
1205
|
}
|
1165
1206
|
};
|
1166
|
-
return /* @__PURE__ */
|
1167
|
-
Modal,
|
1207
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ import_react4.default.createElement(Loader_default, { loading }), /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Request Payment"), /* @__PURE__ */ import_react4.default.createElement(
|
1208
|
+
import_react_bootstrap.Modal,
|
1168
1209
|
{
|
1169
1210
|
show,
|
1170
1211
|
onHide: handleClose,
|
@@ -1172,8 +1213,8 @@ function RequestPayment(props) {
|
|
1172
1213
|
backdrop: "static",
|
1173
1214
|
keyboard: false
|
1174
1215
|
},
|
1175
|
-
/* @__PURE__ */
|
1176
|
-
/* @__PURE__ */
|
1216
|
+
/* @__PURE__ */ import_react4.default.createElement(import_react_bootstrap.Modal.Header, { closeButton: true }, /* @__PURE__ */ import_react4.default.createElement(import_react_bootstrap.Modal.Title, null, "Request Payment")),
|
1217
|
+
/* @__PURE__ */ import_react4.default.createElement(import_react_bootstrap.Modal.Body, { id: "Checkout" }, /* @__PURE__ */ import_react4.default.createElement(import_react_bootstrap.Form, null, /* @__PURE__ */ import_react4.default.createElement("div", { className: "mb-3" }, /* @__PURE__ */ import_react4.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "form-label" }, "FULL NAME *"), /* @__PURE__ */ import_react4.default.createElement(
|
1177
1218
|
"input",
|
1178
1219
|
{
|
1179
1220
|
className: "form-control",
|
@@ -1182,7 +1223,7 @@ function RequestPayment(props) {
|
|
1182
1223
|
"data-token": "name",
|
1183
1224
|
onChange: handleChange
|
1184
1225
|
}
|
1185
|
-
), errors.name && /* @__PURE__ */
|
1226
|
+
), errors.name && /* @__PURE__ */ import_react4.default.createElement("small", { className: "text-danger" }, errors.name)), /* @__PURE__ */ import_react4.default.createElement("div", { className: "mb-3" }, /* @__PURE__ */ import_react4.default.createElement("label", { htmlFor: "requestPhoneNumber", className: "form-label" }, "Phone Number"), /* @__PURE__ */ import_react4.default.createElement(
|
1186
1227
|
"input",
|
1187
1228
|
{
|
1188
1229
|
maxLength: 10,
|
@@ -1194,7 +1235,7 @@ function RequestPayment(props) {
|
|
1194
1235
|
type: "text",
|
1195
1236
|
"data-token": "phone_number"
|
1196
1237
|
}
|
1197
|
-
), errors.phone_number && /* @__PURE__ */
|
1238
|
+
), errors.phone_number && /* @__PURE__ */ import_react4.default.createElement("small", { className: "text-danger" }, errors.phone_number)), /* @__PURE__ */ import_react4.default.createElement("div", { className: "mb-3" }, /* @__PURE__ */ import_react4.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "form-label" }, "EMAIL"), /* @__PURE__ */ import_react4.default.createElement(
|
1198
1239
|
"input",
|
1199
1240
|
{
|
1200
1241
|
className: "form-control",
|
@@ -1203,7 +1244,7 @@ function RequestPayment(props) {
|
|
1203
1244
|
onChange: handleChange,
|
1204
1245
|
"data-token": "email"
|
1205
1246
|
}
|
1206
|
-
), errors.email && /* @__PURE__ */
|
1247
|
+
), errors.email && /* @__PURE__ */ import_react4.default.createElement("small", { className: "text-danger" }, errors.email)), /* @__PURE__ */ import_react4.default.createElement("div", { className: "mb-3" }, /* @__PURE__ */ import_react4.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "form-label" }, "AMOUNT *"), /* @__PURE__ */ import_react4.default.createElement("div", { className: "input-group" }, /* @__PURE__ */ import_react4.default.createElement("span", { className: "input-group-text" }, "$"), /* @__PURE__ */ import_react4.default.createElement(
|
1207
1248
|
"input",
|
1208
1249
|
{
|
1209
1250
|
"data-token": "amount",
|
@@ -1219,7 +1260,7 @@ function RequestPayment(props) {
|
|
1219
1260
|
e2.preventDefault();
|
1220
1261
|
}, { passive: false })
|
1221
1262
|
}
|
1222
|
-
)), errors.amount && /* @__PURE__ */
|
1263
|
+
)), errors.amount && /* @__PURE__ */ import_react4.default.createElement("small", { className: "text-danger" }, errors.amount)), /* @__PURE__ */ import_react4.default.createElement("div", { className: "mb-3" }, /* @__PURE__ */ import_react4.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "form-label" }, "ORDER ID"), /* @__PURE__ */ import_react4.default.createElement(
|
1223
1264
|
"input",
|
1224
1265
|
{
|
1225
1266
|
className: "form-control",
|
@@ -1228,8 +1269,8 @@ function RequestPayment(props) {
|
|
1228
1269
|
onChange: handleChange,
|
1229
1270
|
"data-token": "order_id"
|
1230
1271
|
}
|
1231
|
-
), errors.order_id && /* @__PURE__ */
|
1232
|
-
Button,
|
1272
|
+
), errors.order_id && /* @__PURE__ */ import_react4.default.createElement("small", { className: "text-danger" }, errors.order_id)), /* @__PURE__ */ import_react4.default.createElement(
|
1273
|
+
import_react_bootstrap.Button,
|
1233
1274
|
{
|
1234
1275
|
type: "button",
|
1235
1276
|
className: "PayButton",
|
@@ -1237,7 +1278,7 @@ function RequestPayment(props) {
|
|
1237
1278
|
disabled: loading
|
1238
1279
|
},
|
1239
1280
|
loading ? "Loading..." : "Send Request"
|
1240
|
-
)), /* @__PURE__ */
|
1281
|
+
)), /* @__PURE__ */ import_react4.default.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ import_react4.default.createElement(
|
1241
1282
|
"svg",
|
1242
1283
|
{
|
1243
1284
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1245,14 +1286,14 @@ function RequestPayment(props) {
|
|
1245
1286
|
height: "20",
|
1246
1287
|
viewBox: "0 0 26 26"
|
1247
1288
|
},
|
1248
|
-
/* @__PURE__ */
|
1289
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
1249
1290
|
"path",
|
1250
1291
|
{
|
1251
1292
|
fill: "currentColor",
|
1252
1293
|
d: "M23.633 5.028a1.074 1.074 0 0 0-.777-.366c-2.295-.06-5.199-2.514-7.119-3.477C14.551.592 13.768.201 13.18.098a1.225 1.225 0 0 0-.36.001c-.588.103-1.371.494-2.556 1.087c-1.92.962-4.824 3.416-7.119 3.476a1.08 1.08 0 0 0-.778.366a1.167 1.167 0 0 0-.291.834c.493 10.023 4.088 16.226 10.396 19.831c.164.093.346.141.527.141s.363-.048.528-.141c6.308-3.605 9.902-9.808 10.396-19.831a1.161 1.161 0 0 0-.29-.834zM18.617 8.97l-5.323 7.855c-.191.282-.491.469-.788.469c-.298 0-.629-.163-.838-.372l-3.752-3.753a.656.656 0 0 1 0-.926l.927-.929a.658.658 0 0 1 .926 0l2.44 2.44l4.239-6.257a.657.657 0 0 1 .91-.173l1.085.736a.657.657 0 0 1 .174.91z"
|
1253
1294
|
}
|
1254
1295
|
)
|
1255
|
-
), "Secure payments powered by Fractal", /* @__PURE__ */
|
1296
|
+
), "Secure payments powered by Fractal", /* @__PURE__ */ import_react4.default.createElement(
|
1256
1297
|
"img",
|
1257
1298
|
{
|
1258
1299
|
src: "https://ui.fractalpay.com/favicon.ico",
|
@@ -1260,15 +1301,15 @@ function RequestPayment(props) {
|
|
1260
1301
|
className: "powered-logo"
|
1261
1302
|
}
|
1262
1303
|
)))
|
1263
|
-
), /* @__PURE__ */
|
1264
|
-
Modal,
|
1304
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
1305
|
+
import_react_bootstrap.Modal,
|
1265
1306
|
{
|
1266
1307
|
className: "payment-suc",
|
1267
1308
|
show: showConfirmationModal,
|
1268
1309
|
onHide: handleCloseConfirmationModal
|
1269
1310
|
},
|
1270
|
-
/* @__PURE__ */
|
1271
|
-
/* @__PURE__ */
|
1311
|
+
/* @__PURE__ */ import_react4.default.createElement(import_react_bootstrap.Modal.Header, { closeButton: true }),
|
1312
|
+
/* @__PURE__ */ import_react4.default.createElement(import_react_bootstrap.Modal.Body, null, /* @__PURE__ */ import_react4.default.createElement(
|
1272
1313
|
"svg",
|
1273
1314
|
{
|
1274
1315
|
width: "60",
|
@@ -1277,7 +1318,7 @@ function RequestPayment(props) {
|
|
1277
1318
|
fill: "none",
|
1278
1319
|
xmlns: "http://www.w3.org/2000/svg"
|
1279
1320
|
},
|
1280
|
-
/* @__PURE__ */
|
1321
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
1281
1322
|
"rect",
|
1282
1323
|
{
|
1283
1324
|
x: "0.5",
|
@@ -1288,14 +1329,14 @@ function RequestPayment(props) {
|
|
1288
1329
|
stroke: "#31B379"
|
1289
1330
|
}
|
1290
1331
|
),
|
1291
|
-
/* @__PURE__ */
|
1332
|
+
/* @__PURE__ */ import_react4.default.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react4.default.createElement(
|
1292
1333
|
"path",
|
1293
1334
|
{
|
1294
1335
|
d: "M41.1778 22.248C40.7483 21.8184 40.0518 21.8184 39.6222 22.248L26.4435 35.4268L21.3778 30.3611C20.9483 29.9315 20.2518 29.9316 19.8222 30.3611C19.3926 30.7907 19.3926 31.4871 19.8222 31.9167L25.6657 37.7601C26.0951 38.1897 26.7921 38.1894 27.2213 37.7601L41.1778 23.8036C41.6074 23.3741 41.6074 22.6776 41.1778 22.248Z",
|
1295
1336
|
fill: "#31B379"
|
1296
1337
|
}
|
1297
1338
|
)),
|
1298
|
-
/* @__PURE__ */
|
1339
|
+
/* @__PURE__ */ import_react4.default.createElement("defs", null, /* @__PURE__ */ import_react4.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react4.default.createElement(
|
1299
1340
|
"rect",
|
1300
1341
|
{
|
1301
1342
|
width: "22",
|
@@ -1304,28 +1345,28 @@ function RequestPayment(props) {
|
|
1304
1345
|
transform: "translate(19.5 19.0039)"
|
1305
1346
|
}
|
1306
1347
|
)))
|
1307
|
-
), /* @__PURE__ */
|
1348
|
+
), /* @__PURE__ */ import_react4.default.createElement("h2", null, "Payment link has been ", /* @__PURE__ */ import_react4.default.createElement("br", null), " sent successfully"))
|
1308
1349
|
)));
|
1309
1350
|
}
|
1310
1351
|
|
1311
1352
|
// src/app/components/RequestPayment/RequestPaymentAllInput.tsx
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1353
|
+
var import_react5 = __toESM(require("react"));
|
1354
|
+
var import_react_bootstrap2 = require("react-bootstrap");
|
1355
|
+
var import_react_toastify = require("react-toastify");
|
1356
|
+
var import_ReactToastify = require("react-toastify/dist/ReactToastify.css");
|
1316
1357
|
function RequestPaymentAllInput({ fractalpayClientKey }) {
|
1317
|
-
const [isLoading, setIsLoading] =
|
1318
|
-
const [show, setShow] =
|
1319
|
-
const [phoneNumber, setPhoneNumber] =
|
1320
|
-
const [amount, setAmount] =
|
1321
|
-
const [orderId, setOrderId] =
|
1322
|
-
const [isValidNumber, setIsValidNumber] =
|
1323
|
-
const [isValidAmount, setIsValidAmount] =
|
1324
|
-
const [isValidOrderId, setIsValidOrderId] =
|
1325
|
-
const [errorMessagephone, setErrorMessagephone] =
|
1326
|
-
const [errorMessageamount, setErrorMessageamount] =
|
1327
|
-
const [errorMessageorderid, setErrorMessageorderid] =
|
1328
|
-
const [submitClicked, setSubmitClicked] =
|
1358
|
+
const [isLoading, setIsLoading] = (0, import_react5.useState)(false);
|
1359
|
+
const [show, setShow] = (0, import_react5.useState)(false);
|
1360
|
+
const [phoneNumber, setPhoneNumber] = (0, import_react5.useState)("");
|
1361
|
+
const [amount, setAmount] = (0, import_react5.useState)("");
|
1362
|
+
const [orderId, setOrderId] = (0, import_react5.useState)("");
|
1363
|
+
const [isValidNumber, setIsValidNumber] = (0, import_react5.useState)(true);
|
1364
|
+
const [isValidAmount, setIsValidAmount] = (0, import_react5.useState)(true);
|
1365
|
+
const [isValidOrderId, setIsValidOrderId] = (0, import_react5.useState)(true);
|
1366
|
+
const [errorMessagephone, setErrorMessagephone] = (0, import_react5.useState)("");
|
1367
|
+
const [errorMessageamount, setErrorMessageamount] = (0, import_react5.useState)("");
|
1368
|
+
const [errorMessageorderid, setErrorMessageorderid] = (0, import_react5.useState)("");
|
1369
|
+
const [submitClicked, setSubmitClicked] = (0, import_react5.useState)(false);
|
1329
1370
|
const handleClose = () => setShow(false);
|
1330
1371
|
const handleShow = () => setShow(true);
|
1331
1372
|
const sendRequestPayment = () => {
|
@@ -1387,7 +1428,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1387
1428
|
}).catch((error) => {
|
1388
1429
|
setIsLoading(false);
|
1389
1430
|
console.error("Error:", error);
|
1390
|
-
toast.error(ErrorText.anerroroccured);
|
1431
|
+
import_react_toastify.toast.error(ErrorText.anerroroccured);
|
1391
1432
|
});
|
1392
1433
|
};
|
1393
1434
|
const handlePhoneNumberChange = (e) => {
|
@@ -1427,7 +1468,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1427
1468
|
setIsValidOrderId(false);
|
1428
1469
|
}
|
1429
1470
|
};
|
1430
|
-
return /* @__PURE__ */
|
1471
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ import_react5.default.createElement("div", { className: " border-container" }, /* @__PURE__ */ import_react5.default.createElement("div", { className: "payment-column" }, /* @__PURE__ */ import_react5.default.createElement("label", null, "Enter Phone Number:"), /* @__PURE__ */ import_react5.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react5.default.createElement(
|
1431
1472
|
"input",
|
1432
1473
|
{
|
1433
1474
|
type: "text",
|
@@ -1437,7 +1478,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1437
1478
|
maxLength: 10,
|
1438
1479
|
className: submitClicked && (!phoneNumber || !isValidNumber) ? "error" : ""
|
1439
1480
|
}
|
1440
|
-
), errorMessagephone && /* @__PURE__ */
|
1481
|
+
), errorMessagephone && /* @__PURE__ */ import_react5.default.createElement("div", { className: "error-message text-danger" }, errorMessagephone))), /* @__PURE__ */ import_react5.default.createElement("div", { className: "payment-column" }, /* @__PURE__ */ import_react5.default.createElement("label", null, "Enter Amount:"), /* @__PURE__ */ import_react5.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react5.default.createElement(
|
1441
1482
|
"input",
|
1442
1483
|
{
|
1443
1484
|
type: "text",
|
@@ -1446,7 +1487,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1446
1487
|
placeholder: "Enter amount",
|
1447
1488
|
className: submitClicked && (!amount || !isValidAmount) ? "error" : ""
|
1448
1489
|
}
|
1449
|
-
), errorMessageamount && /* @__PURE__ */
|
1490
|
+
), errorMessageamount && /* @__PURE__ */ import_react5.default.createElement("div", { className: "error-message text-danger" }, errorMessageamount))), /* @__PURE__ */ import_react5.default.createElement("div", { className: "payment-column" }, /* @__PURE__ */ import_react5.default.createElement("label", null, "Enter Order ID:"), /* @__PURE__ */ import_react5.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react5.default.createElement(
|
1450
1491
|
"input",
|
1451
1492
|
{
|
1452
1493
|
type: "text",
|
@@ -1455,7 +1496,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1455
1496
|
placeholder: "Enter order ID",
|
1456
1497
|
className: submitClicked && (!orderId || !isValidOrderId) ? "error" : ""
|
1457
1498
|
}
|
1458
|
-
), errorMessageorderid && /* @__PURE__ */
|
1499
|
+
), errorMessageorderid && /* @__PURE__ */ import_react5.default.createElement("div", { className: "error-message text-danger" }, errorMessageorderid))), /* @__PURE__ */ import_react5.default.createElement(
|
1459
1500
|
"button",
|
1460
1501
|
{
|
1461
1502
|
onClick: sendRequestPayment,
|
@@ -1463,7 +1504,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1463
1504
|
className: "paymentBtn"
|
1464
1505
|
},
|
1465
1506
|
isLoading ? "Loading..." : "Request Payment"
|
1466
|
-
)), /* @__PURE__ */
|
1507
|
+
)), /* @__PURE__ */ import_react5.default.createElement(import_react_bootstrap2.Modal, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ import_react5.default.createElement(import_react_bootstrap2.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react5.default.createElement(import_react_bootstrap2.Modal.Body, null, /* @__PURE__ */ import_react5.default.createElement(
|
1467
1508
|
"svg",
|
1468
1509
|
{
|
1469
1510
|
width: "60",
|
@@ -1472,7 +1513,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1472
1513
|
fill: "none",
|
1473
1514
|
xmlns: "http://www.w3.org/2000/svg"
|
1474
1515
|
},
|
1475
|
-
/* @__PURE__ */
|
1516
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
1476
1517
|
"rect",
|
1477
1518
|
{
|
1478
1519
|
x: "0.5",
|
@@ -1483,14 +1524,14 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1483
1524
|
stroke: "#31B379"
|
1484
1525
|
}
|
1485
1526
|
),
|
1486
|
-
/* @__PURE__ */
|
1527
|
+
/* @__PURE__ */ import_react5.default.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react5.default.createElement(
|
1487
1528
|
"path",
|
1488
1529
|
{
|
1489
1530
|
d: "M41.1778 22.248C40.7483 21.8184 40.0518 21.8184 39.6222 22.248L26.4435 35.4268L21.3778 30.3611C20.9483 29.9315 20.2518 29.9316 19.8222 30.3611C19.3926 30.7907 19.3926 31.4871 19.8222 31.9167L25.6657 37.7601C26.0951 38.1897 26.7921 38.1894 27.2213 37.7601L41.1778 23.8036C41.6074 23.3741 41.6074 22.6776 41.1778 22.248Z",
|
1490
1531
|
fill: "#31B379"
|
1491
1532
|
}
|
1492
1533
|
)),
|
1493
|
-
/* @__PURE__ */
|
1534
|
+
/* @__PURE__ */ import_react5.default.createElement("defs", null, /* @__PURE__ */ import_react5.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react5.default.createElement(
|
1494
1535
|
"rect",
|
1495
1536
|
{
|
1496
1537
|
width: "22",
|
@@ -1499,12 +1540,12 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1499
1540
|
transform: "translate(19.5 19.0039)"
|
1500
1541
|
}
|
1501
1542
|
)))
|
1502
|
-
), /* @__PURE__ */
|
1543
|
+
), /* @__PURE__ */ import_react5.default.createElement("h1", null, "Success!"), /* @__PURE__ */ import_react5.default.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ import_react5.default.createElement(import_react_bootstrap2.Modal.Footer, null, /* @__PURE__ */ import_react5.default.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))), /* @__PURE__ */ import_react5.default.createElement(import_react_toastify.ToastContainer, null));
|
1503
1544
|
}
|
1504
1545
|
|
1505
1546
|
// src/app/components/RequestPayment/RequestPaymentDynamic.tsx
|
1506
|
-
|
1507
|
-
|
1547
|
+
var import_react6 = __toESM(require("react"));
|
1548
|
+
var import_react_bootstrap3 = require("react-bootstrap");
|
1508
1549
|
|
1509
1550
|
// src/app/components/Api/createWidgetOrder.ts
|
1510
1551
|
var createWidgetOrder = (formData) => {
|
@@ -1527,8 +1568,8 @@ var createWidgetOrder = (formData) => {
|
|
1527
1568
|
|
1528
1569
|
// src/app/components/RequestPayment/RequestPaymentDynamic.tsx
|
1529
1570
|
function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orderID }) {
|
1530
|
-
const [isLoading, setIsLoading] =
|
1531
|
-
const [show, setShow] =
|
1571
|
+
const [isLoading, setIsLoading] = (0, import_react6.useState)(false);
|
1572
|
+
const [show, setShow] = (0, import_react6.useState)(false);
|
1532
1573
|
const handleClose = () => setShow(false);
|
1533
1574
|
const handleShow = () => setShow(true);
|
1534
1575
|
const sendRequestPayment = () => {
|
@@ -1551,7 +1592,7 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1551
1592
|
console.error("Error:", error);
|
1552
1593
|
});
|
1553
1594
|
};
|
1554
|
-
return /* @__PURE__ */
|
1595
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, /* @__PURE__ */ import_react6.default.createElement(
|
1555
1596
|
"button",
|
1556
1597
|
{
|
1557
1598
|
onClick: sendRequestPayment,
|
@@ -1559,7 +1600,7 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1559
1600
|
className: "paymentBtn"
|
1560
1601
|
},
|
1561
1602
|
isLoading ? "Loading..." : "Request Payment"
|
1562
|
-
), /* @__PURE__ */
|
1603
|
+
), /* @__PURE__ */ import_react6.default.createElement(import_react_bootstrap3.Modal, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ import_react6.default.createElement(import_react_bootstrap3.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react6.default.createElement(import_react_bootstrap3.Modal.Body, null, /* @__PURE__ */ import_react6.default.createElement(
|
1563
1604
|
"svg",
|
1564
1605
|
{
|
1565
1606
|
width: "60",
|
@@ -1568,7 +1609,7 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1568
1609
|
fill: "none",
|
1569
1610
|
xmlns: "http://www.w3.org/2000/svg"
|
1570
1611
|
},
|
1571
|
-
/* @__PURE__ */
|
1612
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
1572
1613
|
"rect",
|
1573
1614
|
{
|
1574
1615
|
x: "0.5",
|
@@ -1579,14 +1620,14 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1579
1620
|
stroke: "#31B379"
|
1580
1621
|
}
|
1581
1622
|
),
|
1582
|
-
/* @__PURE__ */
|
1623
|
+
/* @__PURE__ */ import_react6.default.createElement("g", { "clip-path": "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react6.default.createElement(
|
1583
1624
|
"path",
|
1584
1625
|
{
|
1585
1626
|
d: "M41.1778 22.248C40.7483 21.8184 40.0518 21.8184 39.6222 22.248L26.4435 35.4268L21.3778 30.3611C20.9483 29.9315 20.2518 29.9316 19.8222 30.3611C19.3926 30.7907 19.3926 31.4871 19.8222 31.9167L25.6657 37.7601C26.0951 38.1897 26.7921 38.1894 27.2213 37.7601L41.1778 23.8036C41.6074 23.3741 41.6074 22.6776 41.1778 22.248Z",
|
1586
1627
|
fill: "#31B379"
|
1587
1628
|
}
|
1588
1629
|
)),
|
1589
|
-
/* @__PURE__ */
|
1630
|
+
/* @__PURE__ */ import_react6.default.createElement("defs", null, /* @__PURE__ */ import_react6.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react6.default.createElement(
|
1590
1631
|
"rect",
|
1591
1632
|
{
|
1592
1633
|
width: "22",
|
@@ -1595,15 +1636,15 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1595
1636
|
transform: "translate(19.5 19.0039)"
|
1596
1637
|
}
|
1597
1638
|
)))
|
1598
|
-
), /* @__PURE__ */
|
1639
|
+
), /* @__PURE__ */ import_react6.default.createElement("h1", null, "Success!"), /* @__PURE__ */ import_react6.default.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ import_react6.default.createElement(import_react_bootstrap3.Modal.Footer, null, /* @__PURE__ */ import_react6.default.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))));
|
1599
1640
|
}
|
1600
1641
|
|
1601
1642
|
// src/app/components/RequestPayment/RequestPaymentonClick.tsx
|
1602
|
-
|
1603
|
-
|
1643
|
+
var import_react7 = __toESM(require("react"));
|
1644
|
+
var import_react_bootstrap4 = require("react-bootstrap");
|
1604
1645
|
function RequestPaymentonClick(props) {
|
1605
|
-
const [isLoading, setIsLoading] =
|
1606
|
-
const [show, setShow] =
|
1646
|
+
const [isLoading, setIsLoading] = (0, import_react7.useState)(false);
|
1647
|
+
const [show, setShow] = (0, import_react7.useState)(false);
|
1607
1648
|
const handleClose = () => setShow(false);
|
1608
1649
|
const handleShow = () => setShow(true);
|
1609
1650
|
const { fractalpayClientKey, amount, phone_number, orderID, onSuccess, onError } = props;
|
@@ -1637,7 +1678,7 @@ function RequestPaymentonClick(props) {
|
|
1637
1678
|
console.error("Error:", error);
|
1638
1679
|
});
|
1639
1680
|
};
|
1640
|
-
return /* @__PURE__ */
|
1681
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ import_react7.default.createElement(
|
1641
1682
|
"button",
|
1642
1683
|
{
|
1643
1684
|
onClick: sendRequestPayment,
|
@@ -1645,7 +1686,7 @@ function RequestPaymentonClick(props) {
|
|
1645
1686
|
className: "paymentBtn"
|
1646
1687
|
},
|
1647
1688
|
isLoading ? "Loading..." : "Request Payment"
|
1648
|
-
), /* @__PURE__ */
|
1689
|
+
), /* @__PURE__ */ import_react7.default.createElement(import_react_bootstrap4.Modal, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ import_react7.default.createElement(import_react_bootstrap4.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react7.default.createElement(import_react_bootstrap4.Modal.Body, null, onSuccess && /* @__PURE__ */ import_react7.default.createElement(
|
1649
1690
|
"svg",
|
1650
1691
|
{
|
1651
1692
|
width: "60",
|
@@ -1654,7 +1695,7 @@ function RequestPaymentonClick(props) {
|
|
1654
1695
|
fill: "none",
|
1655
1696
|
xmlns: "http://www.w3.org/2000/svg"
|
1656
1697
|
},
|
1657
|
-
/* @__PURE__ */
|
1698
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
1658
1699
|
"rect",
|
1659
1700
|
{
|
1660
1701
|
x: "0.5",
|
@@ -1665,14 +1706,14 @@ function RequestPaymentonClick(props) {
|
|
1665
1706
|
stroke: "#31B379"
|
1666
1707
|
}
|
1667
1708
|
),
|
1668
|
-
/* @__PURE__ */
|
1709
|
+
/* @__PURE__ */ import_react7.default.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react7.default.createElement(
|
1669
1710
|
"path",
|
1670
1711
|
{
|
1671
1712
|
d: "M41.1778 22.248C40.7483 21.8184 40.0518 21.8184 39.6222 22.248L26.4435 35.4268L21.3778 30.3611C20.9483 29.9315 20.2518 29.9316 19.8222 30.3611C19.3926 30.7907 19.3926 31.4871 19.8222 31.9167L25.6657 37.7601C26.0951 38.1897 26.7921 38.1894 27.2213 37.7601L41.1778 23.8036C41.6074 23.3741 41.6074 22.6776 41.1778 22.248Z",
|
1672
1713
|
fill: "#31B379"
|
1673
1714
|
}
|
1674
1715
|
)),
|
1675
|
-
/* @__PURE__ */
|
1716
|
+
/* @__PURE__ */ import_react7.default.createElement("defs", null, /* @__PURE__ */ import_react7.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react7.default.createElement(
|
1676
1717
|
"rect",
|
1677
1718
|
{
|
1678
1719
|
width: "22",
|
@@ -1681,21 +1722,21 @@ function RequestPaymentonClick(props) {
|
|
1681
1722
|
transform: "translate(19.5 19.0039)"
|
1682
1723
|
}
|
1683
1724
|
)))
|
1684
|
-
), onSuccess ? /* @__PURE__ */
|
1725
|
+
), onSuccess ? /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement("h1", null, "Success!"), /* @__PURE__ */ import_react7.default.createElement("h4", null, onSuccess)) : /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement("h1", null, "Error!"), /* @__PURE__ */ import_react7.default.createElement("h4", null, onError))), /* @__PURE__ */ import_react7.default.createElement(import_react_bootstrap4.Modal.Footer, null, /* @__PURE__ */ import_react7.default.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))));
|
1685
1726
|
}
|
1686
1727
|
|
1687
1728
|
// src/app/components/RequestPayment/RqstPaymntInputField.tsx
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1729
|
+
var import_react8 = __toESM(require("react"));
|
1730
|
+
var import_react_bootstrap5 = require("react-bootstrap");
|
1731
|
+
var import_react_toastify2 = require("react-toastify");
|
1732
|
+
var import_ReactToastify2 = require("react-toastify/dist/ReactToastify.css");
|
1692
1733
|
function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
1693
|
-
const [isLoading, setIsLoading] =
|
1694
|
-
const [show, setShow] =
|
1695
|
-
const [phoneNumber, setPhoneNumber] =
|
1696
|
-
const [isValidNumber, setIsValidNumber] =
|
1697
|
-
const [errorMessage, setErrorMessage] =
|
1698
|
-
const [submitClicked, setSubmitClicked] =
|
1734
|
+
const [isLoading, setIsLoading] = (0, import_react8.useState)(false);
|
1735
|
+
const [show, setShow] = (0, import_react8.useState)(false);
|
1736
|
+
const [phoneNumber, setPhoneNumber] = (0, import_react8.useState)("");
|
1737
|
+
const [isValidNumber, setIsValidNumber] = (0, import_react8.useState)(true);
|
1738
|
+
const [errorMessage, setErrorMessage] = (0, import_react8.useState)("");
|
1739
|
+
const [submitClicked, setSubmitClicked] = (0, import_react8.useState)(false);
|
1699
1740
|
const handleClose = () => setShow(false);
|
1700
1741
|
const handleShow = () => setShow(true);
|
1701
1742
|
const sendRequestPayment = () => {
|
@@ -1740,7 +1781,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1740
1781
|
}).catch((error) => {
|
1741
1782
|
setIsLoading(false);
|
1742
1783
|
console.error("Error:", error);
|
1743
|
-
|
1784
|
+
import_react_toastify2.toast.error(ErrorText.anerroroccured);
|
1744
1785
|
});
|
1745
1786
|
};
|
1746
1787
|
const handlePhoneNumberChange = (e) => {
|
@@ -1758,7 +1799,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1758
1799
|
setErrorMessage(ErrorText.phonenumbervalid);
|
1759
1800
|
}
|
1760
1801
|
};
|
1761
|
-
return /* @__PURE__ */
|
1802
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement("div", { className: "payment-container" }, /* @__PURE__ */ import_react8.default.createElement("div", { className: "input-wrapper" }, /* @__PURE__ */ import_react8.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react8.default.createElement(
|
1762
1803
|
"input",
|
1763
1804
|
{
|
1764
1805
|
type: "text",
|
@@ -1768,7 +1809,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1768
1809
|
maxLength: 10,
|
1769
1810
|
className: submitClicked && (!phoneNumber || !isValidNumber) ? "error" : ""
|
1770
1811
|
}
|
1771
|
-
), errorMessage && /* @__PURE__ */
|
1812
|
+
), errorMessage && /* @__PURE__ */ import_react8.default.createElement("div", { className: "error-message text-danger" }, errorMessage))), /* @__PURE__ */ import_react8.default.createElement("div", { className: "button-wrapper" }, /* @__PURE__ */ import_react8.default.createElement(
|
1772
1813
|
"button",
|
1773
1814
|
{
|
1774
1815
|
onClick: sendRequestPayment,
|
@@ -1776,7 +1817,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1776
1817
|
className: "paymentBtn"
|
1777
1818
|
},
|
1778
1819
|
isLoading ? "Loading..." : "Request Payment"
|
1779
|
-
))), /* @__PURE__ */
|
1820
|
+
))), /* @__PURE__ */ import_react8.default.createElement(import_react_bootstrap5.Modal, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ import_react8.default.createElement(import_react_bootstrap5.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react8.default.createElement(import_react_bootstrap5.Modal.Body, null, /* @__PURE__ */ import_react8.default.createElement(
|
1780
1821
|
"svg",
|
1781
1822
|
{
|
1782
1823
|
width: "60",
|
@@ -1785,7 +1826,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1785
1826
|
fill: "none",
|
1786
1827
|
xmlns: "http://www.w3.org/2000/svg"
|
1787
1828
|
},
|
1788
|
-
/* @__PURE__ */
|
1829
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
1789
1830
|
"rect",
|
1790
1831
|
{
|
1791
1832
|
x: "0.5",
|
@@ -1796,14 +1837,14 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1796
1837
|
stroke: "#31B379"
|
1797
1838
|
}
|
1798
1839
|
),
|
1799
|
-
/* @__PURE__ */
|
1840
|
+
/* @__PURE__ */ import_react8.default.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react8.default.createElement(
|
1800
1841
|
"path",
|
1801
1842
|
{
|
1802
1843
|
d: "M41.1778 22.248C40.7483 21.8184 40.0518 21.8184 39.6222 22.248L26.4435 35.4268L21.3778 30.3611C20.9483 29.9315 20.2518 29.9316 19.8222 30.3611C19.3926 30.7907 19.3926 31.4871 19.8222 31.9167L25.6657 37.7601C26.0951 38.1897 26.7921 38.1894 27.2213 37.7601L41.1778 23.8036C41.6074 23.3741 41.6074 22.6776 41.1778 22.248Z",
|
1803
1844
|
fill: "#31B379"
|
1804
1845
|
}
|
1805
1846
|
)),
|
1806
|
-
/* @__PURE__ */
|
1847
|
+
/* @__PURE__ */ import_react8.default.createElement("defs", null, /* @__PURE__ */ import_react8.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react8.default.createElement(
|
1807
1848
|
"rect",
|
1808
1849
|
{
|
1809
1850
|
width: "22",
|
@@ -1812,20 +1853,20 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1812
1853
|
transform: "translate(19.5 19.0039)"
|
1813
1854
|
}
|
1814
1855
|
)))
|
1815
|
-
), /* @__PURE__ */
|
1856
|
+
), /* @__PURE__ */ import_react8.default.createElement("h1", null, "Success!"), /* @__PURE__ */ import_react8.default.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ import_react8.default.createElement(import_react_bootstrap5.Modal.Footer, null, /* @__PURE__ */ import_react8.default.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))), /* @__PURE__ */ import_react8.default.createElement(import_react_toastify2.ToastContainer, null));
|
1816
1857
|
}
|
1817
1858
|
|
1818
1859
|
// src/app/components/Payment/Payment.tsx
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1860
|
+
var import_react10 = __toESM(require("react"));
|
1861
|
+
var import_axios2 = __toESM(require("axios"));
|
1862
|
+
var import_node_forge = __toESM(require("node-forge"));
|
1863
|
+
var import_react_toastify3 = require("react-toastify");
|
1864
|
+
var import_react_bootstrap6 = require("react-bootstrap");
|
1824
1865
|
|
1825
1866
|
// src/app/components/Payment/Paymentstyles.tsx
|
1826
|
-
|
1867
|
+
var import_react9 = __toESM(require("react"));
|
1827
1868
|
function Paymentstyles() {
|
1828
|
-
return /* @__PURE__ */
|
1869
|
+
return /* @__PURE__ */ import_react9.default.createElement("style", null, `
|
1829
1870
|
.paymentBtn {
|
1830
1871
|
background-color: black;
|
1831
1872
|
border: none;
|
@@ -2751,7 +2792,7 @@ input {
|
|
2751
2792
|
// src/app/components/Payment/Payment.tsx
|
2752
2793
|
function Payment() {
|
2753
2794
|
var _a;
|
2754
|
-
const [state, setState] =
|
2795
|
+
const [state, setState] = (0, import_react10.useState)({
|
2755
2796
|
show: false,
|
2756
2797
|
publicKey: "",
|
2757
2798
|
sessionKey: "",
|
@@ -2762,12 +2803,12 @@ function Payment() {
|
|
2762
2803
|
zip: "",
|
2763
2804
|
amount: ""
|
2764
2805
|
});
|
2765
|
-
const [isValid, setIsValid] =
|
2766
|
-
const [isValidMonth, setIsValidMonth] =
|
2767
|
-
const [data, setData] =
|
2806
|
+
const [isValid, setIsValid] = (0, import_react10.useState)(false);
|
2807
|
+
const [isValidMonth, setIsValidMonth] = (0, import_react10.useState)(false);
|
2808
|
+
const [data, setData] = (0, import_react10.useState)(null);
|
2768
2809
|
const handlePaymentClick = async () => {
|
2769
2810
|
try {
|
2770
|
-
const response = await
|
2811
|
+
const response = await import_axios2.default.post(`${baseUrl}generate-session`, {});
|
2771
2812
|
const data2 = response.data;
|
2772
2813
|
if (data2 && (data2 == null ? void 0 : data2.result) === true) {
|
2773
2814
|
setState((prev) => {
|
@@ -2785,12 +2826,12 @@ function Payment() {
|
|
2785
2826
|
};
|
2786
2827
|
const handleSubmitPay = async () => {
|
2787
2828
|
const track2_data = `${state.cardNumber.replace(/\s+/g, "")}=${state.year}${state.month.length > 1 ? state.month : "0" + state.month} ${state.cvv}`;
|
2788
|
-
const publicKey =
|
2829
|
+
const publicKey = import_node_forge.default.pki.publicKeyFromPem(state.publicKey);
|
2789
2830
|
const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
|
2790
|
-
md:
|
2791
|
-
mgf1: { md:
|
2831
|
+
md: import_node_forge.default.md.sha1.create(),
|
2832
|
+
mgf1: { md: import_node_forge.default.md.sha1.create() }
|
2792
2833
|
});
|
2793
|
-
const encryptedBase64 =
|
2834
|
+
const encryptedBase64 = import_node_forge.default.util.encode64(encrypted);
|
2794
2835
|
console.log(encryptedBase64);
|
2795
2836
|
const requestBody = {
|
2796
2837
|
enc_track2_data: encryptedBase64,
|
@@ -2799,14 +2840,14 @@ function Payment() {
|
|
2799
2840
|
};
|
2800
2841
|
const apiUrl = "https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize";
|
2801
2842
|
try {
|
2802
|
-
const response = await
|
2843
|
+
const response = await import_axios2.default.post(apiUrl, requestBody, {
|
2803
2844
|
headers: {
|
2804
2845
|
"x-app-session-key": state == null ? void 0 : state.sessionKey,
|
2805
2846
|
"Content-Type": "application/json"
|
2806
2847
|
}
|
2807
2848
|
});
|
2808
2849
|
if ((response == null ? void 0 : response.status) === 200) {
|
2809
|
-
|
2850
|
+
import_react_toastify3.toast.success("Payment Successful");
|
2810
2851
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
2811
2852
|
show: false,
|
2812
2853
|
publicKey: "",
|
@@ -2916,7 +2957,7 @@ function Payment() {
|
|
2916
2957
|
}
|
2917
2958
|
return "";
|
2918
2959
|
}
|
2919
|
-
return /* @__PURE__ */
|
2960
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, /* @__PURE__ */ import_react10.default.createElement(Paymentstyles, null), /* @__PURE__ */ import_react10.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react10.default.createElement(
|
2920
2961
|
"button",
|
2921
2962
|
{
|
2922
2963
|
className: "export-btn",
|
@@ -2924,8 +2965,8 @@ function Payment() {
|
|
2924
2965
|
onClick: () => handlePaymentClick()
|
2925
2966
|
},
|
2926
2967
|
"Payment"
|
2927
|
-
), /* @__PURE__ */
|
2928
|
-
|
2968
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
2969
|
+
import_react_bootstrap6.Modal,
|
2929
2970
|
{
|
2930
2971
|
show: state.show,
|
2931
2972
|
onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -2933,8 +2974,8 @@ function Payment() {
|
|
2933
2974
|
})),
|
2934
2975
|
centered: true
|
2935
2976
|
},
|
2936
|
-
/* @__PURE__ */
|
2937
|
-
/* @__PURE__ */
|
2977
|
+
/* @__PURE__ */ import_react10.default.createElement(import_react_bootstrap6.Modal.Header, { closeButton: true }),
|
2978
|
+
/* @__PURE__ */ import_react10.default.createElement(import_react_bootstrap6.Modal.Body, null, /* @__PURE__ */ import_react10.default.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "row" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react10.default.createElement("div", { id: "Checkout", className: "inline" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "header" }, /* @__PURE__ */ import_react10.default.createElement("h1", null, "Pay")), /* @__PURE__ */ import_react10.default.createElement("form", { id: "PaymentForm", className: "payment-form" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "form-group", style: { display: "none" } }, /* @__PURE__ */ import_react10.default.createElement("label", null, "Payment amount"), /* @__PURE__ */ import_react10.default.createElement("div", { className: "input-group" }, /* @__PURE__ */ import_react10.default.createElement("span", { className: "input-group-addon" }, "$"), /* @__PURE__ */ import_react10.default.createElement(
|
2938
2979
|
"input",
|
2939
2980
|
{
|
2940
2981
|
type: "text",
|
@@ -2943,13 +2984,13 @@ function Payment() {
|
|
2943
2984
|
className: "form-control",
|
2944
2985
|
id: ""
|
2945
2986
|
}
|
2946
|
-
)), /* @__PURE__ */
|
2987
|
+
)), /* @__PURE__ */ import_react10.default.createElement(
|
2947
2988
|
"span",
|
2948
2989
|
{
|
2949
2990
|
id: "amount-error",
|
2950
2991
|
style: { color: "red", display: "none" }
|
2951
2992
|
}
|
2952
|
-
)), /* @__PURE__ */
|
2993
|
+
)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react10.default.createElement("label", null, "Name on card"), /* @__PURE__ */ import_react10.default.createElement(
|
2953
2994
|
"input",
|
2954
2995
|
{
|
2955
2996
|
id: "NameOnCard",
|
@@ -2958,13 +2999,13 @@ function Payment() {
|
|
2958
2999
|
maxLength: 100,
|
2959
3000
|
placeholder: "Name"
|
2960
3001
|
}
|
2961
|
-
), /* @__PURE__ */
|
3002
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
2962
3003
|
"span",
|
2963
3004
|
{
|
2964
3005
|
id: "NameOnCard-error",
|
2965
3006
|
style: { color: "red", display: "none" }
|
2966
3007
|
}
|
2967
|
-
)), /* @__PURE__ */
|
3008
|
+
)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react10.default.createElement(
|
2968
3009
|
"input",
|
2969
3010
|
{
|
2970
3011
|
"data-token": "card_number",
|
@@ -2975,7 +3016,7 @@ function Payment() {
|
|
2975
3016
|
placeholder: "0000 0000 0000 0000",
|
2976
3017
|
onChange: handleCardNumberChange
|
2977
3018
|
}
|
2978
|
-
), state.error && /* @__PURE__ */
|
3019
|
+
), state.error && /* @__PURE__ */ import_react10.default.createElement("div", { style: { color: "red" } }, state.error)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react10.default.createElement(
|
2979
3020
|
"input",
|
2980
3021
|
{
|
2981
3022
|
"data-token": "exp_month",
|
@@ -2986,14 +3027,14 @@ function Payment() {
|
|
2986
3027
|
maxLength: 2,
|
2987
3028
|
onChange: (e) => handleMonthChange(e)
|
2988
3029
|
}
|
2989
|
-
), isValidMonth && /* @__PURE__ */
|
3030
|
+
), isValidMonth && /* @__PURE__ */ import_react10.default.createElement(
|
2990
3031
|
"span",
|
2991
3032
|
{
|
2992
3033
|
id: "card_number-error",
|
2993
3034
|
style: { color: "red", fontSize: "15px" }
|
2994
3035
|
},
|
2995
3036
|
(_a = ErrorText) == null ? void 0 : _a.montherror
|
2996
|
-
)), /* @__PURE__ */
|
3037
|
+
)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react10.default.createElement(
|
2997
3038
|
"input",
|
2998
3039
|
{
|
2999
3040
|
"data-token": "exp_year",
|
@@ -3004,7 +3045,7 @@ function Payment() {
|
|
3004
3045
|
value: state.year,
|
3005
3046
|
onChange: (e) => handleYearChange(e)
|
3006
3047
|
}
|
3007
|
-
), state.yearError && /* @__PURE__ */
|
3048
|
+
), state.yearError && /* @__PURE__ */ import_react10.default.createElement("span", { id: "exp_year-error", style: { color: "red" } }, state.yearError)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "security-code-group form-group" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react10.default.createElement(
|
3008
3049
|
"input",
|
3009
3050
|
{
|
3010
3051
|
"data-token": "cvv",
|
@@ -3015,7 +3056,7 @@ function Payment() {
|
|
3015
3056
|
placeholder: "CVV",
|
3016
3057
|
onChange: (e) => handleCVVChange(e)
|
3017
3058
|
}
|
3018
|
-
), /* @__PURE__ */
|
3059
|
+
), /* @__PURE__ */ import_react10.default.createElement("i", { id: "cvc", className: "fa fa-question-circle" }), state.cvvError && /* @__PURE__ */ import_react10.default.createElement("span", { id: "cvv-error", style: { color: "red" } }, state.cvvError)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "cvc-preview-container two-card hide" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "amex-cvc-preview" }), /* @__PURE__ */ import_react10.default.createElement("div", { className: "visa-mc-dis-cvc-preview" }))), /* @__PURE__ */ import_react10.default.createElement("div", { className: "zip-code-group form-group" }, /* @__PURE__ */ import_react10.default.createElement("label", null, "Postal code"), /* @__PURE__ */ import_react10.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react10.default.createElement(
|
3019
3060
|
"input",
|
3020
3061
|
{
|
3021
3062
|
id: "ZIPCode",
|
@@ -3027,7 +3068,7 @@ function Payment() {
|
|
3027
3068
|
value: state.zip,
|
3028
3069
|
onChange: (e) => handleZIP(e)
|
3029
3070
|
}
|
3030
|
-
), /* @__PURE__ */
|
3071
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
3031
3072
|
"a",
|
3032
3073
|
{
|
3033
3074
|
tabIndex: 0,
|
@@ -3037,15 +3078,15 @@ function Payment() {
|
|
3037
3078
|
"data-placement": "left",
|
3038
3079
|
"data-content": "Enter the ZIP/Postal code for your credit card billing address."
|
3039
3080
|
},
|
3040
|
-
/* @__PURE__ */
|
3041
|
-
), /* @__PURE__ */
|
3081
|
+
/* @__PURE__ */ import_react10.default.createElement("i", { className: "fa fa-question-circle" })
|
3082
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
3042
3083
|
"span",
|
3043
3084
|
{
|
3044
3085
|
id: "ZIPCode-error",
|
3045
3086
|
style: { color: "red", display: "none" }
|
3046
3087
|
},
|
3047
3088
|
ErrorText.fieldrequired
|
3048
|
-
))), /* @__PURE__ */
|
3089
|
+
))), /* @__PURE__ */ import_react10.default.createElement("div", { className: "form-group top-amnt" }, /* @__PURE__ */ import_react10.default.createElement("div", null, /* @__PURE__ */ import_react10.default.createElement("label", null, "Payment amount"), /* @__PURE__ */ import_react10.default.createElement("div", { className: "amount-placeholder" }, /* @__PURE__ */ import_react10.default.createElement(
|
3049
3090
|
"input",
|
3050
3091
|
{
|
3051
3092
|
id: "Amount",
|
@@ -3057,7 +3098,7 @@ function Payment() {
|
|
3057
3098
|
onChange: (e) => handleAmount(e),
|
3058
3099
|
onBlur: handleAmountBlur
|
3059
3100
|
}
|
3060
|
-
))), /* @__PURE__ */
|
3101
|
+
))), /* @__PURE__ */ import_react10.default.createElement("div", { className: "card-row" }, /* @__PURE__ */ import_react10.default.createElement("span", { className: "visa" }), /* @__PURE__ */ import_react10.default.createElement("span", { className: "mastercard" }), /* @__PURE__ */ import_react10.default.createElement("span", { className: "amex" }), /* @__PURE__ */ import_react10.default.createElement("span", { className: "discover" }))), /* @__PURE__ */ import_react10.default.createElement(
|
3061
3102
|
"button",
|
3062
3103
|
{
|
3063
3104
|
type: "button",
|
@@ -3066,7 +3107,7 @@ function Payment() {
|
|
3066
3107
|
className: "btn btn-block btn-success submit-button"
|
3067
3108
|
},
|
3068
3109
|
"Pay"
|
3069
|
-
)), /* @__PURE__ */
|
3110
|
+
)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ import_react10.default.createElement(
|
3070
3111
|
"svg",
|
3071
3112
|
{
|
3072
3113
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3074,14 +3115,14 @@ function Payment() {
|
|
3074
3115
|
height: "20",
|
3075
3116
|
viewBox: "0 0 26 26"
|
3076
3117
|
},
|
3077
|
-
/* @__PURE__ */
|
3118
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
3078
3119
|
"path",
|
3079
3120
|
{
|
3080
3121
|
fill: "currentColor",
|
3081
3122
|
d: "M23.633 5.028a1.074 1.074 0 0 0-.777-.366c-2.295-.06-5.199-2.514-7.119-3.477C14.551.592 13.768.201 13.18.098a1.225 1.225 0 0 0-.36.001c-.588.103-1.371.494-2.556 1.087c-1.92.962-4.824 3.416-7.119 3.476a1.08 1.08 0 0 0-.778.366a1.167 1.167 0 0 0-.291.834c.493 10.023 4.088 16.226 10.396 19.831c.164.093.346.141.527.141s.363-.048.528-.141c6.308-3.605 9.902-9.808 10.396-19.831a1.161 1.161 0 0 0-.29-.834zM18.617 8.97l-5.323 7.855c-.191.282-.491.469-.788.469c-.298 0-.629-.163-.838-.372l-3.752-3.753a.656.656 0 0 1 0-.926l.927-.929a.658.658 0 0 1 .926 0l2.44 2.44l4.239-6.257a.657.657 0 0 1 .91-.173l1.085.736a.657.657 0 0 1 .174.91z"
|
3082
3123
|
}
|
3083
3124
|
)
|
3084
|
-
), "Secure payments powered by Fractal", /* @__PURE__ */
|
3125
|
+
), "Secure payments powered by Fractal", /* @__PURE__ */ import_react10.default.createElement(
|
3085
3126
|
"img",
|
3086
3127
|
{
|
3087
3128
|
src: "https://ui.fractalpay.com/favicon.ico",
|
@@ -3093,28 +3134,22 @@ function Payment() {
|
|
3093
3134
|
}
|
3094
3135
|
|
3095
3136
|
// src/app/components/Transaction/CompletedTransactions.tsx
|
3096
|
-
|
3097
|
-
|
3098
|
-
|
3099
|
-
|
3100
|
-
|
3101
|
-
|
3102
|
-
TableBody,
|
3103
|
-
TableHeader
|
3104
|
-
} from "react-bs-datatable";
|
3105
|
-
import DatePicker from "react-datepicker";
|
3106
|
-
import "react-datepicker/dist/react-datepicker.css";
|
3107
|
-
import { toast as toast4 } from "react-toastify";
|
3137
|
+
var import_react12 = __toESM(require("react"));
|
3138
|
+
var import_react_bootstrap7 = require("react-bootstrap");
|
3139
|
+
var import_react_bs_datatable = require("react-bs-datatable");
|
3140
|
+
var import_react_datepicker = __toESM(require("react-datepicker"));
|
3141
|
+
var import_react_datepicker2 = require("react-datepicker/dist/react-datepicker.css");
|
3142
|
+
var import_react_toastify4 = require("react-toastify");
|
3108
3143
|
|
3109
3144
|
// src/app/components/Pagination/Pagination.tsx
|
3110
|
-
|
3145
|
+
var import_react11 = __toESM(require("react"));
|
3111
3146
|
function PaginationPg({ totalPages, onPageChange, current }) {
|
3112
|
-
const [currentPage, setCurrentPage] =
|
3113
|
-
const [showPages, setShowPages] =
|
3114
|
-
|
3147
|
+
const [currentPage, setCurrentPage] = (0, import_react11.useState)(current);
|
3148
|
+
const [showPages, setShowPages] = (0, import_react11.useState)(false);
|
3149
|
+
(0, import_react11.useEffect)(() => {
|
3115
3150
|
setCurrentPage(current);
|
3116
3151
|
}, [current]);
|
3117
|
-
|
3152
|
+
(0, import_react11.useEffect)(() => {
|
3118
3153
|
setTimeout(() => {
|
3119
3154
|
setShowPages(true);
|
3120
3155
|
}, 1e3);
|
@@ -3150,7 +3185,7 @@ function PaginationPg({ totalPages, onPageChange, current }) {
|
|
3150
3185
|
if (currentPage > 3) {
|
3151
3186
|
pageNumbers.push(renderPageNumber(1));
|
3152
3187
|
if (currentPage > 4) {
|
3153
|
-
pageNumbers.push(/* @__PURE__ */
|
3188
|
+
pageNumbers.push(/* @__PURE__ */ import_react11.default.createElement("li", { key: "start-break", className: "page-item disabled" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "page-link" }, "...")));
|
3154
3189
|
}
|
3155
3190
|
}
|
3156
3191
|
const startPage = Math.max(currentPage - 1, 1);
|
@@ -3160,15 +3195,15 @@ function PaginationPg({ totalPages, onPageChange, current }) {
|
|
3160
3195
|
}
|
3161
3196
|
if (currentPage < totalPages - 2) {
|
3162
3197
|
if (currentPage < totalPages - 3) {
|
3163
|
-
pageNumbers.push(/* @__PURE__ */
|
3198
|
+
pageNumbers.push(/* @__PURE__ */ import_react11.default.createElement("li", { key: "end-break", className: "page-item disabled" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "page-link" }, "...")));
|
3164
3199
|
}
|
3165
3200
|
pageNumbers.push(renderPageNumber(totalPages));
|
3166
3201
|
}
|
3167
3202
|
}
|
3168
3203
|
return pageNumbers;
|
3169
3204
|
};
|
3170
|
-
const renderPageNumber = (pageNumber) => /* @__PURE__ */
|
3171
|
-
return /* @__PURE__ */
|
3205
|
+
const renderPageNumber = (pageNumber) => /* @__PURE__ */ import_react11.default.createElement("li", { key: pageNumber, className: `page-item ${currentPage === pageNumber ? "active" : ""}` }, /* @__PURE__ */ import_react11.default.createElement("a", { className: "page-link cursor-pointer", onClick: (e) => handlePageClick(e, pageNumber) }, pageNumber));
|
3206
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("nav", { className: "app-pagination py-2" }, /* @__PURE__ */ import_react11.default.createElement("ul", { className: "pagination justify-content-center" }, /* @__PURE__ */ import_react11.default.createElement("li", { className: `page-item ${currentPage === 1 ? "disabled" : ""}` }, /* @__PURE__ */ import_react11.default.createElement("a", { className: "page-link cursor-pointer", onClick: handlePrevious }, /* @__PURE__ */ import_react11.default.createElement("span", null, "\u2B9C"))), showPages && getPageNumbers(), /* @__PURE__ */ import_react11.default.createElement("li", { className: `page-item ${currentPage === totalPages ? "disabled" : ""}` }, /* @__PURE__ */ import_react11.default.createElement("a", { className: "page-link cursor-pointer", onClick: handleNext }, /* @__PURE__ */ import_react11.default.createElement("span", null, "\u2B9E"))))));
|
3172
3207
|
}
|
3173
3208
|
|
3174
3209
|
// src/app/components/Transaction/CompletedTransactions.tsx
|
@@ -3206,10 +3241,10 @@ var STORY_HEADERS = [
|
|
3206
3241
|
}
|
3207
3242
|
];
|
3208
3243
|
function CompletedTransactions(props) {
|
3209
|
-
const [dataList, setDataList] =
|
3210
|
-
const [startDate, setStartDate] =
|
3211
|
-
const [endDate, setEndDate] =
|
3212
|
-
const [state, setState] =
|
3244
|
+
const [dataList, setDataList] = (0, import_react12.useState)([]);
|
3245
|
+
const [startDate, setStartDate] = (0, import_react12.useState)(null);
|
3246
|
+
const [endDate, setEndDate] = (0, import_react12.useState)(null);
|
3247
|
+
const [state, setState] = (0, import_react12.useState)({
|
3213
3248
|
page: 1,
|
3214
3249
|
totalPage: 0,
|
3215
3250
|
data: [],
|
@@ -3297,9 +3332,9 @@ function CompletedTransactions(props) {
|
|
3297
3332
|
};
|
3298
3333
|
const handleExport = async () => {
|
3299
3334
|
if (!startDate) {
|
3300
|
-
|
3335
|
+
import_react_toastify4.toast.error("Start date required");
|
3301
3336
|
} else if (!endDate) {
|
3302
|
-
|
3337
|
+
import_react_toastify4.toast.error("End date required");
|
3303
3338
|
} else {
|
3304
3339
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { csvData: true }));
|
3305
3340
|
try {
|
@@ -3332,19 +3367,19 @@ function CompletedTransactions(props) {
|
|
3332
3367
|
}
|
3333
3368
|
}
|
3334
3369
|
};
|
3335
|
-
|
3370
|
+
(0, import_react12.useEffect)(() => {
|
3336
3371
|
fetchData(state.page, startDate, endDate);
|
3337
3372
|
}, [state.page]);
|
3338
3373
|
const handlePageChange = (pageNumber) => {
|
3339
3374
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { page: pageNumber }));
|
3340
3375
|
fetchData(pageNumber, startDate, endDate);
|
3341
3376
|
};
|
3342
|
-
return /* @__PURE__ */
|
3377
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement("style", null, `
|
3343
3378
|
.react-datepicker-wrapper:first-child {
|
3344
3379
|
margin-right: 10px;
|
3345
3380
|
}
|
3346
|
-
`), /* @__PURE__ */
|
3347
|
-
|
3381
|
+
`), /* @__PURE__ */ import_react12.default.createElement("div", { className: "mb-5" }, /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ import_react12.default.createElement("div", { style: { display: "flex", marginRight: "10px", marginTop: "25px" } }, /* @__PURE__ */ import_react12.default.createElement(
|
3382
|
+
import_react_datepicker.default,
|
3348
3383
|
{
|
3349
3384
|
selected: startDate,
|
3350
3385
|
onChange: handleStartDateChange,
|
@@ -3354,8 +3389,8 @@ function CompletedTransactions(props) {
|
|
3354
3389
|
placeholderText: "Start Date",
|
3355
3390
|
required: true
|
3356
3391
|
}
|
3357
|
-
), /* @__PURE__ */
|
3358
|
-
|
3392
|
+
), /* @__PURE__ */ import_react12.default.createElement(
|
3393
|
+
import_react_datepicker.default,
|
3359
3394
|
{
|
3360
3395
|
selected: endDate,
|
3361
3396
|
onChange: handleEndDateChange,
|
@@ -3365,8 +3400,8 @@ function CompletedTransactions(props) {
|
|
3365
3400
|
minDate: startDate,
|
3366
3401
|
placeholderText: "End Date"
|
3367
3402
|
}
|
3368
|
-
)), /* @__PURE__ */
|
3369
|
-
DatatableWrapper,
|
3403
|
+
)), /* @__PURE__ */ import_react12.default.createElement("button", { className: "export-btn1", onClick: handleExport }, "Export")), /* @__PURE__ */ import_react12.default.createElement(
|
3404
|
+
import_react_bs_datatable.DatatableWrapper,
|
3370
3405
|
{
|
3371
3406
|
body: dataList,
|
3372
3407
|
headers: STORY_HEADERS,
|
@@ -3377,21 +3412,21 @@ function CompletedTransactions(props) {
|
|
3377
3412
|
}
|
3378
3413
|
}
|
3379
3414
|
},
|
3380
|
-
/* @__PURE__ */
|
3381
|
-
/* @__PURE__ */
|
3382
|
-
/* @__PURE__ */
|
3415
|
+
/* @__PURE__ */ import_react12.default.createElement(import_react_bootstrap7.Row, { className: "mb-4 p-2" }, /* @__PURE__ */ import_react12.default.createElement(import_react_bootstrap7.Col, { xs: 12, sm: 6, lg: 4, className: "d-flex flex-col justify-content-lg-start align-items-center justify-content-sm-start mb-2 mb-sm-0" }, /* @__PURE__ */ import_react12.default.createElement(import_react_bs_datatable.PaginationOptions, null)), /* @__PURE__ */ import_react12.default.createElement(import_react_bootstrap7.Col, { xs: 12, lg: 4, className: "d-flex flex-col justify-content-end align-items-end" }), /* @__PURE__ */ import_react12.default.createElement(import_react_bootstrap7.Col, { xs: 12, sm: 6, lg: 4, className: "d-flex flex-col justify-content-end align-items-end" }, /* @__PURE__ */ import_react12.default.createElement(import_react_bs_datatable.Filter, null))),
|
3416
|
+
/* @__PURE__ */ import_react12.default.createElement(import_react_bootstrap7.Row, null, /* @__PURE__ */ import_react12.default.createElement("div", { className: "responsive-tbl" }, /* @__PURE__ */ import_react12.default.createElement(import_react_bootstrap7.Table, null, /* @__PURE__ */ import_react12.default.createElement(import_react_bs_datatable.TableHeader, null), /* @__PURE__ */ import_react12.default.createElement(import_react_bs_datatable.TableBody, null)))),
|
3417
|
+
/* @__PURE__ */ import_react12.default.createElement(PaginationPg, { totalPages: state.totalPage, onPageChange: handlePageChange, current: state.page })
|
3383
3418
|
))));
|
3384
3419
|
}
|
3385
3420
|
|
3386
3421
|
// src/app/components/Payment/TockenizPay.tsx
|
3387
|
-
|
3388
|
-
|
3389
|
-
|
3390
|
-
|
3391
|
-
|
3392
|
-
|
3422
|
+
var import_react13 = __toESM(require("react"));
|
3423
|
+
var import_react_bootstrap8 = require("react-bootstrap");
|
3424
|
+
var import_react_toastify5 = require("react-toastify");
|
3425
|
+
var import_axios3 = __toESM(require("axios"));
|
3426
|
+
var import_node_forge2 = __toESM(require("node-forge"));
|
3427
|
+
var import_credit_card_type = __toESM(require("credit-card-type"));
|
3393
3428
|
function TockenizPay() {
|
3394
|
-
const [state, setState] =
|
3429
|
+
const [state, setState] = (0, import_react13.useState)({
|
3395
3430
|
show: false,
|
3396
3431
|
publicKey: "",
|
3397
3432
|
sessionKey: "",
|
@@ -3402,13 +3437,13 @@ function TockenizPay() {
|
|
3402
3437
|
zip: "",
|
3403
3438
|
amount: ""
|
3404
3439
|
});
|
3405
|
-
const [cardTypeDetail, setCardTypeDetail] =
|
3406
|
-
const [isValid, setIsValid] =
|
3407
|
-
const [isValidMonth, setIsValidMonth] =
|
3408
|
-
const [data, setData] =
|
3440
|
+
const [cardTypeDetail, setCardTypeDetail] = (0, import_react13.useState)(null);
|
3441
|
+
const [isValid, setIsValid] = (0, import_react13.useState)(false);
|
3442
|
+
const [isValidMonth, setIsValidMonth] = (0, import_react13.useState)(false);
|
3443
|
+
const [data, setData] = (0, import_react13.useState)(null);
|
3409
3444
|
const handlePaymentClick = async () => {
|
3410
3445
|
try {
|
3411
|
-
const response = await
|
3446
|
+
const response = await import_axios3.default.post(`${baseUrl}/generate-session`, {});
|
3412
3447
|
const data2 = response.data;
|
3413
3448
|
if (data2 && (data2 == null ? void 0 : data2.result) === true) {
|
3414
3449
|
setState((prev) => {
|
@@ -3427,14 +3462,14 @@ function TockenizPay() {
|
|
3427
3462
|
const handleSubmitPay = async () => {
|
3428
3463
|
var _a, _b, _c, _d, _e;
|
3429
3464
|
let track2_data = `${(_a = state == null ? void 0 : state.cardNumber) == null ? void 0 : _a.replaceAll(" ", "")}=${state.year}${((_b = state == null ? void 0 : state.month) == null ? void 0 : _b.length) > 1 ? state == null ? void 0 : state.month : "0" + (state == null ? void 0 : state.month)} ${state.cvv}`;
|
3430
|
-
const publicKey =
|
3465
|
+
const publicKey = import_node_forge2.default.pki.publicKeyFromPem(state.publicKey);
|
3431
3466
|
const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
|
3432
|
-
md:
|
3467
|
+
md: import_node_forge2.default.md.sha1.create(),
|
3433
3468
|
mgf1: {
|
3434
|
-
md:
|
3469
|
+
md: import_node_forge2.default.md.sha1.create()
|
3435
3470
|
}
|
3436
3471
|
});
|
3437
|
-
const encryptedBase64 =
|
3472
|
+
const encryptedBase64 = import_node_forge2.default.util.encode64(encrypted);
|
3438
3473
|
console.log(encryptedBase64);
|
3439
3474
|
const requestBody = {
|
3440
3475
|
enc_track2_data: encryptedBase64,
|
@@ -3442,7 +3477,7 @@ function TockenizPay() {
|
|
3442
3477
|
algorithm: "RSAES_OAEP_SHA_1"
|
3443
3478
|
};
|
3444
3479
|
try {
|
3445
|
-
const response = await
|
3480
|
+
const response = await import_axios3.default.post(
|
3446
3481
|
"https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize",
|
3447
3482
|
requestBody,
|
3448
3483
|
{
|
@@ -3453,7 +3488,7 @@ function TockenizPay() {
|
|
3453
3488
|
}
|
3454
3489
|
);
|
3455
3490
|
if ((response == null ? void 0 : response.status) === 200) {
|
3456
|
-
|
3491
|
+
import_react_toastify5.toast.success("Payment Successful");
|
3457
3492
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
3458
3493
|
show: false,
|
3459
3494
|
publicKey: "",
|
@@ -3468,7 +3503,7 @@ function TockenizPay() {
|
|
3468
3503
|
}
|
3469
3504
|
console.log("response", response);
|
3470
3505
|
} catch (error) {
|
3471
|
-
|
3506
|
+
import_react_toastify5.toast.error((_e = (_d = (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.data) == null ? void 0 : _e.message);
|
3472
3507
|
console.error("Error:", error);
|
3473
3508
|
}
|
3474
3509
|
};
|
@@ -3500,9 +3535,9 @@ function TockenizPay() {
|
|
3500
3535
|
e.preventDefault();
|
3501
3536
|
e.stopPropagation();
|
3502
3537
|
const { value } = e.target;
|
3503
|
-
let cardtyp =
|
3538
|
+
let cardtyp = (0, import_credit_card_type.default)(value)[0];
|
3504
3539
|
const formattedValue = formatCreditCardNumber(value, cardtyp == null ? void 0 : cardtyp.type);
|
3505
|
-
setCardTypeDetail(
|
3540
|
+
setCardTypeDetail((0, import_credit_card_type.default)(value)[0]);
|
3506
3541
|
console.log(formattedValue);
|
3507
3542
|
if (value.match(/[a-zA-Z]/)) {
|
3508
3543
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -3604,7 +3639,7 @@ function TockenizPay() {
|
|
3604
3639
|
}
|
3605
3640
|
return "";
|
3606
3641
|
}
|
3607
|
-
return /* @__PURE__ */
|
3642
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement(import_react_toastify5.ToastContainer, null), /* @__PURE__ */ import_react13.default.createElement(
|
3608
3643
|
"button",
|
3609
3644
|
{
|
3610
3645
|
className: "export-btn mt-4",
|
@@ -3612,8 +3647,8 @@ function TockenizPay() {
|
|
3612
3647
|
onClick: () => handlePaymentClick()
|
3613
3648
|
},
|
3614
3649
|
"TokenizePay"
|
3615
|
-
), /* @__PURE__ */
|
3616
|
-
|
3650
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
3651
|
+
import_react_bootstrap8.Modal,
|
3617
3652
|
{
|
3618
3653
|
show: state.show,
|
3619
3654
|
onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -3621,8 +3656,8 @@ function TockenizPay() {
|
|
3621
3656
|
})),
|
3622
3657
|
centered: true
|
3623
3658
|
},
|
3624
|
-
/* @__PURE__ */
|
3625
|
-
/* @__PURE__ */
|
3659
|
+
/* @__PURE__ */ import_react13.default.createElement(import_react_bootstrap8.Modal.Header, { closeButton: true }),
|
3660
|
+
/* @__PURE__ */ import_react13.default.createElement(import_react_bootstrap8.Modal.Body, null, /* @__PURE__ */ import_react13.default.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "row" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react13.default.createElement("div", { id: "Checkout", className: "inline" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "header" }, /* @__PURE__ */ import_react13.default.createElement("h1", null, "Pay")), /* @__PURE__ */ import_react13.default.createElement("form", { id: "PaymentForm", className: "payment-form" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react13.default.createElement("label", null, "Name on card"), /* @__PURE__ */ import_react13.default.createElement(
|
3626
3661
|
"input",
|
3627
3662
|
{
|
3628
3663
|
id: "NameOnCard",
|
@@ -3631,13 +3666,13 @@ function TockenizPay() {
|
|
3631
3666
|
maxLength: 100,
|
3632
3667
|
placeholder: "Name"
|
3633
3668
|
}
|
3634
|
-
), /* @__PURE__ */
|
3669
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
3635
3670
|
"span",
|
3636
3671
|
{
|
3637
3672
|
id: "NameOnCard-error",
|
3638
3673
|
style: { color: "red", display: "none" }
|
3639
3674
|
}
|
3640
|
-
)), /* @__PURE__ */
|
3675
|
+
)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react13.default.createElement(
|
3641
3676
|
"input",
|
3642
3677
|
{
|
3643
3678
|
"data-token": "card_number",
|
@@ -3648,7 +3683,7 @@ function TockenizPay() {
|
|
3648
3683
|
placeholder: "0000 0000 0000 0000",
|
3649
3684
|
onChange: handleCardNumberChange
|
3650
3685
|
}
|
3651
|
-
), state.error && /* @__PURE__ */
|
3686
|
+
), state.error && /* @__PURE__ */ import_react13.default.createElement("div", { style: { color: "red" } }, state.error)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react13.default.createElement(
|
3652
3687
|
"input",
|
3653
3688
|
{
|
3654
3689
|
"data-token": "exp_month",
|
@@ -3659,14 +3694,14 @@ function TockenizPay() {
|
|
3659
3694
|
maxLength: 2,
|
3660
3695
|
onChange: (e) => handleMonthChange(e)
|
3661
3696
|
}
|
3662
|
-
), isValidMonth && /* @__PURE__ */
|
3697
|
+
), isValidMonth && /* @__PURE__ */ import_react13.default.createElement(
|
3663
3698
|
"span",
|
3664
3699
|
{
|
3665
3700
|
id: "card_number-error",
|
3666
3701
|
style: { color: "red", fontSize: "15px" }
|
3667
3702
|
},
|
3668
3703
|
"Please write month only 1 to 12"
|
3669
|
-
)), /* @__PURE__ */
|
3704
|
+
)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react13.default.createElement(
|
3670
3705
|
"input",
|
3671
3706
|
{
|
3672
3707
|
"data-token": "exp_year",
|
@@ -3677,7 +3712,7 @@ function TockenizPay() {
|
|
3677
3712
|
value: state.year,
|
3678
3713
|
onChange: (e) => handleYearChange(e)
|
3679
3714
|
}
|
3680
|
-
), state.yearError && /* @__PURE__ */
|
3715
|
+
), state.yearError && /* @__PURE__ */ import_react13.default.createElement("span", { id: "exp_year-error", style: { color: "red" } }, state.yearError)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "security-code-group form-group" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react13.default.createElement(
|
3681
3716
|
"input",
|
3682
3717
|
{
|
3683
3718
|
"data-token": "cvv",
|
@@ -3688,7 +3723,7 @@ function TockenizPay() {
|
|
3688
3723
|
placeholder: "CVV",
|
3689
3724
|
onChange: (e) => handleCVVChange(e)
|
3690
3725
|
}
|
3691
|
-
), /* @__PURE__ */
|
3726
|
+
), /* @__PURE__ */ import_react13.default.createElement("i", { id: "cvc", className: "fa fa-question-circle" }), state.cvvError && /* @__PURE__ */ import_react13.default.createElement("span", { id: "cvv-error", style: { color: "red" } }, state.cvvError)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "cvc-preview-container two-card hide" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "amex-cvc-preview" }), /* @__PURE__ */ import_react13.default.createElement("div", { className: "visa-mc-dis-cvc-preview" }))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "zip-code-group form-group" }, /* @__PURE__ */ import_react13.default.createElement("label", null, "Postal code"), /* @__PURE__ */ import_react13.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react13.default.createElement(
|
3692
3727
|
"input",
|
3693
3728
|
{
|
3694
3729
|
id: "ZIPCode",
|
@@ -3700,7 +3735,7 @@ function TockenizPay() {
|
|
3700
3735
|
value: state.zip,
|
3701
3736
|
onChange: (e) => handleZIP(e)
|
3702
3737
|
}
|
3703
|
-
), /* @__PURE__ */
|
3738
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
3704
3739
|
"a",
|
3705
3740
|
{
|
3706
3741
|
tabIndex: 0,
|
@@ -3710,15 +3745,15 @@ function TockenizPay() {
|
|
3710
3745
|
"data-placement": "left",
|
3711
3746
|
"data-content": "Enter the ZIP/Postal code for your credit card billing address."
|
3712
3747
|
},
|
3713
|
-
/* @__PURE__ */
|
3714
|
-
), /* @__PURE__ */
|
3748
|
+
/* @__PURE__ */ import_react13.default.createElement("i", { className: "fa fa-question-circle" })
|
3749
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
3715
3750
|
"span",
|
3716
3751
|
{
|
3717
3752
|
id: "ZIPCode-error",
|
3718
3753
|
style: { color: "red", display: "none" }
|
3719
3754
|
},
|
3720
3755
|
"This field is required"
|
3721
|
-
))), /* @__PURE__ */
|
3756
|
+
))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group top-amnt" }, /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement("label", null, "Payment amount"), /* @__PURE__ */ import_react13.default.createElement("div", { className: "amount-placeholder" }, /* @__PURE__ */ import_react13.default.createElement(
|
3722
3757
|
"input",
|
3723
3758
|
{
|
3724
3759
|
id: "Amount",
|
@@ -3730,7 +3765,7 @@ function TockenizPay() {
|
|
3730
3765
|
onChange: (e) => handleAmount(e),
|
3731
3766
|
onBlur: handleAmountBlur
|
3732
3767
|
}
|
3733
|
-
))), /* @__PURE__ */
|
3768
|
+
))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "card-row" }, /* @__PURE__ */ import_react13.default.createElement("span", { className: "visa" }), /* @__PURE__ */ import_react13.default.createElement("span", { className: "mastercard" }), /* @__PURE__ */ import_react13.default.createElement("span", { className: "amex" }), /* @__PURE__ */ import_react13.default.createElement("span", { className: "discover" }))), /* @__PURE__ */ import_react13.default.createElement(
|
3734
3769
|
"button",
|
3735
3770
|
{
|
3736
3771
|
type: "button",
|
@@ -3739,7 +3774,7 @@ function TockenizPay() {
|
|
3739
3774
|
className: "btn btn-block btn-success submit-button"
|
3740
3775
|
},
|
3741
3776
|
"Submit"
|
3742
|
-
)), /* @__PURE__ */
|
3777
|
+
)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ import_react13.default.createElement(
|
3743
3778
|
"svg",
|
3744
3779
|
{
|
3745
3780
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3747,14 +3782,14 @@ function TockenizPay() {
|
|
3747
3782
|
height: "20",
|
3748
3783
|
viewBox: "0 0 26 26"
|
3749
3784
|
},
|
3750
|
-
/* @__PURE__ */
|
3785
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
3751
3786
|
"path",
|
3752
3787
|
{
|
3753
3788
|
fill: "currentColor",
|
3754
3789
|
d: "M23.633 5.028a1.074 1.074 0 0 0-.777-.366c-2.295-.06-5.199-2.514-7.119-3.477C14.551.592 13.768.201 13.18.098a1.225 1.225 0 0 0-.36.001c-.588.103-1.371.494-2.556 1.087c-1.92.962-4.824 3.416-7.119 3.476a1.08 1.08 0 0 0-.778.366a1.167 1.167 0 0 0-.291.834c.493 10.023 4.088 16.226 10.396 19.831c.164.093.346.141.527.141s.363-.048.528-.141c6.308-3.605 9.902-9.808 10.396-19.831a1.161 1.161 0 0 0-.29-.834zM18.617 8.97l-5.323 7.855c-.191.282-.491.469-.788.469c-.298 0-.629-.163-.838-.372l-3.752-3.753a.656.656 0 0 1 0-.926l.927-.929a.658.658 0 0 1 .926 0l2.44 2.44l4.239-6.257a.657.657 0 0 1 .91-.173l1.085.736a.657.657 0 0 1 .174.91z"
|
3755
3790
|
}
|
3756
3791
|
)
|
3757
|
-
), "Secure payments powered by Fractal", /* @__PURE__ */
|
3792
|
+
), "Secure payments powered by Fractal", /* @__PURE__ */ import_react13.default.createElement(
|
3758
3793
|
"img",
|
3759
3794
|
{
|
3760
3795
|
src: "https://ui.fractalpay.com/favicon.ico",
|
@@ -3766,25 +3801,25 @@ function TockenizPay() {
|
|
3766
3801
|
}
|
3767
3802
|
|
3768
3803
|
// src/app/components/Payment/GetPaymentDynamic.tsx
|
3769
|
-
|
3770
|
-
|
3804
|
+
var import_react15 = __toESM(require("react"));
|
3805
|
+
var import_react_bootstrap9 = require("react-bootstrap");
|
3771
3806
|
|
3772
3807
|
// src/app/components/Loader/MyLoadingAnimation.tsx
|
3773
|
-
|
3808
|
+
var import_react14 = __toESM(require("react"));
|
3774
3809
|
function MyLoadingAnimation() {
|
3775
|
-
return /* @__PURE__ */
|
3810
|
+
return /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, /* @__PURE__ */ import_react14.default.createElement(LoaderStyle_default, null), /* @__PURE__ */ import_react14.default.createElement("div", { className: "loading-animation" }, /* @__PURE__ */ import_react14.default.createElement("div", { className: "spinner" })));
|
3776
3811
|
}
|
3777
3812
|
|
3778
3813
|
// src/app/components/Payment/GetPaymentDynamic.tsx
|
3779
3814
|
function GetPaymentDynamic(props) {
|
3780
3815
|
const { amount, fractalpayClientKey, orderID } = props;
|
3781
|
-
const [loading, setLoading] =
|
3782
|
-
const [show, setShow] =
|
3783
|
-
const [iframeLoaded, setIframeLoaded] =
|
3784
|
-
const [phoneNumber, setPhoneNumber] =
|
3785
|
-
const [errorMessage, setErrorMessage] =
|
3786
|
-
const [submitClicked, setSubmitClicked] =
|
3787
|
-
const [isValidNumber, setIsValidNumber] =
|
3816
|
+
const [loading, setLoading] = (0, import_react15.useState)(false);
|
3817
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
3818
|
+
const [iframeLoaded, setIframeLoaded] = (0, import_react15.useState)(false);
|
3819
|
+
const [phoneNumber, setPhoneNumber] = (0, import_react15.useState)("");
|
3820
|
+
const [errorMessage, setErrorMessage] = (0, import_react15.useState)("");
|
3821
|
+
const [submitClicked, setSubmitClicked] = (0, import_react15.useState)(false);
|
3822
|
+
const [isValidNumber, setIsValidNumber] = (0, import_react15.useState)(true);
|
3788
3823
|
const handleClose = () => {
|
3789
3824
|
setIframeLoaded(false);
|
3790
3825
|
setTimeout(() => {
|
@@ -3799,7 +3834,7 @@ function GetPaymentDynamic(props) {
|
|
3799
3834
|
console.error("Fractalpay client key is missing or empty.");
|
3800
3835
|
}
|
3801
3836
|
};
|
3802
|
-
|
3837
|
+
(0, import_react15.useEffect)(() => {
|
3803
3838
|
if (!fractalpayClientKey) {
|
3804
3839
|
console.error("Fractalpay client key is missing or empty.");
|
3805
3840
|
}
|
@@ -3822,7 +3857,7 @@ function GetPaymentDynamic(props) {
|
|
3822
3857
|
const handleLoad = () => {
|
3823
3858
|
setLoading(false);
|
3824
3859
|
};
|
3825
|
-
|
3860
|
+
(0, import_react15.useEffect)(() => {
|
3826
3861
|
const messageListener = (event) => {
|
3827
3862
|
var _a, _b;
|
3828
3863
|
const response = (_b = (_a = event == null ? void 0 : event.data) == null ? void 0 : _a.other) == null ? void 0 : _b.data;
|
@@ -3837,7 +3872,7 @@ function GetPaymentDynamic(props) {
|
|
3837
3872
|
window.removeEventListener("message", messageListener);
|
3838
3873
|
};
|
3839
3874
|
}, []);
|
3840
|
-
return /* @__PURE__ */
|
3875
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", null, /* @__PURE__ */ import_react15.default.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Pay"), /* @__PURE__ */ import_react15.default.createElement(import_react_bootstrap9.Modal, { show: show && iframeLoaded, id: "modal-pay", className: "modal-lg", onHide: handleClose }, /* @__PURE__ */ import_react15.default.createElement(import_react_bootstrap9.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react15.default.createElement(import_react_bootstrap9.Modal.Body, null, loading && /* @__PURE__ */ import_react15.default.createElement(MyLoadingAnimation, null), /* @__PURE__ */ import_react15.default.createElement(
|
3841
3876
|
"iframe",
|
3842
3877
|
{
|
3843
3878
|
src: `${baseUrl}widget-form/${amount}?fractalpay_public_key=${fractalpayClientKey}&order_id=${orderID}`,
|
@@ -3848,7 +3883,8 @@ function GetPaymentDynamic(props) {
|
|
3848
3883
|
}
|
3849
3884
|
))));
|
3850
3885
|
}
|
3851
|
-
export
|
3886
|
+
// Annotate the CommonJS export names for ESM import in node:
|
3887
|
+
0 && (module.exports = {
|
3852
3888
|
CompletedTransactions,
|
3853
3889
|
GetPaymentDynamic,
|
3854
3890
|
Payment,
|
@@ -3858,4 +3894,4 @@ export {
|
|
3858
3894
|
RequestPaymentonClick,
|
3859
3895
|
RqstPaymntInputField,
|
3860
3896
|
TockenizPay
|
3861
|
-
};
|
3897
|
+
});
|