@pinerohit11/testwidget 0.1.66 → 0.1.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -47,15 +47,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
47
47
  // src/app/index.ts
48
48
  var index_exports = {};
49
49
  __export(index_exports, {
50
- CompletedTransactions: () => CompletedTransactions,
51
- GetPaymentDynamic: () => GetPaymentDynamic,
52
- Payment: () => Payment,
53
50
  RequestPayment: () => RequestPayment,
54
- RequestPaymentAllInput: () => RequestPaymentAllInput,
55
- RequestPaymentDynamic: () => RequestPaymentDynamic,
56
- RequestPaymentonClick: () => RequestPaymentonClick,
57
- RqstPaymntInputField: () => RqstPaymntInputField,
58
- TockenizPay: () => TockenizPay
51
+ RequestPreAuthPayment: () => RequestPreAuthPayment
59
52
  });
60
53
  module.exports = __toCommonJS(index_exports);
61
54
 
@@ -477,7 +470,6 @@ var CustomModal2_default = CustomModal2;
477
470
  // src/app/components/RequestPayment/RequestPayment.tsx
478
471
  var import_axios = __toESM(require("axios"));
479
472
  var import_react_number_format = require("react-number-format");
480
- var import_styled_components = __toESM(require("styled-components"));
481
473
 
482
474
  // src/app/components/RequestPayment/RequestPaymentstyles.tsx
483
475
  var import_react5 = __toESM(require("react"));
@@ -723,18 +715,6 @@ var RequestPaymentstyles = (props) => {
723
715
  var RequestPaymentstyles_default = RequestPaymentstyles;
724
716
 
725
717
  // src/app/components/RequestPayment/RequestPayment.tsx
726
- var Label = import_styled_components.default.label`
727
- color: #727272;
728
- font-family: Inter;
729
- font-size: 12px;
730
- font-style: normal;
731
- font-weight: 500;
732
- margin-bottom: 6px !important;
733
- text-align: start !important;
734
- width: 100% !important;
735
- margin-bottom: 6px !important;
736
- text-transform: uppercase;
737
- `;
738
718
  function RequestPayment(props) {
739
719
  const fractalpayClientKey = props.fractalpayClientKey;
740
720
  const [show, setShow] = (0, import_react6.useState)(false);
@@ -910,7 +890,7 @@ function RequestPayment(props) {
910
890
  onClose: () => setShow(false)
911
891
  },
912
892
  /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-amount-detail" }, /* @__PURE__ */ import_react6.default.createElement("p", { className: "request-payment-merchantname" }, "Pay ", props == null ? void 0 : props.webname), /* @__PURE__ */ import_react6.default.createElement("p", { className: "request-payment-amount" }, formatAmount(props == null ? void 0 : props.amount)), (props == null ? void 0 : props.from) === "merchant" && /* @__PURE__ */ import_react6.default.createElement("p", { className: "request-payment-orderid" }, requestDetails == null ? void 0 : requestDetails.order_id), /* @__PURE__ */ import_react6.default.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ import_react6.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react6.default.createElement("g", { "clip-path": "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react6.default.createElement("path", { d: "M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z", fill: "#727272" })), /* @__PURE__ */ import_react6.default.createElement("defs", null, /* @__PURE__ */ import_react6.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react6.default.createElement("rect", { width: "16", height: "16", fill: "white" })))))),
913
- /* @__PURE__ */ import_react6.default.createElement("form", { className: "request-payment-input-form" }, /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react6.default.createElement(Label, { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "FULL NAME"), /* @__PURE__ */ import_react6.default.createElement(
893
+ /* @__PURE__ */ import_react6.default.createElement("form", { className: "request-payment-input-form" }, /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react6.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "FULL NAME"), /* @__PURE__ */ import_react6.default.createElement(
914
894
  "input",
915
895
  {
916
896
  className: "request-payment-input-box",
@@ -920,7 +900,7 @@ function RequestPayment(props) {
920
900
  onChange: handleChange,
921
901
  value: requestDetails == null ? void 0 : requestDetails.name
922
902
  }
923
- ), errors.name && /* @__PURE__ */ import_react6.default.createElement("small", { className: "request-payment-error-msg" }, errors.name)), /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react6.default.createElement(Label, { htmlFor: "requestPhoneNumber", className: "request-payment-input-label" }, "Phone Number"), /* @__PURE__ */ import_react6.default.createElement(
903
+ ), errors.name && /* @__PURE__ */ import_react6.default.createElement("small", { className: "request-payment-error-msg" }, errors.name)), /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react6.default.createElement("label", { htmlFor: "requestPhoneNumber", className: "request-payment-input-label" }, "Phone Number"), /* @__PURE__ */ import_react6.default.createElement(
924
904
  import_react_number_format.PatternFormat,
925
905
  {
926
906
  className: "request-payment-input-box",
@@ -931,7 +911,7 @@ function RequestPayment(props) {
931
911
  handlePhoneChange(e);
932
912
  }
933
913
  }
934
- ), errors.phone && /* @__PURE__ */ import_react6.default.createElement("small", { className: "request-payment-error-msg" }, errors.phone)), /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react6.default.createElement(Label, { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "EMAIL"), /* @__PURE__ */ import_react6.default.createElement(
914
+ ), errors.phone && /* @__PURE__ */ import_react6.default.createElement("small", { className: "request-payment-error-msg" }, errors.phone)), /* @__PURE__ */ import_react6.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react6.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "EMAIL"), /* @__PURE__ */ import_react6.default.createElement(
935
915
  "input",
936
916
  {
937
917
  className: "request-payment-input-box",
@@ -961,2572 +941,238 @@ function RequestPayment(props) {
961
941
  )));
962
942
  }
963
943
 
964
- // src/app/components/RequestPayment/RequestPaymentAllInput.tsx
944
+ // src/app/components/RequestPayment/RequestPreAuthPayment.tsx
945
+ var import_bootstrap_bundle_min2 = require("bootstrap/dist/js/bootstrap.bundle.min.js");
965
946
  var import_react7 = __toESM(require("react"));
