@pinerohit11/testwidget 0.1.50 → 0.1.52
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +330 -262
- package/dist/{index.cjs → index.mjs} +294 -298
- package/package.json +2 -4
- /package/dist/{index.d.cts → index.d.mts} +0 -0
@@ -1,12 +1,7 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __create = Object.create;
|
3
1
|
var __defProp = Object.defineProperty;
|
4
2
|
var __defProps = Object.defineProperties;
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
6
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
8
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
9
|
-
var __getProtoOf = Object.getPrototypeOf;
|
10
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
11
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
12
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
@@ -22,54 +17,17 @@ var __spreadValues = (a, b) => {
|
|
22
17
|
return a;
|
23
18
|
};
|
24
19
|
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);
|
61
20
|
|
62
21
|
// src/app/components/RequestPayment/RequestPayment.tsx
|
63
|
-
|
64
|
-
var import_axios = __toESM(require("axios"), 1);
|
22
|
+
import React4, { useState, useEffect } from "react";
|
65
23
|
|
66
24
|
// src/app/components/Loader/Loader.tsx
|
67
|
-
|
25
|
+
import React2 from "react";
|
68
26
|
|
69
27
|
// src/app/components/Loader/LoaderStyle.tsx
|
70
|
-
|
28
|
+
import React from "react";
|
71
29
|
var LoaderStyle = (props) => {
|
72
|
-
return /* @__PURE__ */
|
30
|
+
return /* @__PURE__ */ React.createElement("style", null, `
|
73
31
|
.loader {
|
74
32
|
position: fixed;
|
75
33
|
/* Fixed position to cover the viewport */
|
@@ -188,17 +146,17 @@ var LoaderStyle_default = LoaderStyle;
|
|
188
146
|
|
189
147
|
// src/app/components/Loader/Loader.tsx
|
190
148
|
var Loader = (props) => {
|
191
|
-
return /* @__PURE__ */
|
149
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(LoaderStyle_default, null), (props == null ? void 0 : props.loading) && /* @__PURE__ */ React2.createElement("div", { className: "loader" }, /* @__PURE__ */ React2.createElement("div", { className: "lds-ellipsis" }, /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement("div", null))));
|
192
150
|
};
|
193
151
|
var Loader_default = Loader;
|
194
152
|
|
195
153
|
// src/app/components/RequestPayment/RequestPayment.tsx
|
196
|
-
|
154
|
+
import { Button, Form, Modal } from "react-bootstrap";
|
197
155
|
|
198
156
|
// src/app/components/RequestPayment/RequestPaymentstyles.tsx
|
199
|
-
|
157
|
+
import React3 from "react";
|
200
158
|
var RequestPaymentstyles = (props) => {
|
201
|
-
return /* @__PURE__ */
|
159
|
+
return /* @__PURE__ */ React3.createElement("style", null, `
|
202
160
|
.paymentBtn {
|
203
161
|
background-color: black;
|
204
162
|
border: none;
|
@@ -1052,10 +1010,10 @@ var ErrorText = {
|
|
1052
1010
|
// src/app/components/RequestPayment/RequestPayment.tsx
|
1053
1011
|
function RequestPayment(props) {
|
1054
1012
|
const fractalpayClientKey = props.fractalpayClientKey;
|
1055
|
-
const [show, setShow] =
|
1056
|
-
const [loading, setLoading] =
|
1057
|
-
const [errors, setErrors] =
|
1058
|
-
const [requestDetails, setRequestDetails] =
|
1013
|
+
const [show, setShow] = useState(false);
|
1014
|
+
const [loading, setLoading] = useState(false);
|
1015
|
+
const [errors, setErrors] = useState({});
|
1016
|
+
const [requestDetails, setRequestDetails] = useState({
|
1059
1017
|
email: "",
|
1060
1018
|
amount: "",
|
1061
1019
|
phone_number: "",
|
@@ -1063,7 +1021,7 @@ function RequestPayment(props) {
|
|
1063
1021
|
name: "",
|
1064
1022
|
fractalpayPublicKey: fractalpayClientKey
|
1065
1023
|
});
|
1066
|
-
const [showConfirmationModal, setShowConfirmationModal] =
|
1024
|
+
const [showConfirmationModal, setShowConfirmationModal] = useState(false);
|
1067
1025
|
const phoneNumberRegex = (value) => /^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(value);
|
1068
1026
|
const amoutRegex = /[+-]?([0-9]*[.])?[0-9]+/;
|
1069
1027
|
const positiveAmountRegex = /^[+]?\d+(\.\d+)?$/;
|
@@ -1116,14 +1074,24 @@ function RequestPayment(props) {
|
|
1116
1074
|
name: requestDetails.name,
|
1117
1075
|
email: requestDetails.email
|
1118
1076
|
};
|
1119
|
-
|
1120
|
-
|
1077
|
+
const response = await fetch(`${baseUrl}create-widget-order`, {
|
1078
|
+
method: "POST",
|
1079
|
+
headers: {
|
1080
|
+
"Content-Type": "application/json"
|
1081
|
+
},
|
1082
|
+
body: JSON.stringify(formData)
|
1083
|
+
});
|
1084
|
+
if (!response.ok) {
|
1085
|
+
throw new Error("Failed to create widget order");
|
1086
|
+
}
|
1087
|
+
const data = await response.json();
|
1088
|
+
if (data) {
|
1121
1089
|
setShowConfirmationModal(true);
|
1122
1090
|
setShow(false);
|
1123
1091
|
emptyFields();
|
1124
|
-
handleSubmit(
|
1092
|
+
handleSubmit(data);
|
1125
1093
|
}
|
1126
|
-
console.log(
|
1094
|
+
console.log(data);
|
1127
1095
|
setLoading(false);
|
1128
1096
|
} catch (error) {
|
1129
1097
|
console.log(error);
|
@@ -1194,7 +1162,7 @@ function RequestPayment(props) {
|
|
1194
1162
|
setErrors(newErrors);
|
1195
1163
|
return Object.keys(newErrors).length === 0;
|
1196
1164
|
};
|
1197
|
-
|
1165
|
+
useEffect(() => {
|
1198
1166
|
if (props.amount) {
|
1199
1167
|
setRequestDetails((prev) => __spreadProps(__spreadValues({}, prev), { amount: props.amount }));
|
1200
1168
|
}
|
@@ -1204,8 +1172,8 @@ function RequestPayment(props) {
|
|
1204
1172
|
e.preventDefault();
|
1205
1173
|
}
|
1206
1174
|
};
|
1207
|
-
return /* @__PURE__ */
|
1208
|
-
|
1175
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ React4.createElement(Loader_default, { loading }), /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Request Payment"), /* @__PURE__ */ React4.createElement(
|
1176
|
+
Modal,
|
1209
1177
|
{
|
1210
1178
|
show,
|
1211
1179
|
onHide: handleClose,
|
@@ -1213,8 +1181,8 @@ function RequestPayment(props) {
|
|
1213
1181
|
backdrop: "static",
|
1214
1182
|
keyboard: false
|
1215
1183
|
},
|
1216
|
-
/* @__PURE__ */
|
1217
|
-
/* @__PURE__ */
|
1184
|
+
/* @__PURE__ */ React4.createElement(Modal.Header, { closeButton: true }, /* @__PURE__ */ React4.createElement(Modal.Title, null, "Request Payment")),
|
1185
|
+
/* @__PURE__ */ React4.createElement(Modal.Body, { id: "Checkout" }, /* @__PURE__ */ React4.createElement(Form, null, /* @__PURE__ */ React4.createElement("div", { className: "mb-3" }, /* @__PURE__ */ React4.createElement("label", { htmlFor: "exampleFormControlInput2", className: "form-label" }, "FULL NAME *"), /* @__PURE__ */ React4.createElement(
|
1218
1186
|
"input",
|
1219
1187
|
{
|
1220
1188
|
className: "form-control",
|
@@ -1223,7 +1191,7 @@ function RequestPayment(props) {
|
|
1223
1191
|
"data-token": "name",
|
1224
1192
|
onChange: handleChange
|
1225
1193
|
}
|
1226
|
-
), errors.name && /* @__PURE__ */
|
1194
|
+
), errors.name && /* @__PURE__ */ React4.createElement("small", { className: "text-danger" }, errors.name)), /* @__PURE__ */ React4.createElement("div", { className: "mb-3" }, /* @__PURE__ */ React4.createElement("label", { htmlFor: "requestPhoneNumber", className: "form-label" }, "Phone Number"), /* @__PURE__ */ React4.createElement(
|
1227
1195
|
"input",
|
1228
1196
|
{
|
1229
1197
|
maxLength: 10,
|
@@ -1235,7 +1203,7 @@ function RequestPayment(props) {
|
|
1235
1203
|
type: "text",
|
1236
1204
|
"data-token": "phone_number"
|
1237
1205
|
}
|
1238
|
-
), errors.phone_number && /* @__PURE__ */
|
1206
|
+
), errors.phone_number && /* @__PURE__ */ React4.createElement("small", { className: "text-danger" }, errors.phone_number)), /* @__PURE__ */ React4.createElement("div", { className: "mb-3" }, /* @__PURE__ */ React4.createElement("label", { htmlFor: "exampleFormControlInput2", className: "form-label" }, "EMAIL"), /* @__PURE__ */ React4.createElement(
|
1239
1207
|
"input",
|
1240
1208
|
{
|
1241
1209
|
className: "form-control",
|
@@ -1244,7 +1212,7 @@ function RequestPayment(props) {
|
|
1244
1212
|
onChange: handleChange,
|
1245
1213
|
"data-token": "email"
|
1246
1214
|
}
|
1247
|
-
), errors.email && /* @__PURE__ */
|
1215
|
+
), errors.email && /* @__PURE__ */ React4.createElement("small", { className: "text-danger" }, errors.email)), /* @__PURE__ */ React4.createElement("div", { className: "mb-3" }, /* @__PURE__ */ React4.createElement("label", { htmlFor: "exampleFormControlInput2", className: "form-label" }, "AMOUNT *"), /* @__PURE__ */ React4.createElement("div", { className: "input-group" }, /* @__PURE__ */ React4.createElement("span", { className: "input-group-text" }, "$"), /* @__PURE__ */ React4.createElement(
|
1248
1216
|
"input",
|
1249
1217
|
{
|
1250
1218
|
"data-token": "amount",
|
@@ -1260,7 +1228,7 @@ function RequestPayment(props) {
|
|
1260
1228
|
e2.preventDefault();
|
1261
1229
|
}, { passive: false })
|
1262
1230
|
}
|
1263
|
-
)), errors.amount && /* @__PURE__ */
|
1231
|
+
)), errors.amount && /* @__PURE__ */ React4.createElement("small", { className: "text-danger" }, errors.amount)), /* @__PURE__ */ React4.createElement("div", { className: "mb-3" }, /* @__PURE__ */ React4.createElement("label", { htmlFor: "exampleFormControlInput2", className: "form-label" }, "ORDER ID"), /* @__PURE__ */ React4.createElement(
|
1264
1232
|
"input",
|
1265
1233
|
{
|
1266
1234
|
className: "form-control",
|
@@ -1269,8 +1237,8 @@ function RequestPayment(props) {
|
|
1269
1237
|
onChange: handleChange,
|
1270
1238
|
"data-token": "order_id"
|
1271
1239
|
}
|
1272
|
-
), errors.order_id && /* @__PURE__ */
|
1273
|
-
|
1240
|
+
), errors.order_id && /* @__PURE__ */ React4.createElement("small", { className: "text-danger" }, errors.order_id)), /* @__PURE__ */ React4.createElement(
|
1241
|
+
Button,
|
1274
1242
|
{
|
1275
1243
|
type: "button",
|
1276
1244
|
className: "PayButton",
|
@@ -1278,7 +1246,7 @@ function RequestPayment(props) {
|
|
1278
1246
|
disabled: loading
|
1279
1247
|
},
|
1280
1248
|
loading ? "Loading..." : "Send Request"
|
1281
|
-
)), /* @__PURE__ */
|
1249
|
+
)), /* @__PURE__ */ React4.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ React4.createElement(
|
1282
1250
|
"svg",
|
1283
1251
|
{
|
1284
1252
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1286,14 +1254,14 @@ function RequestPayment(props) {
|
|
1286
1254
|
height: "20",
|
1287
1255
|
viewBox: "0 0 26 26"
|
1288
1256
|
},
|
1289
|
-
/* @__PURE__ */
|
1257
|
+
/* @__PURE__ */ React4.createElement(
|
1290
1258
|
"path",
|
1291
1259
|
{
|
1292
1260
|
fill: "currentColor",
|
1293
1261
|
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"
|
1294
1262
|
}
|
1295
1263
|
)
|
1296
|
-
), "Secure payments powered by Fractal", /* @__PURE__ */
|
1264
|
+
), "Secure payments powered by Fractal", /* @__PURE__ */ React4.createElement(
|
1297
1265
|
"img",
|
1298
1266
|
{
|
1299
1267
|
src: "https://ui.fractalpay.com/favicon.ico",
|
@@ -1301,15 +1269,15 @@ function RequestPayment(props) {
|
|
1301
1269
|
className: "powered-logo"
|
1302
1270
|
}
|
1303
1271
|
)))
|
1304
|
-
), /* @__PURE__ */
|
1305
|
-
|
1272
|
+
), /* @__PURE__ */ React4.createElement(
|
1273
|
+
Modal,
|
1306
1274
|
{
|
1307
1275
|
className: "payment-suc",
|
1308
1276
|
show: showConfirmationModal,
|
1309
1277
|
onHide: handleCloseConfirmationModal
|
1310
1278
|
},
|
1311
|
-
/* @__PURE__ */
|
1312
|
-
/* @__PURE__ */
|
1279
|
+
/* @__PURE__ */ React4.createElement(Modal.Header, { closeButton: true }),
|
1280
|
+
/* @__PURE__ */ React4.createElement(Modal.Body, null, /* @__PURE__ */ React4.createElement(
|
1313
1281
|
"svg",
|
1314
1282
|
{
|
1315
1283
|
width: "60",
|
@@ -1318,7 +1286,7 @@ function RequestPayment(props) {
|
|
1318
1286
|
fill: "none",
|
1319
1287
|
xmlns: "http://www.w3.org/2000/svg"
|
1320
1288
|
},
|
1321
|
-
/* @__PURE__ */
|
1289
|
+
/* @__PURE__ */ React4.createElement(
|
1322
1290
|
"rect",
|
1323
1291
|
{
|
1324
1292
|
x: "0.5",
|
@@ -1329,14 +1297,14 @@ function RequestPayment(props) {
|
|
1329
1297
|
stroke: "#31B379"
|
1330
1298
|
}
|
1331
1299
|
),
|
1332
|
-
/* @__PURE__ */
|
1300
|
+
/* @__PURE__ */ React4.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ React4.createElement(
|
1333
1301
|
"path",
|
1334
1302
|
{
|
1335
1303
|
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",
|
1336
1304
|
fill: "#31B379"
|
1337
1305
|
}
|
1338
1306
|
)),
|
1339
|
-
/* @__PURE__ */
|
1307
|
+
/* @__PURE__ */ React4.createElement("defs", null, /* @__PURE__ */ React4.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ React4.createElement(
|
1340
1308
|
"rect",
|
1341
1309
|
{
|
1342
1310
|
width: "22",
|
@@ -1345,28 +1313,28 @@ function RequestPayment(props) {
|
|
1345
1313
|
transform: "translate(19.5 19.0039)"
|
1346
1314
|
}
|
1347
1315
|
)))
|
1348
|
-
), /* @__PURE__ */
|
1316
|
+
), /* @__PURE__ */ React4.createElement("h2", null, "Payment link has been ", /* @__PURE__ */ React4.createElement("br", null), " sent successfully"))
|
1349
1317
|
)));
|
1350
1318
|
}
|
1351
1319
|
|
1352
1320
|
// src/app/components/RequestPayment/RequestPaymentAllInput.tsx
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1321
|
+
import React5, { useState as useState2 } from "react";
|
1322
|
+
import { Modal as Modal2 } from "react-bootstrap";
|
1323
|
+
import { toast, ToastContainer } from "react-toastify";
|
1324
|
+
import "react-toastify/dist/ReactToastify.css";
|
1357
1325
|
function RequestPaymentAllInput({ fractalpayClientKey }) {
|
1358
|
-
const [isLoading, setIsLoading] = (
|
1359
|
-
const [show, setShow] = (
|
1360
|
-
const [phoneNumber, setPhoneNumber] = (
|
1361
|
-
const [amount, setAmount] = (
|
1362
|
-
const [orderId, setOrderId] = (
|
1363
|
-
const [isValidNumber, setIsValidNumber] = (
|
1364
|
-
const [isValidAmount, setIsValidAmount] = (
|
1365
|
-
const [isValidOrderId, setIsValidOrderId] = (
|
1366
|
-
const [errorMessagephone, setErrorMessagephone] = (
|
1367
|
-
const [errorMessageamount, setErrorMessageamount] = (
|
1368
|
-
const [errorMessageorderid, setErrorMessageorderid] = (
|
1369
|
-
const [submitClicked, setSubmitClicked] = (
|
1326
|
+
const [isLoading, setIsLoading] = useState2(false);
|
1327
|
+
const [show, setShow] = useState2(false);
|
1328
|
+
const [phoneNumber, setPhoneNumber] = useState2("");
|
1329
|
+
const [amount, setAmount] = useState2("");
|
1330
|
+
const [orderId, setOrderId] = useState2("");
|
1331
|
+
const [isValidNumber, setIsValidNumber] = useState2(true);
|
1332
|
+
const [isValidAmount, setIsValidAmount] = useState2(true);
|
1333
|
+
const [isValidOrderId, setIsValidOrderId] = useState2(true);
|
1334
|
+
const [errorMessagephone, setErrorMessagephone] = useState2("");
|
1335
|
+
const [errorMessageamount, setErrorMessageamount] = useState2("");
|
1336
|
+
const [errorMessageorderid, setErrorMessageorderid] = useState2("");
|
1337
|
+
const [submitClicked, setSubmitClicked] = useState2(false);
|
1370
1338
|
const handleClose = () => setShow(false);
|
1371
1339
|
const handleShow = () => setShow(true);
|
1372
1340
|
const sendRequestPayment = () => {
|
@@ -1428,7 +1396,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1428
1396
|
}).catch((error) => {
|
1429
1397
|
setIsLoading(false);
|
1430
1398
|
console.error("Error:", error);
|
1431
|
-
|
1399
|
+
toast.error(ErrorText.anerroroccured);
|
1432
1400
|
});
|
1433
1401
|
};
|
1434
1402
|
const handlePhoneNumberChange = (e) => {
|
@@ -1468,7 +1436,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1468
1436
|
setIsValidOrderId(false);
|
1469
1437
|
}
|
1470
1438
|
};
|
1471
|
-
return /* @__PURE__ */
|
1439
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ React5.createElement("div", { className: " border-container" }, /* @__PURE__ */ React5.createElement("div", { className: "payment-column" }, /* @__PURE__ */ React5.createElement("label", null, "Enter Phone Number:"), /* @__PURE__ */ React5.createElement("div", { className: "input-container" }, /* @__PURE__ */ React5.createElement(
|
1472
1440
|
"input",
|
1473
1441
|
{
|
1474
1442
|
type: "text",
|
@@ -1478,7 +1446,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1478
1446
|
maxLength: 10,
|
1479
1447
|
className: submitClicked && (!phoneNumber || !isValidNumber) ? "error" : ""
|
1480
1448
|
}
|
1481
|
-
), errorMessagephone && /* @__PURE__ */
|
1449
|
+
), errorMessagephone && /* @__PURE__ */ React5.createElement("div", { className: "error-message text-danger" }, errorMessagephone))), /* @__PURE__ */ React5.createElement("div", { className: "payment-column" }, /* @__PURE__ */ React5.createElement("label", null, "Enter Amount:"), /* @__PURE__ */ React5.createElement("div", { className: "input-container" }, /* @__PURE__ */ React5.createElement(
|
1482
1450
|
"input",
|
1483
1451
|
{
|
1484
1452
|
type: "text",
|
@@ -1487,7 +1455,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1487
1455
|
placeholder: "Enter amount",
|
1488
1456
|
className: submitClicked && (!amount || !isValidAmount) ? "error" : ""
|
1489
1457
|
}
|
1490
|
-
), errorMessageamount && /* @__PURE__ */
|
1458
|
+
), errorMessageamount && /* @__PURE__ */ React5.createElement("div", { className: "error-message text-danger" }, errorMessageamount))), /* @__PURE__ */ React5.createElement("div", { className: "payment-column" }, /* @__PURE__ */ React5.createElement("label", null, "Enter Order ID:"), /* @__PURE__ */ React5.createElement("div", { className: "input-container" }, /* @__PURE__ */ React5.createElement(
|
1491
1459
|
"input",
|
1492
1460
|
{
|
1493
1461
|
type: "text",
|
@@ -1496,7 +1464,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1496
1464
|
placeholder: "Enter order ID",
|
1497
1465
|
className: submitClicked && (!orderId || !isValidOrderId) ? "error" : ""
|
1498
1466
|
}
|
1499
|
-
), errorMessageorderid && /* @__PURE__ */
|
1467
|
+
), errorMessageorderid && /* @__PURE__ */ React5.createElement("div", { className: "error-message text-danger" }, errorMessageorderid))), /* @__PURE__ */ React5.createElement(
|
1500
1468
|
"button",
|
1501
1469
|
{
|
1502
1470
|
onClick: sendRequestPayment,
|
@@ -1504,7 +1472,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1504
1472
|
className: "paymentBtn"
|
1505
1473
|
},
|
1506
1474
|
isLoading ? "Loading..." : "Request Payment"
|
1507
|
-
)), /* @__PURE__ */
|
1475
|
+
)), /* @__PURE__ */ React5.createElement(Modal2, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ React5.createElement(Modal2.Header, { closeButton: true }), /* @__PURE__ */ React5.createElement(Modal2.Body, null, /* @__PURE__ */ React5.createElement(
|
1508
1476
|
"svg",
|
1509
1477
|
{
|
1510
1478
|
width: "60",
|
@@ -1513,7 +1481,7 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1513
1481
|
fill: "none",
|
1514
1482
|
xmlns: "http://www.w3.org/2000/svg"
|
1515
1483
|
},
|
1516
|
-
/* @__PURE__ */
|
1484
|
+
/* @__PURE__ */ React5.createElement(
|
1517
1485
|
"rect",
|
1518
1486
|
{
|
1519
1487
|
x: "0.5",
|
@@ -1524,14 +1492,14 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1524
1492
|
stroke: "#31B379"
|
1525
1493
|
}
|
1526
1494
|
),
|
1527
|
-
/* @__PURE__ */
|
1495
|
+
/* @__PURE__ */ React5.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ React5.createElement(
|
1528
1496
|
"path",
|
1529
1497
|
{
|
1530
1498
|
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",
|
1531
1499
|
fill: "#31B379"
|
1532
1500
|
}
|
1533
1501
|
)),
|
1534
|
-
/* @__PURE__ */
|
1502
|
+
/* @__PURE__ */ React5.createElement("defs", null, /* @__PURE__ */ React5.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ React5.createElement(
|
1535
1503
|
"rect",
|
1536
1504
|
{
|
1537
1505
|
width: "22",
|
@@ -1540,12 +1508,12 @@ function RequestPaymentAllInput({ fractalpayClientKey }) {
|
|
1540
1508
|
transform: "translate(19.5 19.0039)"
|
1541
1509
|
}
|
1542
1510
|
)))
|
1543
|
-
), /* @__PURE__ */
|
1511
|
+
), /* @__PURE__ */ React5.createElement("h1", null, "Success!"), /* @__PURE__ */ React5.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ React5.createElement(Modal2.Footer, null, /* @__PURE__ */ React5.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))), /* @__PURE__ */ React5.createElement(ToastContainer, null));
|
1544
1512
|
}
|
1545
1513
|
|
1546
1514
|
// src/app/components/RequestPayment/RequestPaymentDynamic.tsx
|
1547
|
-
|
1548
|
-
|
1515
|
+
import React6, { useState as useState3 } from "react";
|
1516
|
+
import { Modal as Modal3 } from "react-bootstrap";
|
1549
1517
|
|
1550
1518
|
// src/app/components/Api/createWidgetOrder.ts
|
1551
1519
|
var createWidgetOrder = (formData) => {
|
@@ -1568,8 +1536,8 @@ var createWidgetOrder = (formData) => {
|
|
1568
1536
|
|
1569
1537
|
// src/app/components/RequestPayment/RequestPaymentDynamic.tsx
|
1570
1538
|
function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orderID }) {
|
1571
|
-
const [isLoading, setIsLoading] = (
|
1572
|
-
const [show, setShow] = (
|
1539
|
+
const [isLoading, setIsLoading] = useState3(false);
|
1540
|
+
const [show, setShow] = useState3(false);
|
1573
1541
|
const handleClose = () => setShow(false);
|
1574
1542
|
const handleShow = () => setShow(true);
|
1575
1543
|
const sendRequestPayment = () => {
|
@@ -1592,7 +1560,7 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1592
1560
|
console.error("Error:", error);
|
1593
1561
|
});
|
1594
1562
|
};
|
1595
|
-
return /* @__PURE__ */
|
1563
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(
|
1596
1564
|
"button",
|
1597
1565
|
{
|
1598
1566
|
onClick: sendRequestPayment,
|
@@ -1600,7 +1568,7 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1600
1568
|
className: "paymentBtn"
|
1601
1569
|
},
|
1602
1570
|
isLoading ? "Loading..." : "Request Payment"
|
1603
|
-
), /* @__PURE__ */
|
1571
|
+
), /* @__PURE__ */ React6.createElement(Modal3, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ React6.createElement(Modal3.Header, { closeButton: true }), /* @__PURE__ */ React6.createElement(Modal3.Body, null, /* @__PURE__ */ React6.createElement(
|
1604
1572
|
"svg",
|
1605
1573
|
{
|
1606
1574
|
width: "60",
|
@@ -1609,7 +1577,7 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1609
1577
|
fill: "none",
|
1610
1578
|
xmlns: "http://www.w3.org/2000/svg"
|
1611
1579
|
},
|
1612
|
-
/* @__PURE__ */
|
1580
|
+
/* @__PURE__ */ React6.createElement(
|
1613
1581
|
"rect",
|
1614
1582
|
{
|
1615
1583
|
x: "0.5",
|
@@ -1620,14 +1588,14 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1620
1588
|
stroke: "#31B379"
|
1621
1589
|
}
|
1622
1590
|
),
|
1623
|
-
/* @__PURE__ */
|
1591
|
+
/* @__PURE__ */ React6.createElement("g", { "clip-path": "url(#clip0_2659_5018)" }, /* @__PURE__ */ React6.createElement(
|
1624
1592
|
"path",
|
1625
1593
|
{
|
1626
1594
|
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",
|
1627
1595
|
fill: "#31B379"
|
1628
1596
|
}
|
1629
1597
|
)),
|
1630
|
-
/* @__PURE__ */
|
1598
|
+
/* @__PURE__ */ React6.createElement("defs", null, /* @__PURE__ */ React6.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ React6.createElement(
|
1631
1599
|
"rect",
|
1632
1600
|
{
|
1633
1601
|
width: "22",
|
@@ -1636,15 +1604,15 @@ function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orde
|
|
1636
1604
|
transform: "translate(19.5 19.0039)"
|
1637
1605
|
}
|
1638
1606
|
)))
|
1639
|
-
), /* @__PURE__ */
|
1607
|
+
), /* @__PURE__ */ React6.createElement("h1", null, "Success!"), /* @__PURE__ */ React6.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ React6.createElement(Modal3.Footer, null, /* @__PURE__ */ React6.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))));
|
1640
1608
|
}
|
1641
1609
|
|
1642
1610
|
// src/app/components/RequestPayment/RequestPaymentonClick.tsx
|
1643
|
-
|
1644
|
-
|
1611
|
+
import React7, { useState as useState4 } from "react";
|
1612
|
+
import { Modal as Modal4 } from "react-bootstrap";
|
1645
1613
|
function RequestPaymentonClick(props) {
|
1646
|
-
const [isLoading, setIsLoading] = (
|
1647
|
-
const [show, setShow] = (
|
1614
|
+
const [isLoading, setIsLoading] = useState4(false);
|
1615
|
+
const [show, setShow] = useState4(false);
|
1648
1616
|
const handleClose = () => setShow(false);
|
1649
1617
|
const handleShow = () => setShow(true);
|
1650
1618
|
const { fractalpayClientKey, amount, phone_number, orderID, onSuccess, onError } = props;
|
@@ -1678,7 +1646,7 @@ function RequestPaymentonClick(props) {
|
|
1678
1646
|
console.error("Error:", error);
|
1679
1647
|
});
|
1680
1648
|
};
|
1681
|
-
return /* @__PURE__ */
|
1649
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ React7.createElement(
|
1682
1650
|
"button",
|
1683
1651
|
{
|
1684
1652
|
onClick: sendRequestPayment,
|
@@ -1686,7 +1654,7 @@ function RequestPaymentonClick(props) {
|
|
1686
1654
|
className: "paymentBtn"
|
1687
1655
|
},
|
1688
1656
|
isLoading ? "Loading..." : "Request Payment"
|
1689
|
-
), /* @__PURE__ */
|
1657
|
+
), /* @__PURE__ */ React7.createElement(Modal4, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ React7.createElement(Modal4.Header, { closeButton: true }), /* @__PURE__ */ React7.createElement(Modal4.Body, null, onSuccess && /* @__PURE__ */ React7.createElement(
|
1690
1658
|
"svg",
|
1691
1659
|
{
|
1692
1660
|
width: "60",
|
@@ -1695,7 +1663,7 @@ function RequestPaymentonClick(props) {
|
|
1695
1663
|
fill: "none",
|
1696
1664
|
xmlns: "http://www.w3.org/2000/svg"
|
1697
1665
|
},
|
1698
|
-
/* @__PURE__ */
|
1666
|
+
/* @__PURE__ */ React7.createElement(
|
1699
1667
|
"rect",
|
1700
1668
|
{
|
1701
1669
|
x: "0.5",
|
@@ -1706,14 +1674,14 @@ function RequestPaymentonClick(props) {
|
|
1706
1674
|
stroke: "#31B379"
|
1707
1675
|
}
|
1708
1676
|
),
|
1709
|
-
/* @__PURE__ */
|
1677
|
+
/* @__PURE__ */ React7.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ React7.createElement(
|
1710
1678
|
"path",
|
1711
1679
|
{
|
1712
1680
|
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",
|
1713
1681
|
fill: "#31B379"
|
1714
1682
|
}
|
1715
1683
|
)),
|
1716
|
-
/* @__PURE__ */
|
1684
|
+
/* @__PURE__ */ React7.createElement("defs", null, /* @__PURE__ */ React7.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ React7.createElement(
|
1717
1685
|
"rect",
|
1718
1686
|
{
|
1719
1687
|
width: "22",
|
@@ -1722,21 +1690,21 @@ function RequestPaymentonClick(props) {
|
|
1722
1690
|
transform: "translate(19.5 19.0039)"
|
1723
1691
|
}
|
1724
1692
|
)))
|
1725
|
-
), onSuccess ? /* @__PURE__ */
|
1693
|
+
), onSuccess ? /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("h1", null, "Success!"), /* @__PURE__ */ React7.createElement("h4", null, onSuccess)) : /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("h1", null, "Error!"), /* @__PURE__ */ React7.createElement("h4", null, onError))), /* @__PURE__ */ React7.createElement(Modal4.Footer, null, /* @__PURE__ */ React7.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))));
|
1726
1694
|
}
|
1727
1695
|
|
1728
1696
|
// src/app/components/RequestPayment/RqstPaymntInputField.tsx
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1697
|
+
import React8, { useState as useState5 } from "react";
|
1698
|
+
import { Modal as Modal5 } from "react-bootstrap";
|
1699
|
+
import { toast as toast2, ToastContainer as ToastContainer2 } from "react-toastify";
|
1700
|
+
import "react-toastify/dist/ReactToastify.css";
|
1733
1701
|
function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
1734
|
-
const [isLoading, setIsLoading] = (
|
1735
|
-
const [show, setShow] = (
|
1736
|
-
const [phoneNumber, setPhoneNumber] = (
|
1737
|
-
const [isValidNumber, setIsValidNumber] = (
|
1738
|
-
const [errorMessage, setErrorMessage] = (
|
1739
|
-
const [submitClicked, setSubmitClicked] = (
|
1702
|
+
const [isLoading, setIsLoading] = useState5(false);
|
1703
|
+
const [show, setShow] = useState5(false);
|
1704
|
+
const [phoneNumber, setPhoneNumber] = useState5("");
|
1705
|
+
const [isValidNumber, setIsValidNumber] = useState5(true);
|
1706
|
+
const [errorMessage, setErrorMessage] = useState5("");
|
1707
|
+
const [submitClicked, setSubmitClicked] = useState5(false);
|
1740
1708
|
const handleClose = () => setShow(false);
|
1741
1709
|
const handleShow = () => setShow(true);
|
1742
1710
|
const sendRequestPayment = () => {
|
@@ -1781,7 +1749,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1781
1749
|
}).catch((error) => {
|
1782
1750
|
setIsLoading(false);
|
1783
1751
|
console.error("Error:", error);
|
1784
|
-
|
1752
|
+
toast2.error(ErrorText.anerroroccured);
|
1785
1753
|
});
|
1786
1754
|
};
|
1787
1755
|
const handlePhoneNumberChange = (e) => {
|
@@ -1799,7 +1767,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1799
1767
|
setErrorMessage(ErrorText.phonenumbervalid);
|
1800
1768
|
}
|
1801
1769
|
};
|
1802
|
-
return /* @__PURE__ */
|
1770
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("div", { className: "payment-container" }, /* @__PURE__ */ React8.createElement("div", { className: "input-wrapper" }, /* @__PURE__ */ React8.createElement("div", { className: "input-container" }, /* @__PURE__ */ React8.createElement(
|
1803
1771
|
"input",
|
1804
1772
|
{
|
1805
1773
|
type: "text",
|
@@ -1809,7 +1777,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1809
1777
|
maxLength: 10,
|
1810
1778
|
className: submitClicked && (!phoneNumber || !isValidNumber) ? "error" : ""
|
1811
1779
|
}
|
1812
|
-
), errorMessage && /* @__PURE__ */
|
1780
|
+
), errorMessage && /* @__PURE__ */ React8.createElement("div", { className: "error-message text-danger" }, errorMessage))), /* @__PURE__ */ React8.createElement("div", { className: "button-wrapper" }, /* @__PURE__ */ React8.createElement(
|
1813
1781
|
"button",
|
1814
1782
|
{
|
1815
1783
|
onClick: sendRequestPayment,
|
@@ -1817,7 +1785,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1817
1785
|
className: "paymentBtn"
|
1818
1786
|
},
|
1819
1787
|
isLoading ? "Loading..." : "Request Payment"
|
1820
|
-
))), /* @__PURE__ */
|
1788
|
+
))), /* @__PURE__ */ React8.createElement(Modal5, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ React8.createElement(Modal5.Header, { closeButton: true }), /* @__PURE__ */ React8.createElement(Modal5.Body, null, /* @__PURE__ */ React8.createElement(
|
1821
1789
|
"svg",
|
1822
1790
|
{
|
1823
1791
|
width: "60",
|
@@ -1826,7 +1794,7 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1826
1794
|
fill: "none",
|
1827
1795
|
xmlns: "http://www.w3.org/2000/svg"
|
1828
1796
|
},
|
1829
|
-
/* @__PURE__ */
|
1797
|
+
/* @__PURE__ */ React8.createElement(
|
1830
1798
|
"rect",
|
1831
1799
|
{
|
1832
1800
|
x: "0.5",
|
@@ -1837,14 +1805,14 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1837
1805
|
stroke: "#31B379"
|
1838
1806
|
}
|
1839
1807
|
),
|
1840
|
-
/* @__PURE__ */
|
1808
|
+
/* @__PURE__ */ React8.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ React8.createElement(
|
1841
1809
|
"path",
|
1842
1810
|
{
|
1843
1811
|
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",
|
1844
1812
|
fill: "#31B379"
|
1845
1813
|
}
|
1846
1814
|
)),
|
1847
|
-
/* @__PURE__ */
|
1815
|
+
/* @__PURE__ */ React8.createElement("defs", null, /* @__PURE__ */ React8.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ React8.createElement(
|
1848
1816
|
"rect",
|
1849
1817
|
{
|
1850
1818
|
width: "22",
|
@@ -1853,20 +1821,19 @@ function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
|
|
1853
1821
|
transform: "translate(19.5 19.0039)"
|
1854
1822
|
}
|
1855
1823
|
)))
|
1856
|
-
), /* @__PURE__ */
|
1824
|
+
), /* @__PURE__ */ React8.createElement("h1", null, "Success!"), /* @__PURE__ */ React8.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ React8.createElement(Modal5.Footer, null, /* @__PURE__ */ React8.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))), /* @__PURE__ */ React8.createElement(ToastContainer2, null));
|
1857
1825
|
}
|
1858
1826
|
|
1859
1827
|
// src/app/components/Payment/Payment.tsx
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
var import_react_bootstrap6 = require("react-bootstrap");
|
1828
|
+
import React10, { useState as useState6 } from "react";
|
1829
|
+
import forge from "node-forge";
|
1830
|
+
import { toast as toast3 } from "react-toastify";
|
1831
|
+
import { Modal as Modal6 } from "react-bootstrap";
|
1865
1832
|
|
1866
1833
|
// src/app/components/Payment/Paymentstyles.tsx
|
1867
|
-
|
1834
|
+
import React9 from "react";
|
1868
1835
|
function Paymentstyles() {
|
1869
|
-
return /* @__PURE__ */
|
1836
|
+
return /* @__PURE__ */ React9.createElement("style", null, `
|
1870
1837
|
.paymentBtn {
|
1871
1838
|
background-color: black;
|
1872
1839
|
border: none;
|
@@ -2792,7 +2759,7 @@ input {
|
|
2792
2759
|
// src/app/components/Payment/Payment.tsx
|
2793
2760
|
function Payment() {
|
2794
2761
|
var _a;
|
2795
|
-
const [state, setState] = (
|
2762
|
+
const [state, setState] = useState6({
|
2796
2763
|
show: false,
|
2797
2764
|
publicKey: "",
|
2798
2765
|
sessionKey: "",
|
@@ -2803,14 +2770,23 @@ function Payment() {
|
|
2803
2770
|
zip: "",
|
2804
2771
|
amount: ""
|
2805
2772
|
});
|
2806
|
-
const [isValid, setIsValid] = (
|
2807
|
-
const [isValidMonth, setIsValidMonth] = (
|
2808
|
-
const [data, setData] = (
|
2773
|
+
const [isValid, setIsValid] = useState6(false);
|
2774
|
+
const [isValidMonth, setIsValidMonth] = useState6(false);
|
2775
|
+
const [data, setData] = useState6(null);
|
2809
2776
|
const handlePaymentClick = async () => {
|
2810
2777
|
try {
|
2811
|
-
const response = await
|
2812
|
-
|
2813
|
-
|
2778
|
+
const response = await fetch(`${baseUrl}generate-session`, {
|
2779
|
+
method: "POST",
|
2780
|
+
headers: {
|
2781
|
+
"Content-Type": "application/json"
|
2782
|
+
},
|
2783
|
+
body: JSON.stringify({})
|
2784
|
+
});
|
2785
|
+
if (!response.ok) {
|
2786
|
+
throw new Error("Network response was not ok");
|
2787
|
+
}
|
2788
|
+
const data2 = await response.json();
|
2789
|
+
if (data2 && data2.result === true) {
|
2814
2790
|
setState((prev) => {
|
2815
2791
|
var _a2, _b;
|
2816
2792
|
return __spreadProps(__spreadValues({}, prev), {
|
@@ -2826,12 +2802,12 @@ function Payment() {
|
|
2826
2802
|
};
|
2827
2803
|
const handleSubmitPay = async () => {
|
2828
2804
|
const track2_data = `${state.cardNumber.replace(/\s+/g, "")}=${state.year}${state.month.length > 1 ? state.month : "0" + state.month} ${state.cvv}`;
|
2829
|
-
const publicKey =
|
2805
|
+
const publicKey = forge.pki.publicKeyFromPem(state.publicKey);
|
2830
2806
|
const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
|
2831
|
-
md:
|
2832
|
-
mgf1: { md:
|
2807
|
+
md: forge.md.sha1.create(),
|
2808
|
+
mgf1: { md: forge.md.sha1.create() }
|
2833
2809
|
});
|
2834
|
-
const encryptedBase64 =
|
2810
|
+
const encryptedBase64 = forge.util.encode64(encrypted);
|
2835
2811
|
console.log(encryptedBase64);
|
2836
2812
|
const requestBody = {
|
2837
2813
|
enc_track2_data: encryptedBase64,
|
@@ -2840,14 +2816,16 @@ function Payment() {
|
|
2840
2816
|
};
|
2841
2817
|
const apiUrl = "https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize";
|
2842
2818
|
try {
|
2843
|
-
const response = await
|
2819
|
+
const response = await fetch(apiUrl, {
|
2820
|
+
method: "POST",
|
2844
2821
|
headers: {
|
2845
2822
|
"x-app-session-key": state == null ? void 0 : state.sessionKey,
|
2846
2823
|
"Content-Type": "application/json"
|
2847
|
-
}
|
2824
|
+
},
|
2825
|
+
body: JSON.stringify(requestBody)
|
2848
2826
|
});
|
2849
|
-
if (
|
2850
|
-
|
2827
|
+
if (response.ok) {
|
2828
|
+
toast3.success("Payment Successful");
|
2851
2829
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
2852
2830
|
show: false,
|
2853
2831
|
publicKey: "",
|
@@ -2860,7 +2838,8 @@ function Payment() {
|
|
2860
2838
|
amount: ""
|
2861
2839
|
}));
|
2862
2840
|
}
|
2863
|
-
|
2841
|
+
const responseData = await response.json();
|
2842
|
+
console.log("response", responseData);
|
2864
2843
|
} catch (error) {
|
2865
2844
|
console.error("Error:", error);
|
2866
2845
|
}
|
@@ -2957,7 +2936,7 @@ function Payment() {
|
|
2957
2936
|
}
|
2958
2937
|
return "";
|
2959
2938
|
}
|
2960
|
-
return /* @__PURE__ */
|
2939
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(Paymentstyles, null), /* @__PURE__ */ React10.createElement("div", { className: "" }, /* @__PURE__ */ React10.createElement(
|
2961
2940
|
"button",
|
2962
2941
|
{
|
2963
2942
|
className: "export-btn",
|
@@ -2965,8 +2944,8 @@ function Payment() {
|
|
2965
2944
|
onClick: () => handlePaymentClick()
|
2966
2945
|
},
|
2967
2946
|
"Payment"
|
2968
|
-
), /* @__PURE__ */
|
2969
|
-
|
2947
|
+
), /* @__PURE__ */ React10.createElement(
|
2948
|
+
Modal6,
|
2970
2949
|
{
|
2971
2950
|
show: state.show,
|
2972
2951
|
onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -2974,8 +2953,8 @@ function Payment() {
|
|
2974
2953
|
})),
|
2975
2954
|
centered: true
|
2976
2955
|
},
|
2977
|
-
/* @__PURE__ */
|
2978
|
-
/* @__PURE__ */
|
2956
|
+
/* @__PURE__ */ React10.createElement(Modal6.Header, { closeButton: true }),
|
2957
|
+
/* @__PURE__ */ React10.createElement(Modal6.Body, null, /* @__PURE__ */ React10.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ React10.createElement("div", { className: "row" }, /* @__PURE__ */ React10.createElement("div", { className: "" }, /* @__PURE__ */ React10.createElement("div", { id: "Checkout", className: "inline" }, /* @__PURE__ */ React10.createElement("div", { className: "header" }, /* @__PURE__ */ React10.createElement("h1", null, "Pay")), /* @__PURE__ */ React10.createElement("form", { id: "PaymentForm", className: "payment-form" }, /* @__PURE__ */ React10.createElement("div", { className: "form-group", style: { display: "none" } }, /* @__PURE__ */ React10.createElement("label", null, "Payment amount"), /* @__PURE__ */ React10.createElement("div", { className: "input-group" }, /* @__PURE__ */ React10.createElement("span", { className: "input-group-addon" }, "$"), /* @__PURE__ */ React10.createElement(
|
2979
2958
|
"input",
|
2980
2959
|
{
|
2981
2960
|
type: "text",
|
@@ -2984,13 +2963,13 @@ function Payment() {
|
|
2984
2963
|
className: "form-control",
|
2985
2964
|
id: ""
|
2986
2965
|
}
|
2987
|
-
)), /* @__PURE__ */
|
2966
|
+
)), /* @__PURE__ */ React10.createElement(
|
2988
2967
|
"span",
|
2989
2968
|
{
|
2990
2969
|
id: "amount-error",
|
2991
2970
|
style: { color: "red", display: "none" }
|
2992
2971
|
}
|
2993
|
-
)), /* @__PURE__ */
|
2972
|
+
)), /* @__PURE__ */ React10.createElement("div", { className: "form-group" }, /* @__PURE__ */ React10.createElement("label", null, "Name on card"), /* @__PURE__ */ React10.createElement(
|
2994
2973
|
"input",
|
2995
2974
|
{
|
2996
2975
|
id: "NameOnCard",
|
@@ -2999,13 +2978,13 @@ function Payment() {
|
|
2999
2978
|
maxLength: 100,
|
3000
2979
|
placeholder: "Name"
|
3001
2980
|
}
|
3002
|
-
), /* @__PURE__ */
|
2981
|
+
), /* @__PURE__ */ React10.createElement(
|
3003
2982
|
"span",
|
3004
2983
|
{
|
3005
2984
|
id: "NameOnCard-error",
|
3006
2985
|
style: { color: "red", display: "none" }
|
3007
2986
|
}
|
3008
|
-
)), /* @__PURE__ */
|
2987
|
+
)), /* @__PURE__ */ React10.createElement("div", { className: "form-group" }, /* @__PURE__ */ React10.createElement(
|
3009
2988
|
"input",
|
3010
2989
|
{
|
3011
2990
|
"data-token": "card_number",
|
@@ -3016,7 +2995,7 @@ function Payment() {
|
|
3016
2995
|
placeholder: "0000 0000 0000 0000",
|
3017
2996
|
onChange: handleCardNumberChange
|
3018
2997
|
}
|
3019
|
-
), state.error && /* @__PURE__ */
|
2998
|
+
), state.error && /* @__PURE__ */ React10.createElement("div", { style: { color: "red" } }, state.error)), /* @__PURE__ */ React10.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ React10.createElement(
|
3020
2999
|
"input",
|
3021
3000
|
{
|
3022
3001
|
"data-token": "exp_month",
|
@@ -3027,14 +3006,14 @@ function Payment() {
|
|
3027
3006
|
maxLength: 2,
|
3028
3007
|
onChange: (e) => handleMonthChange(e)
|
3029
3008
|
}
|
3030
|
-
), isValidMonth && /* @__PURE__ */
|
3009
|
+
), isValidMonth && /* @__PURE__ */ React10.createElement(
|
3031
3010
|
"span",
|
3032
3011
|
{
|
3033
3012
|
id: "card_number-error",
|
3034
3013
|
style: { color: "red", fontSize: "15px" }
|
3035
3014
|
},
|
3036
3015
|
(_a = ErrorText) == null ? void 0 : _a.montherror
|
3037
|
-
)), /* @__PURE__ */
|
3016
|
+
)), /* @__PURE__ */ React10.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ React10.createElement(
|
3038
3017
|
"input",
|
3039
3018
|
{
|
3040
3019
|
"data-token": "exp_year",
|
@@ -3045,7 +3024,7 @@ function Payment() {
|
|
3045
3024
|
value: state.year,
|
3046
3025
|
onChange: (e) => handleYearChange(e)
|
3047
3026
|
}
|
3048
|
-
), state.yearError && /* @__PURE__ */
|
3027
|
+
), state.yearError && /* @__PURE__ */ React10.createElement("span", { id: "exp_year-error", style: { color: "red" } }, state.yearError)), /* @__PURE__ */ React10.createElement("div", { className: "security-code-group form-group" }, /* @__PURE__ */ React10.createElement("div", { className: "input-container" }, /* @__PURE__ */ React10.createElement(
|
3049
3028
|
"input",
|
3050
3029
|
{
|
3051
3030
|
"data-token": "cvv",
|
@@ -3056,7 +3035,7 @@ function Payment() {
|
|
3056
3035
|
placeholder: "CVV",
|
3057
3036
|
onChange: (e) => handleCVVChange(e)
|
3058
3037
|
}
|
3059
|
-
), /* @__PURE__ */
|
3038
|
+
), /* @__PURE__ */ React10.createElement("i", { id: "cvc", className: "fa fa-question-circle" }), state.cvvError && /* @__PURE__ */ React10.createElement("span", { id: "cvv-error", style: { color: "red" } }, state.cvvError)), /* @__PURE__ */ React10.createElement("div", { className: "cvc-preview-container two-card hide" }, /* @__PURE__ */ React10.createElement("div", { className: "amex-cvc-preview" }), /* @__PURE__ */ React10.createElement("div", { className: "visa-mc-dis-cvc-preview" }))), /* @__PURE__ */ React10.createElement("div", { className: "zip-code-group form-group" }, /* @__PURE__ */ React10.createElement("label", null, "Postal code"), /* @__PURE__ */ React10.createElement("div", { className: "input-container" }, /* @__PURE__ */ React10.createElement(
|
3060
3039
|
"input",
|
3061
3040
|
{
|
3062
3041
|
id: "ZIPCode",
|
@@ -3068,7 +3047,7 @@ function Payment() {
|
|
3068
3047
|
value: state.zip,
|
3069
3048
|
onChange: (e) => handleZIP(e)
|
3070
3049
|
}
|
3071
|
-
), /* @__PURE__ */
|
3050
|
+
), /* @__PURE__ */ React10.createElement(
|
3072
3051
|
"a",
|
3073
3052
|
{
|
3074
3053
|
tabIndex: 0,
|
@@ -3078,15 +3057,15 @@ function Payment() {
|
|
3078
3057
|
"data-placement": "left",
|
3079
3058
|
"data-content": "Enter the ZIP/Postal code for your credit card billing address."
|
3080
3059
|
},
|
3081
|
-
/* @__PURE__ */
|
3082
|
-
), /* @__PURE__ */
|
3060
|
+
/* @__PURE__ */ React10.createElement("i", { className: "fa fa-question-circle" })
|
3061
|
+
), /* @__PURE__ */ React10.createElement(
|
3083
3062
|
"span",
|
3084
3063
|
{
|
3085
3064
|
id: "ZIPCode-error",
|
3086
3065
|
style: { color: "red", display: "none" }
|
3087
3066
|
},
|
3088
3067
|
ErrorText.fieldrequired
|
3089
|
-
))), /* @__PURE__ */
|
3068
|
+
))), /* @__PURE__ */ React10.createElement("div", { className: "form-group top-amnt" }, /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("label", null, "Payment amount"), /* @__PURE__ */ React10.createElement("div", { className: "amount-placeholder" }, /* @__PURE__ */ React10.createElement(
|
3090
3069
|
"input",
|
3091
3070
|
{
|
3092
3071
|
id: "Amount",
|
@@ -3098,7 +3077,7 @@ function Payment() {
|
|
3098
3077
|
onChange: (e) => handleAmount(e),
|
3099
3078
|
onBlur: handleAmountBlur
|
3100
3079
|
}
|
3101
|
-
))), /* @__PURE__ */
|
3080
|
+
))), /* @__PURE__ */ React10.createElement("div", { className: "card-row" }, /* @__PURE__ */ React10.createElement("span", { className: "visa" }), /* @__PURE__ */ React10.createElement("span", { className: "mastercard" }), /* @__PURE__ */ React10.createElement("span", { className: "amex" }), /* @__PURE__ */ React10.createElement("span", { className: "discover" }))), /* @__PURE__ */ React10.createElement(
|
3102
3081
|
"button",
|
3103
3082
|
{
|
3104
3083
|
type: "button",
|
@@ -3107,7 +3086,7 @@ function Payment() {
|
|
3107
3086
|
className: "btn btn-block btn-success submit-button"
|
3108
3087
|
},
|
3109
3088
|
"Pay"
|
3110
|
-
)), /* @__PURE__ */
|
3089
|
+
)), /* @__PURE__ */ React10.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ React10.createElement(
|
3111
3090
|
"svg",
|
3112
3091
|
{
|
3113
3092
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3115,14 +3094,14 @@ function Payment() {
|
|
3115
3094
|
height: "20",
|
3116
3095
|
viewBox: "0 0 26 26"
|
3117
3096
|
},
|
3118
|
-
/* @__PURE__ */
|
3097
|
+
/* @__PURE__ */ React10.createElement(
|
3119
3098
|
"path",
|
3120
3099
|
{
|
3121
3100
|
fill: "currentColor",
|
3122
3101
|
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"
|
3123
3102
|
}
|
3124
3103
|
)
|
3125
|
-
), "Secure payments powered by Fractal", /* @__PURE__ */
|
3104
|
+
), "Secure payments powered by Fractal", /* @__PURE__ */ React10.createElement(
|
3126
3105
|
"img",
|
3127
3106
|
{
|
3128
3107
|
src: "https://ui.fractalpay.com/favicon.ico",
|
@@ -3134,22 +3113,28 @@ function Payment() {
|
|
3134
3113
|
}
|
3135
3114
|
|
3136
3115
|
// src/app/components/Transaction/CompletedTransactions.tsx
|
3137
|
-
|
3138
|
-
|
3139
|
-
|
3140
|
-
|
3141
|
-
|
3142
|
-
|
3116
|
+
import React12, { useEffect as useEffect3, useState as useState8 } from "react";
|
3117
|
+
import { Col, Row, Table } from "react-bootstrap";
|
3118
|
+
import {
|
3119
|
+
DatatableWrapper,
|
3120
|
+
Filter,
|
3121
|
+
PaginationOptions,
|
3122
|
+
TableBody,
|
3123
|
+
TableHeader
|
3124
|
+
} from "react-bs-datatable";
|
3125
|
+
import DatePicker from "react-datepicker";
|
3126
|
+
import "react-datepicker/dist/react-datepicker.css";
|
3127
|
+
import { toast as toast4 } from "react-toastify";
|
3143
3128
|
|
3144
3129
|
// src/app/components/Pagination/Pagination.tsx
|
3145
|
-
|
3130
|
+
import React11, { useState as useState7, useEffect as useEffect2 } from "react";
|
3146
3131
|
function PaginationPg({ totalPages, onPageChange, current }) {
|
3147
|
-
const [currentPage, setCurrentPage] = (
|
3148
|
-
const [showPages, setShowPages] = (
|
3149
|
-
(
|
3132
|
+
const [currentPage, setCurrentPage] = useState7(current);
|
3133
|
+
const [showPages, setShowPages] = useState7(false);
|
3134
|
+
useEffect2(() => {
|
3150
3135
|
setCurrentPage(current);
|
3151
3136
|
}, [current]);
|
3152
|
-
(
|
3137
|
+
useEffect2(() => {
|
3153
3138
|
setTimeout(() => {
|
3154
3139
|
setShowPages(true);
|
3155
3140
|
}, 1e3);
|
@@ -3185,7 +3170,7 @@ function PaginationPg({ totalPages, onPageChange, current }) {
|
|
3185
3170
|
if (currentPage > 3) {
|
3186
3171
|
pageNumbers.push(renderPageNumber(1));
|
3187
3172
|
if (currentPage > 4) {
|
3188
|
-
pageNumbers.push(/* @__PURE__ */
|
3173
|
+
pageNumbers.push(/* @__PURE__ */ React11.createElement("li", { key: "start-break", className: "page-item disabled" }, /* @__PURE__ */ React11.createElement("span", { className: "page-link" }, "...")));
|
3189
3174
|
}
|
3190
3175
|
}
|
3191
3176
|
const startPage = Math.max(currentPage - 1, 1);
|
@@ -3195,15 +3180,15 @@ function PaginationPg({ totalPages, onPageChange, current }) {
|
|
3195
3180
|
}
|
3196
3181
|
if (currentPage < totalPages - 2) {
|
3197
3182
|
if (currentPage < totalPages - 3) {
|
3198
|
-
pageNumbers.push(/* @__PURE__ */
|
3183
|
+
pageNumbers.push(/* @__PURE__ */ React11.createElement("li", { key: "end-break", className: "page-item disabled" }, /* @__PURE__ */ React11.createElement("span", { className: "page-link" }, "...")));
|
3199
3184
|
}
|
3200
3185
|
pageNumbers.push(renderPageNumber(totalPages));
|
3201
3186
|
}
|
3202
3187
|
}
|
3203
3188
|
return pageNumbers;
|
3204
3189
|
};
|
3205
|
-
const renderPageNumber = (pageNumber) => /* @__PURE__ */
|
3206
|
-
return /* @__PURE__ */
|
3190
|
+
const renderPageNumber = (pageNumber) => /* @__PURE__ */ React11.createElement("li", { key: pageNumber, className: `page-item ${currentPage === pageNumber ? "active" : ""}` }, /* @__PURE__ */ React11.createElement("a", { className: "page-link cursor-pointer", onClick: (e) => handlePageClick(e, pageNumber) }, pageNumber));
|
3191
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("nav", { className: "app-pagination py-2" }, /* @__PURE__ */ React11.createElement("ul", { className: "pagination justify-content-center" }, /* @__PURE__ */ React11.createElement("li", { className: `page-item ${currentPage === 1 ? "disabled" : ""}` }, /* @__PURE__ */ React11.createElement("a", { className: "page-link cursor-pointer", onClick: handlePrevious }, /* @__PURE__ */ React11.createElement("span", null, "\u2B9C"))), showPages && getPageNumbers(), /* @__PURE__ */ React11.createElement("li", { className: `page-item ${currentPage === totalPages ? "disabled" : ""}` }, /* @__PURE__ */ React11.createElement("a", { className: "page-link cursor-pointer", onClick: handleNext }, /* @__PURE__ */ React11.createElement("span", null, "\u2B9E"))))));
|
3207
3192
|
}
|
3208
3193
|
|
3209
3194
|
// src/app/components/Transaction/CompletedTransactions.tsx
|
@@ -3241,10 +3226,10 @@ var STORY_HEADERS = [
|
|
3241
3226
|
}
|
3242
3227
|
];
|
3243
3228
|
function CompletedTransactions(props) {
|
3244
|
-
const [dataList, setDataList] = (
|
3245
|
-
const [startDate, setStartDate] = (
|
3246
|
-
const [endDate, setEndDate] = (
|
3247
|
-
const [state, setState] = (
|
3229
|
+
const [dataList, setDataList] = useState8([]);
|
3230
|
+
const [startDate, setStartDate] = useState8(null);
|
3231
|
+
const [endDate, setEndDate] = useState8(null);
|
3232
|
+
const [state, setState] = useState8({
|
3248
3233
|
page: 1,
|
3249
3234
|
totalPage: 0,
|
3250
3235
|
data: [],
|
@@ -3332,9 +3317,9 @@ function CompletedTransactions(props) {
|
|
3332
3317
|
};
|
3333
3318
|
const handleExport = async () => {
|
3334
3319
|
if (!startDate) {
|
3335
|
-
|
3320
|
+
toast4.error("Start date required");
|
3336
3321
|
} else if (!endDate) {
|
3337
|
-
|
3322
|
+
toast4.error("End date required");
|
3338
3323
|
} else {
|
3339
3324
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { csvData: true }));
|
3340
3325
|
try {
|
@@ -3367,19 +3352,19 @@ function CompletedTransactions(props) {
|
|
3367
3352
|
}
|
3368
3353
|
}
|
3369
3354
|
};
|
3370
|
-
(
|
3355
|
+
useEffect3(() => {
|
3371
3356
|
fetchData(state.page, startDate, endDate);
|
3372
3357
|
}, [state.page]);
|
3373
3358
|
const handlePageChange = (pageNumber) => {
|
3374
3359
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { page: pageNumber }));
|
3375
3360
|
fetchData(pageNumber, startDate, endDate);
|
3376
3361
|
};
|
3377
|
-
return /* @__PURE__ */
|
3362
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("style", null, `
|
3378
3363
|
.react-datepicker-wrapper:first-child {
|
3379
3364
|
margin-right: 10px;
|
3380
3365
|
}
|
3381
|
-
`), /* @__PURE__ */
|
3382
|
-
|
3366
|
+
`), /* @__PURE__ */ React12.createElement("div", { className: "mb-5" }, /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ React12.createElement("div", { style: { display: "flex", marginRight: "10px", marginTop: "25px" } }, /* @__PURE__ */ React12.createElement(
|
3367
|
+
DatePicker,
|
3383
3368
|
{
|
3384
3369
|
selected: startDate,
|
3385
3370
|
onChange: handleStartDateChange,
|
@@ -3389,8 +3374,8 @@ function CompletedTransactions(props) {
|
|
3389
3374
|
placeholderText: "Start Date",
|
3390
3375
|
required: true
|
3391
3376
|
}
|
3392
|
-
), /* @__PURE__ */
|
3393
|
-
|
3377
|
+
), /* @__PURE__ */ React12.createElement(
|
3378
|
+
DatePicker,
|
3394
3379
|
{
|
3395
3380
|
selected: endDate,
|
3396
3381
|
onChange: handleEndDateChange,
|
@@ -3400,8 +3385,8 @@ function CompletedTransactions(props) {
|
|
3400
3385
|
minDate: startDate,
|
3401
3386
|
placeholderText: "End Date"
|
3402
3387
|
}
|
3403
|
-
)), /* @__PURE__ */
|
3404
|
-
|
3388
|
+
)), /* @__PURE__ */ React12.createElement("button", { className: "export-btn1", onClick: handleExport }, "Export")), /* @__PURE__ */ React12.createElement(
|
3389
|
+
DatatableWrapper,
|
3405
3390
|
{
|
3406
3391
|
body: dataList,
|
3407
3392
|
headers: STORY_HEADERS,
|
@@ -3412,21 +3397,20 @@ function CompletedTransactions(props) {
|
|
3412
3397
|
}
|
3413
3398
|
}
|
3414
3399
|
},
|
3415
|
-
/* @__PURE__ */
|
3416
|
-
/* @__PURE__ */
|
3417
|
-
/* @__PURE__ */
|
3400
|
+
/* @__PURE__ */ React12.createElement(Row, { className: "mb-4 p-2" }, /* @__PURE__ */ React12.createElement(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__ */ React12.createElement(PaginationOptions, null)), /* @__PURE__ */ React12.createElement(Col, { xs: 12, lg: 4, className: "d-flex flex-col justify-content-end align-items-end" }), /* @__PURE__ */ React12.createElement(Col, { xs: 12, sm: 6, lg: 4, className: "d-flex flex-col justify-content-end align-items-end" }, /* @__PURE__ */ React12.createElement(Filter, null))),
|
3401
|
+
/* @__PURE__ */ React12.createElement(Row, null, /* @__PURE__ */ React12.createElement("div", { className: "responsive-tbl" }, /* @__PURE__ */ React12.createElement(Table, null, /* @__PURE__ */ React12.createElement(TableHeader, null), /* @__PURE__ */ React12.createElement(TableBody, null)))),
|
3402
|
+
/* @__PURE__ */ React12.createElement(PaginationPg, { totalPages: state.totalPage, onPageChange: handlePageChange, current: state.page })
|
3418
3403
|
))));
|
3419
3404
|
}
|
3420
3405
|
|
3421
3406
|
// src/app/components/Payment/TockenizPay.tsx
|
3422
|
-
|
3423
|
-
|
3424
|
-
|
3425
|
-
|
3426
|
-
|
3427
|
-
var import_credit_card_type = __toESM(require("credit-card-type"), 1);
|
3407
|
+
import React13, { useState as useState9 } from "react";
|
3408
|
+
import { Modal as Modal7 } from "react-bootstrap";
|
3409
|
+
import { toast as toast5, ToastContainer as ToastContainer3 } from "react-toastify";
|
3410
|
+
import forge2 from "node-forge";
|
3411
|
+
import creditCardType from "credit-card-type";
|
3428
3412
|
function TockenizPay() {
|
3429
|
-
const [state, setState] = (
|
3413
|
+
const [state, setState] = useState9({
|
3430
3414
|
show: false,
|
3431
3415
|
publicKey: "",
|
3432
3416
|
sessionKey: "",
|
@@ -3437,15 +3421,24 @@ function TockenizPay() {
|
|
3437
3421
|
zip: "",
|
3438
3422
|
amount: ""
|
3439
3423
|
});
|
3440
|
-
const [cardTypeDetail, setCardTypeDetail] = (
|
3441
|
-
const [isValid, setIsValid] = (
|
3442
|
-
const [isValidMonth, setIsValidMonth] = (
|
3443
|
-
const [data, setData] = (
|
3424
|
+
const [cardTypeDetail, setCardTypeDetail] = useState9(null);
|
3425
|
+
const [isValid, setIsValid] = useState9(false);
|
3426
|
+
const [isValidMonth, setIsValidMonth] = useState9(false);
|
3427
|
+
const [data, setData] = useState9(null);
|
3444
3428
|
const handlePaymentClick = async () => {
|
3445
3429
|
try {
|
3446
|
-
const response = await
|
3447
|
-
|
3448
|
-
|
3430
|
+
const response = await fetch(`${baseUrl}/generate-session`, {
|
3431
|
+
method: "POST",
|
3432
|
+
headers: {
|
3433
|
+
"Content-Type": "application/json"
|
3434
|
+
},
|
3435
|
+
body: JSON.stringify({})
|
3436
|
+
});
|
3437
|
+
if (!response.ok) {
|
3438
|
+
throw new Error("Network response was not ok");
|
3439
|
+
}
|
3440
|
+
const data2 = await response.json();
|
3441
|
+
if (data2 && data2.result === true) {
|
3449
3442
|
setState((prev) => {
|
3450
3443
|
var _a, _b;
|
3451
3444
|
return __spreadProps(__spreadValues({}, prev), {
|
@@ -3460,16 +3453,16 @@ function TockenizPay() {
|
|
3460
3453
|
}
|
3461
3454
|
};
|
3462
3455
|
const handleSubmitPay = async () => {
|
3463
|
-
var _a, _b, _c
|
3456
|
+
var _a, _b, _c;
|
3464
3457
|
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}`;
|
3465
|
-
const publicKey =
|
3458
|
+
const publicKey = forge2.pki.publicKeyFromPem(state.publicKey);
|
3466
3459
|
const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
|
3467
|
-
md:
|
3460
|
+
md: forge2.md.sha1.create(),
|
3468
3461
|
mgf1: {
|
3469
|
-
md:
|
3462
|
+
md: forge2.md.sha1.create()
|
3470
3463
|
}
|
3471
3464
|
});
|
3472
|
-
const encryptedBase64 =
|
3465
|
+
const encryptedBase64 = forge2.util.encode64(encrypted);
|
3473
3466
|
console.log(encryptedBase64);
|
3474
3467
|
const requestBody = {
|
3475
3468
|
enc_track2_data: encryptedBase64,
|
@@ -3477,33 +3470,37 @@ function TockenizPay() {
|
|
3477
3470
|
algorithm: "RSAES_OAEP_SHA_1"
|
3478
3471
|
};
|
3479
3472
|
try {
|
3480
|
-
const response = await
|
3473
|
+
const response = await fetch(
|
3481
3474
|
"https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize",
|
3482
|
-
requestBody,
|
3483
3475
|
{
|
3476
|
+
method: "POST",
|
3484
3477
|
headers: {
|
3485
3478
|
"x-app-session-key": state == null ? void 0 : state.sessionKey,
|
3486
3479
|
"Content-Type": "application/json"
|
3487
|
-
}
|
3480
|
+
},
|
3481
|
+
body: JSON.stringify(requestBody)
|
3488
3482
|
}
|
3489
3483
|
);
|
3490
|
-
if (
|
3491
|
-
|
3492
|
-
|
3493
|
-
show: false,
|
3494
|
-
publicKey: "",
|
3495
|
-
sessionKey: "",
|
3496
|
-
cardNumber: "",
|
3497
|
-
year: "",
|
3498
|
-
month: "",
|
3499
|
-
cvv: "",
|
3500
|
-
zip: "",
|
3501
|
-
amount: ""
|
3502
|
-
}));
|
3484
|
+
if (!response.ok) {
|
3485
|
+
const errorData = await response.json();
|
3486
|
+
throw new Error(((_c = errorData == null ? void 0 : errorData.data) == null ? void 0 : _c.message) || "Request failed");
|
3503
3487
|
}
|
3504
|
-
|
3488
|
+
const responseData = await response.json();
|
3489
|
+
toast5.success("Payment Successful");
|
3490
|
+
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
3491
|
+
show: false,
|
3492
|
+
publicKey: "",
|
3493
|
+
sessionKey: "",
|
3494
|
+
cardNumber: "",
|
3495
|
+
year: "",
|
3496
|
+
month: "",
|
3497
|
+
cvv: "",
|
3498
|
+
zip: "",
|
3499
|
+
amount: ""
|
3500
|
+
}));
|
3501
|
+
console.log("response", responseData);
|
3505
3502
|
} catch (error) {
|
3506
|
-
|
3503
|
+
toast5.error((error == null ? void 0 : error.message) || "An error occurred");
|
3507
3504
|
console.error("Error:", error);
|
3508
3505
|
}
|
3509
3506
|
};
|
@@ -3535,9 +3532,9 @@ function TockenizPay() {
|
|
3535
3532
|
e.preventDefault();
|
3536
3533
|
e.stopPropagation();
|
3537
3534
|
const { value } = e.target;
|
3538
|
-
let cardtyp = (
|
3535
|
+
let cardtyp = creditCardType(value)[0];
|
3539
3536
|
const formattedValue = formatCreditCardNumber(value, cardtyp == null ? void 0 : cardtyp.type);
|
3540
|
-
setCardTypeDetail((
|
3537
|
+
setCardTypeDetail(creditCardType(value)[0]);
|
3541
3538
|
console.log(formattedValue);
|
3542
3539
|
if (value.match(/[a-zA-Z]/)) {
|
3543
3540
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -3639,7 +3636,7 @@ function TockenizPay() {
|
|
3639
3636
|
}
|
3640
3637
|
return "";
|
3641
3638
|
}
|
3642
|
-
return /* @__PURE__ */
|
3639
|
+
return /* @__PURE__ */ React13.createElement("div", null, /* @__PURE__ */ React13.createElement(ToastContainer3, null), /* @__PURE__ */ React13.createElement(
|
3643
3640
|
"button",
|
3644
3641
|
{
|
3645
3642
|
className: "export-btn mt-4",
|
@@ -3647,8 +3644,8 @@ function TockenizPay() {
|
|
3647
3644
|
onClick: () => handlePaymentClick()
|
3648
3645
|
},
|
3649
3646
|
"TokenizePay"
|
3650
|
-
), /* @__PURE__ */
|
3651
|
-
|
3647
|
+
), /* @__PURE__ */ React13.createElement(
|
3648
|
+
Modal7,
|
3652
3649
|
{
|
3653
3650
|
show: state.show,
|
3654
3651
|
onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
@@ -3656,8 +3653,8 @@ function TockenizPay() {
|
|
3656
3653
|
})),
|
3657
3654
|
centered: true
|
3658
3655
|
},
|
3659
|
-
/* @__PURE__ */
|
3660
|
-
/* @__PURE__ */
|
3656
|
+
/* @__PURE__ */ React13.createElement(Modal7.Header, { closeButton: true }),
|
3657
|
+
/* @__PURE__ */ React13.createElement(Modal7.Body, null, /* @__PURE__ */ React13.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ React13.createElement("div", { className: "row" }, /* @__PURE__ */ React13.createElement("div", { className: "" }, /* @__PURE__ */ React13.createElement("div", { id: "Checkout", className: "inline" }, /* @__PURE__ */ React13.createElement("div", { className: "header" }, /* @__PURE__ */ React13.createElement("h1", null, "Pay")), /* @__PURE__ */ React13.createElement("form", { id: "PaymentForm", className: "payment-form" }, /* @__PURE__ */ React13.createElement("div", { className: "form-group" }, /* @__PURE__ */ React13.createElement("label", null, "Name on card"), /* @__PURE__ */ React13.createElement(
|
3661
3658
|
"input",
|
3662
3659
|
{
|
3663
3660
|
id: "NameOnCard",
|
@@ -3666,13 +3663,13 @@ function TockenizPay() {
|
|
3666
3663
|
maxLength: 100,
|
3667
3664
|
placeholder: "Name"
|
3668
3665
|
}
|
3669
|
-
), /* @__PURE__ */
|
3666
|
+
), /* @__PURE__ */ React13.createElement(
|
3670
3667
|
"span",
|
3671
3668
|
{
|
3672
3669
|
id: "NameOnCard-error",
|
3673
3670
|
style: { color: "red", display: "none" }
|
3674
3671
|
}
|
3675
|
-
)), /* @__PURE__ */
|
3672
|
+
)), /* @__PURE__ */ React13.createElement("div", { className: "form-group" }, /* @__PURE__ */ React13.createElement(
|
3676
3673
|
"input",
|
3677
3674
|
{
|
3678
3675
|
"data-token": "card_number",
|
@@ -3683,7 +3680,7 @@ function TockenizPay() {
|
|
3683
3680
|
placeholder: "0000 0000 0000 0000",
|
3684
3681
|
onChange: handleCardNumberChange
|
3685
3682
|
}
|
3686
|
-
), state.error && /* @__PURE__ */
|
3683
|
+
), state.error && /* @__PURE__ */ React13.createElement("div", { style: { color: "red" } }, state.error)), /* @__PURE__ */ React13.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ React13.createElement(
|
3687
3684
|
"input",
|
3688
3685
|
{
|
3689
3686
|
"data-token": "exp_month",
|
@@ -3694,14 +3691,14 @@ function TockenizPay() {
|
|
3694
3691
|
maxLength: 2,
|
3695
3692
|
onChange: (e) => handleMonthChange(e)
|
3696
3693
|
}
|
3697
|
-
), isValidMonth && /* @__PURE__ */
|
3694
|
+
), isValidMonth && /* @__PURE__ */ React13.createElement(
|
3698
3695
|
"span",
|
3699
3696
|
{
|
3700
3697
|
id: "card_number-error",
|
3701
3698
|
style: { color: "red", fontSize: "15px" }
|
3702
3699
|
},
|
3703
3700
|
"Please write month only 1 to 12"
|
3704
|
-
)), /* @__PURE__ */
|
3701
|
+
)), /* @__PURE__ */ React13.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ React13.createElement(
|
3705
3702
|
"input",
|
3706
3703
|
{
|
3707
3704
|
"data-token": "exp_year",
|
@@ -3712,7 +3709,7 @@ function TockenizPay() {
|
|
3712
3709
|
value: state.year,
|
3713
3710
|
onChange: (e) => handleYearChange(e)
|
3714
3711
|
}
|
3715
|
-
), state.yearError && /* @__PURE__ */
|
3712
|
+
), state.yearError && /* @__PURE__ */ React13.createElement("span", { id: "exp_year-error", style: { color: "red" } }, state.yearError)), /* @__PURE__ */ React13.createElement("div", { className: "security-code-group form-group" }, /* @__PURE__ */ React13.createElement("div", { className: "input-container" }, /* @__PURE__ */ React13.createElement(
|
3716
3713
|
"input",
|
3717
3714
|
{
|
3718
3715
|
"data-token": "cvv",
|
@@ -3723,7 +3720,7 @@ function TockenizPay() {
|
|
3723
3720
|
placeholder: "CVV",
|
3724
3721
|
onChange: (e) => handleCVVChange(e)
|
3725
3722
|
}
|
3726
|
-
), /* @__PURE__ */
|
3723
|
+
), /* @__PURE__ */ React13.createElement("i", { id: "cvc", className: "fa fa-question-circle" }), state.cvvError && /* @__PURE__ */ React13.createElement("span", { id: "cvv-error", style: { color: "red" } }, state.cvvError)), /* @__PURE__ */ React13.createElement("div", { className: "cvc-preview-container two-card hide" }, /* @__PURE__ */ React13.createElement("div", { className: "amex-cvc-preview" }), /* @__PURE__ */ React13.createElement("div", { className: "visa-mc-dis-cvc-preview" }))), /* @__PURE__ */ React13.createElement("div", { className: "zip-code-group form-group" }, /* @__PURE__ */ React13.createElement("label", null, "Postal code"), /* @__PURE__ */ React13.createElement("div", { className: "input-container" }, /* @__PURE__ */ React13.createElement(
|
3727
3724
|
"input",
|
3728
3725
|
{
|
3729
3726
|
id: "ZIPCode",
|
@@ -3735,7 +3732,7 @@ function TockenizPay() {
|
|
3735
3732
|
value: state.zip,
|
3736
3733
|
onChange: (e) => handleZIP(e)
|
3737
3734
|
}
|
3738
|
-
), /* @__PURE__ */
|
3735
|
+
), /* @__PURE__ */ React13.createElement(
|
3739
3736
|
"a",
|
3740
3737
|
{
|
3741
3738
|
tabIndex: 0,
|
@@ -3745,15 +3742,15 @@ function TockenizPay() {
|
|
3745
3742
|
"data-placement": "left",
|
3746
3743
|
"data-content": "Enter the ZIP/Postal code for your credit card billing address."
|
3747
3744
|
},
|
3748
|
-
/* @__PURE__ */
|
3749
|
-
), /* @__PURE__ */
|
3745
|
+
/* @__PURE__ */ React13.createElement("i", { className: "fa fa-question-circle" })
|
3746
|
+
), /* @__PURE__ */ React13.createElement(
|
3750
3747
|
"span",
|
3751
3748
|
{
|
3752
3749
|
id: "ZIPCode-error",
|
3753
3750
|
style: { color: "red", display: "none" }
|
3754
3751
|
},
|
3755
3752
|
"This field is required"
|
3756
|
-
))), /* @__PURE__ */
|
3753
|
+
))), /* @__PURE__ */ React13.createElement("div", { className: "form-group top-amnt" }, /* @__PURE__ */ React13.createElement("div", null, /* @__PURE__ */ React13.createElement("label", null, "Payment amount"), /* @__PURE__ */ React13.createElement("div", { className: "amount-placeholder" }, /* @__PURE__ */ React13.createElement(
|
3757
3754
|
"input",
|
3758
3755
|
{
|
3759
3756
|
id: "Amount",
|
@@ -3765,7 +3762,7 @@ function TockenizPay() {
|
|
3765
3762
|
onChange: (e) => handleAmount(e),
|
3766
3763
|
onBlur: handleAmountBlur
|
3767
3764
|
}
|
3768
|
-
))), /* @__PURE__ */
|
3765
|
+
))), /* @__PURE__ */ React13.createElement("div", { className: "card-row" }, /* @__PURE__ */ React13.createElement("span", { className: "visa" }), /* @__PURE__ */ React13.createElement("span", { className: "mastercard" }), /* @__PURE__ */ React13.createElement("span", { className: "amex" }), /* @__PURE__ */ React13.createElement("span", { className: "discover" }))), /* @__PURE__ */ React13.createElement(
|
3769
3766
|
"button",
|
3770
3767
|
{
|
3771
3768
|
type: "button",
|
@@ -3774,7 +3771,7 @@ function TockenizPay() {
|
|
3774
3771
|
className: "btn btn-block btn-success submit-button"
|
3775
3772
|
},
|
3776
3773
|
"Submit"
|
3777
|
-
)), /* @__PURE__ */
|
3774
|
+
)), /* @__PURE__ */ React13.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ React13.createElement(
|
3778
3775
|
"svg",
|
3779
3776
|
{
|
3780
3777
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3782,14 +3779,14 @@ function TockenizPay() {
|
|
3782
3779
|
height: "20",
|
3783
3780
|
viewBox: "0 0 26 26"
|
3784
3781
|
},
|
3785
|
-
/* @__PURE__ */
|
3782
|
+
/* @__PURE__ */ React13.createElement(
|
3786
3783
|
"path",
|
3787
3784
|
{
|
3788
3785
|
fill: "currentColor",
|
3789
3786
|
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"
|
3790
3787
|
}
|
3791
3788
|
)
|
3792
|
-
), "Secure payments powered by Fractal", /* @__PURE__ */
|
3789
|
+
), "Secure payments powered by Fractal", /* @__PURE__ */ React13.createElement(
|
3793
3790
|
"img",
|
3794
3791
|
{
|
3795
3792
|
src: "https://ui.fractalpay.com/favicon.ico",
|
@@ -3801,25 +3798,25 @@ function TockenizPay() {
|
|
3801
3798
|
}
|
3802
3799
|
|
3803
3800
|
// src/app/components/Payment/GetPaymentDynamic.tsx
|
3804
|
-
|
3805
|
-
|
3801
|
+
import React15, { useEffect as useEffect4, useState as useState10 } from "react";
|
3802
|
+
import { Modal as Modal8 } from "react-bootstrap";
|
3806
3803
|
|
3807
3804
|
// src/app/components/Loader/MyLoadingAnimation.tsx
|
3808
|
-
|
3805
|
+
import React14 from "react";
|
3809
3806
|
function MyLoadingAnimation() {
|
3810
|
-
return /* @__PURE__ */
|
3807
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(LoaderStyle_default, null), /* @__PURE__ */ React14.createElement("div", { className: "loading-animation" }, /* @__PURE__ */ React14.createElement("div", { className: "spinner" })));
|
3811
3808
|
}
|
3812
3809
|
|
3813
3810
|
// src/app/components/Payment/GetPaymentDynamic.tsx
|
3814
3811
|
function GetPaymentDynamic(props) {
|
3815
3812
|
const { amount, fractalpayClientKey, orderID } = props;
|
3816
|
-
const [loading, setLoading] = (
|
3817
|
-
const [show, setShow] = (
|
3818
|
-
const [iframeLoaded, setIframeLoaded] = (
|
3819
|
-
const [phoneNumber, setPhoneNumber] = (
|
3820
|
-
const [errorMessage, setErrorMessage] = (
|
3821
|
-
const [submitClicked, setSubmitClicked] = (
|
3822
|
-
const [isValidNumber, setIsValidNumber] = (
|
3813
|
+
const [loading, setLoading] = useState10(false);
|
3814
|
+
const [show, setShow] = useState10(false);
|
3815
|
+
const [iframeLoaded, setIframeLoaded] = useState10(false);
|
3816
|
+
const [phoneNumber, setPhoneNumber] = useState10("");
|
3817
|
+
const [errorMessage, setErrorMessage] = useState10("");
|
3818
|
+
const [submitClicked, setSubmitClicked] = useState10(false);
|
3819
|
+
const [isValidNumber, setIsValidNumber] = useState10(true);
|
3823
3820
|
const handleClose = () => {
|
3824
3821
|
setIframeLoaded(false);
|
3825
3822
|
setTimeout(() => {
|
@@ -3834,7 +3831,7 @@ function GetPaymentDynamic(props) {
|
|
3834
3831
|
console.error("Fractalpay client key is missing or empty.");
|
3835
3832
|
}
|
3836
3833
|
};
|
3837
|
-
(
|
3834
|
+
useEffect4(() => {
|
3838
3835
|
if (!fractalpayClientKey) {
|
3839
3836
|
console.error("Fractalpay client key is missing or empty.");
|
3840
3837
|
}
|
@@ -3857,7 +3854,7 @@ function GetPaymentDynamic(props) {
|
|
3857
3854
|
const handleLoad = () => {
|
3858
3855
|
setLoading(false);
|
3859
3856
|
};
|
3860
|
-
(
|
3857
|
+
useEffect4(() => {
|
3861
3858
|
const messageListener = (event) => {
|
3862
3859
|
var _a, _b;
|
3863
3860
|
const response = (_b = (_a = event == null ? void 0 : event.data) == null ? void 0 : _a.other) == null ? void 0 : _b.data;
|
@@ -3872,7 +3869,7 @@ function GetPaymentDynamic(props) {
|
|
3872
3869
|
window.removeEventListener("message", messageListener);
|
3873
3870
|
};
|
3874
3871
|
}, []);
|
3875
|
-
return /* @__PURE__ */
|
3872
|
+
return /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Pay"), /* @__PURE__ */ React15.createElement(Modal8, { show: show && iframeLoaded, id: "modal-pay", className: "modal-lg", onHide: handleClose }, /* @__PURE__ */ React15.createElement(Modal8.Header, { closeButton: true }), /* @__PURE__ */ React15.createElement(Modal8.Body, null, loading && /* @__PURE__ */ React15.createElement(MyLoadingAnimation, null), /* @__PURE__ */ React15.createElement(
|
3876
3873
|
"iframe",
|
3877
3874
|
{
|
3878
3875
|
src: `${baseUrl}widget-form/${amount}?fractalpay_public_key=${fractalpayClientKey}&order_id=${orderID}`,
|
@@ -3883,8 +3880,7 @@ function GetPaymentDynamic(props) {
|
|
3883
3880
|
}
|
3884
3881
|
))));
|
3885
3882
|
}
|
3886
|
-
|
3887
|
-
0 && (module.exports = {
|
3883
|
+
export {
|
3888
3884
|
CompletedTransactions,
|
3889
3885
|
GetPaymentDynamic,
|
3890
3886
|
Payment,
|
@@ -3894,4 +3890,4 @@ function GetPaymentDynamic(props) {
|
|
3894
3890
|
RequestPaymentonClick,
|
3895
3891
|
RqstPaymntInputField,
|
3896
3892
|
TockenizPay
|
3897
|
-
}
|
3893
|
+
};
|