@pinerohit11/testwidget 0.1.49 → 0.1.51
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +274 -241
- package/dist/{index.cjs → index.mjs} +238 -277
- 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,9 +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
|
-
|
1531
|
-
const [
|
1532
|
-
const [show, setShow] = useState3(false);
|
1571
|
+
const [isLoading, setIsLoading] = (0, import_react6.useState)(false);
|
1572
|
+
const [show, setShow] = (0, import_react6.useState)(false);
|
1533
1573
|
const handleClose = () => setShow(false);
|
1534
1574
|
const handleShow = () => setShow(true);
|
1535
1575
|
const sendRequestPayment = () => {
|
@@ -1552,7 +1592,7 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1552
1592
|
console.error("Error:", error);
|
1553
1593
|
});
|
1554
1594
|
};
|
1555
|
-
return /* @__PURE__ */
|
1595
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, /* @__PURE__ */ import_react6.default.createElement(
|
1556
1596
|
"button",
|
1557
1597
|
{
|
1558
1598
|
onClick: sendRequestPayment,
|
@@ -1560,7 +1600,7 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1560
1600
|
className: "paymentBtn"
|
1561
1601
|
},
|
1562
1602
|
isLoading ? "Loading..." : "Request Payment"
|
1563
|
-
), /* @__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(
|
1564
1604
|
"svg",
|
1565
1605
|
{
|
1566
1606
|
width: "60",
|
@@ -1569,7 +1609,7 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1569
1609
|
fill: "none",
|
1570
1610
|
xmlns: "http://www.w3.org/2000/svg"
|
1571
1611
|
},
|
1572
|
-
/* @__PURE__ */
|
1612
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
1573
1613
|
"rect",
|
1574
1614
|
{
|
1575
1615
|
x: "0.5",
|
@@ -1580,14 +1620,14 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1580
1620
|
stroke: "#31B379"
|
1581
1621
|
}
|
1582
1622
|
),
|
1583
|
-
/* @__PURE__ */
|
1623
|
+
/* @__PURE__ */ import_react6.default.createElement("g", { "clip-path": "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react6.default.createElement(
|
1584
1624
|
"path",
|
1585
1625
|
{
|
1586
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",
|
1587
1627
|
fill: "#31B379"
|
1588
1628
|
}
|
1589
1629
|
)),
|
1590
|
-
/* @__PURE__ */
|
1630
|
+
/* @__PURE__ */ import_react6.default.createElement("defs", null, /* @__PURE__ */ import_react6.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react6.default.createElement(
|
1591
1631
|
"rect",
|
1592
1632
|
{
|
1593
1633
|
width: "22",
|
@@ -1596,15 +1636,15 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1596
1636
|
transform: "translate(19.5 19.0039)"
|
1597
1637
|
}
|
1598
1638
|
)))
|
1599
|
-
), /* @__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"))));
|
1600
1640
|
}
|
1601
1641
|
|
1602
1642
|
// src/app/components/RequestPayment/RequestPaymentonClick.tsx
|
1603
|
-
|
1604
|
-
|
1643
|
+
var import_react7 = __toESM(require("react"));
|
1644
|
+
var import_react_bootstrap4 = require("react-bootstrap");
|
1605
1645
|
function RequestPaymentonClick(props) {
|
1606
|
-
const [isLoading, setIsLoading] =
|
1607
|
-
const [show, setShow] =
|
1646
|
+
const [isLoading, setIsLoading] = (0, import_react7.useState)(false);
|
1647
|
+
const [show, setShow] = (0, import_react7.useState)(false);
|
1608
1648
|
const handleClose = () => setShow(false);
|
1609
1649
|
const handleShow = () => setShow(true);
|
1610
1650
|
const { fractalpayClientKey, amount, phone_number, orderID, onSuccess, onError } = props;
|
@@ -1638,7 +1678,7 @@ function RequestPaymentonClick(props) {
|
|
1638
1678
|
console.error("Error:", error);
|
1639
1679
|
});
|
1640
1680
|
};
|
1641
|
-
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(
|
1642
1682
|
"button",
|
1643
1683
|
{
|
1644
1684
|
onClick: sendRequestPayment,
|
@@ -1646,7 +1686,7 @@ function RequestPaymentonClick(props) {
|
|
1646
1686
|
className: "paymentBtn"
|
1647
1687
|
},
|
1648
1688
|
isLoading ? "Loading..." : "Request Payment"
|
1649
|
-
), /* @__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(
|
1650
1690
|
"svg",
|
1651
1691
|
{
|
1652
1692
|
width: "60",
|
@@ -1655,7 +1695,7 @@ function RequestPaymentonClick(props) {
|
|
1655
1695
|
fill: "none",
|
1656
1696
|
xmlns: "http://www.w3.org/2000/svg"
|
1657
1697
|
},
|
1658
|
-
/* @__PURE__ */
|
1698
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
1659
1699
|
"rect",
|
1660
1700
|
{
|
1661
1701
|
x: "0.5",
|
@@ -1666,14 +1706,14 @@ function RequestPaymentonClick(props) {
|
|
1666
1706
|
stroke: "#31B379"
|
1667
1707
|
}
|
1668
1708
|
),
|
1669
|
-
/* @__PURE__ */
|
1709
|
+
/* @__PURE__ */ import_react7.default.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react7.default.createElement(
|
1670
1710
|
"path",
|
1671
1711
|
{
|
1672
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",
|
1673
1713
|
fill: "#31B379"
|
1674
1714
|
}
|
1675
1715
|
)),
|
1676
|
-
/* @__PURE__ */
|
1716
|
+
/* @__PURE__ */ import_react7.default.createElement("defs", null, /* @__PURE__ */ import_react7.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react7.default.createElement(
|
1677
1717
|
"rect",
|
1678
1718
|
{
|
1679
1719
|
width: "22",
|
@@ -1682,21 +1722,21 @@ function RequestPaymentonClick(props) {
|
|
1682
1722
|
transform: "translate(19.5 19.0039)"
|
1683
1723
|
}
|
1684
1724
|
)))
|
1685
|
-
), 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"))));
|
1686
1726
|
}
|
1687
1727
|
|
1688
1728
|
// src/app/components/RequestPayment/RqstPaymntInputField.tsx
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
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");
|
1693
1733
|
function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
1694
|
-
const [isLoading, setIsLoading] =
|
1695
|
-
const [show, setShow] =
|
1696
|
-
const [phoneNumber, setPhoneNumber] =
|
1697
|
-
const [isValidNumber, setIsValidNumber] =
|
1698
|
-
const [errorMessage, setErrorMessage] =
|
1699
|
-
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);
|
1700
1740
|
const handleClose = () => setShow(false);
|
1701
1741
|
const handleShow = () => setShow(true);
|
1702
1742
|
const sendRequestPayment = () => {
|
@@ -1741,7 +1781,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1741
1781
|
}).catch((error) => {
|
1742
1782
|
setIsLoading(false);
|
1743
1783
|
console.error("Error:", error);
|
1744
|
-
|
1784
|
+
import_react_toastify2.toast.error(ErrorText.anerroroccured);
|
1745
1785
|
});
|
1746
1786
|
};
|
1747
1787
|
const handlePhoneNumberChange = (e) => {
|
@@ -1759,7 +1799,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1759
1799
|
setErrorMessage(ErrorText.phonenumbervalid);
|
1760
1800
|
}
|
1761
1801
|
};
|
1762
|
-
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(
|
1763
1803
|
"input",
|
1764
1804
|
{
|
1765
1805
|
type: "text",
|
@@ -1769,7 +1809,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1769
1809
|
maxLength: 10,
|
1770
1810
|
className: submitClicked && (!phoneNumber || !isValidNumber) ? "error" : ""
|
1771
1811
|
}
|
1772
|
-
), 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(
|
1773
1813
|
"button",
|
1774
1814
|
{
|
1775
1815
|
onClick: sendRequestPayment,
|
@@ -1777,7 +1817,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1777
1817
|
className: "paymentBtn"
|
1778
1818
|
},
|
1779
1819
|
isLoading ? "Loading..." : "Request Payment"
|
1780
|
-
))), /* @__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(
|
1781
1821
|
"svg",
|
1782
1822
|
{
|
1783
1823
|
width: "60",
|
@@ -1786,7 +1826,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1786
1826
|
fill: "none",
|
1787
1827
|
xmlns: "http://www.w3.org/2000/svg"
|
1788
1828
|
},
|
1789
|
-
/* @__PURE__ */
|
1829
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
1790
1830
|
"rect",
|
1791
1831
|
{
|
1792
1832
|
x: "0.5",
|
@@ -1797,14 +1837,14 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1797
1837
|
stroke: "#31B379"
|
1798
1838
|
}
|
1799
1839
|
),
|
1800
|
-
/* @__PURE__ */
|
1840
|
+
/* @__PURE__ */ import_react8.default.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react8.default.createElement(
|
1801
1841
|
"path",
|
1802
1842
|
{
|
1803
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",
|
1804
1844
|
fill: "#31B379"
|
1805
1845
|
}
|
1806
1846
|
)),
|
1807
|
-
/* @__PURE__ */
|
1847
|
+
/* @__PURE__ */ import_react8.default.createElement("defs", null, /* @__PURE__ */ import_react8.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react8.default.createElement(
|
1808
1848
|
"rect",
|
1809
1849
|
{
|
1810
1850
|
width: "22",
|
@@ -1813,20 +1853,20 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1813
1853
|
transform: "translate(19.5 19.0039)"
|
1814
1854
|
}
|
1815
1855
|
)))
|
1816
|
-
), /* @__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));
|
1817
1857
|
}
|
1818
1858
|
|
1819
1859
|
// src/app/components/Payment/Payment.tsx
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
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");
|
1825
1865
|
|
1826
1866
|
// src/app/components/Payment/Paymentstyles.tsx
|
1827
|
-
|
1867
|
+
var import_react9 = __toESM(require("react"));
|
1828
1868
|
function Paymentstyles() {
|
1829
|
-
return /* @__PURE__ */
|
1869
|
+
return /* @__PURE__ */ import_react9.default.createElement("style", null, `
|
1830
1870
|
.paymentBtn {
|
1831
1871
|
background-color: black;
|
1832
1872
|
border: none;
|
@@ -2752,7 +2792,7 @@ input {
|
|
2752
2792
|
// src/app/components/Payment/Payment.tsx
|
2753
2793
|
function Payment() {
|
2754
2794
|
var _a;
|
2755
|
-
const [state, setState] =
|
2795
|
+
const [state, setState] = (0, import_react10.useState)({
|
2756
2796
|
show: false,
|
2757
2797
|
publicKey: "",
|
2758
2798
|
sessionKey: "",
|
@@ -2763,12 +2803,12 @@ function Payment() {
|
|
2763
2803
|
zip: "",
|
2764
2804
|
amount: ""
|
2765
2805
|
});
|
2766
|
-
const [isValid, setIsValid] =
|
2767
|
-
const [isValidMonth, setIsValidMonth] =
|
2768
|
-
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);
|
2769
2809
|
const handlePaymentClick = async () => {
|
2770
2810
|
try {
|
2771
|
-
const response = await
|
2811
|
+
const response = await import_axios2.default.post(`${baseUrl}generate-session`, {});
|
2772
2812
|
const data2 = response.data;
|
2773
2813
|
if (data2 && (data2 == null ? void 0 : data2.result) === true) {
|
2774
2814
|
setState((prev) => {
|
@@ -2786,12 +2826,12 @@ function Payment() {
|
|
2786
2826
|
};
|
2787
2827
|
const handleSubmitPay = async () => {
|
2788
2828
|
const track2_data = `${state.cardNumber.replace(/\s+/g, "")}=${state.year}${state.month.length > 1 ? state.month : "0" + state.month} ${state.cvv}`;
|
2789
|
-
const publicKey =
|
2829
|
+
const publicKey = import_node_forge.default.pki.publicKeyFromPem(state.publicKey);
|
2790
2830
|
const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
|
2791
|
-
md:
|
2792
|
-
mgf1: { md:
|
2831
|
+
md: import_node_forge.default.md.sha1.create(),
|
2832
|
+
mgf1: { md: import_node_forge.default.md.sha1.create() }
|
2793
2833
|
});
|
2794
|
-
const encryptedBase64 =
|
2834
|
+
const encryptedBase64 = import_node_forge.default.util.encode64(encrypted);
|
2795
2835
|
console.log(encryptedBase64);
|
2796
2836
|
const requestBody = {
|
2797
2837
|
enc_track2_data: encryptedBase64,
|
@@ -2800,14 +2840,14 @@ function Payment() {
|
|
2800
2840
|
};
|
2801
2841
|
const apiUrl = "https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize";
|
2802
2842
|
try {
|
2803
|
-
const response = await
|
2843
|
+
const response = await import_axios2.default.post(apiUrl, requestBody, {
|
2804
2844
|
headers: {
|
2805
2845
|
"x-app-session-key": state == null ? void 0 : state.sessionKey,
|
2806
2846
|
"Content-Type": "application/json"
|
2807
2847
|
}
|
2808
2848
|
});
|
2809
2849
|
if ((response == null ? void 0 : response.status) === 200) {
|
2810
|
-
|
2850
|
+
import_react_toastify3.toast.success("Payment Successful");
|
2811
2851
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
2812
2852
|
show: false,
|
2813
2853
|
publicKey: "",
|
@@ -2917,7 +2957,7 @@ function Payment() {
|
|
2917
2957
|
}
|
2918
2958
|
return "";
|
2919
2959
|
}
|
2920
|
-
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(
|
2921
2961
|
"button",
|
2922
2962
|
{
|
2923
2963
|
className: "export-btn",
|
@@ -2925,8 +2965,8 @@ function Payment() {
|
|
2925
2965
|
onClick: () => handlePaymentClick()
|
2926
2966
|
},
|
2927
2967
|
"Payment"
|
2928
|
-
), /* @__PURE__ */
|
2929
|
-
|
2968
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
2969
|
+
import_react_bootstrap6.Modal,
|
2930
2970
|
{
|
2931
2971
|
show: state.show,
|
2932
2972
|
onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -2934,8 +2974,8 @@ function Payment() {
|
|
2934
2974
|
})),
|
2935
2975
|
centered: true
|
2936
2976
|
},
|
2937
|
-
/* @__PURE__ */
|
2938
|
-
/* @__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(
|
2939
2979
|
"input",
|
2940
2980
|
{
|
2941
2981
|
type: "text",
|
@@ -2944,13 +2984,13 @@ function Payment() {
|
|
2944
2984
|
className: "form-control",
|
2945
2985
|
id: ""
|
2946
2986
|
}
|
2947
|
-
)), /* @__PURE__ */
|
2987
|
+
)), /* @__PURE__ */ import_react10.default.createElement(
|
2948
2988
|
"span",
|
2949
2989
|
{
|
2950
2990
|
id: "amount-error",
|
2951
2991
|
style: { color: "red", display: "none" }
|
2952
2992
|
}
|
2953
|
-
)), /* @__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(
|
2954
2994
|
"input",
|
2955
2995
|
{
|
2956
2996
|
id: "NameOnCard",
|
@@ -2959,13 +2999,13 @@ function Payment() {
|
|
2959
2999
|
maxLength: 100,
|
2960
3000
|
placeholder: "Name"
|
2961
3001
|
}
|
2962
|
-
), /* @__PURE__ */
|
3002
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
2963
3003
|
"span",
|
2964
3004
|
{
|
2965
3005
|
id: "NameOnCard-error",
|
2966
3006
|
style: { color: "red", display: "none" }
|
2967
3007
|
}
|
2968
|
-
)), /* @__PURE__ */
|
3008
|
+
)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react10.default.createElement(
|
2969
3009
|
"input",
|
2970
3010
|
{
|
2971
3011
|
"data-token": "card_number",
|
@@ -2976,7 +3016,7 @@ function Payment() {
|
|
2976
3016
|
placeholder: "0000 0000 0000 0000",
|
2977
3017
|
onChange: handleCardNumberChange
|
2978
3018
|
}
|
2979
|
-
), 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(
|
2980
3020
|
"input",
|
2981
3021
|
{
|
2982
3022
|
"data-token": "exp_month",
|
@@ -2987,14 +3027,14 @@ function Payment() {
|
|
2987
3027
|
maxLength: 2,
|
2988
3028
|
onChange: (e) => handleMonthChange(e)
|
2989
3029
|
}
|
2990
|
-
), isValidMonth && /* @__PURE__ */
|
3030
|
+
), isValidMonth && /* @__PURE__ */ import_react10.default.createElement(
|
2991
3031
|
"span",
|
2992
3032
|
{
|
2993
3033
|
id: "card_number-error",
|
2994
3034
|
style: { color: "red", fontSize: "15px" }
|
2995
3035
|
},
|
2996
3036
|
(_a = ErrorText) == null ? void 0 : _a.montherror
|
2997
|
-
)), /* @__PURE__ */
|
3037
|
+
)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react10.default.createElement(
|
2998
3038
|
"input",
|
2999
3039
|
{
|
3000
3040
|
"data-token": "exp_year",
|
@@ -3005,7 +3045,7 @@ function Payment() {
|
|
3005
3045
|
value: state.year,
|
3006
3046
|
onChange: (e) => handleYearChange(e)
|
3007
3047
|
}
|
3008
|
-
), 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(
|
3009
3049
|
"input",
|
3010
3050
|
{
|
3011
3051
|
"data-token": "cvv",
|
@@ -3016,7 +3056,7 @@ function Payment() {
|
|
3016
3056
|
placeholder: "CVV",
|
3017
3057
|
onChange: (e) => handleCVVChange(e)
|
3018
3058
|
}
|
3019
|
-
), /* @__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(
|
3020
3060
|
"input",
|
3021
3061
|
{
|
3022
3062
|
id: "ZIPCode",
|
@@ -3028,7 +3068,7 @@ function Payment() {
|
|
3028
3068
|
value: state.zip,
|
3029
3069
|
onChange: (e) => handleZIP(e)
|
3030
3070
|
}
|
3031
|
-
), /* @__PURE__ */
|
3071
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
3032
3072
|
"a",
|
3033
3073
|
{
|
3034
3074
|
tabIndex: 0,
|
@@ -3038,15 +3078,15 @@ function Payment() {
|
|
3038
3078
|
"data-placement": "left",
|
3039
3079
|
"data-content": "Enter the ZIP/Postal code for your credit card billing address."
|
3040
3080
|
},
|
3041
|
-
/* @__PURE__ */
|
3042
|
-
), /* @__PURE__ */
|
3081
|
+
/* @__PURE__ */ import_react10.default.createElement("i", { className: "fa fa-question-circle" })
|
3082
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
3043
3083
|
"span",
|
3044
3084
|
{
|
3045
3085
|
id: "ZIPCode-error",
|
3046
3086
|
style: { color: "red", display: "none" }
|
3047
3087
|
},
|
3048
3088
|
ErrorText.fieldrequired
|
3049
|
-
))), /* @__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(
|
3050
3090
|
"input",
|
3051
3091
|
{
|
3052
3092
|
id: "Amount",
|
@@ -3058,7 +3098,7 @@ function Payment() {
|
|
3058
3098
|
onChange: (e) => handleAmount(e),
|
3059
3099
|
onBlur: handleAmountBlur
|
3060
3100
|
}
|
3061
|
-
))), /* @__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(
|
3062
3102
|
"button",
|
3063
3103
|
{
|
3064
3104
|
type: "button",
|
@@ -3067,7 +3107,7 @@ function Payment() {
|
|
3067
3107
|
className: "btn btn-block btn-success submit-button"
|
3068
3108
|
},
|
3069
3109
|
"Pay"
|
3070
|
-
)), /* @__PURE__ */
|
3110
|
+
)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ import_react10.default.createElement(
|
3071
3111
|
"svg",
|
3072
3112
|
{
|
3073
3113
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3075,14 +3115,14 @@ function Payment() {
|
|
3075
3115
|
height: "20",
|
3076
3116
|
viewBox: "0 0 26 26"
|
3077
3117
|
},
|
3078
|
-
/* @__PURE__ */
|
3118
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
3079
3119
|
"path",
|
3080
3120
|
{
|
3081
3121
|
fill: "currentColor",
|
3082
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"
|
3083
3123
|
}
|
3084
3124
|
)
|
3085
|
-
), "Secure payments powered by Fractal", /* @__PURE__ */
|
3125
|
+
), "Secure payments powered by Fractal", /* @__PURE__ */ import_react10.default.createElement(
|
3086
3126
|
"img",
|
3087
3127
|
{
|
3088
3128
|
src: "https://ui.fractalpay.com/favicon.ico",
|
@@ -3094,28 +3134,22 @@ function Payment() {
|
|
3094
3134
|
}
|
3095
3135
|
|
3096
3136
|
// src/app/components/Transaction/CompletedTransactions.tsx
|
3097
|
-
|
3098
|
-
|
3099
|
-
|
3100
|
-
|
3101
|
-
|
3102
|
-
|
3103
|
-
TableBody,
|
3104
|
-
TableHeader
|
3105
|
-
} from "react-bs-datatable";
|
3106
|
-
import DatePicker from "react-datepicker";
|
3107
|
-
import "react-datepicker/dist/react-datepicker.css";
|
3108
|
-
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");
|
3109
3143
|
|
3110
3144
|
// src/app/components/Pagination/Pagination.tsx
|
3111
|
-
|
3112
|
-
|
3113
|
-
const [currentPage, setCurrentPage] =
|
3114
|
-
const [showPages, setShowPages] =
|
3115
|
-
|
3145
|
+
var import_react11 = __toESM(require("react"));
|
3146
|
+
function PaginationPg({ totalPages, onPageChange, current }) {
|
3147
|
+
const [currentPage, setCurrentPage] = (0, import_react11.useState)(current);
|
3148
|
+
const [showPages, setShowPages] = (0, import_react11.useState)(false);
|
3149
|
+
(0, import_react11.useEffect)(() => {
|
3116
3150
|
setCurrentPage(current);
|
3117
3151
|
}, [current]);
|
3118
|
-
|
3152
|
+
(0, import_react11.useEffect)(() => {
|
3119
3153
|
setTimeout(() => {
|
3120
3154
|
setShowPages(true);
|
3121
3155
|
}, 1e3);
|
@@ -3151,7 +3185,7 @@ var PaginationPgComp = ({ totalPages, onPageChange, current }) => {
|
|
3151
3185
|
if (currentPage > 3) {
|
3152
3186
|
pageNumbers.push(renderPageNumber(1));
|
3153
3187
|
if (currentPage > 4) {
|
3154
|
-
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" }, "...")));
|
3155
3189
|
}
|
3156
3190
|
}
|
3157
3191
|
const startPage = Math.max(currentPage - 1, 1);
|
@@ -3161,17 +3195,16 @@ var PaginationPgComp = ({ totalPages, onPageChange, current }) => {
|
|
3161
3195
|
}
|
3162
3196
|
if (currentPage < totalPages - 2) {
|
3163
3197
|
if (currentPage < totalPages - 3) {
|
3164
|
-
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" }, "...")));
|
3165
3199
|
}
|
3166
3200
|
pageNumbers.push(renderPageNumber(totalPages));
|
3167
3201
|
}
|
3168
3202
|
}
|
3169
3203
|
return pageNumbers;
|
3170
3204
|
};
|
3171
|
-
const renderPageNumber = (pageNumber) => /* @__PURE__ */
|
3172
|
-
return /* @__PURE__ */
|
3173
|
-
}
|
3174
|
-
var PaginationPg = React11.memo(PaginationPgComp);
|
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"))))));
|
3207
|
+
}
|
3175
3208
|
|
3176
3209
|
// src/app/components/Transaction/CompletedTransactions.tsx
|
3177
3210
|
var STORY_HEADERS = [
|
@@ -3208,10 +3241,10 @@ var STORY_HEADERS = [
|
|
3208
3241
|
}
|
3209
3242
|
];
|
3210
3243
|
function CompletedTransactions(props) {
|
3211
|
-
const [dataList, setDataList] =
|
3212
|
-
const [startDate, setStartDate] =
|
3213
|
-
const [endDate, setEndDate] =
|
3214
|
-
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)({
|
3215
3248
|
page: 1,
|
3216
3249
|
totalPage: 0,
|
3217
3250
|
data: [],
|
@@ -3299,9 +3332,9 @@ function CompletedTransactions(props) {
|
|
3299
3332
|
};
|
3300
3333
|
const handleExport = async () => {
|
3301
3334
|
if (!startDate) {
|
3302
|
-
|
3335
|
+
import_react_toastify4.toast.error("Start date required");
|
3303
3336
|
} else if (!endDate) {
|
3304
|
-
|
3337
|
+
import_react_toastify4.toast.error("End date required");
|
3305
3338
|
} else {
|
3306
3339
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { csvData: true }));
|
3307
3340
|
try {
|
@@ -3334,19 +3367,19 @@ function CompletedTransactions(props) {
|
|
3334
3367
|
}
|
3335
3368
|
}
|
3336
3369
|
};
|
3337
|
-
|
3370
|
+
(0, import_react12.useEffect)(() => {
|
3338
3371
|
fetchData(state.page, startDate, endDate);
|
3339
3372
|
}, [state.page]);
|
3340
3373
|
const handlePageChange = (pageNumber) => {
|
3341
3374
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { page: pageNumber }));
|
3342
3375
|
fetchData(pageNumber, startDate, endDate);
|
3343
3376
|
};
|
3344
|
-
return /* @__PURE__ */
|
3377
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement("style", null, `
|
3345
3378
|
.react-datepicker-wrapper:first-child {
|
3346
3379
|
margin-right: 10px;
|
3347
3380
|
}
|
3348
|
-
`), /* @__PURE__ */
|
3349
|
-
|
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,
|
3350
3383
|
{
|
3351
3384
|
selected: startDate,
|
3352
3385
|
onChange: handleStartDateChange,
|
@@ -3356,8 +3389,8 @@ function CompletedTransactions(props) {
|
|
3356
3389
|
placeholderText: "Start Date",
|
3357
3390
|
required: true
|
3358
3391
|
}
|
3359
|
-
), /* @__PURE__ */
|
3360
|
-
|
3392
|
+
), /* @__PURE__ */ import_react12.default.createElement(
|
3393
|
+
import_react_datepicker.default,
|
3361
3394
|
{
|
3362
3395
|
selected: endDate,
|
3363
3396
|
onChange: handleEndDateChange,
|
@@ -3367,8 +3400,8 @@ function CompletedTransactions(props) {
|
|
3367
3400
|
minDate: startDate,
|
3368
3401
|
placeholderText: "End Date"
|
3369
3402
|
}
|
3370
|
-
)), /* @__PURE__ */
|
3371
|
-
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,
|
3372
3405
|
{
|
3373
3406
|
body: dataList,
|
3374
3407
|
headers: STORY_HEADERS,
|
@@ -3379,21 +3412,21 @@ function CompletedTransactions(props) {
|
|
3379
3412
|
}
|
3380
3413
|
}
|
3381
3414
|
},
|
3382
|
-
/* @__PURE__ */
|
3383
|
-
/* @__PURE__ */
|
3384
|
-
/* @__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 })
|
3385
3418
|
))));
|
3386
3419
|
}
|
3387
3420
|
|
3388
3421
|
// src/app/components/Payment/TockenizPay.tsx
|
3389
|
-
|
3390
|
-
|
3391
|
-
|
3392
|
-
|
3393
|
-
|
3394
|
-
|
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"));
|
3395
3428
|
function TockenizPay() {
|
3396
|
-
const [state, setState] =
|
3429
|
+
const [state, setState] = (0, import_react13.useState)({
|
3397
3430
|
show: false,
|
3398
3431
|
publicKey: "",
|
3399
3432
|
sessionKey: "",
|
@@ -3404,13 +3437,13 @@ function TockenizPay() {
|
|
3404
3437
|
zip: "",
|
3405
3438
|
amount: ""
|
3406
3439
|
});
|
3407
|
-
const [cardTypeDetail, setCardTypeDetail] =
|
3408
|
-
const [isValid, setIsValid] =
|
3409
|
-
const [isValidMonth, setIsValidMonth] =
|
3410
|
-
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);
|
3411
3444
|
const handlePaymentClick = async () => {
|
3412
3445
|
try {
|
3413
|
-
const response = await
|
3446
|
+
const response = await import_axios3.default.post(`${baseUrl}/generate-session`, {});
|
3414
3447
|
const data2 = response.data;
|
3415
3448
|
if (data2 && (data2 == null ? void 0 : data2.result) === true) {
|
3416
3449
|
setState((prev) => {
|
@@ -3429,14 +3462,14 @@ function TockenizPay() {
|
|
3429
3462
|
const handleSubmitPay = async () => {
|
3430
3463
|
var _a, _b, _c, _d, _e;
|
3431
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}`;
|
3432
|
-
const publicKey =
|
3465
|
+
const publicKey = import_node_forge2.default.pki.publicKeyFromPem(state.publicKey);
|
3433
3466
|
const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
|
3434
|
-
md:
|
3467
|
+
md: import_node_forge2.default.md.sha1.create(),
|
3435
3468
|
mgf1: {
|
3436
|
-
md:
|
3469
|
+
md: import_node_forge2.default.md.sha1.create()
|
3437
3470
|
}
|
3438
3471
|
});
|
3439
|
-
const encryptedBase64 =
|
3472
|
+
const encryptedBase64 = import_node_forge2.default.util.encode64(encrypted);
|
3440
3473
|
console.log(encryptedBase64);
|
3441
3474
|
const requestBody = {
|
3442
3475
|
enc_track2_data: encryptedBase64,
|
@@ -3444,7 +3477,7 @@ function TockenizPay() {
|
|
3444
3477
|
algorithm: "RSAES_OAEP_SHA_1"
|
3445
3478
|
};
|
3446
3479
|
try {
|
3447
|
-
const response = await
|
3480
|
+
const response = await import_axios3.default.post(
|
3448
3481
|
"https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize",
|
3449
3482
|
requestBody,
|
3450
3483
|
{
|
@@ -3455,7 +3488,7 @@ function TockenizPay() {
|
|
3455
3488
|
}
|
3456
3489
|
);
|
3457
3490
|
if ((response == null ? void 0 : response.status) === 200) {
|
3458
|
-
|
3491
|
+
import_react_toastify5.toast.success("Payment Successful");
|
3459
3492
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
3460
3493
|
show: false,
|
3461
3494
|
publicKey: "",
|
@@ -3470,7 +3503,7 @@ function TockenizPay() {
|
|
3470
3503
|
}
|
3471
3504
|
console.log("response", response);
|
3472
3505
|
} catch (error) {
|
3473
|
-
|
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);
|
3474
3507
|
console.error("Error:", error);
|
3475
3508
|
}
|
3476
3509
|
};
|
@@ -3502,9 +3535,9 @@ function TockenizPay() {
|
|
3502
3535
|
e.preventDefault();
|
3503
3536
|
e.stopPropagation();
|
3504
3537
|
const { value } = e.target;
|
3505
|
-
let cardtyp =
|
3538
|
+
let cardtyp = (0, import_credit_card_type.default)(value)[0];
|
3506
3539
|
const formattedValue = formatCreditCardNumber(value, cardtyp == null ? void 0 : cardtyp.type);
|
3507
|
-
setCardTypeDetail(
|
3540
|
+
setCardTypeDetail((0, import_credit_card_type.default)(value)[0]);
|
3508
3541
|
console.log(formattedValue);
|
3509
3542
|
if (value.match(/[a-zA-Z]/)) {
|
3510
3543
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -3606,8 +3639,7 @@ function TockenizPay() {
|
|
3606
3639
|
}
|
3607
3640
|
return "";
|
3608
3641
|
}
|
3609
|
-
|
3610
|
-
return /* @__PURE__ */ React13.createElement("div", null, /* @__PURE__ */ React13.createElement(ToastContainer3, null), /* @__PURE__ */ React13.createElement(
|
3642
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement(import_react_toastify5.ToastContainer, null), /* @__PURE__ */ import_react13.default.createElement(
|
3611
3643
|
"button",
|
3612
3644
|
{
|
3613
3645
|
className: "export-btn mt-4",
|
@@ -3615,8 +3647,8 @@ function TockenizPay() {
|
|
3615
3647
|
onClick: () => handlePaymentClick()
|
3616
3648
|
},
|
3617
3649
|
"TokenizePay"
|
3618
|
-
), /* @__PURE__ */
|
3619
|
-
|
3650
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
3651
|
+
import_react_bootstrap8.Modal,
|
3620
3652
|
{
|
3621
3653
|
show: state.show,
|
3622
3654
|
onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -3624,8 +3656,8 @@ function TockenizPay() {
|
|
3624
3656
|
})),
|
3625
3657
|
centered: true
|
3626
3658
|
},
|
3627
|
-
/* @__PURE__ */
|
3628
|
-
/* @__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(
|
3629
3661
|
"input",
|
3630
3662
|
{
|
3631
3663
|
id: "NameOnCard",
|
@@ -3634,13 +3666,13 @@ function TockenizPay() {
|
|
3634
3666
|
maxLength: 100,
|
3635
3667
|
placeholder: "Name"
|
3636
3668
|
}
|
3637
|
-
), /* @__PURE__ */
|
3669
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
3638
3670
|
"span",
|
3639
3671
|
{
|
3640
3672
|
id: "NameOnCard-error",
|
3641
3673
|
style: { color: "red", display: "none" }
|
3642
3674
|
}
|
3643
|
-
)), /* @__PURE__ */
|
3675
|
+
)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react13.default.createElement(
|
3644
3676
|
"input",
|
3645
3677
|
{
|
3646
3678
|
"data-token": "card_number",
|
@@ -3651,7 +3683,7 @@ function TockenizPay() {
|
|
3651
3683
|
placeholder: "0000 0000 0000 0000",
|
3652
3684
|
onChange: handleCardNumberChange
|
3653
3685
|
}
|
3654
|
-
), 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(
|
3655
3687
|
"input",
|
3656
3688
|
{
|
3657
3689
|
"data-token": "exp_month",
|
@@ -3662,14 +3694,14 @@ function TockenizPay() {
|
|
3662
3694
|
maxLength: 2,
|
3663
3695
|
onChange: (e) => handleMonthChange(e)
|
3664
3696
|
}
|
3665
|
-
), isValidMonth && /* @__PURE__ */
|
3697
|
+
), isValidMonth && /* @__PURE__ */ import_react13.default.createElement(
|
3666
3698
|
"span",
|
3667
3699
|
{
|
3668
3700
|
id: "card_number-error",
|
3669
3701
|
style: { color: "red", fontSize: "15px" }
|
3670
3702
|
},
|
3671
3703
|
"Please write month only 1 to 12"
|
3672
|
-
)), /* @__PURE__ */
|
3704
|
+
)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react13.default.createElement(
|
3673
3705
|
"input",
|
3674
3706
|
{
|
3675
3707
|
"data-token": "exp_year",
|
@@ -3680,7 +3712,7 @@ function TockenizPay() {
|
|
3680
3712
|
value: state.year,
|
3681
3713
|
onChange: (e) => handleYearChange(e)
|
3682
3714
|
}
|
3683
|
-
), 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(
|
3684
3716
|
"input",
|
3685
3717
|
{
|
3686
3718
|
"data-token": "cvv",
|
@@ -3691,7 +3723,7 @@ function TockenizPay() {
|
|
3691
3723
|
placeholder: "CVV",
|
3692
3724
|
onChange: (e) => handleCVVChange(e)
|
3693
3725
|
}
|
3694
|
-
), /* @__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(
|
3695
3727
|
"input",
|
3696
3728
|
{
|
3697
3729
|
id: "ZIPCode",
|
@@ -3703,7 +3735,7 @@ function TockenizPay() {
|
|
3703
3735
|
value: state.zip,
|
3704
3736
|
onChange: (e) => handleZIP(e)
|
3705
3737
|
}
|
3706
|
-
), /* @__PURE__ */
|
3738
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
3707
3739
|
"a",
|
3708
3740
|
{
|
3709
3741
|
tabIndex: 0,
|
@@ -3713,15 +3745,15 @@ function TockenizPay() {
|
|
3713
3745
|
"data-placement": "left",
|
3714
3746
|
"data-content": "Enter the ZIP/Postal code for your credit card billing address."
|
3715
3747
|
},
|
3716
|
-
/* @__PURE__ */
|
3717
|
-
), /* @__PURE__ */
|
3748
|
+
/* @__PURE__ */ import_react13.default.createElement("i", { className: "fa fa-question-circle" })
|
3749
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
3718
3750
|
"span",
|
3719
3751
|
{
|
3720
3752
|
id: "ZIPCode-error",
|
3721
3753
|
style: { color: "red", display: "none" }
|
3722
3754
|
},
|
3723
3755
|
"This field is required"
|
3724
|
-
))), /* @__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(
|
3725
3757
|
"input",
|
3726
3758
|
{
|
3727
3759
|
id: "Amount",
|
@@ -3733,7 +3765,7 @@ function TockenizPay() {
|
|
3733
3765
|
onChange: (e) => handleAmount(e),
|
3734
3766
|
onBlur: handleAmountBlur
|
3735
3767
|
}
|
3736
|
-
))), /* @__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(
|
3737
3769
|
"button",
|
3738
3770
|
{
|
3739
3771
|
type: "button",
|
@@ -3742,7 +3774,7 @@ function TockenizPay() {
|
|
3742
3774
|
className: "btn btn-block btn-success submit-button"
|
3743
3775
|
},
|
3744
3776
|
"Submit"
|
3745
|
-
)), /* @__PURE__ */
|
3777
|
+
)), /* @__PURE__ */ import_react13.default.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ import_react13.default.createElement(
|
3746
3778
|
"svg",
|
3747
3779
|
{
|
3748
3780
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3750,14 +3782,14 @@ function TockenizPay() {
|
|
3750
3782
|
height: "20",
|
3751
3783
|
viewBox: "0 0 26 26"
|
3752
3784
|
},
|
3753
|
-
/* @__PURE__ */
|
3785
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
3754
3786
|
"path",
|
3755
3787
|
{
|
3756
3788
|
fill: "currentColor",
|
3757
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"
|
3758
3790
|
}
|
3759
3791
|
)
|
3760
|
-
), "Secure payments powered by Fractal", /* @__PURE__ */
|
3792
|
+
), "Secure payments powered by Fractal", /* @__PURE__ */ import_react13.default.createElement(
|
3761
3793
|
"img",
|
3762
3794
|
{
|
3763
3795
|
src: "https://ui.fractalpay.com/favicon.ico",
|
@@ -3769,25 +3801,25 @@ function TockenizPay() {
|
|
3769
3801
|
}
|
3770
3802
|
|
3771
3803
|
// src/app/components/Payment/GetPaymentDynamic.tsx
|
3772
|
-
|
3773
|
-
|
3804
|
+
var import_react15 = __toESM(require("react"));
|
3805
|
+
var import_react_bootstrap9 = require("react-bootstrap");
|
3774
3806
|
|
3775
3807
|
// src/app/components/Loader/MyLoadingAnimation.tsx
|
3776
|
-
|
3808
|
+
var import_react14 = __toESM(require("react"));
|
3777
3809
|
function MyLoadingAnimation() {
|
3778
|
-
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" })));
|
3779
3811
|
}
|
3780
3812
|
|
3781
3813
|
// src/app/components/Payment/GetPaymentDynamic.tsx
|
3782
3814
|
function GetPaymentDynamic(props) {
|
3783
3815
|
const { amount, fractalpayClientKey, orderID } = props;
|
3784
|
-
const [loading, setLoading] =
|
3785
|
-
const [show, setShow] =
|
3786
|
-
const [iframeLoaded, setIframeLoaded] =
|
3787
|
-
const [phoneNumber, setPhoneNumber] =
|
3788
|
-
const [errorMessage, setErrorMessage] =
|
3789
|
-
const [submitClicked, setSubmitClicked] =
|
3790
|
-
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);
|
3791
3823
|
const handleClose = () => {
|
3792
3824
|
setIframeLoaded(false);
|
3793
3825
|
setTimeout(() => {
|
@@ -3802,7 +3834,7 @@ function GetPaymentDynamic(props) {
|
|
3802
3834
|
console.error("Fractalpay client key is missing or empty.");
|
3803
3835
|
}
|
3804
3836
|
};
|
3805
|
-
|
3837
|
+
(0, import_react15.useEffect)(() => {
|
3806
3838
|
if (!fractalpayClientKey) {
|
3807
3839
|
console.error("Fractalpay client key is missing or empty.");
|
3808
3840
|
}
|
@@ -3825,7 +3857,7 @@ function GetPaymentDynamic(props) {
|
|
3825
3857
|
const handleLoad = () => {
|
3826
3858
|
setLoading(false);
|
3827
3859
|
};
|
3828
|
-
|
3860
|
+
(0, import_react15.useEffect)(() => {
|
3829
3861
|
const messageListener = (event) => {
|
3830
3862
|
var _a, _b;
|
3831
3863
|
const response = (_b = (_a = event == null ? void 0 : event.data) == null ? void 0 : _a.other) == null ? void 0 : _b.data;
|
@@ -3840,7 +3872,7 @@ function GetPaymentDynamic(props) {
|
|
3840
3872
|
window.removeEventListener("message", messageListener);
|
3841
3873
|
};
|
3842
3874
|
}, []);
|
3843
|
-
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(
|
3844
3876
|
"iframe",
|
3845
3877
|
{
|
3846
3878
|
src: `${baseUrl}widget-form/${amount}?fractalpay_public_key=${fractalpayClientKey}&order_id=${orderID}`,
|
@@ -3851,7 +3883,8 @@ function GetPaymentDynamic(props) {
|
|
3851
3883
|
}
|
3852
3884
|
))));
|
3853
3885
|
}
|
3854
|
-
export
|
3886
|
+
// Annotate the CommonJS export names for ESM import in node:
|
3887
|
+
0 && (module.exports = {
|
3855
3888
|
CompletedTransactions,
|
3856
3889
|
GetPaymentDynamic,
|
3857
3890
|
Payment,
|
@@ -3861,4 +3894,4 @@ export {
|
|
3861
3894
|
RequestPaymentonClick,
|
3862
3895
|
RqstPaymntInputField,
|
3863
3896
|
TockenizPay
|
3864
|
-
};
|
3897
|
+
});
|