966
- var import_react_bootstrap = require("react-bootstrap");
967
- var import_react_toastify = require("react-toastify");
968
- var import_ReactToastify = require("react-toastify/dist/ReactToastify.css");
969
- function RequestPaymentAllInput({ fractalpayClientKey }) {
970
- const [isLoading, setIsLoading] = (0, import_react7.useState)(false);
947
+ var import_axios2 = __toESM(require("axios"));
948
+ var import_react_number_format2 = require("react-number-format");
949
+ function RequestPreAuthPayment(props) {
950
+ const fractalpayClientKey = props.fractalpayClientKey;
971
951
  const [show, setShow] = (0, import_react7.useState)(false);
972
- const [phoneNumber, setPhoneNumber] = (0, import_react7.useState)("");
952
+ const [loading, setLoading] = (0, import_react7.useState)(false);
953
+ const [errors, setErrors] = (0, import_react7.useState)({});
954
+ const [phone, setPhone] = (0, import_react7.useState)(null);
955
+ const [requestDetails, setRequestDetails] = (0, import_react7.useState)({
956
+ email: "",
957
+ phone_number: "",
958
+ order_id: "",
959
+ name: "",
960
+ fractalpayPublicKey: fractalpayClientKey
961
+ });
973
962
  const [amount, setAmount] = (0, import_react7.useState)("");
974
- const [orderId, setOrderId] = (0, import_react7.useState)("");
975
- const [isValidNumber, setIsValidNumber] = (0, import_react7.useState)(true);
976
- const [isValidAmount, setIsValidAmount] = (0, import_react7.useState)(true);
977
- const [isValidOrderId, setIsValidOrderId] = (0, import_react7.useState)(true);
978
- const [errorMessagephone, setErrorMessagephone] = (0, import_react7.useState)("");
979
- const [errorMessageamount, setErrorMessageamount] = (0, import_react7.useState)("");
980
- const [errorMessageorderid, setErrorMessageorderid] = (0, import_react7.useState)("");
981
- const [submitClicked, setSubmitClicked] = (0, import_react7.useState)(false);
982
- const handleClose = () => setShow(false);
963
+ const [showConfirmationModal, setShowConfirmationModal] = (0, import_react7.useState)(false);
964
+ const [apiResponse, setApiResponse] = (0, import_react7.useState)(null);
965
+ const phoneNumberRegex = (value) => /^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(value);
966
+ const amoutRegex = /[+-]?([0-9]*[.])?[0-9]+/;
967
+ const isValidEmail = (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
968
+ const isAlpha = (value) => /^[A-Za-z\s]*$/.test(value);
969
+ const handleClose = () => {
970
+ setShow(false);
971
+ setErrors({});
972
+ };
983
973
  const handleShow = () => setShow(true);
984
- const sendRequestPayment = () => {
985
- if (!phoneNumber) {
986
- setErrorMessagephone(ErrorText.phonenumberrequired);
987
- setSubmitClicked(true);
974
+ const handleCloseConfirmationModal = () => {
975
+ console.log(apiResponse, "apiresponse");
976
+ handleSubmit(apiResponse);
977
+ setShowConfirmationModal(false);
978
+ };
979
+ function emptyFields() {
980
+ setRequestDetails({
981
+ email: "",
982
+ phone_number: "",
983
+ order_id: "",
984
+ name: "",
985
+ fractalpayPublicKey: fractalpayClientKey
986
+ });
987
+ setAmount("");
988
+ }
989
+ function handleSubmit(event) {
990
+ let message = {
991
+ type: "preview.compiledcheck",
992
+ other: __spreadProps(__spreadValues({}, event), { status: true })
993
+ };
994
+ window.parent.postMessage(message, "*");
995
+ }
996
+ const sendRequestPayment = async () => {
997
+ if (Object.keys(errors).length > 0) {
988
998
  return;
989
999
  }
990
- if (!/^\d{10}$/.test(phoneNumber)) {
991
- setErrorMessagephone(ErrorText.phonenumbervalid);
992
- setSubmitClicked(true);
1000
+ setErrors({});
1001
+ if (!(requestDetails == null ? void 0 : requestDetails.email) && phone && !phoneNumberRegex(phone)) {
1002
+ setErrors((prevErrors) => __spreadProps(__spreadValues({}, prevErrors), {
1003
+ phone: ErrorText.phonenumbervalid
1004
+ }));
993
1005
  return;
994
1006
  }
995
- if (!amount) {
996
- setErrorMessageamount(ErrorText.amountenter);
997
- setSubmitClicked(true);
1007
+ if (!validateForm()) {
998
1008
  return;
999
1009
  }
1000
- if (isNaN(Number(amount))) {
1001
- setErrorMessageamount(ErrorText.amountvalid);
1002
- setSubmitClicked(true);
1003
- return;
1010
+ try {
1011
+ setLoading(true);
1012
+ const formData = {
1013
+ fractalpayPublicKey: fractalpayClientKey,
1014
+ amount,
1015
+ phone_number: phone,
1016
+ order_id: requestDetails.order_id,
1017
+ action: "request",
1018
+ name: requestDetails.name,
1019
+ email: requestDetails.email,
1020
+ customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : ""
1021
+ };
1022
+ let response = await import_axios2.default.post(`${baseUrl}send-request-pre-auth-payment`, formData);
1023
+ if ((response == null ? void 0 : response.status) === 200) {
1024
+ setShowConfirmationModal(true);
1025
+ setShow(false);
1026
+ emptyFields();
1027
+ setApiResponse(response == null ? void 0 : response.data);
1028
+ }
1029
+ setLoading(false);
1030
+ } catch (error) {
1031
+ console.log(error);
1032
+ setLoading(false);
1004
1033
  }
1005
- if (!orderId) {
1006
- setErrorMessageorderid(ErrorText.orderidenter);
1007
- setSubmitClicked(true);
1034
+ };
1035
+ let favicon_logo = baseUrl + "images/logo-img.png";
1036
+ const handleChange = (e) => {
1037
+ const { value } = e.target;
1038
+ const token = e.target.dataset.token;
1039
+ setRequestDetails(__spreadProps(__spreadValues({}, requestDetails), { [token]: value }));
1040
+ if (token === "name" && !isAlpha(value)) {
1041
+ setErrors((prevErrors) => __spreadProps(__spreadValues({}, prevErrors), {
1042
+ [token]: ErrorText.onlylettersallowed
1043
+ }));
1008
1044
  return;
1009
1045
  }
1010
- setErrorMessagephone("");
1011
- setErrorMessageamount("");
1012
- setErrorMessageorderid("");
1013
- setSubmitClicked(true);
1014
- setIsLoading(true);
1015
- let formData = {
1016
- fractalpayPublicKey: fractalpayClientKey,
1017
- amount,
1018
- phone_number: phoneNumber,
1019
- orderId,
1020
- action: "request"
1021
- };
1022
- const jsonData = JSON.stringify(formData);
1023
- fetch(`${baseUrl}create-widget-order`, {
1024
- method: "POST",
1025
- headers: {
1026
- "Content-Type": "application/json"
1027
- },
1028
- body: jsonData
1029
- }).then((response) => {
1030
- setIsLoading(false);
1031
- if (!response.ok) {
1032
- throw new Error(ErrorText.networkresponseerror);
1033
- }
1034
- return response.json();
1035
- }).then((data) => {
1036
- if (data.result === true) {
1037
- setShow(true);
1038
- }
1039
- console.log(data);
1040
- }).catch((error) => {
1041
- setIsLoading(false);
1042
- console.error("Error:", error);
1043
- import_react_toastify.toast.error(ErrorText.anerroroccured);
1044
- });
1045
- };
1046
- const handlePhoneNumberChange = (e) => {
1047
- const number = e.target.value;
1048
- const isValid = /^\d*$/.test(number);
1049
- if (isValid) {
1050
- setPhoneNumber(number);
1051
- setIsValidNumber(number.length <= 10);
1052
- if (number.length > 10) {
1053
- setErrorMessagephone(ErrorText.phonenumberlength);
1054
- } else {
1055
- setErrorMessagephone("");
1056
- }
1057
- } else {
1058
- setErrorMessagephone(ErrorText.phonenumbervalid);
1046
+ let errorobj = errors;
1047
+ if (token === "email" && !phone) {
1048
+ delete errorobj.phone;
1049
+ setErrors(errorobj);
1059
1050
  }
1060
- };
1061
- const handleAmountChange = (e) => {
1062
- const amountValue = e.target.value;
1063
- if (!isNaN(Number(amountValue))) {
1064
- setAmount(amountValue);
1065
- setIsValidAmount(true);
1066
- setErrorMessageamount("");
1067
- } else {
1068
- setAmount("");
1069
- setIsValidAmount(false);
1051
+ if (value) {
1052
+ delete errorobj[token];
1053
+ setErrors(errorobj);
1070
1054
  }
1071
- };
1072
- const handleOrderIdChange = (e) => {
1073
- const orderIdValue = e.target.value;
1074
- if (orderIdValue) {
1075
- setOrderId(orderIdValue);
1076
- setIsValidOrderId(true);
1077
- setErrorMessageorderid("");
1078
- } else {
1079
- setOrderId("");
1080
- setIsValidOrderId(false);
1055
+ if (token === "email" && !value) {
1056
+ delete errorobj[token];
1057
+ setErrors(errorobj);
1081
1058
  }
1082
1059
  };
1083
- return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ import_react7.default.createElement("div", { className: " border-container" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "payment-column" }, /* @__PURE__ */ import_react7.default.createElement("label", null, "Enter Phone Number:"), /* @__PURE__ */ import_react7.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react7.default.createElement(
1084
- "input",
1085
- {
1086
- type: "text",
1087
- value: phoneNumber,
1088
- onChange: handlePhoneNumberChange,
1089
- placeholder: "Enter phone number",
1090
- maxLength: 10,
1091
- className: submitClicked && (!phoneNumber || !isValidNumber) ? "error" : ""
1060
+ const handleAmountChange = (data) => {
1061
+ const { value } = data;
1062
+ if (Number(value) > 0) {
1063
+ let errorobj = errors;
1064
+ delete errorobj.amount;
1065
+ setErrors(errorobj);
1092
1066
  }
1093
- ), errorMessagephone && /* @__PURE__ */ import_react7.default.createElement("div", { className: "error-message text-danger" }, errorMessagephone))), /* @__PURE__ */ import_react7.default.createElement("div", { className: "payment-column" }, /* @__PURE__ */ import_react7.default.createElement("label", null, "Enter Amount:"), /* @__PURE__ */ import_react7.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react7.default.createElement(
1094
- "input",
1095
- {
1096
- type: "text",
1097
- value: amount,
1098
- onChange: handleAmountChange,
1099
- placeholder: "Enter amount",
1100
- className: submitClicked && (!amount || !isValidAmount) ? "error" : ""
1067
+ setAmount(value);
1068
+ };
1069
+ const validateForm = () => {
1070
+ let newErrors = {};
1071
+ if (!amount) newErrors.amount = ErrorText.amountrequired;
1072
+ if (requestDetails.email && !isValidEmail(requestDetails == null ? void 0 : requestDetails.email)) newErrors.email = ErrorText.invalidemail;
1073
+ if (!phone && !(requestDetails == null ? void 0 : requestDetails.email)) newErrors.phone = ErrorText.phoneoremailrequired;
1074
+ if (!phone && !(requestDetails == null ? void 0 : requestDetails.email)) newErrors.email = ErrorText.phoneoremailrequired;
1075
+ if (!phone && requestDetails.email && !isValidEmail(requestDetails == null ? void 0 : requestDetails.email)) newErrors.email = ErrorText.invalidemail;
1076
+ if (props.from === "merchant" && !requestDetails.order_id) newErrors.order_id = ErrorText.orderidrequired;
1077
+ setErrors(newErrors);
1078
+ return Object.keys(newErrors).length === 0;
1079
+ };
1080
+ (0, import_react7.useEffect)(() => {
1081
+ if (props) {
1082
+ setRequestDetails((prev) => __spreadProps(__spreadValues({}, prev), {
1083
+ order_id: props.orderID ? props.orderID : "",
1084
+ name: (props == null ? void 0 : props.name) ? props == null ? void 0 : props.name : "",
1085
+ email: (props == null ? void 0 : props.email) ? props == null ? void 0 : props.email : ""
1086
+ }));
1087
+ setAmount(props.amount ? props.amount : "");
1088
+ setPhone(props.phone ? `${props.phone}` : null);
1101
1089
  }
1102
- ), errorMessageamount && /* @__PURE__ */ import_react7.default.createElement("div", { className: "error-message text-danger" }, errorMessageamount))), /* @__PURE__ */ import_react7.default.createElement("div", { className: "payment-column" }, /* @__PURE__ */ import_react7.default.createElement("label", null, "Enter Order ID:"), /* @__PURE__ */ import_react7.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react7.default.createElement(
1103
- "input",
1104
- {
1105
- type: "text",
1106
- value: orderId,
1107
- onChange: handleOrderIdChange,
1108
- placeholder: "Enter order ID",
1109
- className: submitClicked && (!orderId || !isValidOrderId) ? "error" : ""
1090
+ }, [props]);
1091
+ const handlePhoneChange = (e) => {
1092
+ let value = e == null ? void 0 : e.value;
1093
+ if (value && (value == null ? void 0 : value.length) > 0 && (value == null ? void 0 : value.length) !== 10) {
1094
+ setErrors((prevErrors) => __spreadProps(__spreadValues({}, prevErrors), {
1095
+ phone: ErrorText.phonenumberlength
1096
+ }));
1097
+ setPhone(value);
1098
+ return;
1099
+ } else {
1100
+ setPhone(value);
1110
1101
  }
1111
- ), errorMessageorderid && /* @__PURE__ */ import_react7.default.createElement("div", { className: "error-message text-danger" }, errorMessageorderid))), /* @__PURE__ */ import_react7.default.createElement(
1112
- "button",
1113
- {
1114
- onClick: sendRequestPayment,
1115
- disabled: isLoading || !isValidNumber || !isValidAmount || !isValidOrderId,
1116
- className: "paymentBtn"
1117
- },
1118
- isLoading ? "Loading..." : "Request Payment"
1119
- )), /* @__PURE__ */ import_react7.default.createElement(import_react_bootstrap.Modal, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ import_react7.default.createElement(import_react_bootstrap.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react7.default.createElement(import_react_bootstrap.Modal.Body, null, /* @__PURE__ */ import_react7.default.createElement(
1120
- "svg",
1121
- {
1122
- width: "60",
1123
- height: "60",
1124
- viewBox: "0 0 60 60",
1125
- fill: "none",
1126
- xmlns: "http://www.w3.org/2000/svg"
1127
- },
1128
- /* @__PURE__ */ import_react7.default.createElement(
1129
- "rect",
1130
- {
1131
- x: "0.5",
1132
- y: "0.5",
1133
- width: "59",
1134
- height: "59",
1135
- rx: "29.5",
1136
- stroke: "#31B379"
1137
- }
1138
- ),
1139
- /* @__PURE__ */ import_react7.default.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react7.default.createElement(
1140
- "path",
1141
- {
1142
- 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",
1143
- fill: "#31B379"
1144
- }
1145
- )),
1146
- /* @__PURE__ */ import_react7.default.createElement("defs", null, /* @__PURE__ */ import_react7.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react7.default.createElement(
1147
- "rect",
1148
- {
1149
- width: "22",
1150
- height: "22",
1151
- fill: "white",
1152
- transform: "translate(19.5 19.0039)"
1153
- }
1154
- )))
1155
- ), /* @__PURE__ */ import_react7.default.createElement("h1", null, "Success!"), /* @__PURE__ */ import_react7.default.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ import_react7.default.createElement(import_react_bootstrap.Modal.Footer, null, /* @__PURE__ */ import_react7.default.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))), /* @__PURE__ */ import_react7.default.createElement(import_react_toastify.ToastContainer, null));
1156
- }
1157
-
1158
- // src/app/components/RequestPayment/RequestPaymentDynamic.tsx
1159
- var import_react8 = __toESM(require("react"));
1160
- var import_react_bootstrap2 = require("react-bootstrap");
1161
-
1162
- // src/app/components/Api/createWidgetOrder.ts
1163
- var createWidgetOrder = (formData) => {
1164
- const jsonData = JSON.stringify(formData);
1165
- return fetch(`${baseUrl}create-widget-order`, {
1166
- method: "POST",
1167
- headers: {
1168
- "Content-Type": "application/json"
1169
- },
1170
- body: jsonData
1171
- }).then((response) => {
1172
- if (!response.ok) {
1173
- throw new Error(ErrorText.networkresponseerror);
1102
+ let errorobj = errors;
1103
+ delete errorobj.phone;
1104
+ if (value && !(requestDetails == null ? void 0 : requestDetails.email)) {
1105
+ delete errorobj.email;
1174
1106
  }
1175
- return response.json();
1176
- }).then((data) => {
1177
- return data;
1178
- });
1179
- };
1180
-
1181
- // src/app/components/RequestPayment/RequestPaymentDynamic.tsx
1182
- function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orderID }) {
1183
- const [isLoading, setIsLoading] = (0, import_react8.useState)(false);
1184
- const [show, setShow] = (0, import_react8.useState)(false);
1185
- const handleClose = () => setShow(false);
1186
- const handleShow = () => setShow(true);
1187
- const sendRequestPayment = () => {
1188
- setIsLoading(true);
1189
- const formData = {
1190
- fractalpayPublicKey: fractalpayClientKey,
1191
- amount,
1192
- phone_number,
1193
- orderId: orderID,
1194
- action: "request"
1195
- };
1196
- createWidgetOrder(formData).then((data) => {
1197
- setIsLoading(false);
1198
- if (data.result === true) {
1199
- setShow(true);
1200
- }
1201
- console.log(data);
1202
- }).catch((error) => {
1203
- setIsLoading(false);
1204
- console.error("Error:", error);
1205
- });
1107
+ setErrors(errorobj);
1206
1108
  };
1207
- return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement(
1208
- "button",
1209
- {
1210
- onClick: sendRequestPayment,
1211
- disabled: isLoading,
1212
- className: "paymentBtn"
1213
- },
1214
- isLoading ? "Loading..." : "Request Payment"
1215
- ), /* @__PURE__ */ import_react8.default.createElement(import_react_bootstrap2.Modal, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ import_react8.default.createElement(import_react_bootstrap2.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react8.default.createElement(import_react_bootstrap2.Modal.Body, null, /* @__PURE__ */ import_react8.default.createElement(
1216
- "svg",
1109
+ function formatAmount(amount2) {
1110
+ return new Intl.NumberFormat("en-US", {
1111
+ style: "currency",
1112
+ currency: "USD",
1113
+ minimumFractionDigits: 2,
1114
+ maximumFractionDigits: 2
1115
+ }).format(Number(amount2));
1116
+ }
1117
+ return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ import_react7.default.createElement(Loader_default, { loading }), /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Request Pre Auth Payment"), /* @__PURE__ */ import_react7.default.createElement(
1118
+ CustomModal2_default,
1217
1119
  {
1218
- width: "60",
1219
- height: "60",
1220
- viewBox: "0 0 60 60",
1221
- fill: "none",
1222
- xmlns: "http://www.w3.org/2000/svg"
1120
+ open: show,
1121
+ onClose: () => setShow(false)
1223
1122
  },
1224
- /* @__PURE__ */ import_react8.default.createElement(
1225
- "rect",
1226
- {
1227
- x: "0.5",
1228
- y: "0.5",
1229
- width: "59",
1230
- height: "59",
1231
- rx: "29.5",
1232
- stroke: "#31B379"
1233
- }
1234
- ),
1235
- /* @__PURE__ */ import_react8.default.createElement("g", { "clip-path": "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react8.default.createElement(
1236
- "path",
1237
- {
1238
- 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",
1239
- fill: "#31B379"
1240
- }
1241
- )),
1242
- /* @__PURE__ */ import_react8.default.createElement("defs", null, /* @__PURE__ */ import_react8.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react8.default.createElement(
1243
- "rect",
1123
+ /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-amount-detail" }, /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-merchantname" }, "Authorization Request"), /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-pre-auth-merchantname" }, "Pay ", props == null ? void 0 : props.webname), /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-amount" }, formatAmount(props == null ? void 0 : props.amount)), (props == null ? void 0 : props.from) === "merchant" && /* @__PURE__ */ import_react7.default.createElement("p", { className: "request-payment-orderid" }, requestDetails == null ? void 0 : requestDetails.order_id), /* @__PURE__ */ import_react7.default.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("g", { "clip-path": "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: "M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z", fill: "#727272" })), /* @__PURE__ */ import_react7.default.createElement("defs", null, /* @__PURE__ */ import_react7.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react7.default.createElement("rect", { width: "16", height: "16", fill: "white" })))))),
1124
+ /* @__PURE__ */ import_react7.default.createElement("form", { className: "request-payment-input-form" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react7.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "FULL NAME"), /* @__PURE__ */ import_react7.default.createElement(
1125
+ "input",
1244
1126
  {
1245
- width: "22",
1246
- height: "22",
1247
- fill: "white",
1248
- transform: "translate(19.5 19.0039)"
1249
- }
1250
- )))
1251
- ), /* @__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_bootstrap2.Modal.Footer, null, /* @__PURE__ */ import_react8.default.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))));
1252
- }
1253
-
1254
- // src/app/components/RequestPayment/RequestPaymentonClick.tsx
1255
- var import_react9 = __toESM(require("react"));
1256
- var import_react_bootstrap3 = require("react-bootstrap");
1257
- function RequestPaymentonClick(props) {
1258
- const [isLoading, setIsLoading] = (0, import_react9.useState)(false);
1259
- const [show, setShow] = (0, import_react9.useState)(false);
1260
- const handleClose = () => setShow(false);
1261
- const handleShow = () => setShow(true);
1262
- const { fractalpayClientKey, amount, phone_number, orderID, onSuccess, onError } = props;
1263
- const sendRequestPayment = () => {
1264
- setIsLoading(true);
1265
- let formData = {
1266
- fractalpayPublicKey: fractalpayClientKey,
1267
- amount,
1268
- phone_number,
1269
- orderId: orderID,
1270
- action: "request"
1271
- };
1272
- const jsonData = JSON.stringify(formData);
1273
- fetch(`${baseUrl}create-widget-order`, {
1274
- method: "POST",
1275
- headers: {
1276
- "Content-Type": "application/json"
1277
- },
1278
- body: jsonData
1279
- }).then((response) => {
1280
- setIsLoading(false);
1281
- if (!response.ok) {
1282
- throw new Error(ErrorText.networkresponseerror);
1127
+ className: "request-payment-input-box",
1128
+ type: "text",
1129
+ placeholder: "Full Name",
1130
+ "data-token": "name",
1131
+ onChange: handleChange,
1132
+ value: requestDetails == null ? void 0 : requestDetails.name
1283
1133
  }
1284
- return response.json();
1285
- }).then((data) => {
1286
- setShow(true);
1287
- console.log(data);
1288
- }).catch((error) => {
1289
- setIsLoading(false);
1290
- console.error("Error:", error);
1291
- });
1292
- };
1293
- return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ import_react9.default.createElement(
1294
- "button",
1295
- {
1296
- onClick: sendRequestPayment,
1297
- disabled: isLoading,
1298
- className: "paymentBtn"
1299
- },
1300
- isLoading ? "Loading..." : "Request Payment"
1301
- ), /* @__PURE__ */ import_react9.default.createElement(import_react_bootstrap3.Modal, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ import_react9.default.createElement(import_react_bootstrap3.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react9.default.createElement(import_react_bootstrap3.Modal.Body, null, onSuccess && /* @__PURE__ */ import_react9.default.createElement(
1302
- "svg",
1303
- {
1304
- width: "60",
1305
- height: "60",
1306
- viewBox: "0 0 60 60",
1307
- fill: "none",
1308
- xmlns: "http://www.w3.org/2000/svg"
1309
- },
1310
- /* @__PURE__ */ import_react9.default.createElement(
1311
- "rect",
1134
+ ), errors.name && /* @__PURE__ */ import_react7.default.createElement("small", { className: "request-payment-error-msg" }, errors.name)), /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react7.default.createElement("label", { htmlFor: "requestPhoneNumber", className: "request-payment-input-label" }, "Phone Number"), /* @__PURE__ */ import_react7.default.createElement(
1135
+ import_react_number_format2.PatternFormat,
1312
1136
  {
1313
- x: "0.5",
1314
- y: "0.5",
1315
- width: "59",
1316
- height: "59",
1317
- rx: "29.5",
1318
- stroke: "#31B379"
1137
+ className: "request-payment-input-box",
1138
+ placeholder: "Mobile number",
1139
+ format: "+1 (###) ###-####",
1140
+ value: phone,
1141
+ onValueChange: (e) => {
1142
+ handlePhoneChange(e);
1143
+ }
1319
1144
  }
1320
- ),
1321
- /* @__PURE__ */ import_react9.default.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react9.default.createElement(
1322
- "path",
1145
+ ), errors.phone && /* @__PURE__ */ import_react7.default.createElement("small", { className: "request-payment-error-msg" }, errors.phone)), /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ import_react7.default.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "EMAIL"), /* @__PURE__ */ import_react7.default.createElement(
1146
+ "input",
1323
1147
  {
1324
- 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",
1325
- fill: "#31B379"
1148
+ className: "request-payment-input-box",
1149
+ type: "text",
1150
+ placeholder: "Email",
1151
+ onChange: handleChange,
1152
+ "data-token": "email",
1153
+ value: requestDetails == null ? void 0 : requestDetails.email
1326
1154
  }
1327
- )),
1328
- /* @__PURE__ */ import_react9.default.createElement("defs", null, /* @__PURE__ */ import_react9.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react9.default.createElement(
1329
- "rect",
1155
+ ), errors.email && /* @__PURE__ */ import_react7.default.createElement("small", { className: "request-payment-error-msg" }, errors.email)), /* @__PURE__ */ import_react7.default.createElement(
1156
+ "button",
1330
1157
  {
1331
- width: "22",
1332
- height: "22",
1333
- fill: "white",
1334
- transform: "translate(19.5 19.0039)"
1335
- }
1336
- )))
1337
- ), onSuccess ? /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement("h1", null, "Success!"), /* @__PURE__ */ import_react9.default.createElement("h4", null, onSuccess)) : /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement("h1", null, "Error!"), /* @__PURE__ */ import_react9.default.createElement("h4", null, onError))), /* @__PURE__ */ import_react9.default.createElement(import_react_bootstrap3.Modal.Footer, null, /* @__PURE__ */ import_react9.default.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))));
1338
- }
1339
-
1340
- // src/app/components/RequestPayment/RqstPaymntInputField.tsx
1341
- var import_react10 = __toESM(require("react"));
1342
- var import_react_bootstrap4 = require("react-bootstrap");
1343
- var import_react_toastify2 = require("react-toastify");
1344
- var import_ReactToastify2 = require("react-toastify/dist/ReactToastify.css");
1345
- function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
1346
- const [isLoading, setIsLoading] = (0, import_react10.useState)(false);
1347
- const [show, setShow] = (0, import_react10.useState)(false);
1348
- const [phoneNumber, setPhoneNumber] = (0, import_react10.useState)("");
1349
- const [isValidNumber, setIsValidNumber] = (0, import_react10.useState)(true);
1350
- const [errorMessage, setErrorMessage] = (0, import_react10.useState)("");
1351
- const [submitClicked, setSubmitClicked] = (0, import_react10.useState)(false);
1352
- const handleClose = () => setShow(false);
1353
- const handleShow = () => setShow(true);
1354
- const sendRequestPayment = () => {
1355
- if (!phoneNumber) {
1356
- setErrorMessage(ErrorText.phonenumberrequired);
1357
- setSubmitClicked(true);
1358
- return;
1359
- }
1360
- if (!/^\d{10}$/.test(phoneNumber)) {
1361
- setErrorMessage(ErrorText.phonenumbervalid);
1362
- setSubmitClicked(true);
1363
- return;
1364
- }
1365
- setErrorMessage("");
1366
- setSubmitClicked(true);
1367
- setIsLoading(true);
1368
- let formData = {
1369
- fractalpayPublicKey: fractalpayClientKey,
1370
- amount,
1371
- phone_number: phoneNumber,
1372
- orderId: orderID,
1373
- action: "request"
1374
- };
1375
- const jsonData = JSON.stringify(formData);
1376
- fetch(`${baseUrl}create-widget-order`, {
1377
- method: "POST",
1378
- headers: {
1379
- "Content-Type": "application/json"
1158
+ type: "button",
1159
+ className: "request-payment-submit-button",
1160
+ onClick: sendRequestPayment,
1161
+ disabled: loading
1380
1162
  },
1381
- body: jsonData
1382
- }).then((response) => {
1383
- setIsLoading(false);
1384
- if (!response.ok) {
1385
- throw new Error(ErrorText.networkresponseerror);
1386
- }
1387
- return response.json();
1388
- }).then((data) => {
1389
- if (data.result === true) {
1390
- setShow(true);
1391
- }
1392
- console.log(data);
1393
- }).catch((error) => {
1394
- setIsLoading(false);
1395
- console.error("Error:", error);
1396
- import_react_toastify2.toast.error(ErrorText.anerroroccured);
1397
- });
1398
- };
1399
- const handlePhoneNumberChange = (e) => {
1400
- const number = e.target.value;
1401
- const isValid = /^\d*$/.test(number);
1402
- if (isValid) {
1403
- setPhoneNumber(number);
1404
- setIsValidNumber(number.length <= 10);
1405
- if (number.length > 10) {
1406
- setErrorMessage(ErrorText.phonenumberlength);
1407
- } else {
1408
- setErrorMessage("");
1409
- }
1410
- } else {
1411
- setErrorMessage(ErrorText.phonenumbervalid);
1412
- }
1413
- };
1414
- return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, /* @__PURE__ */ import_react10.default.createElement("div", { className: "payment-container" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "input-wrapper" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react10.default.createElement(
1415
- "input",
1416
- {
1417
- type: "text",
1418
- value: phoneNumber,
1419
- onChange: handlePhoneNumberChange,
1420
- placeholder: "Enter phone number",
1421
- maxLength: 10,
1422
- className: submitClicked && (!phoneNumber || !isValidNumber) ? "error" : ""
1423
- }
1424
- ), errorMessage && /* @__PURE__ */ import_react10.default.createElement("div", { className: "error-message text-danger" }, errorMessage))), /* @__PURE__ */ import_react10.default.createElement("div", { className: "button-wrapper" }, /* @__PURE__ */ import_react10.default.createElement(
1425
- "button",
1426
- {
1427
- onClick: sendRequestPayment,
1428
- disabled: isLoading || !isValidNumber,
1429
- className: "paymentBtn"
1430
- },
1431
- isLoading ? "Loading..." : "Request Payment"
1432
- ))), /* @__PURE__ */ import_react10.default.createElement(import_react_bootstrap4.Modal, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ import_react10.default.createElement(import_react_bootstrap4.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react10.default.createElement(import_react_bootstrap4.Modal.Body, null, /* @__PURE__ */ import_react10.default.createElement(
1433
- "svg",
1163
+ loading ? "Loading..." : "Send Request"
1164
+ ), /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-fractal-powerd-by" }, /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "16", viewBox: "0 0 17 16", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: "M15.2165 4.11839C15.1973 3.69746 15.1973 3.29567 15.1973 2.89387C15.1973 2.56861 14.9486 2.31988 14.6234 2.31988C12.2317 2.31988 10.4141 1.63109 8.90257 0.157848C8.67298 -0.0526158 8.32858 -0.0526158 8.09898 0.157848C6.58748 1.63109 4.76984 2.31988 2.37821 2.31988C2.05295 2.31988 1.80422 2.56861 1.80422 2.89387C1.80422 3.29567 1.80422 3.69746 1.78508 4.11839C1.70855 8.13632 1.59375 13.6466 8.30945 15.9617L8.50078 16L8.69211 15.9617C15.3887 13.6466 15.293 8.15546 15.2165 4.11839ZM8.04159 9.6861C7.92679 9.78176 7.79286 9.83916 7.63979 9.83916H7.62066C7.46759 9.83916 7.31453 9.76263 7.21887 9.64783L5.43949 7.67713L6.30048 6.91181L7.69719 8.46158L10.7967 5.5151L11.5812 6.35695L8.04159 9.6861Z", fill: "#727272" })), "Secure payments powered by ", /* @__PURE__ */ import_react7.default.createElement("span", null, "Fractal"), /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: "M17.4999 5.49758V7.01156C17.4999 7.05924 17.4595 7.09898 17.411 7.09898H12.3516C12.9169 6.54266 13.4781 5.99032 14.0434 5.434C14.0596 5.4181 14.0838 5.41016 14.104 5.41016H17.411C17.4595 5.41016 17.4999 5.44989 17.4999 5.49758Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M12.3462 10.9037V9.29836C12.3462 9.25067 12.3866 9.21094 12.435 9.21094H13.8523C13.929 9.21094 13.9694 9.30631 13.9129 9.35796C13.392 9.87455 12.8711 10.3911 12.3462 10.9037Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M12.4404 9.00523H15.6949C15.7434 9.00523 15.7838 8.96549 15.7838 8.91781V7.40383C15.7838 7.35614 15.7434 7.31641 15.6949 7.31641H12.4404C12.3919 7.31641 12.3516 7.35614 12.3516 7.40383V8.91781C12.3516 8.96549 12.3919 9.00523 12.4404 9.00523Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M10.1581 0.0120725L11.4906 0.77105C11.531 0.794892 11.5471 0.84655 11.5229 0.890261L8.99114 5.20173C8.78521 4.44275 8.57927 3.68775 8.37334 2.92877C8.36527 2.90493 8.3693 2.88109 8.38142 2.86122L10.0329 0.0438621C10.0612 0.000151419 10.1177 -0.0117697 10.1581 0.0120725Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M12.3382 7.10006L10.9289 6.29737C10.8886 6.27353 10.8724 6.22187 10.8966 6.17816L11.6033 4.97015C11.6436 4.9026 11.7446 4.91452 11.7648 4.99002C11.9546 5.69734 12.1484 6.40068 12.3382 7.10006Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M10.7107 6.0771L12.338 3.30345C12.3622 3.26372 12.346 3.20808 12.3057 3.18424L10.9732 2.42526C10.9328 2.40142 10.8763 2.41732 10.852 2.45705L9.22476 5.2307C9.20053 5.27044 9.21669 5.32607 9.25706 5.34991L10.5896 6.10889C10.634 6.13273 10.6865 6.11683 10.7107 6.0771Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M1.66713 3.51237L2.99963 2.75339C3.04001 2.72955 3.09654 2.74544 3.12077 2.78518L5.65251 7.09665C4.88128 6.89399 4.11408 6.69133 3.34285 6.48867C3.31862 6.4847 3.30247 6.4688 3.29036 6.44893L1.63483 3.63158C1.6106 3.58787 1.62271 3.53621 1.66713 3.51237Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M8.99793 5.20018L7.58871 5.99889C7.54833 6.02274 7.4918 6.00684 7.46757 5.9671L6.76095 4.76307C6.72057 4.69552 6.78517 4.61605 6.86189 4.63591C7.57256 4.82268 8.28726 5.00944 8.99793 5.20018Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M7.27986 6.07054L5.6526 3.2969C5.62837 3.25716 5.57588 3.24127 5.53146 3.26511L4.19896 4.02409C4.15858 4.04793 4.14243 4.09959 4.16666 4.1433L5.79392 6.91694C5.81815 6.95668 5.87064 6.97257 5.91506 6.94873L7.24756 6.18975C7.28794 6.16591 7.30409 6.11425 7.27986 6.07054Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M0.5 12.4998V10.9859C0.5 10.9382 0.540379 10.8984 0.588833 10.8984H5.64829C5.08299 11.4548 4.52172 12.0071 3.95642 12.5634C3.94027 12.5793 3.91604 12.5873 3.89585 12.5873H0.588833C0.540379 12.5873 0.5 12.5475 0.5 12.4998Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M5.65129 7.09766V8.70303C5.65129 8.75072 5.61091 8.79045 5.56246 8.79045H4.14516C4.06844 8.79045 4.02806 8.69508 4.08459 8.64343C4.60548 8.12685 5.12637 7.61424 5.65129 7.09766Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M5.55967 8.99609H2.30514C2.25669 8.99609 2.21631 9.03583 2.21631 9.08352V10.5975C2.21631 10.6452 2.25669 10.6849 2.30514 10.6849H5.55967C5.60813 10.6849 5.6485 10.6452 5.6485 10.5975V9.08352C5.6485 9.03583 5.60813 8.99609 5.55967 8.99609Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M7.82638 17.9865L6.49388 17.2276C6.4535 17.2037 6.43735 17.1521 6.46158 17.1083L8.99333 12.7969C9.19926 13.5559 9.40519 14.3109 9.61112 15.0698C9.6192 15.0937 9.61516 15.1175 9.60305 15.1374L7.95155 17.9547C7.91925 17.9985 7.86676 18.0104 7.82638 17.9865Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M5.64795 10.8984L7.05717 11.7011C7.09755 11.725 7.1137 11.7766 7.08947 11.8203L6.38284 13.0283C6.34246 13.0959 6.24152 13.084 6.22133 13.0085C6.02751 12.3012 5.83773 11.5978 5.64795 10.8984Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M7.2739 11.9258L5.64664 14.6994C5.62241 14.7392 5.63856 14.7948 5.67894 14.8187L7.01144 15.5776C7.05182 15.6015 7.10835 15.5856 7.13258 15.5458L8.75984 12.7722C8.78407 12.7325 8.76792 12.6768 8.72754 12.653L7.39504 11.894C7.35062 11.8702 7.29813 11.8861 7.2739 11.9258Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M16.3199 14.4866L14.9874 15.2456C14.947 15.2694 14.8904 15.2535 14.8662 15.2138L12.3345 10.9023C13.1057 11.105 13.8729 11.3077 14.6441 11.5103C14.6684 11.5143 14.6845 11.5302 14.6966 11.5501L16.3481 14.3674C16.3764 14.4111 16.3643 14.4628 16.3199 14.4866Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M8.99121 12.7983L10.4004 11.9956C10.4408 11.9717 10.4973 11.9876 10.5216 12.0274L11.2282 13.2354C11.2686 13.3029 11.204 13.3824 11.1272 13.3625C10.4166 13.1758 9.70188 12.989 8.99121 12.7983Z", fill: "#61C699" }), /* @__PURE__ */ import_react7.default.createElement("path", { d: "M10.7077 11.9285L12.3349 14.7021C12.3592 14.7418 12.4117 14.7577 12.4561 14.7339L13.7886 13.9749C13.829 13.9511 13.8451 13.8994 13.8209 13.8557L12.1936 11.0821C12.1694 11.0423 12.1169 11.0264 12.0725 11.0503L10.74 11.8092C10.6996 11.8331 10.6834 11.8847 10.7077 11.9285Z", fill: "#61C699" }))))
1165
+ ), /* @__PURE__ */ import_react7.default.createElement(
1166
+ CustomModal2_default,
1434
1167
  {
1435
- width: "60",
1436
- height: "60",
1437
- viewBox: "0 0 60 60",
1438
- fill: "none",
1439
- xmlns: "http://www.w3.org/2000/svg"
1168
+ open: showConfirmationModal,
1169
+ onClose: handleCloseConfirmationModal
1440
1170
  },
1441
- /* @__PURE__ */ import_react10.default.createElement(
1442
- "rect",
1443
- {
1444
- x: "0.5",
1445
- y: "0.5",
1446
- width: "59",
1447
- height: "59",
1448
- rx: "29.5",
1449
- stroke: "#31B379"
1450
- }
1451
- ),
1452
- /* @__PURE__ */ import_react10.default.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ import_react10.default.createElement(
1453
- "path",
1454
- {
1455
- 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",
1456
- fill: "#31B379"
1457
- }
1458
- )),
1459
- /* @__PURE__ */ import_react10.default.createElement("defs", null, /* @__PURE__ */ import_react10.default.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ import_react10.default.createElement(
1460
- "rect",
1461
- {
1462
- width: "22",
1463
- height: "22",
1464
- fill: "white",
1465
- transform: "translate(19.5 19.0039)"
1466
- }
1467
- )))
1468
- ), /* @__PURE__ */ import_react10.default.createElement("h1", null, "Success!"), /* @__PURE__ */ import_react10.default.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ import_react10.default.createElement(import_react_bootstrap4.Modal.Footer, null, /* @__PURE__ */ import_react10.default.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))), /* @__PURE__ */ import_react10.default.createElement(import_react_toastify2.ToastContainer, null));
1469
- }
1470
-
1471
- // src/app/components/Payment/Payment.tsx
1472
- var import_react12 = __toESM(require("react"));
1473
- var import_node_forge = __toESM(require("node-forge"));
1474
- var import_react_toastify3 = require("react-toastify");
1475
- var import_react_bootstrap5 = require("react-bootstrap");
1476
-
1477
- // src/app/components/Payment/Paymentstyles.tsx
1478
- var import_react11 = __toESM(require("react"));
1479
- function Paymentstyles() {
1480
- return /* @__PURE__ */ import_react11.default.createElement("style", null, `
1481
- .paymentBtn {
1482
- background-color: black;
1483
- border: none;
1484
- color: white;
1485
- padding: 15px 32px;
1486
- text-align: center;
1487
- text-decoration: none;
1488
- display: inline-block;
1489
- font-size: 16px;
1490
- margin: 4px 2px;
1491
- cursor: pointer;
1492
- border-radius: 180px;
1493
- /* width: auto; */
1494
- }
1495
-
1496
- .modal-backdrop {
1497
- display: none !important;
1498
- }
1499
-
1500
- /* CSS for modal */
1501
- .modal {
1502
- /* display: none; */
1503
- position: fixed;
1504
- z-index: 5555;
1505
- left: 0;
1506
- top: 0;
1507
- width: 100%;
1508
- height: 100%;
1509
- overflow: auto;
1510
- background-color: rgba(0, 0, 0, 0.8);
1511
- }
1512
-
1513
- .input-container {
1514
- position: relative;
1515
- }
1516
-
1517
- .error {
1518
- /* border: 1px solid red; */
1519
- color: #ffe6e6;
1520
- /* light red background color */
1521
- }
1522
-
1523
- .form-group {
1524
- margin-bottom: 15px;
1525
- }
1526
-
1527
- .input-container input {
1528
- padding-right: 25px;
1529
- }
1530
-
1531
- .modal-header {
1532
- border-bottom: 0 !important;
1533
- padding-top: 0 !important;
1534
- }
1535
-
1536
- /* CSS for modal content */
1537
- .modal-content {
1538
- /* height: 90vh !important; */
1539
- height: auto;
1540
- /* padding: 20px; */
1541
- padding: 20px 2px !important;
1542
- /* background: #fff; */
1543
- border-radius: 20px !important;
1544
- position: relative;
1545
- width: 430px;
1546
- margin: 30px auto;
1547
- overflow: hidden !important;
1548
- }
1549
- .input-container {
1550
- display: flex;
1551
- align-items: baseline;
1552
- }
1553
-
1554
- .input-error-container {
1555
- flex: 1;
1556
- }
1557
-
1558
- .paymentBtn {
1559
- margin-left: 10px;
1560
- }
1561
-
1562
- .PayButton {
1563
- outline: 0 !important;
1564
- height: 46px;
1565
- font-size: 16px;
1566
- background-color: #161616 !important;
1567
- border: none;
1568
- display: block;
1569
- width: 100%;
1570
- border-radius: 180px;
1571
- margin: 10px 0;
1572
- }
1573
-
1574
- #PayButton:hover {
1575
- background-color: #61c699 !important;
1576
- }
1577
-
1578
- #PayButton:active {
1579
- background-color: #61c699 !important;
1580
- }
1581
-
1582
- #PayButton:disabled {
1583
- background: rgb(172, 44, 170) !important;
1584
- color: #fff !important;
1585
- }
1586
-
1587
- label {
1588
- color: rgba(53, 37, 77, 0.6);
1589
- margin-bottom: 2px;
1590
- text-transform: uppercase;
1591
- font-family: "IBM Plex Mono", monospace;
1592
- font-weight: 500;
1593
- font-size: 12px;
1594
- }
1595
-
1596
- .input-container {
1597
- position: relative;
1598
- }
1599
-
1600
- .input-container input {
1601
- padding-right: 25px;
1602
- }
1603
-
1604
- #Checkout {
1605
- /* z-index: 100001; */
1606
- width: 100%;
1607
- /* height: 100%; */
1608
- /* background: 0 0 #ffffff; */
1609
- border-radius: 24px;
1610
- border: 1px solid #e0dfe2;
1611
- display: block;
1612
- }
1613
-
1614
- .container {
1615
- margin-top: 10px;
1616
- }
1617
-
1618
- .powered-logo {
1619
- width: 18px;
1620
- height: 18px;
1621
- /* float: right; */
1622
- padding: 2px;
1623
- background: #000000;
1624
- border-radius: 4px;
1625
- /* margin-left: 5px; */
1626
- }
1627
-
1628
- .modal-content .container {
1629
- width: 100%;
1630
- }
1631
-
1632
- .powerd-by-part {
1633
- display: flex;
1634
- justify-content: center;
1635
- align-items: center;
1636
- gap: 5px;
1637
- }
1638
-
1639
- .errorText {
1640
- color: red;
1641
- }
1642
-
1643
- .input-group {
1644
- position: relative;
1645
- }
1646
-
1647
- .paynowbtn {
1648
- outline: 0 !important;
1649
- padding: 7px 25px !important;
1650
- font-size: 13px;
1651
- background-color: #161616 !important;
1652
- border: #161616 1px solid !important;
1653
- color: #fff !important;
1654
- display: inline-block !important;
1655
- border-radius: 180px !important;
1656
- }
1657
-
1658
- .paynowbtn:hover {
1659
- background-color: #fff !important;
1660
- border: #161616 1px solid !important;
1661
- color: #161616 !important;
1662
- }
1663
-
1664
- .ButtonGroup__root.btn-group {
1665
- margin: 10px 0 20px 0;
1666
- }
1667
-
1668
- .ButtonGroup__root.btn-group button {
1669
- background: #000;
1670
- border: 0;
1671
- margin: 0 5px;
1672
- border-radius: 4px !important;
1673
- }
1674
-
1675
- .ButtonGroup__root.btn-group button:hover,
1676
- .ButtonGroup__root.btn-group button:focus {
1677
- background: #333 !important;
1678
- }
1679
-
1680
- .input-group button {
1681
- background: #000;
1682
- border: 0;
1683
- margin: 0 5px;
1684
- border-radius: 0 4px 4px 0 !important;
1685
- }
1686
-
1687
- .input-group button:hover,
1688
- .input-group button:focus {
1689
- background: #333 !important;
1690
- }
1691
-
1692
- .payment-suc {
1693
- text-align: center;
1694
- }
1695
-
1696
- .payment-suc .modal-dialog {
1697
- min-width: 600px;
1698
- padding: 50px 0;
1699
- }
1700
-
1701
- .payment-suc h2 {
1702
- font-size: 24px;
1703
- color: #35254d;
1704
- font-weight: 500;
1705
- padding: 15px 0;
1706
- }
1707
-
1708
- .payment-suc p {
1709
- font-size: 14px;
1710
- color: #9a92a6;
1711
- font-weight: 500;
1712
- }
1713
-
1714
- .payment-suc .btn-close {
1715
- position: absolute;
1716
- right: 20px;
1717
- }
1718
-
1719
- .Checkout.container iframe {
1720
- width: 100%;
1721
- overflow: hidden !important;
1722
- }
1723
-
1724
- .responsive-tbl {
1725
- overflow-x: auto;
1726
- }
1727
-
1728
- body {
1729
- position: relative !important;
1730
- }
1731
-
1732
- thead,
1733
- tbody,
1734
- tfoot,
1735
- tr,
1736
- td,
1737
- th {
1738
- white-space: nowrap;
1739
- }
1740
-
1741
- .button-group {
1742
- display: flex;
1743
- gap: 10px;
1744
- }
1745
-
1746
- .rqstonClickbtn {
1747
- color: #fff;
1748
- background-color: #337ab7;
1749
- border-color: #2e6da4;
1750
- }
1751
-
1752
- .loading-animation {
1753
- position: absolute;
1754
- top: 50%;
1755
- left: 50%;
1756
- transform: translate(-50%, -50%);
1757
- }
1758
-
1759
- .spinner {
1760
- width: 40px;
1761
- height: 40px;
1762
- border-radius: 50%;
1763
- border: 4px solid #f3f3f3;
1764
- border-top: 4px solid black;
1765
- animation: spin 1s linear infinite;
1766
- }
1767
-
1768
- @keyframes spin {
1769
- 0% {
1770
- transform: rotate(0deg);
1771
- }
1772
-
1773
- 100% {
1774
- transform: rotate(360deg);
1775
- }
1776
- }
1777
-
1778
- /* .border-container {
1779
- display: flex;
1780
- flex-direction: column;
1781
- border: 0px solid #ccc;
1782
- padding: 20px;
1783
- border-radius: 10px;
1784
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
1785
- align-items: baseline;
1786
- }
1787
- .payment-container {
1788
- border: 0px solid #ccc;
1789
- padding: 20px;
1790
- border-radius: 10px;
1791
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
1792
- } */
1793
-
1794
- .payment-row {
1795
- display: flex;
1796
- align-items: center;
1797
- margin-bottom: 20px;
1798
- }
1799
-
1800
- .payment-row label {
1801
- width: 150px;
1802
- font-weight: bold;
1803
- margin-right: 10px;
1804
- }
1805
-
1806
- .payment-row input {
1807
- flex-grow: 1;
1808
- margin-right: 10px;
1809
- }
1810
-
1811
- .payment-row button {
1812
- flex-grow: 1;
1813
- }
1814
-
1815
- .payment-row {
1816
- display: flex;
1817
- flex-direction: column;
1818
- border-radius: 10px;
1819
- margin-top: 10px;
1820
- }
1821
-
1822
- .input-wrapper {
1823
- flex: 1;
1824
- }
1825
-
1826
- .button-wrapper {
1827
- margin-left: 10px;
1828
- }
1829
-
1830
- .input-container {
1831
- display: flex;
1832
- flex-direction: column;
1833
- }
1834
-
1835
- .export-btn {
1836
- background: black;
1837
- color: white;
1838
- height: 35px;
1839
- width: 68px;
1840
- border-radius: 5px;
1841
- margin-left: 14px;
1842
- }
1843
-
1844
- .payment-popup {
1845
- padding: 12px 20px;
1846
- background: #fff;
1847
- border-radius: 20px;
1848
- position: relative;
1849
- width: 100%;
1850
- margin: 0 auto;
1851
- }
1852
-
1853
- .modal-dialog {
1854
- max-width: 810px;
1855
- }
1856
-
1857
- .modal-content {
1858
- max-width: 100%;
1859
- /* margin-top: 5%; */
1860
- width: 100%;
1861
- margin: 0;
1862
- }
1863
-
1864
- @media (max-width: 460px) {
1865
- .payment-popup {
1866
- padding: 35px 25px;
1867
- width: 98%;
1868
- }
1869
- }
1870
-
1871
- .close-pop {
1872
- position: absolute;
1873
- right: 8px;
1874
- top: 8px;
1875
- border: 0;
1876
- padding: 0;
1877
- background: none !important;
1878
- }
1879
-
1880
- .copy-api {
1881
- overflow-y: auto;
1882
- scrollbar-width: inherit;
1883
- background: #f2f2f2;
1884
- color: rgb(33, 33, 33);
1885
- font-size: "12px";
1886
- border: 0;
1887
- border-radius: 4px;
1888
- width: 100%;
1889
- padding: 8px 15px;
1890
- position: relative;
1891
- }
1892
-
1893
- #style-3::-webkit-scrollbar-track {
1894
- -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
1895
- background-color: #f5f5f5;
1896
- }
1897
-
1898
- #style-3::-webkit-scrollbar {
1899
- height: 3px;
1900
- background-color: #f5f5f5;
1901
- }
1902
-
1903
- #style-3::-webkit-scrollbar-thumb {
1904
- cursor: pointer;
1905
- background-color: #333;
1906
- }
1907
-
1908
- .copy-code {
1909
- display: flex;
1910
- }
1911
-
1912
- .copy-code svg {
1913
- margin-right: 10px;
1914
- }
1915
-
1916
- .accordion.accordion-flush {
1917
- float: left;
1918
- width: 100%;
1919
- margin-bottom: 45px;
1920
- }
1921
-
1922
- .box {
1923
- width: 100%;
1924
- height: 200px;
1925
- /* background-color: #ddf6fc0e; */
1926
- /* color: #fff; */
1927
- text-align: center;
1928
- line-height: 200px;
1929
- /* Center content vertically */
1930
- font-size: 1.5rem;
1931
- }
1932
-
1933
- .amex {
1934
- background-image: url("/assests/amex.svg");
1935
- }
1936
-
1937
- .visa {
1938
- background-image: url("/assests/visa.svg");
1939
- }
1940
-
1941
- .mastercard {
1942
- background-image: url("/assests/mastercard.svg");
1943
- }
1944
-
1945
- .discover {
1946
- background-image: url("/assests/discover.svg");
1947
- }
1948
-
1949
- .expiry-date-group {
1950
- float: left;
1951
- width: 30%;
1952
- }
1953
-
1954
- .expiry-date-group input {
1955
- width: calc(100% + 1px);
1956
- border-top-right-radius: 0;
1957
- border-bottom-right-radius: 0;
1958
- }
1959
-
1960
- .expiry-date-group input:focus {
1961
- position: relative;
1962
- z-index: 10;
1963
-
1964
- }
1965
- .pay-tbl th{width: 24% !important;}
1966
- .pay-tbl th:last-child{width: 28% !important;}
1967
- .security-code-group {
1968
- float: right;
1969
- width: 40%;
1970
- position: relative;
1971
- }
1972
-
1973
- .security-code-group input {
1974
- border-top-left-radius: 0;
1975
- border-bottom-left-radius: 0;
1976
- }
1977
-
1978
- .zip-code-group {
1979
- clear: both;
1980
- }
1981
- .amnt input{max-width: 150px; margin-right:8px;}
1982
- .amnt p, .amnt form{margin-right:8px;}
1983
- #submitButton {
1984
- outline: 0 !important;
1985
- height: 46px;
1986
- font-size: 16px;
1987
- background-color: #161616 !important;
1988
- border: none;
1989
- display: block;
1990
- width: 100%;
1991
- color: white;
1992
- border-radius: 180px;
1993
- }
1994
-
1995
- #submitRequestButton {
1996
- outline: 0 !important;
1997
- height: 46px;
1998
- font-size: 16px;
1999
- background-color: #161616 !important;
2000
- border: none;
2001
- display: block;
2002
- width: 100%;
2003
- border-radius: 180px;
2004
- }
2005
-
2006
- #PayButton {
2007
- outline: 0 !important;
2008
- height: 46px;
2009
- font-size: 16px;
2010
- background-color: #161616 !important;
2011
- border: none;
2012
- display: block;
2013
- width: 100%;
2014
- border-radius: 180px;
2015
- margin: 2px;
2016
- }
2017
-
2018
- #PayButton:hover {
2019
- background-color: #61c699 !important;
2020
- }
2021
-
2022
- #PayButton:active {
2023
- background-color: #61c699 !important;
2024
- }
2025
-
2026
- #PayButton:disabled {
2027
- background: rgb(172, 44, 170) !important;
2028
- color: #fff !important;
2029
- }
2030
-
2031
- .form-control {
2032
- color: #35254d;
2033
- }
2034
-
2035
- .container {
2036
- margin-top: 10px;
2037
- }
2038
-
2039
- #Checkout {
2040
- z-index: 100001;
2041
- width: 100%;
2042
- height: 100%;
2043
- min-height: 100%;
2044
- background: 0 0 #ffffff;
2045
- border-radius: 24px;
2046
- border: 1px solid #e0dfe2;
2047
- margin-left: auto;
2048
- margin-right: auto;
2049
- display: block;
2050
- }
2051
-
2052
- #Checkout .header {
2053
- display: flex;
2054
- /* Enables Flexbox */
2055
- justify-content: center;
2056
- /* Centers content horizontally */
2057
- align-items: center;
2058
- /* Centers content vertically */
2059
- text-align: center;
2060
- padding: 8px;
2061
- border-bottom: 1px solid #dedede;
2062
- margin: 0 10px 20px 10px;
2063
- }
2064
-
2065
- #Checkout .header button {
2066
- border: 0;
2067
- background: none;
2068
- padding: 0;
2069
- }
2070
-
2071
- #Checkout h1 {
2072
- margin: 0;
2073
- flex: 1;
2074
- padding: 10px;
2075
- /* Allows the title to grow and fill the space for centering */
2076
- font-size: 23px;
2077
- font-weight: 500;
2078
- color: #35254d;
2079
- align-items: start;
2080
- display: flex;
2081
- }
2082
-
2083
- #Checkout>form {
2084
- margin: 0 25px 10px 25px;
2085
- }
2086
-
2087
- label {
2088
- color: rgba(53, 37, 77, 0.6);
2089
- margin-bottom: 2px;
2090
- text-transform: uppercase;
2091
- font-family: "IBM Plex Mono", monospace;
2092
- font-weight: 500;
2093
- font-size: 12px;
2094
- }
2095
-
2096
- .input-container {
2097
- position: relative;
2098
- }
2099
-
2100
- .input-container input {
2101
- padding-right: 25px;
2102
- }
2103
-
2104
- #zipcode {
2105
- text-transform: capitalize !important;
2106
- }
2107
-
2108
- #zipcode {
2109
- width: 18px;
2110
- position: absolute;
2111
- right: 8px;
2112
- top: 9px;
2113
- }
2114
-
2115
- #zipcode .zip-tip {
2116
- display: none;
2117
- background-color: rgb(0, 0, 0, 0.4);
2118
- padding: 5px 8px;
2119
- border-radius: 6px;
2120
- position: absolute;
2121
- right: 26px;
2122
- top: -9px;
2123
- font-size: 12.5px;
2124
- text-transform: capitalize !important;
2125
- color: #fff;
2126
- width: 240px;
2127
- line-height: 16px;
2128
- }
2129
-
2130
- #zipcode .zip-tip:before {
2131
- width: 0;
2132
- height: 0;
2133
- border-top: 7px solid transparent;
2134
- border-bottom: 7px solid transparent;
2135
- border-left: 7px solid #000;
2136
- opacity: 0.4;
2137
- position: absolute;
2138
- right: -7px;
2139
- top: 50%;
2140
- transform: translateY(-50%);
2141
- content: "";
2142
- }
2143
-
2144
- #zipcode:hover .zip-tip {
2145
- display: block;
2146
- }
2147
-
2148
- .input-container>i,
2149
- a[role="button"] {
2150
- color: #d3d3d3;
2151
- width: 25px;
2152
- height: 30px;
2153
- line-height: 30px;
2154
- font-size: 16px;
2155
- position: absolute;
2156
- top: 5px;
2157
- right: 6px;
2158
- cursor: pointer;
2159
- text-align: center;
2160
- }
2161
-
2162
- .input-container>i:hover,
2163
- a[role="button"]:hover {
2164
- color: #777;
2165
- }
2166
-
2167
- .amount-placeholder {
2168
- white-space: nowrap;
2169
- font-size: 44px;
2170
- /* height: 35px; */
2171
- font-weight: 600;
2172
- line-height: 40px;
2173
- }
2174
-
2175
- .amount-placeholder>button {
2176
- float: right;
2177
- width: 60px;
2178
- }
2179
-
2180
- .amount-placeholder>span {
2181
- line-height: 34px;
2182
- }
2183
-
2184
- .top-amnt {
2185
- display: flex;
2186
- margin-bottom: 10px;
2187
- align-items: center;
2188
- justify-content: space-between;
2189
- }
2190
-
2191
- .amtleft {
2192
- text-align: center;
2193
- }
2194
-
2195
- .amtleft span {
2196
- color: #35254d;
2197
- margin: 0 -5px;
2198
- }
2199
-
2200
- .card-row {
2201
- text-align: right;
2202
- margin: 22px 0 0 0;
2203
- max-width: 85px;
2204
- line-height: 20px;
2205
- }
2206
-
2207
- .yer {
2208
- border-radius: 0;
2209
- }
2210
-
2211
- .card-row span {
2212
- width: 33px;
2213
- height: 21px;
2214
- margin: 0 2px;
2215
- background-repeat: no-repeat;
2216
- display: inline-block;
2217
- background-size: contain;
2218
- }
2219
-
2220
- .card-image {
2221
- background-repeat: no-repeat;
2222
- padding-right: 50px;
2223
- background-position: right 2px center;
2224
- background-size: auto 90%;
2225
- }
2226
-
2227
- /* .cvc-preview-container {
2228
- overflow: hidden;
2229
- } */
2230
-
2231
- .cvc-preview-container {
2232
- /* overflow: hidden; */
2233
- position: absolute;
2234
- z-index: 9999;
2235
- right: -71px;
2236
- top: -54px;
2237
- width: 165px;
2238
- border-radius: 5px;
2239
- padding: 5px;
2240
- background-color: rgb(0, 0, 0, 0.3);
2241
- display: none;
2242
- }
2243
-
2244
- .cvc-preview-container:before {
2245
- position: absolute;
2246
- left: 50%;
2247
- transform: translate(-50%);
2248
- bottom: -5px;
2249
- width: 0;
2250
- height: 0;
2251
- border-left: 5px solid transparent;
2252
- border-right: 5px solid transparent;
2253
- border-top: 5px solid #000;
2254
- opacity: 0.3;
2255
- content: "";
2256
- }
2257
-
2258
- .security-code-group #cvc:hover .cvc-preview-container {
2259
- display: block;
2260
- }
2261
-
2262
- .cvc-preview-container.two-card div {
2263
- width: 50%;
2264
- height: 45px;
2265
- }
2266
-
2267
- .cvc-preview-container.two-card div.amex-cvc-preview {
2268
- float: right;
2269
- }
2270
-
2271
- .cvc-preview-container.two-card div.visa-mc-dis-cvc-preview {
2272
- float: left;
2273
- }
2274
-
2275
- /* .cvc-preview-container div {
2276
- height: 160px;
2277
- } */
2278
-
2279
- .amex-cvc-preview {
2280
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAACOCAYAAAAlzXSMAAAAAXNSR0IArs4c6QAAFg9J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lQhekVlUWjR+PPiXbCqOxfVJhqv8O/ojCxkQ48BWegJ9CI+aKFGdaISWGGBuZT2EIbE3gn2A7N+ZbLnE1pcnclpy2WvUch9c1E0ZiwTL0p7UJxcfKBsvNtEVPaiIQibbwx86zlRJQZUWCkB9dO7YOh5oEmYeKRjinv4xYtt88Z/e67SlunTpPmMp25ISxd4SVMtcUcXvbQ08acUd8eXR8xy1So5MoL5p05Icz1x8/Khu8Uptr1GZ2vng886MdxbGar25evWk3m0ZlvlCWuaDHXq35IA3Wg20J8OD5i5nybPWIU2GDImTbyja381OZFUSVM7JyEhmraOwLPp9ZmnrSPNvM+NO41gQpEQML5pg0eLZjSxo5M2CxGt0dgBQ3QaYuRG2+zPE9UFiO6KW0AASK6aAnzym2jnaLn26NdIzry6LTD9dCxBdoGTk8DbxU5Gwk6N8yxa7/S1FbvuF6bbj1dbwq169nXeH9wzHl/IsHSPZmygTufsWKkR+N35gWf8Yoc6thZfgTDXPemanWRuGyt/V1jf5mxs7TzfiJt7O7ljFSjY0Rw0pk2OgPERvjrEkL46xJCCIVJCKEwCaEwCSEUJiEUJiGEwiSEwiSEUJiEUJisBEIoTEIIhUkIhUkIoTAJoTAJIRQmIX9tYR649YAVQUgUAU36sHQDK4OQ6AGa9G0+ffH/WBmERA/QpG/ZZ59nsTIIiR6gSV/Spp2bd164xgohJAqAFqFJ3+wN29su3LFXpF//jRVDyJ8INAgtQpM+/PkVehILGXvtQkwIyWFR+rUHDUKLPvU3c2NqpaSUnf+zYPtese3cj8Yt8AghkQdag+agPWgQWvTpf7OSU1/xn/jvOZtS5Q7GySfOibSLN+RehtiTgRASGaApaAsag9agOWgPGvSZ/makpFTwGxxK2pT6bxgTQnIWaA2ag/Z8wf5mJW9tNGfjjmX+L13w8yApJfUfhJAIAU35tQWNQWsmDf4HqpjHZRJqxUwAAAAASUVORK5CYII=") center center/contain no-repeat;
2281
- }
2282
-
2283
- .visa-mc-dis-cvc-preview {
2284
- background: url("data:image/png;base64,iVBORw0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pI6tvtoyq9vz+4/clcf89sJ2eiXIZGEyJD9sEl6RAa1MVPbpczsk8vT52SHHZCDUxelXxtzW/x4wPx+6cxn+0A2208PX9pB2aONef7xk3JrBjkth4Jysnf9fX1T0Czzmqx+6pcvcel/pJd5RRLXg1p6d0vWvdHKHJCeG2XljLVb5aZS5r2E3A6uTiUu2Km1klLK3CXxZDK5xd6RNYd3St+MTuaryr94G6y92iuy77X+b9rSi/d8usOEyZIXC5gsR7O5MN9bRexvwoQJEyZMmDBhwoQJEyZMmDBhwoT5vzNLLihLJu8CM2+6XGB2meUuMFeYyEf9ysmIqcsUtSuLmQZjGp8pdxafNxtjamIZ1f12MhOrDQ6uXhRLD4/nVb4/S/nx4XRsSeUY8prGtOI0186eKl8Xae3QSOxojTSUgT8BEvkXyqDHONgAAAAASUVORK5CYII=") center center/contain no-repeat;
2285
- }
2286
-
2287
- .submit-button-lock {
2288
- height: 15px;
2289
- margin-top: -2px;
2290
- margin-right: 7px;
2291
- vertical-align: middle;
2292
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAgCAMAAAA7dZg3AAAKQWlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUU9kWh8+9N73QEiIgJfQaegkg0jtIFQRRiUmAUAKGhCZ2RAVGFBEpVmRUwAFHhyJjRRQLg4Ji1wnyEFDGwVFEReXdjGsJ7601896a/cdZ39nnt9fZZ+9917oAUPyCBMJ0WAGANKFYFO7rwVwSE8vE9wIYEAEOWAHA4WZmBEf4RALU/L09mZmoSMaz9u4ugGS72yy/UCZz1v9/kSI3QyQGAApF1TY8fiYX5QKUU7PFGTL/BMr0lSkyhjEyFqEJoqwi48SvbPan5iu7yZiXJuShGlnOGbw0noy7UN6aJeGjjAShXJgl4GejfAdlvVRJmgDl9yjT0/icTAAwFJlfzOcmoWyJMkUUGe6J8gIACJTEObxyDov5OWieAHimZ+SKBIlJYqYR15hp5ejIZvrxs1P5YjErlMNN4Yh4TM/0tAyOMBeAr2+WRQEl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zPSe9L8M0ozBDuspp1e5VE6JA0ZFMKHNZZruYjv5M9UiMJJslg1kLs2qy3mdHZZ/KUcwR5vTkmuRuyx3J88n7fjVmNXd1Z752/ob8wTXuaw6thdauXNu5Tnddwbrh9b7rj20gbUjZ8MtGy41lG99uit7UUaBRsL5gaLPv5sZCuUJR4b0tzlsObMVsFWzt3WazrWrblyJe0fViy+KK4k8l3JLr31l9V/ndzPaE7b2l9qX7d+B2CHfc3em681iZYlle2dCu4F2t5czyovK3u1fsvlZhW3FgD2mPZI+0MqiyvUqvakfVp+qk6oEaj5rmvep7t+2d2sfb17/fbX/TAY0DxQc+HhQcvH/I91BrrUFtxWHc4azDz+ui6rq/Z39ff0TtSPGRz0eFR6XHwo911TvU1zeoN5Q2wo2SxrHjccdv/eD1Q3sTq+lQM6O5+AQ4ITnx4sf4H++eDDzZeYp9qukn/Z/2ttBailqh1tzWibakNml7THvf6YDTnR3OHS0/m/989Iz2mZqzymdLz5HOFZybOZ93fvJCxoXxi4kXhzpXdD66tOTSna6wrt7LgZevXvG5cqnbvfv8VZerZ645XTt9nX297Yb9jdYeu56WX+x+aem172296XCz/ZbjrY6+BX3n+l37L972un3ljv+dGwOLBvruLr57/17cPel93v3RB6kPXj/Mejj9aP1j7OOiJwpPKp6qP6391fjXZqm99Oyg12DPs4hnj4a4Qy//lfmvT8MFz6nPK0a0RupHrUfPjPmM3Xqx9MXwy4yX0+OFvyn+tveV0auffnf7vWdiycTwa9HrmT9K3qi+OfrW9m3nZOjk03dp76anit6rvj/2gf2h+2P0x5Hp7E/4T5WfjT93fAn88ngmbWbm3/eE8/syOll+AAAAYFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////98JRy6AAAAH3RSTlMAAgYMEyIzOUpTVFViY3N2gJmcnaipq7fX3ebx+Pn8eTEuDQAAAI9JREFUKM/N0UkOglAQRdFHDyK90n64+9+lAyQgookjuaNKTlJJpaQlO2n6sW8SW/uCjrku2EloWDLhi3gDa4O3pTtA5Tt+BXDbiDsBmSQpAyZ3pRhoLUmS1QLxSilQPOcCSFfKgfxgPgfZ9ch7Y21LCcdd5wVH5SckEzkXc0ylpPJnMpETmX/d9eUpH1/5AKrsQVrz7YPBAAAAAElFTkSuQmCC") center center/contain no-repeat;
2293
- width: 14px;
2294
- display: inline-block;
2295
- }
2296
-
2297
- .align-middle {
2298
- vertical-align: middle;
2299
- }
2300
-
2301
- input {
2302
- box-shadow: none !important;
2303
- }
2304
-
2305
- .powerd-by-part {
2306
- display: flex;
2307
- font-size: 12px;
2308
- text-align: center;
2309
- align-items: center;
2310
- justify-content: center;
2311
- margin: 5px 0 20px 0;
2312
- }
2313
-
2314
- .powered-logo {
2315
- width: 18px;
2316
- height: auto;
2317
- float: right;
2318
- padding: 2px;
2319
- background: #000000;
2320
- border-radius: 4px;
2321
- margin-left: 5px;
2322
- }
2323
-
2324
- .comp-name {
2325
- display: block;
2326
- margin-bottom: 8px;
2327
- }
2328
-
2329
- .client-logo {
2330
- max-width: 140px;
2331
- display: block;
2332
- margin: auto;
2333
- padding: 5px;
2334
- }
2335
-
2336
- #qrCode {
2337
- text-align: center;
2338
- }
2339
-
2340
- #qrIcon {
2341
- cursor: pointer;
2342
- border: 1px solid rgb(252, 252, 252);
2343
- padding: 10px;
2344
- border-radius: 5px;
2345
- background: #ffffff;
2346
- }
2347
-
2348
- #target {
2349
- display: none;
2350
- text-align: center;
2351
- transition: all 5s;
2352
- padding: 5px;
2353
- transition: max-height 0.5s, overflow 0.5s 0.5s;
2354
- }
2355
-
2356
- /* input:focus {
2357
- border-color: #acc6db !important;
2358
- background-color: #acc6db !important;
2359
- } */
2360
-
2361
- @media(min-width:725px) {
2362
- .pay-main{margin: 0 auto !important;}
2363
- #modal-pay iframe{
2364
- max-height: 548px;
2365
- min-height: 548px;
2366
- }
2367
- .get-pay-pgs #modal-pay iframe{
2368
- max-height: 500px !important;
2369
- min-height: 500px !important;
2370
- }
2371
- #modal-pay .modal-header{
2372
- position: absolute;
2373
- right: 5px;
2374
- top: 15px;
2375
- z-index: 4;
2376
- }
2377
- /* #modal-pay .modal-body{
2378
- padding: 0 !important;
2379
- } */
2380
- }
2381
- @media(max-width:724px) {
2382
- #modal-pay iframe{
2383
- min-height: 708px !important;
2384
- }
2385
- #modal-pay iframe .modal-body{
2386
- padding:0 !important;
2387
- }
2388
- }
2389
- #modal-pay .modal-body{padding: 0;}
2390
- /* #modal-pay .modal-content{padding: 0 !important;} */
2391
- .pre-auth-pop .modal-header{position: relative; z-index: 4;}
2392
- .pre-auth-pop iframe{
2393
- margin-top: -60px;
2394
- }
2395
-
2396
- .form-control {
2397
- padding: .320rem .75rem !important;
2398
-
2399
- }
2400
- `);
2401
- }
2402
-
2403
- // src/app/components/Payment/Payment.tsx
2404
- function Payment() {
2405
- var _a;
2406
- const [state, setState] = (0, import_react12.useState)({
2407
- show: false,
2408
- publicKey: "",
2409
- sessionKey: "",
2410
- cardNumber: "",
2411
- year: "",
2412
- month: "",
2413
- cvv: "",
2414
- zip: "",
2415
- amount: ""
2416
- });
2417
- const [isValid, setIsValid] = (0, import_react12.useState)(false);
2418
- const [isValidMonth, setIsValidMonth] = (0, import_react12.useState)(false);
2419
- const [data, setData] = (0, import_react12.useState)(null);
2420
- const handlePaymentClick = async () => {
2421
- try {
2422
- const response = await fetch(`${baseUrl}generate-session`, {
2423
- method: "POST",
2424
- headers: {
2425
- "Content-Type": "application/json"
2426
- },
2427
- body: JSON.stringify({})
2428
- });
2429
- if (!response.ok) {
2430
- throw new Error("Network response was not ok");
2431
- }
2432
- const data2 = await response.json();
2433
- if (data2 && data2.result === true) {
2434
- setState((prev) => {
2435
- var _a2, _b;
2436
- return __spreadProps(__spreadValues({}, prev), {
2437
- show: true,
2438
- publicKey: (_a2 = data2 == null ? void 0 : data2.data) == null ? void 0 : _a2.publicKeyPem,
2439
- sessionKey: (_b = data2 == null ? void 0 : data2.data) == null ? void 0 : _b.session_key
2440
- });
2441
- });
2442
- }
2443
- } catch (error) {
2444
- console.log(error);
2445
- }
2446
- };
2447
- const handleSubmitPay = async () => {
2448
- const track2_data = `${state.cardNumber.replace(/\s+/g, "")}=${state.year}${state.month.length > 1 ? state.month : "0" + state.month} ${state.cvv}`;
2449
- const publicKey = import_node_forge.default.pki.publicKeyFromPem(state.publicKey);
2450
- const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
2451
- md: import_node_forge.default.md.sha1.create(),
2452
- mgf1: { md: import_node_forge.default.md.sha1.create() }
2453
- });
2454
- const encryptedBase64 = import_node_forge.default.util.encode64(encrypted);
2455
- console.log(encryptedBase64);
2456
- const requestBody = {
2457
- enc_track2_data: encryptedBase64,
2458
- session_key: state.sessionKey,
2459
- algorithm: "RSAES_OAEP_SHA_1"
2460
- };
2461
- const apiUrl = "https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize";
2462
- try {
2463
- const response = await fetch(apiUrl, {
2464
- method: "POST",
2465
- headers: {
2466
- "x-app-session-key": state == null ? void 0 : state.sessionKey,
2467
- "Content-Type": "application/json"
2468
- },
2469
- body: JSON.stringify(requestBody)
2470
- });
2471
- if (response.ok) {
2472
- import_react_toastify3.toast.success("Payment Successful");
2473
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2474
- show: false,
2475
- publicKey: "",
2476
- sessionKey: "",
2477
- cardNumber: "",
2478
- year: "",
2479
- month: "",
2480
- cvv: "",
2481
- zip: "",
2482
- amount: ""
2483
- }));
2484
- }
2485
- const responseData = await response.json();
2486
- console.log("response", responseData);
2487
- } catch (error) {
2488
- console.error("Error:", error);
2489
- }
2490
- };
2491
- const handleCardNumberChange = (e) => {
2492
- e.preventDefault();
2493
- const { value } = e.target;
2494
- const formattedValue = value.replace(/\D+/g, "").replace(/(.{4})/g, "$1 ").trim();
2495
- if (value.match(/[a-zA-Z]/)) {
2496
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2497
- cardNumber: formattedValue,
2498
- error: "Invalid input. Please enter only numbers."
2499
- }));
2500
- } else {
2501
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2502
- cardNumber: formattedValue,
2503
- error: null
2504
- }));
2505
- }
2506
- };
2507
- const handleMonthChange = (e) => {
2508
- setIsValid(false);
2509
- let value = e.target.value;
2510
- if (/^\d{0,2}$/.test(value) && (value === "" || parseInt(value, 10) >= 1 && parseInt(value, 10) <= 12)) {
2511
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2512
- month: value
2513
- }));
2514
- setIsValidMonth(false);
2515
- } else {
2516
- setIsValidMonth(true);
2517
- }
2518
- };
2519
- const handleYearChange = (e) => {
2520
- setIsValid(false);
2521
- setIsValidMonth(false);
2522
- let value = e.target.value;
2523
- if (/^\d{0,2}$/.test(value) && (value === "" || parseInt(value, 10) >= 0 && parseInt(value, 10) <= 99)) {
2524
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2525
- year: value
2526
- }));
2527
- }
2528
- };
2529
- const handleCVVChange = (e) => {
2530
- setIsValid(false);
2531
- setIsValidMonth(false);
2532
- let value = e.target.value;
2533
- if (/^\d{0,4}$/.test(value)) {
2534
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2535
- cvv: value
2536
- }));
2537
- }
2538
- };
2539
- const handleZIP = (e) => {
2540
- setIsValid(false);
2541
- setIsValidMonth(false);
2542
- let value = e.target.value;
2543
- if (/^\d{0,7}$/.test(value)) {
2544
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2545
- zip: value
2546
- }));
2547
- }
2548
- };
2549
- const handleAmount = (e) => {
2550
- setIsValid(false);
2551
- setIsValidMonth(false);
2552
- let value = e.target.value;
2553
- value = value.replace(/[^0-9.]/g, "");
2554
- let parts = value.split(".");
2555
- if (parts.length > 2) {
2556
- parts = [parts.shift(), parts.join(".")];
2557
- value = parts.join("");
2558
- }
2559
- if (parts.length === 2 && parts[1].length > 2) {
2560
- value = `${parts[0]}.${parts[1].slice(0, 2)}`;
2561
- }
2562
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2563
- amount: value
2564
- }));
2565
- };
2566
- const handleAmountBlur = () => {
2567
- const value = state.amount;
2568
- if (value && !value.includes(".")) {
2569
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2570
- amount: `${value}.00`
2571
- }));
2572
- }
2573
- };
2574
- function amountFormat(amt) {
2575
- if (amt) {
2576
- return `${parseFloat(amt).toLocaleString("en-US", {
2577
- minimumFractionDigits: 2,
2578
- maximumFractionDigits: 2
2579
- })}`;
2580
- }
2581
- return "";
2582
- }
2583
- return /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement(Paymentstyles, null), /* @__PURE__ */ import_react12.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react12.default.createElement(
2584
- "button",
2585
- {
2586
- className: "export-btn",
2587
- style: { width: "83px" },
2588
- onClick: () => handlePaymentClick()
2589
- },
2590
- "Payment"
2591
- ), /* @__PURE__ */ import_react12.default.createElement(
2592
- import_react_bootstrap5.Modal,
2593
- {
2594
- show: state.show,
2595
- onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
2596
- show: false
2597
- })),
2598
- centered: true
2599
- },
2600
- /* @__PURE__ */ import_react12.default.createElement(import_react_bootstrap5.Modal.Header, { closeButton: true }),
2601
- /* @__PURE__ */ import_react12.default.createElement(import_react_bootstrap5.Modal.Body, null, /* @__PURE__ */ import_react12.default.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "row" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react12.default.createElement("div", { id: "Checkout", className: "inline" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "header" }, /* @__PURE__ */ import_react12.default.createElement("h1", null, "Pay")), /* @__PURE__ */ import_react12.default.createElement("form", { id: "PaymentForm", className: "payment-form" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group", style: { display: "none" } }, /* @__PURE__ */ import_react12.default.createElement("label", null, "Payment amount"), /* @__PURE__ */ import_react12.default.createElement("div", { className: "input-group" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "input-group-addon" }, "$"), /* @__PURE__ */ import_react12.default.createElement(
2602
- "input",
2603
- {
2604
- type: "text",
2605
- name: "amount",
2606
- value: "1",
2607
- className: "form-control",
2608
- id: ""
2609
- }
2610
- )), /* @__PURE__ */ import_react12.default.createElement(
2611
- "span",
2612
- {
2613
- id: "amount-error",
2614
- style: { color: "red", display: "none" }
2615
- }
2616
- )), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", null, "Name on card"), /* @__PURE__ */ import_react12.default.createElement(
2617
- "input",
2618
- {
2619
- id: "NameOnCard",
2620
- className: "form-control required",
2621
- type: "text",
2622
- maxLength: 100,
2623
- placeholder: "Name"
2624
- }
2625
- ), /* @__PURE__ */ import_react12.default.createElement(
2626
- "span",
2627
- {
2628
- id: "NameOnCard-error",
2629
- style: { color: "red", display: "none" }
2630
- }
2631
- )), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement(
2632
- "input",
2633
- {
2634
- "data-token": "card_number",
2635
- className: "null card-image form-control required",
2636
- type: "text",
2637
- maxLength: 19,
2638
- value: state.cardNumber,
2639
- placeholder: "0000 0000 0000 0000",
2640
- onChange: handleCardNumberChange
2641
- }
2642
- ), state.error && /* @__PURE__ */ import_react12.default.createElement("div", { style: { color: "red" } }, state.error)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react12.default.createElement(
2643
- "input",
2644
- {
2645
- "data-token": "exp_month",
2646
- className: "form-control required",
2647
- type: "text",
2648
- placeholder: "MM",
2649
- value: state.month,
2650
- maxLength: 2,
2651
- onChange: (e) => handleMonthChange(e)
2652
- }
2653
- ), isValidMonth && /* @__PURE__ */ import_react12.default.createElement(
2654
- "span",
2655
- {
2656
- id: "card_number-error",
2657
- style: { color: "red", fontSize: "15px" }
2658
- },
2659
- (_a = ErrorText) == null ? void 0 : _a.montherror
2660
- )), /* @__PURE__ */ import_react12.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react12.default.createElement(
2661
- "input",
2662
- {
2663
- "data-token": "exp_year",
2664
- className: "form-control required",
2665
- type: "text",
2666
- placeholder: "YY",
2667
- maxLength: 2,
2668
- value: state.year,
2669
- onChange: (e) => handleYearChange(e)
2670
- }
2671
- ), state.yearError && /* @__PURE__ */ import_react12.default.createElement("span", { id: "exp_year-error", style: { color: "red" } }, state.yearError)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "security-code-group form-group" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react12.default.createElement(
2672
- "input",
2673
- {
2674
- "data-token": "cvv",
2675
- className: "form-control required",
2676
- type: "text",
2677
- maxLength: 4,
2678
- value: state.cvv,
2679
- placeholder: "CVV",
2680
- onChange: (e) => handleCVVChange(e)
2681
- }
2682
- ), /* @__PURE__ */ import_react12.default.createElement("i", { id: "cvc", className: "fa fa-question-circle" }), state.cvvError && /* @__PURE__ */ import_react12.default.createElement("span", { id: "cvv-error", style: { color: "red" } }, state.cvvError)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "cvc-preview-container two-card hide" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "amex-cvc-preview" }), /* @__PURE__ */ import_react12.default.createElement("div", { className: "visa-mc-dis-cvc-preview" }))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "zip-code-group form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", null, "Postal code"), /* @__PURE__ */ import_react12.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react12.default.createElement(
2683
- "input",
2684
- {
2685
- id: "ZIPCode",
2686
- className: "form-control required",
2687
- name: "zip",
2688
- type: "text",
2689
- maxLength: 7,
2690
- placeholder: "000000",
2691
- value: state.zip,
2692
- onChange: (e) => handleZIP(e)
2693
- }
2694
- ), /* @__PURE__ */ import_react12.default.createElement(
2695
- "a",
2696
- {
2697
- tabIndex: 0,
2698
- role: "button",
2699
- "data-toggle": "popover",
2700
- "data-trigger": "focus",
2701
- "data-placement": "left",
2702
- "data-content": "Enter the ZIP/Postal code for your credit card billing address."
2703
- },
2704
- /* @__PURE__ */ import_react12.default.createElement("i", { className: "fa fa-question-circle" })
2705
- ), /* @__PURE__ */ import_react12.default.createElement(
2706
- "span",
2707
- {
2708
- id: "ZIPCode-error",
2709
- style: { color: "red", display: "none" }
2710
- },
2711
- ErrorText.fieldrequired
2712
- ))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group top-amnt" }, /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("label", null, "Payment amount"), /* @__PURE__ */ import_react12.default.createElement("div", { className: "amount-placeholder" }, /* @__PURE__ */ import_react12.default.createElement(
2713
- "input",
2714
- {
2715
- id: "Amount",
2716
- className: "form-control required",
2717
- name: "amount",
2718
- type: "text",
2719
- placeholder: "",
2720
- value: state.amount,
2721
- onChange: (e) => handleAmount(e),
2722
- onBlur: handleAmountBlur
2723
- }
2724
- ))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-row" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "visa" }), /* @__PURE__ */ import_react12.default.createElement("span", { className: "mastercard" }), /* @__PURE__ */ import_react12.default.createElement("span", { className: "amex" }), /* @__PURE__ */ import_react12.default.createElement("span", { className: "discover" }))), /* @__PURE__ */ import_react12.default.createElement(
2725
- "button",
2726
- {
2727
- type: "button",
2728
- id: "submitButton",
2729
- onClick: () => handleSubmitPay(),
2730
- className: "btn btn-block btn-success submit-button"
2731
- },
2732
- "Pay"
2733
- )), /* @__PURE__ */ import_react12.default.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ import_react12.default.createElement(
2734
- "svg",
2735
- {
2736
- xmlns: "http://www.w3.org/2000/svg",
2737
- width: "20",
2738
- height: "20",
2739
- viewBox: "0 0 26 26"
2740
- },
2741
- /* @__PURE__ */ import_react12.default.createElement(
2742
- "path",
2743
- {
2744
- fill: "currentColor",
2745
- 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"
2746
- }
2747
- )
2748
- ), "Secure payments powered by Fractal", /* @__PURE__ */ import_react12.default.createElement(
2749
- "img",
2750
- {
2751
- src: "https://ui.fractalpay.com/favicon.ico",
2752
- alt: "Fractal logo",
2753
- className: "powered-logo"
2754
- }
2755
- )))))))
1171
+ /* @__PURE__ */ import_react7.default.createElement("div", { className: "fractal-popup-content", style: { padding: "0px" } }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-success-container" }, /* @__PURE__ */ import_react7.default.createElement("span", { className: "request-payment-close-popup", onClick: handleCloseConfirmationModal }, /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("g", { "clip-path": "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: "M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z", fill: "#727272" })), /* @__PURE__ */ import_react7.default.createElement("defs", null, /* @__PURE__ */ import_react7.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react7.default.createElement("rect", { width: "16", height: "16", fill: "white" }))))), /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-success-tick-div" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-success-tick" }, /* @__PURE__ */ import_react7.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: "M6.12669 13.9774C5.97396 14.131 5.76558 14.2167 5.54913 14.2167C5.33267 14.2167 5.1243 14.131 4.97157 13.9774L0.359012 9.36408C-0.119671 8.8854 -0.119671 8.10919 0.359012 7.6314L0.936573 7.05369C1.4154 6.57501 2.19072 6.57501 2.6694 7.05369L5.54913 9.93357L13.3306 2.15198C13.8094 1.6733 14.5855 1.6733 15.0634 2.15198L15.641 2.72969C16.1196 3.20837 16.1196 3.98444 15.641 4.46237L6.12669 13.9774Z", fill: "#61C699" })))), /* @__PURE__ */ import_react7.default.createElement("h6", { className: "request-payment-success-text" }, "The request ", /* @__PURE__ */ import_react7.default.createElement("br", null), "was sent"), /* @__PURE__ */ import_react7.default.createElement("h6", { className: "request-payment-success-subtext" }, "Please wait for the customer to pay"), /* @__PURE__ */ import_react7.default.createElement("div", { className: "request-payment-success-btn-div" }, /* @__PURE__ */ import_react7.default.createElement("button", { onClick: handleCloseConfirmationModal, className: "request-payment-success-btn2" }, "Close"))))
2756
1172
  )));
2757
1173
  }
2758
-
2759
- // src/app/components/Transaction/CompletedTransactions.tsx
2760
- var import_react14 = __toESM(require("react"));
2761
- var import_react_bootstrap6 = require("react-bootstrap");
2762
- var import_react_bs_datatable = require("react-bs-datatable");
2763
- var import_react_datepicker = __toESM(require("react-datepicker"));
2764
- var import_react_datepicker2 = require("react-datepicker/dist/react-datepicker.css");
2765
- var import_react_toastify4 = require("react-toastify");
2766
-
2767
- // src/app/components/Pagination/Pagination.tsx
2768
- var import_react13 = __toESM(require("react"));
2769
- function PaginationPg({ totalPages, onPageChange, current }) {
2770
- const [currentPage, setCurrentPage] = (0, import_react13.useState)(current);
2771
- const [showPages, setShowPages] = (0, import_react13.useState)(false);
2772
- (0, import_react13.useEffect)(() => {
2773
- setCurrentPage(current);
2774
- }, [current]);
2775
- (0, import_react13.useEffect)(() => {
2776
- setTimeout(() => {
2777
- setShowPages(true);
2778
- }, 1e3);
2779
- }, []);
2780
- const handlePrevious = (e) => {
2781
- e.preventDefault();
2782
- if (currentPage > 1) {
2783
- const newPage = currentPage - 1;
2784
- setCurrentPage(newPage);
2785
- onPageChange(newPage);
2786
- }
2787
- };
2788
- const handleNext = (e) => {
2789
- e.preventDefault();
2790
- if (currentPage < totalPages) {
2791
- const newPage = currentPage + 1;
2792
- setCurrentPage(newPage);
2793
- onPageChange(newPage);
2794
- }
2795
- };
2796
- const handlePageClick = (e, pageNumber) => {
2797
- e.preventDefault();
2798
- setCurrentPage(pageNumber);
2799
- onPageChange(pageNumber);
2800
- };
2801
- const getPageNumbers = () => {
2802
- const pageNumbers = [];
2803
- if (totalPages <= 5) {
2804
- for (let i = 1; i <= totalPages; i++) {
2805
- pageNumbers.push(renderPageNumber(i));
2806
- }
2807
- } else {
2808
- if (currentPage > 3) {
2809
- pageNumbers.push(renderPageNumber(1));
2810
- if (currentPage > 4) {
2811
- pageNumbers.push(/* @__PURE__ */ import_react13.default.createElement("li", { key: "start-break", className: "page-item disabled" }, /* @__PURE__ */ import_react13.default.createElement("span", { className: "page-link" }, "...")));
2812
- }
2813
- }
2814
- const startPage = Math.max(currentPage - 1, 1);
2815
- const endPage = Math.min(startPage + 2, totalPages);
2816
- for (let i = startPage; i <= endPage; i++) {
2817
- pageNumbers.push(renderPageNumber(i));
2818
- }
2819
- if (currentPage < totalPages - 2) {
2820
- if (currentPage < totalPages - 3) {
2821
- pageNumbers.push(/* @__PURE__ */ import_react13.default.createElement("li", { key: "end-break", className: "page-item disabled" }, /* @__PURE__ */ import_react13.default.createElement("span", { className: "page-link" }, "...")));
2822
- }
2823
- pageNumbers.push(renderPageNumber(totalPages));
2824
- }
2825
- }
2826
- return pageNumbers;
2827
- };
2828
- const renderPageNumber = (pageNumber) => /* @__PURE__ */ import_react13.default.createElement("li", { key: pageNumber, className: `page-item ${currentPage === pageNumber ? "active" : ""}` }, /* @__PURE__ */ import_react13.default.createElement("a", { className: "page-link cursor-pointer", onClick: (e) => handlePageClick(e, pageNumber) }, pageNumber));
2829
- return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement("nav", { className: "app-pagination py-2" }, /* @__PURE__ */ import_react13.default.createElement("ul", { className: "pagination justify-content-center" }, /* @__PURE__ */ import_react13.default.createElement("li", { className: `page-item ${currentPage === 1 ? "disabled" : ""}` }, /* @__PURE__ */ import_react13.default.createElement("a", { className: "page-link cursor-pointer", onClick: handlePrevious }, /* @__PURE__ */ import_react13.default.createElement("span", null, "\u2B9C"))), showPages && getPageNumbers(), /* @__PURE__ */ import_react13.default.createElement("li", { className: `page-item ${currentPage === totalPages ? "disabled" : ""}` }, /* @__PURE__ */ import_react13.default.createElement("a", { className: "page-link cursor-pointer", onClick: handleNext }, /* @__PURE__ */ import_react13.default.createElement("span", null, "\u2B9E"))))));
2830
- }
2831
-
2832
- // src/app/components/Transaction/CompletedTransactions.tsx
2833
- var STORY_HEADERS = [
2834
- {
2835
- prop: "Date",
2836
- title: "Date",
2837
- isSortable: true
2838
- },
2839
- {
2840
- prop: "Name",
2841
- isFilterable: true,
2842
- title: "Name",
2843
- isSortable: true
2844
- },
2845
- {
2846
- prop: "lastFourDigits",
2847
- title: "Last 4",
2848
- isSortable: true
2849
- },
2850
- {
2851
- prop: "cardType",
2852
- title: "Brand",
2853
- isSortable: true
2854
- },
2855
- {
2856
- prop: "Amount",
2857
- title: "Amount",
2858
- isSortable: true
2859
- },
2860
- {
2861
- prop: "Net",
2862
- title: "Net",
2863
- isSortable: true
2864
- }
2865
- ];
2866
- function CompletedTransactions(props) {
2867
- const [dataList, setDataList] = (0, import_react14.useState)([]);
2868
- const [startDate, setStartDate] = (0, import_react14.useState)(null);
2869
- const [endDate, setEndDate] = (0, import_react14.useState)(null);
2870
- const [state, setState] = (0, import_react14.useState)({
2871
- page: 1,
2872
- totalPage: 0,
2873
- data: [],
2874
- csvData: false
2875
- });
2876
- const formatDate = (inputDate) => {
2877
- if (!inputDate) return "";
2878
- const date = new Date(inputDate);
2879
- const month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1;
2880
- const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate();
2881
- return `${date.getFullYear()}-${month}-${day}`;
2882
- };
2883
- const downloadStringAsCSV = (name, content) => {
2884
- const csvContent = convertArrayOfObjectsToCSV(content);
2885
- const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
2886
- const a = document.createElement("a");
2887
- a.href = URL.createObjectURL(blob);
2888
- a.download = name;
2889
- document.body.appendChild(a);
2890
- a.click();
2891
- document.body.removeChild(a);
2892
- };
2893
- const convertArrayOfObjectsToCSV = (array) => {
2894
- const headers = Object.keys(array[0]);
2895
- const csvRows = [];
2896
- csvRows.push(headers.join(","));
2897
- for (const obj of array) {
2898
- const values = headers.map((header) => obj[header]);
2899
- csvRows.push(values.join(","));
2900
- }
2901
- return csvRows.join("\n");
2902
- };
2903
- const fetchData = async (newPage, startDate2, endDate2) => {
2904
- var _a, _b;
2905
- try {
2906
- const response = await fetch(`${baseUrl}get-complete-request-payments`, {
2907
- method: "POST",
2908
- headers: {
2909
- "Content-Type": "application/json"
2910
- },
2911
- body: JSON.stringify({
2912
- fractalpayPublicKey: props.fractalpayClientKey,
2913
- page: newPage,
2914
- dateStart: startDate2 ? formatDate(startDate2) : "",
2915
- dateEnd: endDate2 ? formatDate(endDate2) : ""
2916
- })
2917
- });
2918
- if (!response.ok) {
2919
- throw new Error(`HTTP error! status: ${response.status}`);
2920
- }
2921
- const data = await response.json();
2922
- setState((prev) => {
2923
- var _a2;
2924
- return __spreadProps(__spreadValues({}, prev), { totalPage: (_a2 = data == null ? void 0 : data.data) == null ? void 0 : _a2.totalPage });
2925
- });
2926
- if (data && (data == null ? void 0 : data.result) === true) {
2927
- const result = ((_b = (_a = data == null ? void 0 : data.data) == null ? void 0 : _a.allPaymentTransaction) != null ? _b : []).map((item) => ({
2928
- Date: formatDate(item == null ? void 0 : item.Date),
2929
- Name: item == null ? void 0 : item.Name,
2930
- lastFourDigits: item == null ? void 0 : item.lastFourDigits,
2931
- cardType: item == null ? void 0 : item.cardType,
2932
- Amount: `$${parseFloat(item == null ? void 0 : item.Amount).toLocaleString("en-US", { maximumFractionDigits: 2 })}`,
2933
- Net: `$${parseFloat(item == null ? void 0 : item.Net).toLocaleString("en-US", { maximumFractionDigits: 2 })}`
2934
- }));
2935
- if (state.csvData) {
2936
- downloadStringAsCSV("transaction.csv", result);
2937
- setState((prev) => {
2938
- var _a2;
2939
- return __spreadProps(__spreadValues({}, prev), { data: (_a2 = data == null ? void 0 : data.data) == null ? void 0 : _a2.allPaymentTransaction, csvData: false });
2940
- });
2941
- }
2942
- setDataList(result);
2943
- } else {
2944
- console.log("No data available");
2945
- }
2946
- } catch (error) {
2947
- console.log(error);
2948
- }
2949
- };
2950
- const handleStartDateChange = (date) => {
2951
- setStartDate(date);
2952
- };
2953
- const handleEndDateChange = (date) => {
2954
- setEndDate(date);
2955
- };
2956
- const handleExport = async () => {
2957
- if (!startDate) {
2958
- import_react_toastify4.toast.error("Start date required");
2959
- } else if (!endDate) {
2960
- import_react_toastify4.toast.error("End date required");
2961
- } else {
2962
- setState((prev) => __spreadProps(__spreadValues({}, prev), { csvData: true }));
2963
- try {
2964
- const response = await fetch(`${baseUrl}get-complete-request-payments`, {
2965
- method: "POST",
2966
- headers: {
2967
- "Content-Type": "application/json"
2968
- },
2969
- body: JSON.stringify({
2970
- fractalpayPublicKey: props.fractalpayClientKey,
2971
- dateStart: startDate ? formatDate(startDate) : "",
2972
- dateEnd: endDate ? formatDate(endDate) : "",
2973
- isExport: true
2974
- })
2975
- });
2976
- if (!response.ok) {
2977
- throw new Error(`HTTP error! status: ${response.status}`);
2978
- }
2979
- const data = await response.json();
2980
- if (data.status) {
2981
- const link = document.createElement("a");
2982
- link.href = `${data == null ? void 0 : data.data}`;
2983
- link.target = "_blank";
2984
- document.body.appendChild(link);
2985
- link.click();
2986
- document.body.removeChild(link);
2987
- }
2988
- } catch (error) {
2989
- console.log(error);
2990
- }
2991
- }
2992
- };
2993
- (0, import_react14.useEffect)(() => {
2994
- fetchData(state.page, startDate, endDate);
2995
- }, [state.page]);
2996
- const handlePageChange = (pageNumber) => {
2997
- setState((prev) => __spreadProps(__spreadValues({}, prev), { page: pageNumber }));
2998
- fetchData(pageNumber, startDate, endDate);
2999
- };
3000
- return /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, /* @__PURE__ */ import_react14.default.createElement("style", null, `
3001
- .react-datepicker-wrapper:first-child {
3002
- margin-right: 10px;
3003
- }
3004
- `), /* @__PURE__ */ import_react14.default.createElement("div", { className: "mb-5" }, /* @__PURE__ */ import_react14.default.createElement("div", null, /* @__PURE__ */ import_react14.default.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ import_react14.default.createElement("div", { style: { display: "flex", marginRight: "10px", marginTop: "25px" } }, /* @__PURE__ */ import_react14.default.createElement(
3005
- import_react_datepicker.default,
3006
- {
3007
- selected: startDate,
3008
- onChange: handleStartDateChange,
3009
- selectsStart: true,
3010
- startDate,
3011
- endDate,
3012
- placeholderText: "Start Date",
3013
- required: true
3014
- }
3015
- ), /* @__PURE__ */ import_react14.default.createElement(
3016
- import_react_datepicker.default,
3017
- {
3018
- selected: endDate,
3019
- onChange: handleEndDateChange,
3020
- selectsEnd: true,
3021
- startDate,
3022
- endDate,
3023
- minDate: startDate,
3024
- placeholderText: "End Date"
3025
- }
3026
- )), /* @__PURE__ */ import_react14.default.createElement("button", { className: "export-btn1", onClick: handleExport }, "Export")), /* @__PURE__ */ import_react14.default.createElement(
3027
- import_react_bs_datatable.DatatableWrapper,
3028
- {
3029
- body: dataList,
3030
- headers: STORY_HEADERS,
3031
- paginationOptionsProps: {
3032
- initialState: {
3033
- rowsPerPage: 10,
3034
- options: [5, 10, 15, 20]
3035
- }
3036
- }
3037
- },
3038
- /* @__PURE__ */ import_react14.default.createElement(import_react_bootstrap6.Row, { className: "mb-4 p-2" }, /* @__PURE__ */ import_react14.default.createElement(import_react_bootstrap6.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_react14.default.createElement(import_react_bs_datatable.PaginationOptions, null)), /* @__PURE__ */ import_react14.default.createElement(import_react_bootstrap6.Col, { xs: 12, lg: 4, className: "d-flex flex-col justify-content-end align-items-end" }), /* @__PURE__ */ import_react14.default.createElement(import_react_bootstrap6.Col, { xs: 12, sm: 6, lg: 4, className: "d-flex flex-col justify-content-end align-items-end" }, /* @__PURE__ */ import_react14.default.createElement(import_react_bs_datatable.Filter, null))),
3039
- /* @__PURE__ */ import_react14.default.createElement(import_react_bootstrap6.Row, null, /* @__PURE__ */ import_react14.default.createElement("div", { className: "responsive-tbl" }, /* @__PURE__ */ import_react14.default.createElement(import_react_bootstrap6.Table, null, /* @__PURE__ */ import_react14.default.createElement(import_react_bs_datatable.TableHeader, null), /* @__PURE__ */ import_react14.default.createElement(import_react_bs_datatable.TableBody, null)))),
3040
- /* @__PURE__ */ import_react14.default.createElement(PaginationPg, { totalPages: state.totalPage, onPageChange: handlePageChange, current: state.page })
3041
- ))));
3042
- }
3043
-
3044
- // src/app/components/Payment/TockenizPay.tsx
3045
- var import_react15 = __toESM(require("react"));
3046
- var import_react_bootstrap7 = require("react-bootstrap");
3047
- var import_react_toastify5 = require("react-toastify");
3048
- var import_node_forge2 = __toESM(require("node-forge"));
3049
- var import_credit_card_type = __toESM(require("credit-card-type"));
3050
- function TockenizPay() {
3051
- const [state, setState] = (0, import_react15.useState)({
3052
- show: false,
3053
- publicKey: "",
3054
- sessionKey: "",
3055
- cardNumber: "",
3056
- year: "",
3057
- month: "",
3058
- cvv: "",
3059
- zip: "",
3060
- amount: ""
3061
- });
3062
- const [cardTypeDetail, setCardTypeDetail] = (0, import_react15.useState)(null);
3063
- const [isValid, setIsValid] = (0, import_react15.useState)(false);
3064
- const [isValidMonth, setIsValidMonth] = (0, import_react15.useState)(false);
3065
- const [data, setData] = (0, import_react15.useState)(null);
3066
- const handlePaymentClick = async () => {
3067
- try {
3068
- const response = await fetch(`${baseUrl}/generate-session`, {
3069
- method: "POST",
3070
- headers: {
3071
- "Content-Type": "application/json"
3072
- },
3073
- body: JSON.stringify({})
3074
- });
3075
- if (!response.ok) {
3076
- throw new Error("Network response was not ok");
3077
- }
3078
- const data2 = await response.json();
3079
- if (data2 && data2.result === true) {
3080
- setState((prev) => {
3081
- var _a, _b;
3082
- return __spreadProps(__spreadValues({}, prev), {
3083
- show: true,
3084
- publicKey: (_a = data2 == null ? void 0 : data2.data) == null ? void 0 : _a.publicKeyPem,
3085
- sessionKey: (_b = data2 == null ? void 0 : data2.data) == null ? void 0 : _b.session_key
3086
- });
3087
- });
3088
- }
3089
- } catch (error) {
3090
- console.log(error);
3091
- }
3092
- };
3093
- const handleSubmitPay = async () => {
3094
- var _a, _b, _c;
3095
- 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}`;
3096
- const publicKey = import_node_forge2.default.pki.publicKeyFromPem(state.publicKey);
3097
- const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
3098
- md: import_node_forge2.default.md.sha1.create(),
3099
- mgf1: {
3100
- md: import_node_forge2.default.md.sha1.create()
3101
- }
3102
- });
3103
- const encryptedBase64 = import_node_forge2.default.util.encode64(encrypted);
3104
- console.log(encryptedBase64);
3105
- const requestBody = {
3106
- enc_track2_data: encryptedBase64,
3107
- session_key: state.sessionKey,
3108
- algorithm: "RSAES_OAEP_SHA_1"
3109
- };
3110
- try {
3111
- const response = await fetch(
3112
- "https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize",
3113
- {
3114
- method: "POST",
3115
- headers: {
3116
- "x-app-session-key": state == null ? void 0 : state.sessionKey,
3117
- "Content-Type": "application/json"
3118
- },
3119
- body: JSON.stringify(requestBody)
3120
- }
3121
- );
3122
- if (!response.ok) {
3123
- const errorData = await response.json();
3124
- throw new Error(((_c = errorData == null ? void 0 : errorData.data) == null ? void 0 : _c.message) || "Request failed");
3125
- }
3126
- const responseData = await response.json();
3127
- import_react_toastify5.toast.success("Payment Successful");
3128
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3129
- show: false,
3130
- publicKey: "",
3131
- sessionKey: "",
3132
- cardNumber: "",
3133
- year: "",
3134
- month: "",
3135
- cvv: "",
3136
- zip: "",
3137
- amount: ""
3138
- }));
3139
- console.log("response", responseData);
3140
- } catch (error) {
3141
- import_react_toastify5.toast.error((error == null ? void 0 : error.message) || "An error occurred");
3142
- console.error("Error:", error);
3143
- }
3144
- };
3145
- const formatCreditCardNumber = (cardNumber, cardType) => {
3146
- const cleanNumber = cardNumber.replace(/\D+/g, "");
3147
- let formattedValue;
3148
- switch (cardType) {
3149
- case "visa":
3150
- case "mastercard":
3151
- case "Discover":
3152
- case "JCB":
3153
- formattedValue = cleanNumber.replace(/(.{4})/g, "$1 ").trim();
3154
- break;
3155
- case "american-express":
3156
- formattedValue = cleanNumber.replace(/(\d{4})(\d{6})(\d{5})/, "$1 $2 $3");
3157
- break;
3158
- case "diners-club":
3159
- formattedValue = cleanNumber.replace(/(\d{4})(\d{6})(\d{4})/, "$1 $2 $3");
3160
- break;
3161
- case "maestro":
3162
- formattedValue = cleanNumber.length <= 19 ? cleanNumber.replace(/(.{4})/g, "$1 ").trim() : cleanNumber;
3163
- break;
3164
- default:
3165
- formattedValue = cleanNumber;
3166
- }
3167
- return formattedValue;
3168
- };
3169
- const handleCardNumberChange = (e) => {
3170
- e.preventDefault();
3171
- e.stopPropagation();
3172
- const { value } = e.target;
3173
- let cardtyp = (0, import_credit_card_type.default)(value)[0];
3174
- const formattedValue = formatCreditCardNumber(value, cardtyp == null ? void 0 : cardtyp.type);
3175
- setCardTypeDetail((0, import_credit_card_type.default)(value)[0]);
3176
- console.log(formattedValue);
3177
- if (value.match(/[a-zA-Z]/)) {
3178
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3179
- cardNumber: formattedValue,
3180
- error: "Invalid input. Please enter only numbers."
3181
- }));
3182
- } else {
3183
- handleCardNumLength("");
3184
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3185
- cardNumber: formattedValue,
3186
- error: null
3187
- }));
3188
- }
3189
- };
3190
- function handleCardNumLength(cardType) {
3191
- const cardLengths = {
3192
- "Visa": 16,
3193
- "MasterCard": 16,
3194
- "AmericanExpress": 15,
3195
- "Discover": 16,
3196
- "DinersClub": 14,
3197
- "JCB": 16
3198
- };
3199
- return cardLengths[cardType] || "Unknown card type";
3200
- }
3201
- const handleMonthChange = (e) => {
3202
- setIsValid(false);
3203
- let value = e.target.value;
3204
- if (/^\d{0,2}$/.test(value) && (value === "" || parseInt(value, 10) >= 1 && parseInt(value, 10) <= 12)) {
3205
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3206
- month: value
3207
- }));
3208
- setIsValidMonth(false);
3209
- } else {
3210
- setIsValidMonth(true);
3211
- }
3212
- };
3213
- const handleYearChange = (e) => {
3214
- setIsValid(false);
3215
- setIsValidMonth(false);
3216
- let value = e.target.value;
3217
- if (/^\d{0,2}$/.test(value) && (value === "" || parseInt(value, 10) >= 0 && parseInt(value, 10) <= 99)) {
3218
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3219
- year: value
3220
- }));
3221
- }
3222
- };
3223
- const handleCVVChange = (e) => {
3224
- setIsValid(false);
3225
- setIsValidMonth(false);
3226
- let value = e.target.value;
3227
- if (/^\d{0,4}$/.test(value)) {
3228
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3229
- cvv: value
3230
- }));
3231
- }
3232
- };
3233
- const handleZIP = (e) => {
3234
- setIsValid(false);
3235
- setIsValidMonth(false);
3236
- let value = e.target.value;
3237
- if (/^\d{0,7}$/.test(value)) {
3238
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3239
- zip: value
3240
- }));
3241
- }
3242
- };
3243
- const handleAmount = (e) => {
3244
- setIsValid(false);
3245
- setIsValidMonth(false);
3246
- let value = e.target.value;
3247
- value = value.replace(/[^0-9.]/g, "");
3248
- let parts = value.split(".");
3249
- if (parts.length > 2) {
3250
- parts = [parts.shift(), parts.join(".")];
3251
- value = parts.join("");
3252
- }
3253
- if (parts.length === 2 && parts[1].length > 2) {
3254
- value = `${parts[0]}.${parts[1].slice(0, 2)}`;
3255
- }
3256
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3257
- amount: value
3258
- }));
3259
- };
3260
- const handleAmountBlur = () => {
3261
- const value = state.amount;
3262
- if (value && !value.includes(".")) {
3263
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3264
- amount: `${value}.00`
3265
- }));
3266
- }
3267
- };
3268
- function amountFormat(amt) {
3269
- if (amt) {
3270
- return `${parseFloat(amt).toLocaleString("en-US", {
3271
- minimumFractionDigits: 2,
3272
- maximumFractionDigits: 2
3273
- })}`;
3274
- }
3275
- return "";
3276
- }
3277
- return /* @__PURE__ */ import_react15.default.createElement("div", null, /* @__PURE__ */ import_react15.default.createElement(import_react_toastify5.ToastContainer, null), /* @__PURE__ */ import_react15.default.createElement(
3278
- "button",
3279
- {
3280
- className: "export-btn mt-4",
3281
- style: { width: "100px" },
3282
- onClick: () => handlePaymentClick()
3283
- },
3284
- "TokenizePay"
3285
- ), /* @__PURE__ */ import_react15.default.createElement(
3286
- import_react_bootstrap7.Modal,
3287
- {
3288
- show: state.show,
3289
- onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
3290
- show: false
3291
- })),
3292
- centered: true
3293
- },
3294
- /* @__PURE__ */ import_react15.default.createElement(import_react_bootstrap7.Modal.Header, { closeButton: true }),
3295
- /* @__PURE__ */ import_react15.default.createElement(import_react_bootstrap7.Modal.Body, null, /* @__PURE__ */ import_react15.default.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ import_react15.default.createElement("div", { className: "row" }, /* @__PURE__ */ import_react15.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react15.default.createElement("div", { id: "Checkout", className: "inline" }, /* @__PURE__ */ import_react15.default.createElement("div", { className: "header" }, /* @__PURE__ */ import_react15.default.createElement("h1", null, "Pay")), /* @__PURE__ */ import_react15.default.createElement("form", { id: "PaymentForm", className: "payment-form" }, /* @__PURE__ */ import_react15.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react15.default.createElement("label", null, "Name on card"), /* @__PURE__ */ import_react15.default.createElement(
3296
- "input",
3297
- {
3298
- id: "NameOnCard",
3299
- className: "form-control required",
3300
- type: "text",
3301
- maxLength: 100,
3302
- placeholder: "Name"
3303
- }
3304
- ), /* @__PURE__ */ import_react15.default.createElement(
3305
- "span",
3306
- {
3307
- id: "NameOnCard-error",
3308
- style: { color: "red", display: "none" }
3309
- }
3310
- )), /* @__PURE__ */ import_react15.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react15.default.createElement(
3311
- "input",
3312
- {
3313
- "data-token": "card_number",
3314
- className: "null card-image form-control required",
3315
- type: "text",
3316
- maxLength: 19,
3317
- value: state.cardNumber,
3318
- placeholder: "0000 0000 0000 0000",
3319
- onChange: handleCardNumberChange
3320
- }
3321
- ), state.error && /* @__PURE__ */ import_react15.default.createElement("div", { style: { color: "red" } }, state.error)), /* @__PURE__ */ import_react15.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react15.default.createElement(
3322
- "input",
3323
- {
3324
- "data-token": "exp_month",
3325
- className: "form-control required",
3326
- type: "text",
3327
- placeholder: "MM",
3328
- value: state.month,
3329
- maxLength: 2,
3330
- onChange: (e) => handleMonthChange(e)
3331
- }
3332
- ), isValidMonth && /* @__PURE__ */ import_react15.default.createElement(
3333
- "span",
3334
- {
3335
- id: "card_number-error",
3336
- style: { color: "red", fontSize: "15px" }
3337
- },
3338
- "Please write month only 1 to 12"
3339
- )), /* @__PURE__ */ import_react15.default.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ import_react15.default.createElement(
3340
- "input",
3341
- {
3342
- "data-token": "exp_year",
3343
- className: "form-control required",
3344
- type: "text",
3345
- placeholder: "YY",
3346
- maxLength: 2,
3347
- value: state.year,
3348
- onChange: (e) => handleYearChange(e)
3349
- }
3350
- ), state.yearError && /* @__PURE__ */ import_react15.default.createElement("span", { id: "exp_year-error", style: { color: "red" } }, state.yearError)), /* @__PURE__ */ import_react15.default.createElement("div", { className: "security-code-group form-group" }, /* @__PURE__ */ import_react15.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react15.default.createElement(
3351
- "input",
3352
- {
3353
- "data-token": "cvv",
3354
- className: "form-control required",
3355
- type: "text",
3356
- maxLength: 4,
3357
- value: state.cvv,
3358
- placeholder: "CVV",
3359
- onChange: (e) => handleCVVChange(e)
3360
- }
3361
- ), /* @__PURE__ */ import_react15.default.createElement("i", { id: "cvc", className: "fa fa-question-circle" }), state.cvvError && /* @__PURE__ */ import_react15.default.createElement("span", { id: "cvv-error", style: { color: "red" } }, state.cvvError)), /* @__PURE__ */ import_react15.default.createElement("div", { className: "cvc-preview-container two-card hide" }, /* @__PURE__ */ import_react15.default.createElement("div", { className: "amex-cvc-preview" }), /* @__PURE__ */ import_react15.default.createElement("div", { className: "visa-mc-dis-cvc-preview" }))), /* @__PURE__ */ import_react15.default.createElement("div", { className: "zip-code-group form-group" }, /* @__PURE__ */ import_react15.default.createElement("label", null, "Postal code"), /* @__PURE__ */ import_react15.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react15.default.createElement(
3362
- "input",
3363
- {
3364
- id: "ZIPCode",
3365
- className: "form-control required",
3366
- name: "zip",
3367
- type: "text",
3368
- maxLength: 7,
3369
- placeholder: "000000",
3370
- value: state.zip,
3371
- onChange: (e) => handleZIP(e)
3372
- }
3373
- ), /* @__PURE__ */ import_react15.default.createElement(
3374
- "a",
3375
- {
3376
- tabIndex: 0,
3377
- role: "button",
3378
- "data-toggle": "popover",
3379
- "data-trigger": "focus",
3380
- "data-placement": "left",
3381
- "data-content": "Enter the ZIP/Postal code for your credit card billing address."
3382
- },
3383
- /* @__PURE__ */ import_react15.default.createElement("i", { className: "fa fa-question-circle" })
3384
- ), /* @__PURE__ */ import_react15.default.createElement(
3385
- "span",
3386
- {
3387
- id: "ZIPCode-error",
3388
- style: { color: "red", display: "none" }
3389
- },
3390
- "This field is required"
3391
- ))), /* @__PURE__ */ import_react15.default.createElement("div", { className: "form-group top-amnt" }, /* @__PURE__ */ import_react15.default.createElement("div", null, /* @__PURE__ */ import_react15.default.createElement("label", null, "Payment amount"), /* @__PURE__ */ import_react15.default.createElement("div", { className: "amount-placeholder" }, /* @__PURE__ */ import_react15.default.createElement(
3392
- "input",
3393
- {
3394
- id: "Amount",
3395
- className: "form-control required",
3396
- name: "amount",
3397
- type: "text",
3398
- placeholder: "",
3399
- value: state.amount,
3400
- onChange: (e) => handleAmount(e),
3401
- onBlur: handleAmountBlur
3402
- }
3403
- ))), /* @__PURE__ */ import_react15.default.createElement("div", { className: "card-row" }, /* @__PURE__ */ import_react15.default.createElement("span", { className: "visa" }), /* @__PURE__ */ import_react15.default.createElement("span", { className: "mastercard" }), /* @__PURE__ */ import_react15.default.createElement("span", { className: "amex" }), /* @__PURE__ */ import_react15.default.createElement("span", { className: "discover" }))), /* @__PURE__ */ import_react15.default.createElement(
3404
- "button",
3405
- {
3406
- type: "button",
3407
- id: "submitButton",
3408
- onClick: () => handleSubmitPay(),
3409
- className: "btn btn-block btn-success submit-button"
3410
- },
3411
- "Submit"
3412
- )), /* @__PURE__ */ import_react15.default.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ import_react15.default.createElement(
3413
- "svg",
3414
- {
3415
- xmlns: "http://www.w3.org/2000/svg",
3416
- width: "20",
3417
- height: "20",
3418
- viewBox: "0 0 26 26"
3419
- },
3420
- /* @__PURE__ */ import_react15.default.createElement(
3421
- "path",
3422
- {
3423
- fill: "currentColor",
3424
- 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"
3425
- }
3426
- )
3427
- ), "Secure payments powered by Fractal", /* @__PURE__ */ import_react15.default.createElement(
3428
- "img",
3429
- {
3430
- src: "https://ui.fractalpay.com/favicon.ico",
3431
- alt: "Fractal logo",
3432
- className: "powered-logo"
3433
- }
3434
- )))))))
3435
- ));
3436
- }
3437
-
3438
- // src/app/components/Payment/GetPaymentDynamic.tsx
3439
- var import_react17 = __toESM(require("react"));
3440
- var import_react_bootstrap8 = require("react-bootstrap");
3441
-
3442
- // src/app/components/Loader/MyLoadingAnimation.tsx
3443
- var import_react16 = __toESM(require("react"));
3444
- function MyLoadingAnimation() {
3445
- return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(LoaderStyle_default, null), /* @__PURE__ */ import_react16.default.createElement("div", { className: "loading-animation" }, /* @__PURE__ */ import_react16.default.createElement("div", { className: "spinner" })));
3446
- }
3447
-
3448
- // src/app/components/Payment/GetPaymentDynamic.tsx
3449
- function GetPaymentDynamic(props) {
3450
- const { amount, fractalpayClientKey, orderID } = props;
3451
- const [loading, setLoading] = (0, import_react17.useState)(false);
3452
- const [show, setShow] = (0, import_react17.useState)(false);
3453
- const [iframeLoaded, setIframeLoaded] = (0, import_react17.useState)(false);
3454
- const [phoneNumber, setPhoneNumber] = (0, import_react17.useState)("");
3455
- const [errorMessage, setErrorMessage] = (0, import_react17.useState)("");
3456
- const [submitClicked, setSubmitClicked] = (0, import_react17.useState)(false);
3457
- const [isValidNumber, setIsValidNumber] = (0, import_react17.useState)(true);
3458
- const handleClose = () => {
3459
- setIframeLoaded(false);
3460
- setTimeout(() => {
3461
- setShow(false);
3462
- }, 1e3);
3463
- };
3464
- const handleShow = () => {
3465
- if (fractalpayClientKey) {
3466
- setShow(true);
3467
- setIframeLoaded(true);
3468
- } else {
3469
- console.error(ErrorText.fractalpayclientidrequired);
3470
- }
3471
- };
3472
- (0, import_react17.useEffect)(() => {
3473
- if (!fractalpayClientKey) {
3474
- console.error(ErrorText.fractalpayclientidrequired);
3475
- }
3476
- }, [fractalpayClientKey]);
3477
- const handlePhoneNumberChange = (e) => {
3478
- const number = e.target.value;
3479
- const isValid = /^\d*$/.test(number);
3480
- if (isValid) {
3481
- setPhoneNumber(number);
3482
- setIsValidNumber(number.length <= 10);
3483
- if (number.length > 10) {
3484
- setErrorMessage(ErrorText.phonenumbervalid);
3485
- } else {
3486
- setErrorMessage("");
3487
- }
3488
- } else {
3489
- setErrorMessage(ErrorText.phonenumbervalidnumberonly);
3490
- }
3491
- };
3492
- const handleLoad = () => {
3493
- setLoading(false);
3494
- };
3495
- (0, import_react17.useEffect)(() => {
3496
- const messageListener = (event) => {
3497
- var _a, _b;
3498
- const response = (_b = (_a = event == null ? void 0 : event.data) == null ? void 0 : _a.other) == null ? void 0 : _b.data;
3499
- if (response == null ? void 0 : response.result) {
3500
- setTimeout(() => {
3501
- handleClose();
3502
- }, 5e3);
3503
- }
3504
- };
3505
- window.addEventListener("message", messageListener);
3506
- return () => {
3507
- window.removeEventListener("message", messageListener);
3508
- };
3509
- }, []);
3510
- return /* @__PURE__ */ import_react17.default.createElement("div", null, /* @__PURE__ */ import_react17.default.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Pay"), /* @__PURE__ */ import_react17.default.createElement(import_react_bootstrap8.Modal, { show: show && iframeLoaded, id: "modal-pay", className: "modal-lg", onHide: handleClose }, /* @__PURE__ */ import_react17.default.createElement(import_react_bootstrap8.Modal.Header, { closeButton: true }), /* @__PURE__ */ import_react17.default.createElement(import_react_bootstrap8.Modal.Body, null, loading && /* @__PURE__ */ import_react17.default.createElement(MyLoadingAnimation, null), /* @__PURE__ */ import_react17.default.createElement(
3511
- "iframe",
3512
- {
3513
- src: `${baseUrl}widget-form/${amount}?fractalpay_public_key=${fractalpayClientKey}&order_id=${orderID}`,
3514
- height: "auto",
3515
- width: "100%",
3516
- style: { display: loading ? "none" : "block" },
3517
- onLoad: handleLoad
3518
- }
3519
- ))));
3520
- }
3521
1174
  // Annotate the CommonJS export names for ESM import in node:
3522
1175
  0 && (module.exports = {
3523
- CompletedTransactions,
3524
- GetPaymentDynamic,
3525
- Payment,
3526
1176
  RequestPayment,
3527
- RequestPaymentAllInput,
3528
- RequestPaymentDynamic,
3529
- RequestPaymentonClick,
3530
- RqstPaymntInputField,
3531
- TockenizPay
1177
+ RequestPreAuthPayment
3532
1178
  });