@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.mjs CHANGED
@@ -436,7 +436,6 @@ var CustomModal2_default = CustomModal2;
436
436
  // src/app/components/RequestPayment/RequestPayment.tsx
437
437
  import axios from "axios";
438
438
  import { PatternFormat } from "react-number-format";
439
- import styled from "styled-components";
440
439
 
441
440
  // src/app/components/RequestPayment/RequestPaymentstyles.tsx
442
441
  import React5 from "react";
@@ -682,18 +681,6 @@ var RequestPaymentstyles = (props) => {
682
681
  var RequestPaymentstyles_default = RequestPaymentstyles;
683
682
 
684
683
  // src/app/components/RequestPayment/RequestPayment.tsx
685
- var Label = styled.label`
686
- color: #727272;
687
- font-family: Inter;
688
- font-size: 12px;
689
- font-style: normal;
690
- font-weight: 500;
691
- margin-bottom: 6px !important;
692
- text-align: start !important;
693
- width: 100% !important;
694
- margin-bottom: 6px !important;
695
- text-transform: uppercase;
696
- `;
697
684
  function RequestPayment(props) {
698
685
  const fractalpayClientKey = props.fractalpayClientKey;
699
686
  const [show, setShow] = useState(false);
@@ -869,7 +856,7 @@ function RequestPayment(props) {
869
856
  onClose: () => setShow(false)
870
857
  },
871
858
  /* @__PURE__ */ React6.createElement("div", { className: "request-payment-amount-detail" }, /* @__PURE__ */ React6.createElement("p", { className: "request-payment-merchantname" }, "Pay ", props == null ? void 0 : props.webname), /* @__PURE__ */ React6.createElement("p", { className: "request-payment-amount" }, formatAmount(props == null ? void 0 : props.amount)), (props == null ? void 0 : props.from) === "merchant" && /* @__PURE__ */ React6.createElement("p", { className: "request-payment-orderid" }, requestDetails == null ? void 0 : requestDetails.order_id), /* @__PURE__ */ React6.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ React6.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ React6.createElement("g", { "clip-path": "url(#clip0_12425_52336)" }, /* @__PURE__ */ React6.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__ */ React6.createElement("defs", null, /* @__PURE__ */ React6.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ React6.createElement("rect", { width: "16", height: "16", fill: "white" })))))),
872
- /* @__PURE__ */ React6.createElement("form", { className: "request-payment-input-form" }, /* @__PURE__ */ React6.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ React6.createElement(Label, { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "FULL NAME"), /* @__PURE__ */ React6.createElement(
859
+ /* @__PURE__ */ React6.createElement("form", { className: "request-payment-input-form" }, /* @__PURE__ */ React6.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ React6.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "FULL NAME"), /* @__PURE__ */ React6.createElement(
873
860
  "input",
874
861
  {
875
862
  className: "request-payment-input-box",
@@ -879,7 +866,7 @@ function RequestPayment(props) {
879
866
  onChange: handleChange,
880
867
  value: requestDetails == null ? void 0 : requestDetails.name
881
868
  }
882
- ), errors.name && /* @__PURE__ */ React6.createElement("small", { className: "request-payment-error-msg" }, errors.name)), /* @__PURE__ */ React6.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ React6.createElement(Label, { htmlFor: "requestPhoneNumber", className: "request-payment-input-label" }, "Phone Number"), /* @__PURE__ */ React6.createElement(
869
+ ), errors.name && /* @__PURE__ */ React6.createElement("small", { className: "request-payment-error-msg" }, errors.name)), /* @__PURE__ */ React6.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ React6.createElement("label", { htmlFor: "requestPhoneNumber", className: "request-payment-input-label" }, "Phone Number"), /* @__PURE__ */ React6.createElement(
883
870
  PatternFormat,
884
871
  {
885
872
  className: "request-payment-input-box",
@@ -890,7 +877,7 @@ function RequestPayment(props) {
890
877
  handlePhoneChange(e);
891
878
  }
892
879
  }
893
- ), errors.phone && /* @__PURE__ */ React6.createElement("small", { className: "request-payment-error-msg" }, errors.phone)), /* @__PURE__ */ React6.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ React6.createElement(Label, { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "EMAIL"), /* @__PURE__ */ React6.createElement(
880
+ ), errors.phone && /* @__PURE__ */ React6.createElement("small", { className: "request-payment-error-msg" }, errors.phone)), /* @__PURE__ */ React6.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ React6.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "EMAIL"), /* @__PURE__ */ React6.createElement(
894
881
  "input",
895
882
  {
896
883
  className: "request-payment-input-box",
@@ -920,2577 +907,237 @@ function RequestPayment(props) {
920
907
  )));
921
908
  }
922
909
 
923
- // src/app/components/RequestPayment/RequestPaymentAllInput.tsx
924
- import React7, { useState as useState2 } from "react";
925
- import { Modal } from "react-bootstrap";
926
- import { toast, ToastContainer } from "react-toastify";
927
- import "react-toastify/dist/ReactToastify.css";
928
- function RequestPaymentAllInput({ fractalpayClientKey }) {
929
- const [isLoading, setIsLoading] = useState2(false);
910
+ // src/app/components/RequestPayment/RequestPreAuthPayment.tsx
911
+ import "bootstrap/dist/js/bootstrap.bundle.min.js";
912
+ import React7, { useState as useState2, useEffect as useEffect2 } from "react";
913
+ import axios2 from "axios";
914
+ import { PatternFormat as PatternFormat2 } from "react-number-format";
915
+ function RequestPreAuthPayment(props) {
916
+ const fractalpayClientKey = props.fractalpayClientKey;
930
917
  const [show, setShow] = useState2(false);
931
- const [phoneNumber, setPhoneNumber] = useState2("");
918
+ const [loading, setLoading] = useState2(false);
919
+ const [errors, setErrors] = useState2({});
920
+ const [phone, setPhone] = useState2(null);
921
+ const [requestDetails, setRequestDetails] = useState2({
922
+ email: "",
923
+ phone_number: "",
924
+ order_id: "",
925
+ name: "",
926
+ fractalpayPublicKey: fractalpayClientKey
927
+ });
932
928
  const [amount, setAmount] = useState2("");
933
- const [orderId, setOrderId] = useState2("");
934
- const [isValidNumber, setIsValidNumber] = useState2(true);
935
- const [isValidAmount, setIsValidAmount] = useState2(true);
936
- const [isValidOrderId, setIsValidOrderId] = useState2(true);
937
- const [errorMessagephone, setErrorMessagephone] = useState2("");
938
- const [errorMessageamount, setErrorMessageamount] = useState2("");
939
- const [errorMessageorderid, setErrorMessageorderid] = useState2("");
940
- const [submitClicked, setSubmitClicked] = useState2(false);
941
- const handleClose = () => setShow(false);
929
+ const [showConfirmationModal, setShowConfirmationModal] = useState2(false);
930
+ const [apiResponse, setApiResponse] = useState2(null);
931
+ const phoneNumberRegex = (value) => /^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(value);
932
+ const amoutRegex = /[+-]?([0-9]*[.])?[0-9]+/;
933
+ const isValidEmail = (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
934
+ const isAlpha = (value) => /^[A-Za-z\s]*$/.test(value);
935
+ const handleClose = () => {
936
+ setShow(false);
937
+ setErrors({});
938
+ };
942
939
  const handleShow = () => setShow(true);
943
- const sendRequestPayment = () => {
944
- if (!phoneNumber) {
945
- setErrorMessagephone(ErrorText.phonenumberrequired);
946
- setSubmitClicked(true);
940
+ const handleCloseConfirmationModal = () => {
941
+ console.log(apiResponse, "apiresponse");
942
+ handleSubmit(apiResponse);
943
+ setShowConfirmationModal(false);
944
+ };
945
+ function emptyFields() {
946
+ setRequestDetails({
947
+ email: "",
948
+ phone_number: "",
949
+ order_id: "",
950
+ name: "",
951
+ fractalpayPublicKey: fractalpayClientKey
952
+ });
953
+ setAmount("");
954
+ }
955
+ function handleSubmit(event) {
956
+ let message = {
957
+ type: "preview.compiledcheck",
958
+ other: __spreadProps(__spreadValues({}, event), { status: true })
959
+ };
960
+ window.parent.postMessage(message, "*");
961
+ }
962
+ const sendRequestPayment = async () => {
963
+ if (Object.keys(errors).length > 0) {
947
964
  return;
948
965
  }
949
- if (!/^\d{10}$/.test(phoneNumber)) {
950
- setErrorMessagephone(ErrorText.phonenumbervalid);
951
- setSubmitClicked(true);
966
+ setErrors({});
967
+ if (!(requestDetails == null ? void 0 : requestDetails.email) && phone && !phoneNumberRegex(phone)) {
968
+ setErrors((prevErrors) => __spreadProps(__spreadValues({}, prevErrors), {
969
+ phone: ErrorText.phonenumbervalid
970
+ }));
952
971
  return;
953
972
  }
954
- if (!amount) {
955
- setErrorMessageamount(ErrorText.amountenter);
956
- setSubmitClicked(true);
973
+ if (!validateForm()) {
957
974
  return;
958
975
  }
959
- if (isNaN(Number(amount))) {
960
- setErrorMessageamount(ErrorText.amountvalid);
961
- setSubmitClicked(true);
962
- return;
976
+ try {
977
+ setLoading(true);
978
+ const formData = {
979
+ fractalpayPublicKey: fractalpayClientKey,
980
+ amount,
981
+ phone_number: phone,
982
+ order_id: requestDetails.order_id,
983
+ action: "request",
984
+ name: requestDetails.name,
985
+ email: requestDetails.email,
986
+ customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : ""
987
+ };
988
+ let response = await axios2.post(`${baseUrl}send-request-pre-auth-payment`, formData);
989
+ if ((response == null ? void 0 : response.status) === 200) {
990
+ setShowConfirmationModal(true);
991
+ setShow(false);
992
+ emptyFields();
993
+ setApiResponse(response == null ? void 0 : response.data);
994
+ }
995
+ setLoading(false);
996
+ } catch (error) {
997
+ console.log(error);
998
+ setLoading(false);
963
999
  }
964
- if (!orderId) {
965
- setErrorMessageorderid(ErrorText.orderidenter);
966
- setSubmitClicked(true);
1000
+ };
1001
+ let favicon_logo = baseUrl + "images/logo-img.png";
1002
+ const handleChange = (e) => {
1003
+ const { value } = e.target;
1004
+ const token = e.target.dataset.token;
1005
+ setRequestDetails(__spreadProps(__spreadValues({}, requestDetails), { [token]: value }));
1006
+ if (token === "name" && !isAlpha(value)) {
1007
+ setErrors((prevErrors) => __spreadProps(__spreadValues({}, prevErrors), {
1008
+ [token]: ErrorText.onlylettersallowed
1009
+ }));
967
1010
  return;
968
1011
  }
969
- setErrorMessagephone("");
970
- setErrorMessageamount("");
971
- setErrorMessageorderid("");
972
- setSubmitClicked(true);
973
- setIsLoading(true);
974
- let formData = {
975
- fractalpayPublicKey: fractalpayClientKey,
976
- amount,
977
- phone_number: phoneNumber,
978
- orderId,
979
- action: "request"
980
- };
981
- const jsonData = JSON.stringify(formData);
982
- fetch(`${baseUrl}create-widget-order`, {
983
- method: "POST",
984
- headers: {
985
- "Content-Type": "application/json"
986
- },
987
- body: jsonData
988
- }).then((response) => {
989
- setIsLoading(false);
990
- if (!response.ok) {
991
- throw new Error(ErrorText.networkresponseerror);
992
- }
993
- return response.json();
994
- }).then((data) => {
995
- if (data.result === true) {
996
- setShow(true);
997
- }
998
- console.log(data);
999
- }).catch((error) => {
1000
- setIsLoading(false);
1001
- console.error("Error:", error);
1002
- toast.error(ErrorText.anerroroccured);
1003
- });
1004
- };
1005
- const handlePhoneNumberChange = (e) => {
1006
- const number = e.target.value;
1007
- const isValid = /^\d*$/.test(number);
1008
- if (isValid) {
1009
- setPhoneNumber(number);
1010
- setIsValidNumber(number.length <= 10);
1011
- if (number.length > 10) {
1012
- setErrorMessagephone(ErrorText.phonenumberlength);
1013
- } else {
1014
- setErrorMessagephone("");
1015
- }
1016
- } else {
1017
- setErrorMessagephone(ErrorText.phonenumbervalid);
1012
+ let errorobj = errors;
1013
+ if (token === "email" && !phone) {
1014
+ delete errorobj.phone;
1015
+ setErrors(errorobj);
1018
1016
  }
1019
- };
1020
- const handleAmountChange = (e) => {
1021
- const amountValue = e.target.value;
1022
- if (!isNaN(Number(amountValue))) {
1023
- setAmount(amountValue);
1024
- setIsValidAmount(true);
1025
- setErrorMessageamount("");
1026
- } else {
1027
- setAmount("");
1028
- setIsValidAmount(false);
1017
+ if (value) {
1018
+ delete errorobj[token];
1019
+ setErrors(errorobj);
1029
1020
  }
1030
- };
1031
- const handleOrderIdChange = (e) => {
1032
- const orderIdValue = e.target.value;
1033
- if (orderIdValue) {
1034
- setOrderId(orderIdValue);
1035
- setIsValidOrderId(true);
1036
- setErrorMessageorderid("");
1037
- } else {
1038
- setOrderId("");
1039
- setIsValidOrderId(false);
1021
+ if (token === "email" && !value) {
1022
+ delete errorobj[token];
1023
+ setErrors(errorobj);
1040
1024
  }
1041
1025
  };
1042
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ React7.createElement("div", { className: " border-container" }, /* @__PURE__ */ React7.createElement("div", { className: "payment-column" }, /* @__PURE__ */ React7.createElement("label", null, "Enter Phone Number:"), /* @__PURE__ */ React7.createElement("div", { className: "input-container" }, /* @__PURE__ */ React7.createElement(
1043
- "input",
1044
- {
1045
- type: "text",
1046
- value: phoneNumber,
1047
- onChange: handlePhoneNumberChange,
1048
- placeholder: "Enter phone number",
1049
- maxLength: 10,
1050
- className: submitClicked && (!phoneNumber || !isValidNumber) ? "error" : ""
1026
+ const handleAmountChange = (data) => {
1027
+ const { value } = data;
1028
+ if (Number(value) > 0) {
1029
+ let errorobj = errors;
1030
+ delete errorobj.amount;
1031
+ setErrors(errorobj);
1051
1032
  }
1052
- ), errorMessagephone && /* @__PURE__ */ React7.createElement("div", { className: "error-message text-danger" }, errorMessagephone))), /* @__PURE__ */ React7.createElement("div", { className: "payment-column" }, /* @__PURE__ */ React7.createElement("label", null, "Enter Amount:"), /* @__PURE__ */ React7.createElement("div", { className: "input-container" }, /* @__PURE__ */ React7.createElement(
1053
- "input",
1054
- {
1055
- type: "text",
1056
- value: amount,
1057
- onChange: handleAmountChange,
1058
- placeholder: "Enter amount",
1059
- className: submitClicked && (!amount || !isValidAmount) ? "error" : ""
1033
+ setAmount(value);
1034
+ };
1035
+ const validateForm = () => {
1036
+ let newErrors = {};
1037
+ if (!amount) newErrors.amount = ErrorText.amountrequired;
1038
+ if (requestDetails.email && !isValidEmail(requestDetails == null ? void 0 : requestDetails.email)) newErrors.email = ErrorText.invalidemail;
1039
+ if (!phone && !(requestDetails == null ? void 0 : requestDetails.email)) newErrors.phone = ErrorText.phoneoremailrequired;
1040
+ if (!phone && !(requestDetails == null ? void 0 : requestDetails.email)) newErrors.email = ErrorText.phoneoremailrequired;
1041
+ if (!phone && requestDetails.email && !isValidEmail(requestDetails == null ? void 0 : requestDetails.email)) newErrors.email = ErrorText.invalidemail;
1042
+ if (props.from === "merchant" && !requestDetails.order_id) newErrors.order_id = ErrorText.orderidrequired;
1043
+ setErrors(newErrors);
1044
+ return Object.keys(newErrors).length === 0;
1045
+ };
1046
+ useEffect2(() => {
1047
+ if (props) {
1048
+ setRequestDetails((prev) => __spreadProps(__spreadValues({}, prev), {
1049
+ order_id: props.orderID ? props.orderID : "",
1050
+ name: (props == null ? void 0 : props.name) ? props == null ? void 0 : props.name : "",
1051
+ email: (props == null ? void 0 : props.email) ? props == null ? void 0 : props.email : ""
1052
+ }));
1053
+ setAmount(props.amount ? props.amount : "");
1054
+ setPhone(props.phone ? `${props.phone}` : null);
1060
1055
  }
1061
- ), errorMessageamount && /* @__PURE__ */ React7.createElement("div", { className: "error-message text-danger" }, errorMessageamount))), /* @__PURE__ */ React7.createElement("div", { className: "payment-column" }, /* @__PURE__ */ React7.createElement("label", null, "Enter Order ID:"), /* @__PURE__ */ React7.createElement("div", { className: "input-container" }, /* @__PURE__ */ React7.createElement(
1062
- "input",
1063
- {
1064
- type: "text",
1065
- value: orderId,
1066
- onChange: handleOrderIdChange,
1067
- placeholder: "Enter order ID",
1068
- className: submitClicked && (!orderId || !isValidOrderId) ? "error" : ""
1056
+ }, [props]);
1057
+ const handlePhoneChange = (e) => {
1058
+ let value = e == null ? void 0 : e.value;
1059
+ if (value && (value == null ? void 0 : value.length) > 0 && (value == null ? void 0 : value.length) !== 10) {
1060
+ setErrors((prevErrors) => __spreadProps(__spreadValues({}, prevErrors), {
1061
+ phone: ErrorText.phonenumberlength
1062
+ }));
1063
+ setPhone(value);
1064
+ return;
1065
+ } else {
1066
+ setPhone(value);
1069
1067
  }
1070
- ), errorMessageorderid && /* @__PURE__ */ React7.createElement("div", { className: "error-message text-danger" }, errorMessageorderid))), /* @__PURE__ */ React7.createElement(
1071
- "button",
1072
- {
1073
- onClick: sendRequestPayment,
1074
- disabled: isLoading || !isValidNumber || !isValidAmount || !isValidOrderId,
1075
- className: "paymentBtn"
1076
- },
1077
- isLoading ? "Loading..." : "Request Payment"
1078
- )), /* @__PURE__ */ React7.createElement(Modal, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ React7.createElement(Modal.Header, { closeButton: true }), /* @__PURE__ */ React7.createElement(Modal.Body, null, /* @__PURE__ */ React7.createElement(
1079
- "svg",
1080
- {
1081
- width: "60",
1082
- height: "60",
1083
- viewBox: "0 0 60 60",
1084
- fill: "none",
1085
- xmlns: "http://www.w3.org/2000/svg"
1086
- },
1087
- /* @__PURE__ */ React7.createElement(
1088
- "rect",
1089
- {
1090
- x: "0.5",
1091
- y: "0.5",
1092
- width: "59",
1093
- height: "59",
1094
- rx: "29.5",
1095
- stroke: "#31B379"
1096
- }
1097
- ),
1098
- /* @__PURE__ */ React7.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ React7.createElement(
1099
- "path",
1100
- {
1101
- 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",
1102
- fill: "#31B379"
1103
- }
1104
- )),
1105
- /* @__PURE__ */ React7.createElement("defs", null, /* @__PURE__ */ React7.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ React7.createElement(
1106
- "rect",
1107
- {
1108
- width: "22",
1109
- height: "22",
1110
- fill: "white",
1111
- transform: "translate(19.5 19.0039)"
1112
- }
1113
- )))
1114
- ), /* @__PURE__ */ React7.createElement("h1", null, "Success!"), /* @__PURE__ */ React7.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ React7.createElement(Modal.Footer, null, /* @__PURE__ */ React7.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))), /* @__PURE__ */ React7.createElement(ToastContainer, null));
1115
- }
1116
-
1117
- // src/app/components/RequestPayment/RequestPaymentDynamic.tsx
1118
- import React8, { useState as useState3 } from "react";
1119
- import { Modal as Modal2 } from "react-bootstrap";
1120
-
1121
- // src/app/components/Api/createWidgetOrder.ts
1122
- var createWidgetOrder = (formData) => {
1123
- const jsonData = JSON.stringify(formData);
1124
- return fetch(`${baseUrl}create-widget-order`, {
1125
- method: "POST",
1126
- headers: {
1127
- "Content-Type": "application/json"
1128
- },
1129
- body: jsonData
1130
- }).then((response) => {
1131
- if (!response.ok) {
1132
- throw new Error(ErrorText.networkresponseerror);
1068
+ let errorobj = errors;
1069
+ delete errorobj.phone;
1070
+ if (value && !(requestDetails == null ? void 0 : requestDetails.email)) {
1071
+ delete errorobj.email;
1133
1072
  }
1134
- return response.json();
1135
- }).then((data) => {
1136
- return data;
1137
- });
1138
- };
1139
-
1140
- // src/app/components/RequestPayment/RequestPaymentDynamic.tsx
1141
- function RequestPaymentDynamic({ fractalpayClientKey, amount, phone_number, orderID }) {
1142
- const [isLoading, setIsLoading] = useState3(false);
1143
- const [show, setShow] = useState3(false);
1144
- const handleClose = () => setShow(false);
1145
- const handleShow = () => setShow(true);
1146
- const sendRequestPayment = () => {
1147
- setIsLoading(true);
1148
- const formData = {
1149
- fractalpayPublicKey: fractalpayClientKey,
1150
- amount,
1151
- phone_number,
1152
- orderId: orderID,
1153
- action: "request"
1154
- };
1155
- createWidgetOrder(formData).then((data) => {
1156
- setIsLoading(false);
1157
- if (data.result === true) {
1158
- setShow(true);
1159
- }
1160
- console.log(data);
1161
- }).catch((error) => {
1162
- setIsLoading(false);
1163
- console.error("Error:", error);
1164
- });
1073
+ setErrors(errorobj);
1165
1074
  };
1166
- return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
1167
- "button",
1168
- {
1169
- onClick: sendRequestPayment,
1170
- disabled: isLoading,
1171
- className: "paymentBtn"
1172
- },
1173
- isLoading ? "Loading..." : "Request Payment"
1174
- ), /* @__PURE__ */ React8.createElement(Modal2, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ React8.createElement(Modal2.Header, { closeButton: true }), /* @__PURE__ */ React8.createElement(Modal2.Body, null, /* @__PURE__ */ React8.createElement(
1175
- "svg",
1075
+ function formatAmount(amount2) {
1076
+ return new Intl.NumberFormat("en-US", {
1077
+ style: "currency",
1078
+ currency: "USD",
1079
+ minimumFractionDigits: 2,
1080
+ maximumFractionDigits: 2
1081
+ }).format(Number(amount2));
1082
+ }
1083
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ React7.createElement(Loader_default, { loading }), /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Request Pre Auth Payment"), /* @__PURE__ */ React7.createElement(
1084
+ CustomModal2_default,
1176
1085
  {
1177
- width: "60",
1178
- height: "60",
1179
- viewBox: "0 0 60 60",
1180
- fill: "none",
1181
- xmlns: "http://www.w3.org/2000/svg"
1086
+ open: show,
1087
+ onClose: () => setShow(false)
1182
1088
  },
1183
- /* @__PURE__ */ React8.createElement(
1184
- "rect",
1185
- {
1186
- x: "0.5",
1187
- y: "0.5",
1188
- width: "59",
1189
- height: "59",
1190
- rx: "29.5",
1191
- stroke: "#31B379"
1192
- }
1193
- ),
1194
- /* @__PURE__ */ React8.createElement("g", { "clip-path": "url(#clip0_2659_5018)" }, /* @__PURE__ */ React8.createElement(
1195
- "path",
1196
- {
1197
- 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",
1198
- fill: "#31B379"
1199
- }
1200
- )),
1201
- /* @__PURE__ */ React8.createElement("defs", null, /* @__PURE__ */ React8.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ React8.createElement(
1202
- "rect",
1089
+ /* @__PURE__ */ React7.createElement("div", { className: "request-payment-amount-detail" }, /* @__PURE__ */ React7.createElement("p", { className: "request-payment-merchantname" }, "Authorization Request"), /* @__PURE__ */ React7.createElement("p", { className: "request-payment-pre-auth-merchantname" }, "Pay ", props == null ? void 0 : props.webname), /* @__PURE__ */ React7.createElement("p", { className: "request-payment-amount" }, formatAmount(props == null ? void 0 : props.amount)), (props == null ? void 0 : props.from) === "merchant" && /* @__PURE__ */ React7.createElement("p", { className: "request-payment-orderid" }, requestDetails == null ? void 0 : requestDetails.order_id), /* @__PURE__ */ React7.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ React7.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ React7.createElement("g", { "clip-path": "url(#clip0_12425_52336)" }, /* @__PURE__ */ React7.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__ */ React7.createElement("defs", null, /* @__PURE__ */ React7.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ React7.createElement("rect", { width: "16", height: "16", fill: "white" })))))),
1090
+ /* @__PURE__ */ React7.createElement("form", { className: "request-payment-input-form" }, /* @__PURE__ */ React7.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ React7.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "FULL NAME"), /* @__PURE__ */ React7.createElement(
1091
+ "input",
1203
1092
  {
1204
- width: "22",
1205
- height: "22",
1206
- fill: "white",
1207
- transform: "translate(19.5 19.0039)"
1208
- }
1209
- )))
1210
- ), /* @__PURE__ */ React8.createElement("h1", null, "Success!"), /* @__PURE__ */ React8.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ React8.createElement(Modal2.Footer, null, /* @__PURE__ */ React8.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))));
1211
- }
1212
-
1213
- // src/app/components/RequestPayment/RequestPaymentonClick.tsx
1214
- import React9, { useState as useState4 } from "react";
1215
- import { Modal as Modal3 } from "react-bootstrap";
1216
- function RequestPaymentonClick(props) {
1217
- const [isLoading, setIsLoading] = useState4(false);
1218
- const [show, setShow] = useState4(false);
1219
- const handleClose = () => setShow(false);
1220
- const handleShow = () => setShow(true);
1221
- const { fractalpayClientKey, amount, phone_number, orderID, onSuccess, onError } = props;
1222
- const sendRequestPayment = () => {
1223
- setIsLoading(true);
1224
- let formData = {
1225
- fractalpayPublicKey: fractalpayClientKey,
1226
- amount,
1227
- phone_number,
1228
- orderId: orderID,
1229
- action: "request"
1230
- };
1231
- const jsonData = JSON.stringify(formData);
1232
- fetch(`${baseUrl}create-widget-order`, {
1233
- method: "POST",
1234
- headers: {
1235
- "Content-Type": "application/json"
1236
- },
1237
- body: jsonData
1238
- }).then((response) => {
1239
- setIsLoading(false);
1240
- if (!response.ok) {
1241
- throw new Error(ErrorText.networkresponseerror);
1093
+ className: "request-payment-input-box",
1094
+ type: "text",
1095
+ placeholder: "Full Name",
1096
+ "data-token": "name",
1097
+ onChange: handleChange,
1098
+ value: requestDetails == null ? void 0 : requestDetails.name
1242
1099
  }
1243
- return response.json();
1244
- }).then((data) => {
1245
- setShow(true);
1246
- console.log(data);
1247
- }).catch((error) => {
1248
- setIsLoading(false);
1249
- console.error("Error:", error);
1250
- });
1251
- };
1252
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ React9.createElement(
1253
- "button",
1254
- {
1255
- onClick: sendRequestPayment,
1256
- disabled: isLoading,
1257
- className: "paymentBtn"
1258
- },
1259
- isLoading ? "Loading..." : "Request Payment"
1260
- ), /* @__PURE__ */ React9.createElement(Modal3, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ React9.createElement(Modal3.Header, { closeButton: true }), /* @__PURE__ */ React9.createElement(Modal3.Body, null, onSuccess && /* @__PURE__ */ React9.createElement(
1261
- "svg",
1262
- {
1263
- width: "60",
1264
- height: "60",
1265
- viewBox: "0 0 60 60",
1266
- fill: "none",
1267
- xmlns: "http://www.w3.org/2000/svg"
1268
- },
1269
- /* @__PURE__ */ React9.createElement(
1270
- "rect",
1100
+ ), errors.name && /* @__PURE__ */ React7.createElement("small", { className: "request-payment-error-msg" }, errors.name)), /* @__PURE__ */ React7.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ React7.createElement("label", { htmlFor: "requestPhoneNumber", className: "request-payment-input-label" }, "Phone Number"), /* @__PURE__ */ React7.createElement(
1101
+ PatternFormat2,
1271
1102
  {
1272
- x: "0.5",
1273
- y: "0.5",
1274
- width: "59",
1275
- height: "59",
1276
- rx: "29.5",
1277
- stroke: "#31B379"
1103
+ className: "request-payment-input-box",
1104
+ placeholder: "Mobile number",
1105
+ format: "+1 (###) ###-####",
1106
+ value: phone,
1107
+ onValueChange: (e) => {
1108
+ handlePhoneChange(e);
1109
+ }
1278
1110
  }
1279
- ),
1280
- /* @__PURE__ */ React9.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ React9.createElement(
1281
- "path",
1111
+ ), errors.phone && /* @__PURE__ */ React7.createElement("small", { className: "request-payment-error-msg" }, errors.phone)), /* @__PURE__ */ React7.createElement("div", { className: "request-payment-list-div" }, /* @__PURE__ */ React7.createElement("label", { htmlFor: "exampleFormControlInput2", className: "request-payment-input-label" }, "EMAIL"), /* @__PURE__ */ React7.createElement(
1112
+ "input",
1282
1113
  {
1283
- 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",
1284
- fill: "#31B379"
1114
+ className: "request-payment-input-box",
1115
+ type: "text",
1116
+ placeholder: "Email",
1117
+ onChange: handleChange,
1118
+ "data-token": "email",
1119
+ value: requestDetails == null ? void 0 : requestDetails.email
1285
1120
  }
1286
- )),
1287
- /* @__PURE__ */ React9.createElement("defs", null, /* @__PURE__ */ React9.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ React9.createElement(
1288
- "rect",
1121
+ ), errors.email && /* @__PURE__ */ React7.createElement("small", { className: "request-payment-error-msg" }, errors.email)), /* @__PURE__ */ React7.createElement(
1122
+ "button",
1289
1123
  {
1290
- width: "22",
1291
- height: "22",
1292
- fill: "white",
1293
- transform: "translate(19.5 19.0039)"
1294
- }
1295
- )))
1296
- ), onSuccess ? /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("h1", null, "Success!"), /* @__PURE__ */ React9.createElement("h4", null, onSuccess)) : /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("h1", null, "Error!"), /* @__PURE__ */ React9.createElement("h4", null, onError))), /* @__PURE__ */ React9.createElement(Modal3.Footer, null, /* @__PURE__ */ React9.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))));
1297
- }
1298
-
1299
- // src/app/components/RequestPayment/RqstPaymntInputField.tsx
1300
- import React10, { useState as useState5 } from "react";
1301
- import { Modal as Modal4 } from "react-bootstrap";
1302
- import { toast as toast2, ToastContainer as ToastContainer2 } from "react-toastify";
1303
- import "react-toastify/dist/ReactToastify.css";
1304
- function RqstPaymntInputField({ fractalpayClientKey, amount, orderID }) {
1305
- const [isLoading, setIsLoading] = useState5(false);
1306
- const [show, setShow] = useState5(false);
1307
- const [phoneNumber, setPhoneNumber] = useState5("");
1308
- const [isValidNumber, setIsValidNumber] = useState5(true);
1309
- const [errorMessage, setErrorMessage] = useState5("");
1310
- const [submitClicked, setSubmitClicked] = useState5(false);
1311
- const handleClose = () => setShow(false);
1312
- const handleShow = () => setShow(true);
1313
- const sendRequestPayment = () => {
1314
- if (!phoneNumber) {
1315
- setErrorMessage(ErrorText.phonenumberrequired);
1316
- setSubmitClicked(true);
1317
- return;
1318
- }
1319
- if (!/^\d{10}$/.test(phoneNumber)) {
1320
- setErrorMessage(ErrorText.phonenumbervalid);
1321
- setSubmitClicked(true);
1322
- return;
1323
- }
1324
- setErrorMessage("");
1325
- setSubmitClicked(true);
1326
- setIsLoading(true);
1327
- let formData = {
1328
- fractalpayPublicKey: fractalpayClientKey,
1329
- amount,
1330
- phone_number: phoneNumber,
1331
- orderId: orderID,
1332
- action: "request"
1333
- };
1334
- const jsonData = JSON.stringify(formData);
1335
- fetch(`${baseUrl}create-widget-order`, {
1336
- method: "POST",
1337
- headers: {
1338
- "Content-Type": "application/json"
1124
+ type: "button",
1125
+ className: "request-payment-submit-button",
1126
+ onClick: sendRequestPayment,
1127
+ disabled: loading
1339
1128
  },
1340
- body: jsonData
1341
- }).then((response) => {
1342
- setIsLoading(false);
1343
- if (!response.ok) {
1344
- throw new Error(ErrorText.networkresponseerror);
1345
- }
1346
- return response.json();
1347
- }).then((data) => {
1348
- if (data.result === true) {
1349
- setShow(true);
1350
- }
1351
- console.log(data);
1352
- }).catch((error) => {
1353
- setIsLoading(false);
1354
- console.error("Error:", error);
1355
- toast2.error(ErrorText.anerroroccured);
1356
- });
1357
- };
1358
- const handlePhoneNumberChange = (e) => {
1359
- const number = e.target.value;
1360
- const isValid = /^\d*$/.test(number);
1361
- if (isValid) {
1362
- setPhoneNumber(number);
1363
- setIsValidNumber(number.length <= 10);
1364
- if (number.length > 10) {
1365
- setErrorMessage(ErrorText.phonenumberlength);
1366
- } else {
1367
- setErrorMessage("");
1368
- }
1369
- } else {
1370
- setErrorMessage(ErrorText.phonenumbervalid);
1371
- }
1372
- };
1373
- return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("div", { className: "payment-container" }, /* @__PURE__ */ React10.createElement("div", { className: "input-wrapper" }, /* @__PURE__ */ React10.createElement("div", { className: "input-container" }, /* @__PURE__ */ React10.createElement(
1374
- "input",
1375
- {
1376
- type: "text",
1377
- value: phoneNumber,
1378
- onChange: handlePhoneNumberChange,
1379
- placeholder: "Enter phone number",
1380
- maxLength: 10,
1381
- className: submitClicked && (!phoneNumber || !isValidNumber) ? "error" : ""
1382
- }
1383
- ), errorMessage && /* @__PURE__ */ React10.createElement("div", { className: "error-message text-danger" }, errorMessage))), /* @__PURE__ */ React10.createElement("div", { className: "button-wrapper" }, /* @__PURE__ */ React10.createElement(
1384
- "button",
1129
+ loading ? "Loading..." : "Send Request"
1130
+ ), /* @__PURE__ */ React7.createElement("div", { className: "request-payment-fractal-powerd-by" }, /* @__PURE__ */ React7.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "16", viewBox: "0 0 17 16", fill: "none" }, /* @__PURE__ */ React7.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__ */ React7.createElement("span", null, "Fractal"), /* @__PURE__ */ React7.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" }, /* @__PURE__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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__ */ React7.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" }))))
1131
+ ), /* @__PURE__ */ React7.createElement(
1132
+ CustomModal2_default,
1385
1133
  {
1386
- onClick: sendRequestPayment,
1387
- disabled: isLoading || !isValidNumber,
1388
- className: "paymentBtn"
1134
+ open: showConfirmationModal,
1135
+ onClose: handleCloseConfirmationModal
1389
1136
  },
1390
- isLoading ? "Loading..." : "Request Payment"
1391
- ))), /* @__PURE__ */ React10.createElement(Modal4, { className: "payment-suc", show, onHide: handleClose }, /* @__PURE__ */ React10.createElement(Modal4.Header, { closeButton: true }), /* @__PURE__ */ React10.createElement(Modal4.Body, null, /* @__PURE__ */ React10.createElement(
1392
- "svg",
1393
- {
1394
- width: "60",
1395
- height: "60",
1396
- viewBox: "0 0 60 60",
1397
- fill: "none",
1398
- xmlns: "http://www.w3.org/2000/svg"
1399
- },
1400
- /* @__PURE__ */ React10.createElement(
1401
- "rect",
1402
- {
1403
- x: "0.5",
1404
- y: "0.5",
1405
- width: "59",
1406
- height: "59",
1407
- rx: "29.5",
1408
- stroke: "#31B379"
1409
- }
1410
- ),
1411
- /* @__PURE__ */ React10.createElement("g", { clipPath: "url(#clip0_2659_5018)" }, /* @__PURE__ */ React10.createElement(
1412
- "path",
1413
- {
1414
- 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",
1415
- fill: "#31B379"
1416
- }
1417
- )),
1418
- /* @__PURE__ */ React10.createElement("defs", null, /* @__PURE__ */ React10.createElement("clipPath", { id: "clip0_2659_5018" }, /* @__PURE__ */ React10.createElement(
1419
- "rect",
1420
- {
1421
- width: "22",
1422
- height: "22",
1423
- fill: "white",
1424
- transform: "translate(19.5 19.0039)"
1425
- }
1426
- )))
1427
- ), /* @__PURE__ */ React10.createElement("h1", null, "Success!"), /* @__PURE__ */ React10.createElement("h4", null, "Payment link created successfully.")), /* @__PURE__ */ React10.createElement(Modal4.Footer, null, /* @__PURE__ */ React10.createElement("button", { className: "paymentBtn", onClick: handleClose }, "Ok"))), /* @__PURE__ */ React10.createElement(ToastContainer2, null));
1428
- }
1429
-
1430
- // src/app/components/Payment/Payment.tsx
1431
- import React12, { useState as useState6 } from "react";
1432
- import forge from "node-forge";
1433
- import { toast as toast3 } from "react-toastify";
1434
- import { Modal as Modal5 } from "react-bootstrap";
1435
-
1436
- // src/app/components/Payment/Paymentstyles.tsx
1437
- import React11 from "react";
1438
- function Paymentstyles() {
1439
- return /* @__PURE__ */ React11.createElement("style", null, `
1440
- .paymentBtn {
1441
- background-color: black;
1442
- border: none;
1443
- color: white;
1444
- padding: 15px 32px;
1445
- text-align: center;
1446
- text-decoration: none;
1447
- display: inline-block;
1448
- font-size: 16px;
1449
- margin: 4px 2px;
1450
- cursor: pointer;
1451
- border-radius: 180px;
1452
- /* width: auto; */
1453
- }
1454
-
1455
- .modal-backdrop {
1456
- display: none !important;
1457
- }
1458
-
1459
- /* CSS for modal */
1460
- .modal {
1461
- /* display: none; */
1462
- position: fixed;
1463
- z-index: 5555;
1464
- left: 0;
1465
- top: 0;
1466
- width: 100%;
1467
- height: 100%;
1468
- overflow: auto;
1469
- background-color: rgba(0, 0, 0, 0.8);
1470
- }
1471
-
1472
- .input-container {
1473
- position: relative;
1474
- }
1475
-
1476
- .error {
1477
- /* border: 1px solid red; */
1478
- color: #ffe6e6;
1479
- /* light red background color */
1480
- }
1481
-
1482
- .form-group {
1483
- margin-bottom: 15px;
1484
- }
1485
-
1486
- .input-container input {
1487
- padding-right: 25px;
1488
- }
1489
-
1490
- .modal-header {
1491
- border-bottom: 0 !important;
1492
- padding-top: 0 !important;
1493
- }
1494
-
1495
- /* CSS for modal content */
1496
- .modal-content {
1497
- /* height: 90vh !important; */
1498
- height: auto;
1499
- /* padding: 20px; */
1500
- padding: 20px 2px !important;
1501
- /* background: #fff; */
1502
- border-radius: 20px !important;
1503
- position: relative;
1504
- width: 430px;
1505
- margin: 30px auto;
1506
- overflow: hidden !important;
1507
- }
1508
- .input-container {
1509
- display: flex;
1510
- align-items: baseline;
1511
- }
1512
-
1513
- .input-error-container {
1514
- flex: 1;
1515
- }
1516
-
1517
- .paymentBtn {
1518
- margin-left: 10px;
1519
- }
1520
-
1521
- .PayButton {
1522
- outline: 0 !important;
1523
- height: 46px;
1524
- font-size: 16px;
1525
- background-color: #161616 !important;
1526
- border: none;
1527
- display: block;
1528
- width: 100%;
1529
- border-radius: 180px;
1530
- margin: 10px 0;
1531
- }
1532
-
1533
- #PayButton:hover {
1534
- background-color: #61c699 !important;
1535
- }
1536
-
1537
- #PayButton:active {
1538
- background-color: #61c699 !important;
1539
- }
1540
-
1541
- #PayButton:disabled {
1542
- background: rgb(172, 44, 170) !important;
1543
- color: #fff !important;
1544
- }
1545
-
1546
- label {
1547
- color: rgba(53, 37, 77, 0.6);
1548
- margin-bottom: 2px;
1549
- text-transform: uppercase;
1550
- font-family: "IBM Plex Mono", monospace;
1551
- font-weight: 500;
1552
- font-size: 12px;
1553
- }
1554
-
1555
- .input-container {
1556
- position: relative;
1557
- }
1558
-
1559
- .input-container input {
1560
- padding-right: 25px;
1561
- }
1562
-
1563
- #Checkout {
1564
- /* z-index: 100001; */
1565
- width: 100%;
1566
- /* height: 100%; */
1567
- /* background: 0 0 #ffffff; */
1568
- border-radius: 24px;
1569
- border: 1px solid #e0dfe2;
1570
- display: block;
1571
- }
1572
-
1573
- .container {
1574
- margin-top: 10px;
1575
- }
1576
-
1577
- .powered-logo {
1578
- width: 18px;
1579
- height: 18px;
1580
- /* float: right; */
1581
- padding: 2px;
1582
- background: #000000;
1583
- border-radius: 4px;
1584
- /* margin-left: 5px; */
1585
- }
1586
-
1587
- .modal-content .container {
1588
- width: 100%;
1589
- }
1590
-
1591
- .powerd-by-part {
1592
- display: flex;
1593
- justify-content: center;
1594
- align-items: center;
1595
- gap: 5px;
1596
- }
1597
-
1598
- .errorText {
1599
- color: red;
1600
- }
1601
-
1602
- .input-group {
1603
- position: relative;
1604
- }
1605
-
1606
- .paynowbtn {
1607
- outline: 0 !important;
1608
- padding: 7px 25px !important;
1609
- font-size: 13px;
1610
- background-color: #161616 !important;
1611
- border: #161616 1px solid !important;
1612
- color: #fff !important;
1613
- display: inline-block !important;
1614
- border-radius: 180px !important;
1615
- }
1616
-
1617
- .paynowbtn:hover {
1618
- background-color: #fff !important;
1619
- border: #161616 1px solid !important;
1620
- color: #161616 !important;
1621
- }
1622
-
1623
- .ButtonGroup__root.btn-group {
1624
- margin: 10px 0 20px 0;
1625
- }
1626
-
1627
- .ButtonGroup__root.btn-group button {
1628
- background: #000;
1629
- border: 0;
1630
- margin: 0 5px;
1631
- border-radius: 4px !important;
1632
- }
1633
-
1634
- .ButtonGroup__root.btn-group button:hover,
1635
- .ButtonGroup__root.btn-group button:focus {
1636
- background: #333 !important;
1637
- }
1638
-
1639
- .input-group button {
1640
- background: #000;
1641
- border: 0;
1642
- margin: 0 5px;
1643
- border-radius: 0 4px 4px 0 !important;
1644
- }
1645
-
1646
- .input-group button:hover,
1647
- .input-group button:focus {
1648
- background: #333 !important;
1649
- }
1650
-
1651
- .payment-suc {
1652
- text-align: center;
1653
- }
1654
-
1655
- .payment-suc .modal-dialog {
1656
- min-width: 600px;
1657
- padding: 50px 0;
1658
- }
1659
-
1660
- .payment-suc h2 {
1661
- font-size: 24px;
1662
- color: #35254d;
1663
- font-weight: 500;
1664
- padding: 15px 0;
1665
- }
1666
-
1667
- .payment-suc p {
1668
- font-size: 14px;
1669
- color: #9a92a6;
1670
- font-weight: 500;
1671
- }
1672
-
1673
- .payment-suc .btn-close {
1674
- position: absolute;
1675
- right: 20px;
1676
- }
1677
-
1678
- .Checkout.container iframe {
1679
- width: 100%;
1680
- overflow: hidden !important;
1681
- }
1682
-
1683
- .responsive-tbl {
1684
- overflow-x: auto;
1685
- }
1686
-
1687
- body {
1688
- position: relative !important;
1689
- }
1690
-
1691
- thead,
1692
- tbody,
1693
- tfoot,
1694
- tr,
1695
- td,
1696
- th {
1697
- white-space: nowrap;
1698
- }
1699
-
1700
- .button-group {
1701
- display: flex;
1702
- gap: 10px;
1703
- }
1704
-
1705
- .rqstonClickbtn {
1706
- color: #fff;
1707
- background-color: #337ab7;
1708
- border-color: #2e6da4;
1709
- }
1710
-
1711
- .loading-animation {
1712
- position: absolute;
1713
- top: 50%;
1714
- left: 50%;
1715
- transform: translate(-50%, -50%);
1716
- }
1717
-
1718
- .spinner {
1719
- width: 40px;
1720
- height: 40px;
1721
- border-radius: 50%;
1722
- border: 4px solid #f3f3f3;
1723
- border-top: 4px solid black;
1724
- animation: spin 1s linear infinite;
1725
- }
1726
-
1727
- @keyframes spin {
1728
- 0% {
1729
- transform: rotate(0deg);
1730
- }
1731
-
1732
- 100% {
1733
- transform: rotate(360deg);
1734
- }
1735
- }
1736
-
1737
- /* .border-container {
1738
- display: flex;
1739
- flex-direction: column;
1740
- border: 0px solid #ccc;
1741
- padding: 20px;
1742
- border-radius: 10px;
1743
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
1744
- align-items: baseline;
1745
- }
1746
- .payment-container {
1747
- border: 0px solid #ccc;
1748
- padding: 20px;
1749
- border-radius: 10px;
1750
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
1751
- } */
1752
-
1753
- .payment-row {
1754
- display: flex;
1755
- align-items: center;
1756
- margin-bottom: 20px;
1757
- }
1758
-
1759
- .payment-row label {
1760
- width: 150px;
1761
- font-weight: bold;
1762
- margin-right: 10px;
1763
- }
1764
-
1765
- .payment-row input {
1766
- flex-grow: 1;
1767
- margin-right: 10px;
1768
- }
1769
-
1770
- .payment-row button {
1771
- flex-grow: 1;
1772
- }
1773
-
1774
- .payment-row {
1775
- display: flex;
1776
- flex-direction: column;
1777
- border-radius: 10px;
1778
- margin-top: 10px;
1779
- }
1780
-
1781
- .input-wrapper {
1782
- flex: 1;
1783
- }
1784
-
1785
- .button-wrapper {
1786
- margin-left: 10px;
1787
- }
1788
-
1789
- .input-container {
1790
- display: flex;
1791
- flex-direction: column;
1792
- }
1793
-
1794
- .export-btn {
1795
- background: black;
1796
- color: white;
1797
- height: 35px;
1798
- width: 68px;
1799
- border-radius: 5px;
1800
- margin-left: 14px;
1801
- }
1802
-
1803
- .payment-popup {
1804
- padding: 12px 20px;
1805
- background: #fff;
1806
- border-radius: 20px;
1807
- position: relative;
1808
- width: 100%;
1809
- margin: 0 auto;
1810
- }
1811
-
1812
- .modal-dialog {
1813
- max-width: 810px;
1814
- }
1815
-
1816
- .modal-content {
1817
- max-width: 100%;
1818
- /* margin-top: 5%; */
1819
- width: 100%;
1820
- margin: 0;
1821
- }
1822
-
1823
- @media (max-width: 460px) {
1824
- .payment-popup {
1825
- padding: 35px 25px;
1826
- width: 98%;
1827
- }
1828
- }
1829
-
1830
- .close-pop {
1831
- position: absolute;
1832
- right: 8px;
1833
- top: 8px;
1834
- border: 0;
1835
- padding: 0;
1836
- background: none !important;
1837
- }
1838
-
1839
- .copy-api {
1840
- overflow-y: auto;
1841
- scrollbar-width: inherit;
1842
- background: #f2f2f2;
1843
- color: rgb(33, 33, 33);
1844
- font-size: "12px";
1845
- border: 0;
1846
- border-radius: 4px;
1847
- width: 100%;
1848
- padding: 8px 15px;
1849
- position: relative;
1850
- }
1851
-
1852
- #style-3::-webkit-scrollbar-track {
1853
- -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
1854
- background-color: #f5f5f5;
1855
- }
1856
-
1857
- #style-3::-webkit-scrollbar {
1858
- height: 3px;
1859
- background-color: #f5f5f5;
1860
- }
1861
-
1862
- #style-3::-webkit-scrollbar-thumb {
1863
- cursor: pointer;
1864
- background-color: #333;
1865
- }
1866
-
1867
- .copy-code {
1868
- display: flex;
1869
- }
1870
-
1871
- .copy-code svg {
1872
- margin-right: 10px;
1873
- }
1874
-
1875
- .accordion.accordion-flush {
1876
- float: left;
1877
- width: 100%;
1878
- margin-bottom: 45px;
1879
- }
1880
-
1881
- .box {
1882
- width: 100%;
1883
- height: 200px;
1884
- /* background-color: #ddf6fc0e; */
1885
- /* color: #fff; */
1886
- text-align: center;
1887
- line-height: 200px;
1888
- /* Center content vertically */
1889
- font-size: 1.5rem;
1890
- }
1891
-
1892
- .amex {
1893
- background-image: url("/assests/amex.svg");
1894
- }
1895
-
1896
- .visa {
1897
- background-image: url("/assests/visa.svg");
1898
- }
1899
-
1900
- .mastercard {
1901
- background-image: url("/assests/mastercard.svg");
1902
- }
1903
-
1904
- .discover {
1905
- background-image: url("/assests/discover.svg");
1906
- }
1907
-
1908
- .expiry-date-group {
1909
- float: left;
1910
- width: 30%;
1911
- }
1912
-
1913
- .expiry-date-group input {
1914
- width: calc(100% + 1px);
1915
- border-top-right-radius: 0;
1916
- border-bottom-right-radius: 0;
1917
- }
1918
-
1919
- .expiry-date-group input:focus {
1920
- position: relative;
1921
- z-index: 10;
1922
-
1923
- }
1924
- .pay-tbl th{width: 24% !important;}
1925
- .pay-tbl th:last-child{width: 28% !important;}
1926
- .security-code-group {
1927
- float: right;
1928
- width: 40%;
1929
- position: relative;
1930
- }
1931
-
1932
- .security-code-group input {
1933
- border-top-left-radius: 0;
1934
- border-bottom-left-radius: 0;
1935
- }
1936
-
1937
- .zip-code-group {
1938
- clear: both;
1939
- }
1940
- .amnt input{max-width: 150px; margin-right:8px;}
1941
- .amnt p, .amnt form{margin-right:8px;}
1942
- #submitButton {
1943
- outline: 0 !important;
1944
- height: 46px;
1945
- font-size: 16px;
1946
- background-color: #161616 !important;
1947
- border: none;
1948
- display: block;
1949
- width: 100%;
1950
- color: white;
1951
- border-radius: 180px;
1952
- }
1953
-
1954
- #submitRequestButton {
1955
- outline: 0 !important;
1956
- height: 46px;
1957
- font-size: 16px;
1958
- background-color: #161616 !important;
1959
- border: none;
1960
- display: block;
1961
- width: 100%;
1962
- border-radius: 180px;
1963
- }
1964
-
1965
- #PayButton {
1966
- outline: 0 !important;
1967
- height: 46px;
1968
- font-size: 16px;
1969
- background-color: #161616 !important;
1970
- border: none;
1971
- display: block;
1972
- width: 100%;
1973
- border-radius: 180px;
1974
- margin: 2px;
1975
- }
1976
-
1977
- #PayButton:hover {
1978
- background-color: #61c699 !important;
1979
- }
1980
-
1981
- #PayButton:active {
1982
- background-color: #61c699 !important;
1983
- }
1984
-
1985
- #PayButton:disabled {
1986
- background: rgb(172, 44, 170) !important;
1987
- color: #fff !important;
1988
- }
1989
-
1990
- .form-control {
1991
- color: #35254d;
1992
- }
1993
-
1994
- .container {
1995
- margin-top: 10px;
1996
- }
1997
-
1998
- #Checkout {
1999
- z-index: 100001;
2000
- width: 100%;
2001
- height: 100%;
2002
- min-height: 100%;
2003
- background: 0 0 #ffffff;
2004
- border-radius: 24px;
2005
- border: 1px solid #e0dfe2;
2006
- margin-left: auto;
2007
- margin-right: auto;
2008
- display: block;
2009
- }
2010
-
2011
- #Checkout .header {
2012
- display: flex;
2013
- /* Enables Flexbox */
2014
- justify-content: center;
2015
- /* Centers content horizontally */
2016
- align-items: center;
2017
- /* Centers content vertically */
2018
- text-align: center;
2019
- padding: 8px;
2020
- border-bottom: 1px solid #dedede;
2021
- margin: 0 10px 20px 10px;
2022
- }
2023
-
2024
- #Checkout .header button {
2025
- border: 0;
2026
- background: none;
2027
- padding: 0;
2028
- }
2029
-
2030
- #Checkout h1 {
2031
- margin: 0;
2032
- flex: 1;
2033
- padding: 10px;
2034
- /* Allows the title to grow and fill the space for centering */
2035
- font-size: 23px;
2036
- font-weight: 500;
2037
- color: #35254d;
2038
- align-items: start;
2039
- display: flex;
2040
- }
2041
-
2042
- #Checkout>form {
2043
- margin: 0 25px 10px 25px;
2044
- }
2045
-
2046
- label {
2047
- color: rgba(53, 37, 77, 0.6);
2048
- margin-bottom: 2px;
2049
- text-transform: uppercase;
2050
- font-family: "IBM Plex Mono", monospace;
2051
- font-weight: 500;
2052
- font-size: 12px;
2053
- }
2054
-
2055
- .input-container {
2056
- position: relative;
2057
- }
2058
-
2059
- .input-container input {
2060
- padding-right: 25px;
2061
- }
2062
-
2063
- #zipcode {
2064
- text-transform: capitalize !important;
2065
- }
2066
-
2067
- #zipcode {
2068
- width: 18px;
2069
- position: absolute;
2070
- right: 8px;
2071
- top: 9px;
2072
- }
2073
-
2074
- #zipcode .zip-tip {
2075
- display: none;
2076
- background-color: rgb(0, 0, 0, 0.4);
2077
- padding: 5px 8px;
2078
- border-radius: 6px;
2079
- position: absolute;
2080
- right: 26px;
2081
- top: -9px;
2082
- font-size: 12.5px;
2083
- text-transform: capitalize !important;
2084
- color: #fff;
2085
- width: 240px;
2086
- line-height: 16px;
2087
- }
2088
-
2089
- #zipcode .zip-tip:before {
2090
- width: 0;
2091
- height: 0;
2092
- border-top: 7px solid transparent;
2093
- border-bottom: 7px solid transparent;
2094
- border-left: 7px solid #000;
2095
- opacity: 0.4;
2096
- position: absolute;
2097
- right: -7px;
2098
- top: 50%;
2099
- transform: translateY(-50%);
2100
- content: "";
2101
- }
2102
-
2103
- #zipcode:hover .zip-tip {
2104
- display: block;
2105
- }
2106
-
2107
- .input-container>i,
2108
- a[role="button"] {
2109
- color: #d3d3d3;
2110
- width: 25px;
2111
- height: 30px;
2112
- line-height: 30px;
2113
- font-size: 16px;
2114
- position: absolute;
2115
- top: 5px;
2116
- right: 6px;
2117
- cursor: pointer;
2118
- text-align: center;
2119
- }
2120
-
2121
- .input-container>i:hover,
2122
- a[role="button"]:hover {
2123
- color: #777;
2124
- }
2125
-
2126
- .amount-placeholder {
2127
- white-space: nowrap;
2128
- font-size: 44px;
2129
- /* height: 35px; */
2130
- font-weight: 600;
2131
- line-height: 40px;
2132
- }
2133
-
2134
- .amount-placeholder>button {
2135
- float: right;
2136
- width: 60px;
2137
- }
2138
-
2139
- .amount-placeholder>span {
2140
- line-height: 34px;
2141
- }
2142
-
2143
- .top-amnt {
2144
- display: flex;
2145
- margin-bottom: 10px;
2146
- align-items: center;
2147
- justify-content: space-between;
2148
- }
2149
-
2150
- .amtleft {
2151
- text-align: center;
2152
- }
2153
-
2154
- .amtleft span {
2155
- color: #35254d;
2156
- margin: 0 -5px;
2157
- }
2158
-
2159
- .card-row {
2160
- text-align: right;
2161
- margin: 22px 0 0 0;
2162
- max-width: 85px;
2163
- line-height: 20px;
2164
- }
2165
-
2166
- .yer {
2167
- border-radius: 0;
2168
- }
2169
-
2170
- .card-row span {
2171
- width: 33px;
2172
- height: 21px;
2173
- margin: 0 2px;
2174
- background-repeat: no-repeat;
2175
- display: inline-block;
2176
- background-size: contain;
2177
- }
2178
-
2179
- .card-image {
2180
- background-repeat: no-repeat;
2181
- padding-right: 50px;
2182
- background-position: right 2px center;
2183
- background-size: auto 90%;
2184
- }
2185
-
2186
- /* .cvc-preview-container {
2187
- overflow: hidden;
2188
- } */
2189
-
2190
- .cvc-preview-container {
2191
- /* overflow: hidden; */
2192
- position: absolute;
2193
- z-index: 9999;
2194
- right: -71px;
2195
- top: -54px;
2196
- width: 165px;
2197
- border-radius: 5px;
2198
- padding: 5px;
2199
- background-color: rgb(0, 0, 0, 0.3);
2200
- display: none;
2201
- }
2202
-
2203
- .cvc-preview-container:before {
2204
- position: absolute;
2205
- left: 50%;
2206
- transform: translate(-50%);
2207
- bottom: -5px;
2208
- width: 0;
2209
- height: 0;
2210
- border-left: 5px solid transparent;
2211
- border-right: 5px solid transparent;
2212
- border-top: 5px solid #000;
2213
- opacity: 0.3;
2214
- content: "";
2215
- }
2216
-
2217
- .security-code-group #cvc:hover .cvc-preview-container {
2218
- display: block;
2219
- }
2220
-
2221
- .cvc-preview-container.two-card div {
2222
- width: 50%;
2223
- height: 45px;
2224
- }
2225
-
2226
- .cvc-preview-container.two-card div.amex-cvc-preview {
2227
- float: right;
2228
- }
2229
-
2230
- .cvc-preview-container.two-card div.visa-mc-dis-cvc-preview {
2231
- float: left;
2232
- }
2233
-
2234
- /* .cvc-preview-container div {
2235
- height: 160px;
2236
- } */
2237
-
2238
- .amex-cvc-preview {
2239
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAACOCAYAAAAlzXSMAAAAAXNSR0IArs4c6QAAFg9JREFUeNrtnfeTFcXaxw+ZBZacM0oGySBIXECiSBQQAQFhJaclo+SgAsuS2QVBlrCLSlQBAVGCCpK5XiW4vFVvvXX/gPvDe9+qt+r2Pd9eeuiZ6TkBzuI563erPgVn5jk93T397X76mTndPl+Qv0+v3I/PuHW/MiEkMkBTvnD/3vr883wZdx6NyriX9XXmvax/Zt57LAghkSbrn9AYtAbNBRTlwTuP22Tce/wbK42QFwc0B+0ZRXno9h8D/Ab/YkUR8qeI81/QoE2U++8+apF59/H/soII+RPxaxBaVLrMk3k36yYrhpBoEGfWTWjSl3H30ZusEEKiyK31a9IvzMfprAxCokmYj9N9B289/Acrg5DoAZr0Zdz54/9ZGYRE0Yjp16SPFUFI9EFhEkJhEkIoTEIoTEIIhUkIhUkIoTAJoTBZCYRQmIQQCpMQCpMQQmESQmESQihMQihMEsFfn2eJTad+ENvP/8z6iEIO3flDpHx9QWw5c1kcuv0o4vYxJcx1R06LPHnzSuJLlhLp13832jVt38myA/O27radT0pJtZ1v1qGLda5VQnfbOROVatay7Nt072W0KRRXRJSuUFG07NJNLE//wnb9es1bSZvqdeq78p588rxo0q6D/L7P55PEFYsXvUeOFXt/vudZN598eSqkumnbo4+0yV+goPyO83zF6jXl+b6jxwe8F60SXg9eTzWy62lx2n6RN18+eaxByzay09HTavJaR+s7i9PSjfWK7xcoVEiWrU6T5mL6J5uN5fK6Dy06dxPLPjts+86rr/cOW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QpM+/PkVehILGXvtQkwIyWFR+rUHDUKLPvU3c2NqpaSUnf+zYPtese3cj8Yt8AghkQdag+agPWgQWvTpf7OSU1/xn/jvOZtS5Q7GySfOibSLN+RehtiTgRASGaApaAsag9agOWgPGvSZ/makpFTwGxxK2pT6bxgTQnIWaA2ag/Z8wf5mJW9tNGfjjmX+L13w8yApJfUfhJAIAU35tQWNQWsmDf4HqpjHZRJqxUwAAAAASUVORK5CYII=") center center/contain no-repeat;
2240
- }
2241
-
2242
- .visa-mc-dis-cvc-preview {
2243
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAACOCAMAAAASE4S+AAAAAXNSR0IArs4c6QAAAadQTFRFAAAAzbFj+NyAyLNg+N2DzbRk+96CzrVj+96AzrNj+92By7Rl+92AzbRl/eCDzrRl/t+DzrVl/t+CzbVm/t+C3MFt3MFv/N2B/N6CzrRm/uCDzrRm/uCC7M93/N6CAAAAAQEBAgIBBAQCBQUDBwcECQgFDAsGDg0HEA4IEQ8JFRMLFxUMIBwQIR0RJSETKyYWLikYLyoYMCsZMSsZNC4bNzEcOTIdQDkhQTkhQzsiRT0jRj4kSkEmTEMnWE4tWU8uWk8uXFEvXVIwXlMwX1QxaV02bWA4bmE5cWQ6eGo+eWs+fW5Afm9Bi3pHjHtIkH9KmIZOmYdPnIlQnYpRo5BUppJVqJRWqpZXq5dYrJdYrZhZuaNfvaZhvqdiwKljwapjxK1lybFnyrJoy7NozrVm1Ltq171u2L5v2b9s2b9t2sBt3cNy3zEx3zIx38Rz4MVz4cZ04kI552NI6GVJ6Mx36s5368957dF674xb79J78NN78dV78tV789Z99Nd99dh+9rZv9th+9tl+99l/+duA+sx5+sx6+t2B+92B/N6B/d+C/uCD////AikOogAAAB90Uk5TACQkJSU9PT4+Q0NERJqav7/AwNjY4uLi4u7u8/P6+u6knPAAAAJkSURBVHja7d3pTxNBGMfxQbwAW06Pcj0tntQT8b7v+0JFxaserQcuKlQUFbFUaqvjH+1uG0lMfEETie4z39+bJ/tik/1kjt3MbDLGBFkWbeu0CtPZFq03v7KwxSpO04KKcmm7VZ32xeW2VK70nUF7tlj1afJnH+tA6k3UBWbUrHKBudJ0u8DsNtaJwIQJEyZMmDBhwoQJEyZMmPPCFCcCEyZMmDBhwoQJEyZMmDBhwoQJEyZMmDBhwoQJ010m+5swYcKECRMmTJgwYcKECRMmTJgwYcIMFfPHP8/vz5PLjnpzzmg2F07mxIhXVUYmwsjMVan0nbkQMrOeN1aY+zAsjHleNoRMf1x+rWa6KfjjM4RMvxdWN63+4QaYMGHC/EvM6b0HgpI6tvtoyq9vz+4/clcf89sJ2eiXIZGEyJD9sEl6RAa1MVPbpczsk8vT52SHHZCDUxelXxtzW/x4wPx+6cxn+0A2208PX9pB2aONef7xk3JrBjkth4Jysnf9fX1T0Czzmqx+6pcvcel/pJd5RRLXg1p6d0vWvdHKHJCeG2XljLVb5aZS5r2E3A6uTiUu2Km1klLK3CXxZDK5xd6RNYd3St+MTuaryr94G6y92iuy77X+b9rSi/d8usOEyZIXC5gsR7O5MN9bRexvwoQJEyZMmDBhwoQJEyZMmDBhwoT5vzNLLihLJu8CM2+6XGB2meUuMFeYyEf9ysmIqcsUtSuLmQZjGp8pdxafNxtjamIZ1f12MhOrDQ6uXhRLD4/nVb4/S/nx4XRsSeUY8prGtOI0186eKl8Xae3QSOxojTSUgT8BEvkXyqDHONgAAAAASUVORK5CYII=") center center/contain no-repeat;
2244
- }
2245
-
2246
- .submit-button-lock {
2247
- height: 15px;
2248
- margin-top: -2px;
2249
- margin-right: 7px;
2250
- vertical-align: middle;
2251
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAgCAMAAAA7dZg3AAAKQWlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUU9kWh8+9N73QEiIgJfQaegkg0jtIFQRRiUmAUAKGhCZ2RAVGFBEpVmRUwAFHhyJjRRQLg4Ji1wnyEFDGwVFEReXdjGsJ7601896a/cdZ39nnt9fZZ+9917oA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+OFvyn+tveV0auffnf7vWdiycTwa9HrmT9K3qi+OfrW9m3nZOjk03dp76anit6rvj/2gf2h+2P0x5Hp7E/4T5WfjT93fAn88ngmbWbm3/eE8/syOll+AAAAYFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////98JRy6AAAAH3RSTlMAAgYMEyIzOUpTVFViY3N2gJmcnaipq7fX3ebx+Pn8eTEuDQAAAI9JREFUKM/N0UkOglAQRdFHDyK90n64+9+lAyQgookjuaNKTlJJpaQlO2n6sW8SW/uCjrku2EloWDLhi3gDa4O3pTtA5Tt+BXDbiDsBmSQpAyZ3pRhoLUmS1QLxSilQPOcCSFfKgfxgPgfZ9ch7Y21LCcdd5wVH5SckEzkXc0ylpPJnMpETmX/d9eUpH1/5AKrsQVrz7YPBAAAAAElFTkSuQmCC") center center/contain no-repeat;
2252
- width: 14px;
2253
- display: inline-block;
2254
- }
2255
-
2256
- .align-middle {
2257
- vertical-align: middle;
2258
- }
2259
-
2260
- input {
2261
- box-shadow: none !important;
2262
- }
2263
-
2264
- .powerd-by-part {
2265
- display: flex;
2266
- font-size: 12px;
2267
- text-align: center;
2268
- align-items: center;
2269
- justify-content: center;
2270
- margin: 5px 0 20px 0;
2271
- }
2272
-
2273
- .powered-logo {
2274
- width: 18px;
2275
- height: auto;
2276
- float: right;
2277
- padding: 2px;
2278
- background: #000000;
2279
- border-radius: 4px;
2280
- margin-left: 5px;
2281
- }
2282
-
2283
- .comp-name {
2284
- display: block;
2285
- margin-bottom: 8px;
2286
- }
2287
-
2288
- .client-logo {
2289
- max-width: 140px;
2290
- display: block;
2291
- margin: auto;
2292
- padding: 5px;
2293
- }
2294
-
2295
- #qrCode {
2296
- text-align: center;
2297
- }
2298
-
2299
- #qrIcon {
2300
- cursor: pointer;
2301
- border: 1px solid rgb(252, 252, 252);
2302
- padding: 10px;
2303
- border-radius: 5px;
2304
- background: #ffffff;
2305
- }
2306
-
2307
- #target {
2308
- display: none;
2309
- text-align: center;
2310
- transition: all 5s;
2311
- padding: 5px;
2312
- transition: max-height 0.5s, overflow 0.5s 0.5s;
2313
- }
2314
-
2315
- /* input:focus {
2316
- border-color: #acc6db !important;
2317
- background-color: #acc6db !important;
2318
- } */
2319
-
2320
- @media(min-width:725px) {
2321
- .pay-main{margin: 0 auto !important;}
2322
- #modal-pay iframe{
2323
- max-height: 548px;
2324
- min-height: 548px;
2325
- }
2326
- .get-pay-pgs #modal-pay iframe{
2327
- max-height: 500px !important;
2328
- min-height: 500px !important;
2329
- }
2330
- #modal-pay .modal-header{
2331
- position: absolute;
2332
- right: 5px;
2333
- top: 15px;
2334
- z-index: 4;
2335
- }
2336
- /* #modal-pay .modal-body{
2337
- padding: 0 !important;
2338
- } */
2339
- }
2340
- @media(max-width:724px) {
2341
- #modal-pay iframe{
2342
- min-height: 708px !important;
2343
- }
2344
- #modal-pay iframe .modal-body{
2345
- padding:0 !important;
2346
- }
2347
- }
2348
- #modal-pay .modal-body{padding: 0;}
2349
- /* #modal-pay .modal-content{padding: 0 !important;} */
2350
- .pre-auth-pop .modal-header{position: relative; z-index: 4;}
2351
- .pre-auth-pop iframe{
2352
- margin-top: -60px;
2353
- }
2354
-
2355
- .form-control {
2356
- padding: .320rem .75rem !important;
2357
-
2358
- }
2359
- `);
2360
- }
2361
-
2362
- // src/app/components/Payment/Payment.tsx
2363
- function Payment() {
2364
- var _a;
2365
- const [state, setState] = useState6({
2366
- show: false,
2367
- publicKey: "",
2368
- sessionKey: "",
2369
- cardNumber: "",
2370
- year: "",
2371
- month: "",
2372
- cvv: "",
2373
- zip: "",
2374
- amount: ""
2375
- });
2376
- const [isValid, setIsValid] = useState6(false);
2377
- const [isValidMonth, setIsValidMonth] = useState6(false);
2378
- const [data, setData] = useState6(null);
2379
- const handlePaymentClick = async () => {
2380
- try {
2381
- const response = await fetch(`${baseUrl}generate-session`, {
2382
- method: "POST",
2383
- headers: {
2384
- "Content-Type": "application/json"
2385
- },
2386
- body: JSON.stringify({})
2387
- });
2388
- if (!response.ok) {
2389
- throw new Error("Network response was not ok");
2390
- }
2391
- const data2 = await response.json();
2392
- if (data2 && data2.result === true) {
2393
- setState((prev) => {
2394
- var _a2, _b;
2395
- return __spreadProps(__spreadValues({}, prev), {
2396
- show: true,
2397
- publicKey: (_a2 = data2 == null ? void 0 : data2.data) == null ? void 0 : _a2.publicKeyPem,
2398
- sessionKey: (_b = data2 == null ? void 0 : data2.data) == null ? void 0 : _b.session_key
2399
- });
2400
- });
2401
- }
2402
- } catch (error) {
2403
- console.log(error);
2404
- }
2405
- };
2406
- const handleSubmitPay = async () => {
2407
- const track2_data = `${state.cardNumber.replace(/\s+/g, "")}=${state.year}${state.month.length > 1 ? state.month : "0" + state.month} ${state.cvv}`;
2408
- const publicKey = forge.pki.publicKeyFromPem(state.publicKey);
2409
- const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
2410
- md: forge.md.sha1.create(),
2411
- mgf1: { md: forge.md.sha1.create() }
2412
- });
2413
- const encryptedBase64 = forge.util.encode64(encrypted);
2414
- console.log(encryptedBase64);
2415
- const requestBody = {
2416
- enc_track2_data: encryptedBase64,
2417
- session_key: state.sessionKey,
2418
- algorithm: "RSAES_OAEP_SHA_1"
2419
- };
2420
- const apiUrl = "https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize";
2421
- try {
2422
- const response = await fetch(apiUrl, {
2423
- method: "POST",
2424
- headers: {
2425
- "x-app-session-key": state == null ? void 0 : state.sessionKey,
2426
- "Content-Type": "application/json"
2427
- },
2428
- body: JSON.stringify(requestBody)
2429
- });
2430
- if (response.ok) {
2431
- toast3.success("Payment Successful");
2432
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2433
- show: false,
2434
- publicKey: "",
2435
- sessionKey: "",
2436
- cardNumber: "",
2437
- year: "",
2438
- month: "",
2439
- cvv: "",
2440
- zip: "",
2441
- amount: ""
2442
- }));
2443
- }
2444
- const responseData = await response.json();
2445
- console.log("response", responseData);
2446
- } catch (error) {
2447
- console.error("Error:", error);
2448
- }
2449
- };
2450
- const handleCardNumberChange = (e) => {
2451
- e.preventDefault();
2452
- const { value } = e.target;
2453
- const formattedValue = value.replace(/\D+/g, "").replace(/(.{4})/g, "$1 ").trim();
2454
- if (value.match(/[a-zA-Z]/)) {
2455
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2456
- cardNumber: formattedValue,
2457
- error: "Invalid input. Please enter only numbers."
2458
- }));
2459
- } else {
2460
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2461
- cardNumber: formattedValue,
2462
- error: null
2463
- }));
2464
- }
2465
- };
2466
- const handleMonthChange = (e) => {
2467
- setIsValid(false);
2468
- let value = e.target.value;
2469
- if (/^\d{0,2}$/.test(value) && (value === "" || parseInt(value, 10) >= 1 && parseInt(value, 10) <= 12)) {
2470
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2471
- month: value
2472
- }));
2473
- setIsValidMonth(false);
2474
- } else {
2475
- setIsValidMonth(true);
2476
- }
2477
- };
2478
- const handleYearChange = (e) => {
2479
- setIsValid(false);
2480
- setIsValidMonth(false);
2481
- let value = e.target.value;
2482
- if (/^\d{0,2}$/.test(value) && (value === "" || parseInt(value, 10) >= 0 && parseInt(value, 10) <= 99)) {
2483
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2484
- year: value
2485
- }));
2486
- }
2487
- };
2488
- const handleCVVChange = (e) => {
2489
- setIsValid(false);
2490
- setIsValidMonth(false);
2491
- let value = e.target.value;
2492
- if (/^\d{0,4}$/.test(value)) {
2493
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2494
- cvv: value
2495
- }));
2496
- }
2497
- };
2498
- const handleZIP = (e) => {
2499
- setIsValid(false);
2500
- setIsValidMonth(false);
2501
- let value = e.target.value;
2502
- if (/^\d{0,7}$/.test(value)) {
2503
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2504
- zip: value
2505
- }));
2506
- }
2507
- };
2508
- const handleAmount = (e) => {
2509
- setIsValid(false);
2510
- setIsValidMonth(false);
2511
- let value = e.target.value;
2512
- value = value.replace(/[^0-9.]/g, "");
2513
- let parts = value.split(".");
2514
- if (parts.length > 2) {
2515
- parts = [parts.shift(), parts.join(".")];
2516
- value = parts.join("");
2517
- }
2518
- if (parts.length === 2 && parts[1].length > 2) {
2519
- value = `${parts[0]}.${parts[1].slice(0, 2)}`;
2520
- }
2521
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2522
- amount: value
2523
- }));
2524
- };
2525
- const handleAmountBlur = () => {
2526
- const value = state.amount;
2527
- if (value && !value.includes(".")) {
2528
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
2529
- amount: `${value}.00`
2530
- }));
2531
- }
2532
- };
2533
- function amountFormat(amt) {
2534
- if (amt) {
2535
- return `${parseFloat(amt).toLocaleString("en-US", {
2536
- minimumFractionDigits: 2,
2537
- maximumFractionDigits: 2
2538
- })}`;
2539
- }
2540
- return "";
2541
- }
2542
- return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(Paymentstyles, null), /* @__PURE__ */ React12.createElement("div", { className: "" }, /* @__PURE__ */ React12.createElement(
2543
- "button",
2544
- {
2545
- className: "export-btn",
2546
- style: { width: "83px" },
2547
- onClick: () => handlePaymentClick()
2548
- },
2549
- "Payment"
2550
- ), /* @__PURE__ */ React12.createElement(
2551
- Modal5,
2552
- {
2553
- show: state.show,
2554
- onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
2555
- show: false
2556
- })),
2557
- centered: true
2558
- },
2559
- /* @__PURE__ */ React12.createElement(Modal5.Header, { closeButton: true }),
2560
- /* @__PURE__ */ React12.createElement(Modal5.Body, null, /* @__PURE__ */ React12.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ React12.createElement("div", { className: "row" }, /* @__PURE__ */ React12.createElement("div", { className: "" }, /* @__PURE__ */ React12.createElement("div", { id: "Checkout", className: "inline" }, /* @__PURE__ */ React12.createElement("div", { className: "header" }, /* @__PURE__ */ React12.createElement("h1", null, "Pay")), /* @__PURE__ */ React12.createElement("form", { id: "PaymentForm", className: "payment-form" }, /* @__PURE__ */ React12.createElement("div", { className: "form-group", style: { display: "none" } }, /* @__PURE__ */ React12.createElement("label", null, "Payment amount"), /* @__PURE__ */ React12.createElement("div", { className: "input-group" }, /* @__PURE__ */ React12.createElement("span", { className: "input-group-addon" }, "$"), /* @__PURE__ */ React12.createElement(
2561
- "input",
2562
- {
2563
- type: "text",
2564
- name: "amount",
2565
- value: "1",
2566
- className: "form-control",
2567
- id: ""
2568
- }
2569
- )), /* @__PURE__ */ React12.createElement(
2570
- "span",
2571
- {
2572
- id: "amount-error",
2573
- style: { color: "red", display: "none" }
2574
- }
2575
- )), /* @__PURE__ */ React12.createElement("div", { className: "form-group" }, /* @__PURE__ */ React12.createElement("label", null, "Name on card"), /* @__PURE__ */ React12.createElement(
2576
- "input",
2577
- {
2578
- id: "NameOnCard",
2579
- className: "form-control required",
2580
- type: "text",
2581
- maxLength: 100,
2582
- placeholder: "Name"
2583
- }
2584
- ), /* @__PURE__ */ React12.createElement(
2585
- "span",
2586
- {
2587
- id: "NameOnCard-error",
2588
- style: { color: "red", display: "none" }
2589
- }
2590
- )), /* @__PURE__ */ React12.createElement("div", { className: "form-group" }, /* @__PURE__ */ React12.createElement(
2591
- "input",
2592
- {
2593
- "data-token": "card_number",
2594
- className: "null card-image form-control required",
2595
- type: "text",
2596
- maxLength: 19,
2597
- value: state.cardNumber,
2598
- placeholder: "0000 0000 0000 0000",
2599
- onChange: handleCardNumberChange
2600
- }
2601
- ), state.error && /* @__PURE__ */ React12.createElement("div", { style: { color: "red" } }, state.error)), /* @__PURE__ */ React12.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ React12.createElement(
2602
- "input",
2603
- {
2604
- "data-token": "exp_month",
2605
- className: "form-control required",
2606
- type: "text",
2607
- placeholder: "MM",
2608
- value: state.month,
2609
- maxLength: 2,
2610
- onChange: (e) => handleMonthChange(e)
2611
- }
2612
- ), isValidMonth && /* @__PURE__ */ React12.createElement(
2613
- "span",
2614
- {
2615
- id: "card_number-error",
2616
- style: { color: "red", fontSize: "15px" }
2617
- },
2618
- (_a = ErrorText) == null ? void 0 : _a.montherror
2619
- )), /* @__PURE__ */ React12.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ React12.createElement(
2620
- "input",
2621
- {
2622
- "data-token": "exp_year",
2623
- className: "form-control required",
2624
- type: "text",
2625
- placeholder: "YY",
2626
- maxLength: 2,
2627
- value: state.year,
2628
- onChange: (e) => handleYearChange(e)
2629
- }
2630
- ), state.yearError && /* @__PURE__ */ React12.createElement("span", { id: "exp_year-error", style: { color: "red" } }, state.yearError)), /* @__PURE__ */ React12.createElement("div", { className: "security-code-group form-group" }, /* @__PURE__ */ React12.createElement("div", { className: "input-container" }, /* @__PURE__ */ React12.createElement(
2631
- "input",
2632
- {
2633
- "data-token": "cvv",
2634
- className: "form-control required",
2635
- type: "text",
2636
- maxLength: 4,
2637
- value: state.cvv,
2638
- placeholder: "CVV",
2639
- onChange: (e) => handleCVVChange(e)
2640
- }
2641
- ), /* @__PURE__ */ React12.createElement("i", { id: "cvc", className: "fa fa-question-circle" }), state.cvvError && /* @__PURE__ */ React12.createElement("span", { id: "cvv-error", style: { color: "red" } }, state.cvvError)), /* @__PURE__ */ React12.createElement("div", { className: "cvc-preview-container two-card hide" }, /* @__PURE__ */ React12.createElement("div", { className: "amex-cvc-preview" }), /* @__PURE__ */ React12.createElement("div", { className: "visa-mc-dis-cvc-preview" }))), /* @__PURE__ */ React12.createElement("div", { className: "zip-code-group form-group" }, /* @__PURE__ */ React12.createElement("label", null, "Postal code"), /* @__PURE__ */ React12.createElement("div", { className: "input-container" }, /* @__PURE__ */ React12.createElement(
2642
- "input",
2643
- {
2644
- id: "ZIPCode",
2645
- className: "form-control required",
2646
- name: "zip",
2647
- type: "text",
2648
- maxLength: 7,
2649
- placeholder: "000000",
2650
- value: state.zip,
2651
- onChange: (e) => handleZIP(e)
2652
- }
2653
- ), /* @__PURE__ */ React12.createElement(
2654
- "a",
2655
- {
2656
- tabIndex: 0,
2657
- role: "button",
2658
- "data-toggle": "popover",
2659
- "data-trigger": "focus",
2660
- "data-placement": "left",
2661
- "data-content": "Enter the ZIP/Postal code for your credit card billing address."
2662
- },
2663
- /* @__PURE__ */ React12.createElement("i", { className: "fa fa-question-circle" })
2664
- ), /* @__PURE__ */ React12.createElement(
2665
- "span",
2666
- {
2667
- id: "ZIPCode-error",
2668
- style: { color: "red", display: "none" }
2669
- },
2670
- ErrorText.fieldrequired
2671
- ))), /* @__PURE__ */ React12.createElement("div", { className: "form-group top-amnt" }, /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("label", null, "Payment amount"), /* @__PURE__ */ React12.createElement("div", { className: "amount-placeholder" }, /* @__PURE__ */ React12.createElement(
2672
- "input",
2673
- {
2674
- id: "Amount",
2675
- className: "form-control required",
2676
- name: "amount",
2677
- type: "text",
2678
- placeholder: "",
2679
- value: state.amount,
2680
- onChange: (e) => handleAmount(e),
2681
- onBlur: handleAmountBlur
2682
- }
2683
- ))), /* @__PURE__ */ React12.createElement("div", { className: "card-row" }, /* @__PURE__ */ React12.createElement("span", { className: "visa" }), /* @__PURE__ */ React12.createElement("span", { className: "mastercard" }), /* @__PURE__ */ React12.createElement("span", { className: "amex" }), /* @__PURE__ */ React12.createElement("span", { className: "discover" }))), /* @__PURE__ */ React12.createElement(
2684
- "button",
2685
- {
2686
- type: "button",
2687
- id: "submitButton",
2688
- onClick: () => handleSubmitPay(),
2689
- className: "btn btn-block btn-success submit-button"
2690
- },
2691
- "Pay"
2692
- )), /* @__PURE__ */ React12.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ React12.createElement(
2693
- "svg",
2694
- {
2695
- xmlns: "http://www.w3.org/2000/svg",
2696
- width: "20",
2697
- height: "20",
2698
- viewBox: "0 0 26 26"
2699
- },
2700
- /* @__PURE__ */ React12.createElement(
2701
- "path",
2702
- {
2703
- fill: "currentColor",
2704
- 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"
2705
- }
2706
- )
2707
- ), "Secure payments powered by Fractal", /* @__PURE__ */ React12.createElement(
2708
- "img",
2709
- {
2710
- src: "https://ui.fractalpay.com/favicon.ico",
2711
- alt: "Fractal logo",
2712
- className: "powered-logo"
2713
- }
2714
- )))))))
1137
+ /* @__PURE__ */ React7.createElement("div", { className: "fractal-popup-content", style: { padding: "0px" } }, /* @__PURE__ */ React7.createElement("div", { className: "request-payment-success-container" }, /* @__PURE__ */ React7.createElement("span", { className: "request-payment-close-popup", onClick: handleCloseConfirmationModal }, /* @__PURE__ */ React7.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ React7.createElement("g", { "clip-path": "url(#clip0_12425_52336)" }, /* @__PURE__ */ React7.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__ */ React7.createElement("defs", null, /* @__PURE__ */ React7.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ React7.createElement("rect", { width: "16", height: "16", fill: "white" }))))), /* @__PURE__ */ React7.createElement("div", { className: "request-payment-success-tick-div" }, /* @__PURE__ */ React7.createElement("div", { className: "request-payment-success-tick" }, /* @__PURE__ */ React7.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ React7.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__ */ React7.createElement("h6", { className: "request-payment-success-text" }, "The request ", /* @__PURE__ */ React7.createElement("br", null), "was sent"), /* @__PURE__ */ React7.createElement("h6", { className: "request-payment-success-subtext" }, "Please wait for the customer to pay"), /* @__PURE__ */ React7.createElement("div", { className: "request-payment-success-btn-div" }, /* @__PURE__ */ React7.createElement("button", { onClick: handleCloseConfirmationModal, className: "request-payment-success-btn2" }, "Close"))))
2715
1138
  )));
2716
1139
  }
2717
-
2718
- // src/app/components/Transaction/CompletedTransactions.tsx
2719
- import React14, { useEffect as useEffect3, useState as useState8 } from "react";
2720
- import { Col, Row, Table } from "react-bootstrap";
2721
- import {
2722
- DatatableWrapper,
2723
- Filter,
2724
- PaginationOptions,
2725
- TableBody,
2726
- TableHeader
2727
- } from "react-bs-datatable";
2728
- import DatePicker from "react-datepicker";
2729
- import "react-datepicker/dist/react-datepicker.css";
2730
- import { toast as toast4 } from "react-toastify";
2731
-
2732
- // src/app/components/Pagination/Pagination.tsx
2733
- import React13, { useState as useState7, useEffect as useEffect2 } from "react";
2734
- function PaginationPg({ totalPages, onPageChange, current }) {
2735
- const [currentPage, setCurrentPage] = useState7(current);
2736
- const [showPages, setShowPages] = useState7(false);
2737
- useEffect2(() => {
2738
- setCurrentPage(current);
2739
- }, [current]);
2740
- useEffect2(() => {
2741
- setTimeout(() => {
2742
- setShowPages(true);
2743
- }, 1e3);
2744
- }, []);
2745
- const handlePrevious = (e) => {
2746
- e.preventDefault();
2747
- if (currentPage > 1) {
2748
- const newPage = currentPage - 1;
2749
- setCurrentPage(newPage);
2750
- onPageChange(newPage);
2751
- }
2752
- };
2753
- const handleNext = (e) => {
2754
- e.preventDefault();
2755
- if (currentPage < totalPages) {
2756
- const newPage = currentPage + 1;
2757
- setCurrentPage(newPage);
2758
- onPageChange(newPage);
2759
- }
2760
- };
2761
- const handlePageClick = (e, pageNumber) => {
2762
- e.preventDefault();
2763
- setCurrentPage(pageNumber);
2764
- onPageChange(pageNumber);
2765
- };
2766
- const getPageNumbers = () => {
2767
- const pageNumbers = [];
2768
- if (totalPages <= 5) {
2769
- for (let i = 1; i <= totalPages; i++) {
2770
- pageNumbers.push(renderPageNumber(i));
2771
- }
2772
- } else {
2773
- if (currentPage > 3) {
2774
- pageNumbers.push(renderPageNumber(1));
2775
- if (currentPage > 4) {
2776
- pageNumbers.push(/* @__PURE__ */ React13.createElement("li", { key: "start-break", className: "page-item disabled" }, /* @__PURE__ */ React13.createElement("span", { className: "page-link" }, "...")));
2777
- }
2778
- }
2779
- const startPage = Math.max(currentPage - 1, 1);
2780
- const endPage = Math.min(startPage + 2, totalPages);
2781
- for (let i = startPage; i <= endPage; i++) {
2782
- pageNumbers.push(renderPageNumber(i));
2783
- }
2784
- if (currentPage < totalPages - 2) {
2785
- if (currentPage < totalPages - 3) {
2786
- pageNumbers.push(/* @__PURE__ */ React13.createElement("li", { key: "end-break", className: "page-item disabled" }, /* @__PURE__ */ React13.createElement("span", { className: "page-link" }, "...")));
2787
- }
2788
- pageNumbers.push(renderPageNumber(totalPages));
2789
- }
2790
- }
2791
- return pageNumbers;
2792
- };
2793
- const renderPageNumber = (pageNumber) => /* @__PURE__ */ React13.createElement("li", { key: pageNumber, className: `page-item ${currentPage === pageNumber ? "active" : ""}` }, /* @__PURE__ */ React13.createElement("a", { className: "page-link cursor-pointer", onClick: (e) => handlePageClick(e, pageNumber) }, pageNumber));
2794
- return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement("nav", { className: "app-pagination py-2" }, /* @__PURE__ */ React13.createElement("ul", { className: "pagination justify-content-center" }, /* @__PURE__ */ React13.createElement("li", { className: `page-item ${currentPage === 1 ? "disabled" : ""}` }, /* @__PURE__ */ React13.createElement("a", { className: "page-link cursor-pointer", onClick: handlePrevious }, /* @__PURE__ */ React13.createElement("span", null, "\u2B9C"))), showPages && getPageNumbers(), /* @__PURE__ */ React13.createElement("li", { className: `page-item ${currentPage === totalPages ? "disabled" : ""}` }, /* @__PURE__ */ React13.createElement("a", { className: "page-link cursor-pointer", onClick: handleNext }, /* @__PURE__ */ React13.createElement("span", null, "\u2B9E"))))));
2795
- }
2796
-
2797
- // src/app/components/Transaction/CompletedTransactions.tsx
2798
- var STORY_HEADERS = [
2799
- {
2800
- prop: "Date",
2801
- title: "Date",
2802
- isSortable: true
2803
- },
2804
- {
2805
- prop: "Name",
2806
- isFilterable: true,
2807
- title: "Name",
2808
- isSortable: true
2809
- },
2810
- {
2811
- prop: "lastFourDigits",
2812
- title: "Last 4",
2813
- isSortable: true
2814
- },
2815
- {
2816
- prop: "cardType",
2817
- title: "Brand",
2818
- isSortable: true
2819
- },
2820
- {
2821
- prop: "Amount",
2822
- title: "Amount",
2823
- isSortable: true
2824
- },
2825
- {
2826
- prop: "Net",
2827
- title: "Net",
2828
- isSortable: true
2829
- }
2830
- ];
2831
- function CompletedTransactions(props) {
2832
- const [dataList, setDataList] = useState8([]);
2833
- const [startDate, setStartDate] = useState8(null);
2834
- const [endDate, setEndDate] = useState8(null);
2835
- const [state, setState] = useState8({
2836
- page: 1,
2837
- totalPage: 0,
2838
- data: [],
2839
- csvData: false
2840
- });
2841
- const formatDate = (inputDate) => {
2842
- if (!inputDate) return "";
2843
- const date = new Date(inputDate);
2844
- const month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1;
2845
- const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate();
2846
- return `${date.getFullYear()}-${month}-${day}`;
2847
- };
2848
- const downloadStringAsCSV = (name, content) => {
2849
- const csvContent = convertArrayOfObjectsToCSV(content);
2850
- const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
2851
- const a = document.createElement("a");
2852
- a.href = URL.createObjectURL(blob);
2853
- a.download = name;
2854
- document.body.appendChild(a);
2855
- a.click();
2856
- document.body.removeChild(a);
2857
- };
2858
- const convertArrayOfObjectsToCSV = (array) => {
2859
- const headers = Object.keys(array[0]);
2860
- const csvRows = [];
2861
- csvRows.push(headers.join(","));
2862
- for (const obj of array) {
2863
- const values = headers.map((header) => obj[header]);
2864
- csvRows.push(values.join(","));
2865
- }
2866
- return csvRows.join("\n");
2867
- };
2868
- const fetchData = async (newPage, startDate2, endDate2) => {
2869
- var _a, _b;
2870
- try {
2871
- const response = await fetch(`${baseUrl}get-complete-request-payments`, {
2872
- method: "POST",
2873
- headers: {
2874
- "Content-Type": "application/json"
2875
- },
2876
- body: JSON.stringify({
2877
- fractalpayPublicKey: props.fractalpayClientKey,
2878
- page: newPage,
2879
- dateStart: startDate2 ? formatDate(startDate2) : "",
2880
- dateEnd: endDate2 ? formatDate(endDate2) : ""
2881
- })
2882
- });
2883
- if (!response.ok) {
2884
- throw new Error(`HTTP error! status: ${response.status}`);
2885
- }
2886
- const data = await response.json();
2887
- setState((prev) => {
2888
- var _a2;
2889
- return __spreadProps(__spreadValues({}, prev), { totalPage: (_a2 = data == null ? void 0 : data.data) == null ? void 0 : _a2.totalPage });
2890
- });
2891
- if (data && (data == null ? void 0 : data.result) === true) {
2892
- const result = ((_b = (_a = data == null ? void 0 : data.data) == null ? void 0 : _a.allPaymentTransaction) != null ? _b : []).map((item) => ({
2893
- Date: formatDate(item == null ? void 0 : item.Date),
2894
- Name: item == null ? void 0 : item.Name,
2895
- lastFourDigits: item == null ? void 0 : item.lastFourDigits,
2896
- cardType: item == null ? void 0 : item.cardType,
2897
- Amount: `$${parseFloat(item == null ? void 0 : item.Amount).toLocaleString("en-US", { maximumFractionDigits: 2 })}`,
2898
- Net: `$${parseFloat(item == null ? void 0 : item.Net).toLocaleString("en-US", { maximumFractionDigits: 2 })}`
2899
- }));
2900
- if (state.csvData) {
2901
- downloadStringAsCSV("transaction.csv", result);
2902
- setState((prev) => {
2903
- var _a2;
2904
- return __spreadProps(__spreadValues({}, prev), { data: (_a2 = data == null ? void 0 : data.data) == null ? void 0 : _a2.allPaymentTransaction, csvData: false });
2905
- });
2906
- }
2907
- setDataList(result);
2908
- } else {
2909
- console.log("No data available");
2910
- }
2911
- } catch (error) {
2912
- console.log(error);
2913
- }
2914
- };
2915
- const handleStartDateChange = (date) => {
2916
- setStartDate(date);
2917
- };
2918
- const handleEndDateChange = (date) => {
2919
- setEndDate(date);
2920
- };
2921
- const handleExport = async () => {
2922
- if (!startDate) {
2923
- toast4.error("Start date required");
2924
- } else if (!endDate) {
2925
- toast4.error("End date required");
2926
- } else {
2927
- setState((prev) => __spreadProps(__spreadValues({}, prev), { csvData: true }));
2928
- try {
2929
- const response = await fetch(`${baseUrl}get-complete-request-payments`, {
2930
- method: "POST",
2931
- headers: {
2932
- "Content-Type": "application/json"
2933
- },
2934
- body: JSON.stringify({
2935
- fractalpayPublicKey: props.fractalpayClientKey,
2936
- dateStart: startDate ? formatDate(startDate) : "",
2937
- dateEnd: endDate ? formatDate(endDate) : "",
2938
- isExport: true
2939
- })
2940
- });
2941
- if (!response.ok) {
2942
- throw new Error(`HTTP error! status: ${response.status}`);
2943
- }
2944
- const data = await response.json();
2945
- if (data.status) {
2946
- const link = document.createElement("a");
2947
- link.href = `${data == null ? void 0 : data.data}`;
2948
- link.target = "_blank";
2949
- document.body.appendChild(link);
2950
- link.click();
2951
- document.body.removeChild(link);
2952
- }
2953
- } catch (error) {
2954
- console.log(error);
2955
- }
2956
- }
2957
- };
2958
- useEffect3(() => {
2959
- fetchData(state.page, startDate, endDate);
2960
- }, [state.page]);
2961
- const handlePageChange = (pageNumber) => {
2962
- setState((prev) => __spreadProps(__spreadValues({}, prev), { page: pageNumber }));
2963
- fetchData(pageNumber, startDate, endDate);
2964
- };
2965
- return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("style", null, `
2966
- .react-datepicker-wrapper:first-child {
2967
- margin-right: 10px;
2968
- }
2969
- `), /* @__PURE__ */ React14.createElement("div", { className: "mb-5" }, /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ React14.createElement("div", { style: { display: "flex", marginRight: "10px", marginTop: "25px" } }, /* @__PURE__ */ React14.createElement(
2970
- DatePicker,
2971
- {
2972
- selected: startDate,
2973
- onChange: handleStartDateChange,
2974
- selectsStart: true,
2975
- startDate,
2976
- endDate,
2977
- placeholderText: "Start Date",
2978
- required: true
2979
- }
2980
- ), /* @__PURE__ */ React14.createElement(
2981
- DatePicker,
2982
- {
2983
- selected: endDate,
2984
- onChange: handleEndDateChange,
2985
- selectsEnd: true,
2986
- startDate,
2987
- endDate,
2988
- minDate: startDate,
2989
- placeholderText: "End Date"
2990
- }
2991
- )), /* @__PURE__ */ React14.createElement("button", { className: "export-btn1", onClick: handleExport }, "Export")), /* @__PURE__ */ React14.createElement(
2992
- DatatableWrapper,
2993
- {
2994
- body: dataList,
2995
- headers: STORY_HEADERS,
2996
- paginationOptionsProps: {
2997
- initialState: {
2998
- rowsPerPage: 10,
2999
- options: [5, 10, 15, 20]
3000
- }
3001
- }
3002
- },
3003
- /* @__PURE__ */ React14.createElement(Row, { className: "mb-4 p-2" }, /* @__PURE__ */ React14.createElement(Col, { xs: 12, sm: 6, lg: 4, className: "d-flex flex-col justify-content-lg-start align-items-center justify-content-sm-start mb-2 mb-sm-0" }, /* @__PURE__ */ React14.createElement(PaginationOptions, null)), /* @__PURE__ */ React14.createElement(Col, { xs: 12, lg: 4, className: "d-flex flex-col justify-content-end align-items-end" }), /* @__PURE__ */ React14.createElement(Col, { xs: 12, sm: 6, lg: 4, className: "d-flex flex-col justify-content-end align-items-end" }, /* @__PURE__ */ React14.createElement(Filter, null))),
3004
- /* @__PURE__ */ React14.createElement(Row, null, /* @__PURE__ */ React14.createElement("div", { className: "responsive-tbl" }, /* @__PURE__ */ React14.createElement(Table, null, /* @__PURE__ */ React14.createElement(TableHeader, null), /* @__PURE__ */ React14.createElement(TableBody, null)))),
3005
- /* @__PURE__ */ React14.createElement(PaginationPg, { totalPages: state.totalPage, onPageChange: handlePageChange, current: state.page })
3006
- ))));
3007
- }
3008
-
3009
- // src/app/components/Payment/TockenizPay.tsx
3010
- import React15, { useState as useState9 } from "react";
3011
- import { Modal as Modal6 } from "react-bootstrap";
3012
- import { toast as toast5, ToastContainer as ToastContainer3 } from "react-toastify";
3013
- import forge2 from "node-forge";
3014
- import creditCardType from "credit-card-type";
3015
- function TockenizPay() {
3016
- const [state, setState] = useState9({
3017
- show: false,
3018
- publicKey: "",
3019
- sessionKey: "",
3020
- cardNumber: "",
3021
- year: "",
3022
- month: "",
3023
- cvv: "",
3024
- zip: "",
3025
- amount: ""
3026
- });
3027
- const [cardTypeDetail, setCardTypeDetail] = useState9(null);
3028
- const [isValid, setIsValid] = useState9(false);
3029
- const [isValidMonth, setIsValidMonth] = useState9(false);
3030
- const [data, setData] = useState9(null);
3031
- const handlePaymentClick = async () => {
3032
- try {
3033
- const response = await fetch(`${baseUrl}/generate-session`, {
3034
- method: "POST",
3035
- headers: {
3036
- "Content-Type": "application/json"
3037
- },
3038
- body: JSON.stringify({})
3039
- });
3040
- if (!response.ok) {
3041
- throw new Error("Network response was not ok");
3042
- }
3043
- const data2 = await response.json();
3044
- if (data2 && data2.result === true) {
3045
- setState((prev) => {
3046
- var _a, _b;
3047
- return __spreadProps(__spreadValues({}, prev), {
3048
- show: true,
3049
- publicKey: (_a = data2 == null ? void 0 : data2.data) == null ? void 0 : _a.publicKeyPem,
3050
- sessionKey: (_b = data2 == null ? void 0 : data2.data) == null ? void 0 : _b.session_key
3051
- });
3052
- });
3053
- }
3054
- } catch (error) {
3055
- console.log(error);
3056
- }
3057
- };
3058
- const handleSubmitPay = async () => {
3059
- var _a, _b, _c;
3060
- 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}`;
3061
- const publicKey = forge2.pki.publicKeyFromPem(state.publicKey);
3062
- const encrypted = publicKey.encrypt(track2_data, "RSA-OAEP", {
3063
- md: forge2.md.sha1.create(),
3064
- mgf1: {
3065
- md: forge2.md.sha1.create()
3066
- }
3067
- });
3068
- const encryptedBase64 = forge2.util.encode64(encrypted);
3069
- console.log(encryptedBase64);
3070
- const requestBody = {
3071
- enc_track2_data: encryptedBase64,
3072
- session_key: state.sessionKey,
3073
- algorithm: "RSAES_OAEP_SHA_1"
3074
- };
3075
- try {
3076
- const response = await fetch(
3077
- "https://m1ao5pku8b.execute-api.us-east-2.amazonaws.com/prod/tokenizer/tokenize",
3078
- {
3079
- method: "POST",
3080
- headers: {
3081
- "x-app-session-key": state == null ? void 0 : state.sessionKey,
3082
- "Content-Type": "application/json"
3083
- },
3084
- body: JSON.stringify(requestBody)
3085
- }
3086
- );
3087
- if (!response.ok) {
3088
- const errorData = await response.json();
3089
- throw new Error(((_c = errorData == null ? void 0 : errorData.data) == null ? void 0 : _c.message) || "Request failed");
3090
- }
3091
- const responseData = await response.json();
3092
- toast5.success("Payment Successful");
3093
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3094
- show: false,
3095
- publicKey: "",
3096
- sessionKey: "",
3097
- cardNumber: "",
3098
- year: "",
3099
- month: "",
3100
- cvv: "",
3101
- zip: "",
3102
- amount: ""
3103
- }));
3104
- console.log("response", responseData);
3105
- } catch (error) {
3106
- toast5.error((error == null ? void 0 : error.message) || "An error occurred");
3107
- console.error("Error:", error);
3108
- }
3109
- };
3110
- const formatCreditCardNumber = (cardNumber, cardType) => {
3111
- const cleanNumber = cardNumber.replace(/\D+/g, "");
3112
- let formattedValue;
3113
- switch (cardType) {
3114
- case "visa":
3115
- case "mastercard":
3116
- case "Discover":
3117
- case "JCB":
3118
- formattedValue = cleanNumber.replace(/(.{4})/g, "$1 ").trim();
3119
- break;
3120
- case "american-express":
3121
- formattedValue = cleanNumber.replace(/(\d{4})(\d{6})(\d{5})/, "$1 $2 $3");
3122
- break;
3123
- case "diners-club":
3124
- formattedValue = cleanNumber.replace(/(\d{4})(\d{6})(\d{4})/, "$1 $2 $3");
3125
- break;
3126
- case "maestro":
3127
- formattedValue = cleanNumber.length <= 19 ? cleanNumber.replace(/(.{4})/g, "$1 ").trim() : cleanNumber;
3128
- break;
3129
- default:
3130
- formattedValue = cleanNumber;
3131
- }
3132
- return formattedValue;
3133
- };
3134
- const handleCardNumberChange = (e) => {
3135
- e.preventDefault();
3136
- e.stopPropagation();
3137
- const { value } = e.target;
3138
- let cardtyp = creditCardType(value)[0];
3139
- const formattedValue = formatCreditCardNumber(value, cardtyp == null ? void 0 : cardtyp.type);
3140
- setCardTypeDetail(creditCardType(value)[0]);
3141
- console.log(formattedValue);
3142
- if (value.match(/[a-zA-Z]/)) {
3143
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3144
- cardNumber: formattedValue,
3145
- error: "Invalid input. Please enter only numbers."
3146
- }));
3147
- } else {
3148
- handleCardNumLength("");
3149
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3150
- cardNumber: formattedValue,
3151
- error: null
3152
- }));
3153
- }
3154
- };
3155
- function handleCardNumLength(cardType) {
3156
- const cardLengths = {
3157
- "Visa": 16,
3158
- "MasterCard": 16,
3159
- "AmericanExpress": 15,
3160
- "Discover": 16,
3161
- "DinersClub": 14,
3162
- "JCB": 16
3163
- };
3164
- return cardLengths[cardType] || "Unknown card type";
3165
- }
3166
- const handleMonthChange = (e) => {
3167
- setIsValid(false);
3168
- let value = e.target.value;
3169
- if (/^\d{0,2}$/.test(value) && (value === "" || parseInt(value, 10) >= 1 && parseInt(value, 10) <= 12)) {
3170
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3171
- month: value
3172
- }));
3173
- setIsValidMonth(false);
3174
- } else {
3175
- setIsValidMonth(true);
3176
- }
3177
- };
3178
- const handleYearChange = (e) => {
3179
- setIsValid(false);
3180
- setIsValidMonth(false);
3181
- let value = e.target.value;
3182
- if (/^\d{0,2}$/.test(value) && (value === "" || parseInt(value, 10) >= 0 && parseInt(value, 10) <= 99)) {
3183
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3184
- year: value
3185
- }));
3186
- }
3187
- };
3188
- const handleCVVChange = (e) => {
3189
- setIsValid(false);
3190
- setIsValidMonth(false);
3191
- let value = e.target.value;
3192
- if (/^\d{0,4}$/.test(value)) {
3193
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3194
- cvv: value
3195
- }));
3196
- }
3197
- };
3198
- const handleZIP = (e) => {
3199
- setIsValid(false);
3200
- setIsValidMonth(false);
3201
- let value = e.target.value;
3202
- if (/^\d{0,7}$/.test(value)) {
3203
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3204
- zip: value
3205
- }));
3206
- }
3207
- };
3208
- const handleAmount = (e) => {
3209
- setIsValid(false);
3210
- setIsValidMonth(false);
3211
- let value = e.target.value;
3212
- value = value.replace(/[^0-9.]/g, "");
3213
- let parts = value.split(".");
3214
- if (parts.length > 2) {
3215
- parts = [parts.shift(), parts.join(".")];
3216
- value = parts.join("");
3217
- }
3218
- if (parts.length === 2 && parts[1].length > 2) {
3219
- value = `${parts[0]}.${parts[1].slice(0, 2)}`;
3220
- }
3221
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3222
- amount: value
3223
- }));
3224
- };
3225
- const handleAmountBlur = () => {
3226
- const value = state.amount;
3227
- if (value && !value.includes(".")) {
3228
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
3229
- amount: `${value}.00`
3230
- }));
3231
- }
3232
- };
3233
- function amountFormat(amt) {
3234
- if (amt) {
3235
- return `${parseFloat(amt).toLocaleString("en-US", {
3236
- minimumFractionDigits: 2,
3237
- maximumFractionDigits: 2
3238
- })}`;
3239
- }
3240
- return "";
3241
- }
3242
- return /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(ToastContainer3, null), /* @__PURE__ */ React15.createElement(
3243
- "button",
3244
- {
3245
- className: "export-btn mt-4",
3246
- style: { width: "100px" },
3247
- onClick: () => handlePaymentClick()
3248
- },
3249
- "TokenizePay"
3250
- ), /* @__PURE__ */ React15.createElement(
3251
- Modal6,
3252
- {
3253
- show: state.show,
3254
- onHide: () => setState((prev) => __spreadProps(__spreadValues({}, prev), {
3255
- show: false
3256
- })),
3257
- centered: true
3258
- },
3259
- /* @__PURE__ */ React15.createElement(Modal6.Header, { closeButton: true }),
3260
- /* @__PURE__ */ React15.createElement(Modal6.Body, null, /* @__PURE__ */ React15.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ React15.createElement("div", { className: "row" }, /* @__PURE__ */ React15.createElement("div", { className: "" }, /* @__PURE__ */ React15.createElement("div", { id: "Checkout", className: "inline" }, /* @__PURE__ */ React15.createElement("div", { className: "header" }, /* @__PURE__ */ React15.createElement("h1", null, "Pay")), /* @__PURE__ */ React15.createElement("form", { id: "PaymentForm", className: "payment-form" }, /* @__PURE__ */ React15.createElement("div", { className: "form-group" }, /* @__PURE__ */ React15.createElement("label", null, "Name on card"), /* @__PURE__ */ React15.createElement(
3261
- "input",
3262
- {
3263
- id: "NameOnCard",
3264
- className: "form-control required",
3265
- type: "text",
3266
- maxLength: 100,
3267
- placeholder: "Name"
3268
- }
3269
- ), /* @__PURE__ */ React15.createElement(
3270
- "span",
3271
- {
3272
- id: "NameOnCard-error",
3273
- style: { color: "red", display: "none" }
3274
- }
3275
- )), /* @__PURE__ */ React15.createElement("div", { className: "form-group" }, /* @__PURE__ */ React15.createElement(
3276
- "input",
3277
- {
3278
- "data-token": "card_number",
3279
- className: "null card-image form-control required",
3280
- type: "text",
3281
- maxLength: 19,
3282
- value: state.cardNumber,
3283
- placeholder: "0000 0000 0000 0000",
3284
- onChange: handleCardNumberChange
3285
- }
3286
- ), state.error && /* @__PURE__ */ React15.createElement("div", { style: { color: "red" } }, state.error)), /* @__PURE__ */ React15.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ React15.createElement(
3287
- "input",
3288
- {
3289
- "data-token": "exp_month",
3290
- className: "form-control required",
3291
- type: "text",
3292
- placeholder: "MM",
3293
- value: state.month,
3294
- maxLength: 2,
3295
- onChange: (e) => handleMonthChange(e)
3296
- }
3297
- ), isValidMonth && /* @__PURE__ */ React15.createElement(
3298
- "span",
3299
- {
3300
- id: "card_number-error",
3301
- style: { color: "red", fontSize: "15px" }
3302
- },
3303
- "Please write month only 1 to 12"
3304
- )), /* @__PURE__ */ React15.createElement("div", { className: "expiry-date-group form-group" }, /* @__PURE__ */ React15.createElement(
3305
- "input",
3306
- {
3307
- "data-token": "exp_year",
3308
- className: "form-control required",
3309
- type: "text",
3310
- placeholder: "YY",
3311
- maxLength: 2,
3312
- value: state.year,
3313
- onChange: (e) => handleYearChange(e)
3314
- }
3315
- ), state.yearError && /* @__PURE__ */ React15.createElement("span", { id: "exp_year-error", style: { color: "red" } }, state.yearError)), /* @__PURE__ */ React15.createElement("div", { className: "security-code-group form-group" }, /* @__PURE__ */ React15.createElement("div", { className: "input-container" }, /* @__PURE__ */ React15.createElement(
3316
- "input",
3317
- {
3318
- "data-token": "cvv",
3319
- className: "form-control required",
3320
- type: "text",
3321
- maxLength: 4,
3322
- value: state.cvv,
3323
- placeholder: "CVV",
3324
- onChange: (e) => handleCVVChange(e)
3325
- }
3326
- ), /* @__PURE__ */ React15.createElement("i", { id: "cvc", className: "fa fa-question-circle" }), state.cvvError && /* @__PURE__ */ React15.createElement("span", { id: "cvv-error", style: { color: "red" } }, state.cvvError)), /* @__PURE__ */ React15.createElement("div", { className: "cvc-preview-container two-card hide" }, /* @__PURE__ */ React15.createElement("div", { className: "amex-cvc-preview" }), /* @__PURE__ */ React15.createElement("div", { className: "visa-mc-dis-cvc-preview" }))), /* @__PURE__ */ React15.createElement("div", { className: "zip-code-group form-group" }, /* @__PURE__ */ React15.createElement("label", null, "Postal code"), /* @__PURE__ */ React15.createElement("div", { className: "input-container" }, /* @__PURE__ */ React15.createElement(
3327
- "input",
3328
- {
3329
- id: "ZIPCode",
3330
- className: "form-control required",
3331
- name: "zip",
3332
- type: "text",
3333
- maxLength: 7,
3334
- placeholder: "000000",
3335
- value: state.zip,
3336
- onChange: (e) => handleZIP(e)
3337
- }
3338
- ), /* @__PURE__ */ React15.createElement(
3339
- "a",
3340
- {
3341
- tabIndex: 0,
3342
- role: "button",
3343
- "data-toggle": "popover",
3344
- "data-trigger": "focus",
3345
- "data-placement": "left",
3346
- "data-content": "Enter the ZIP/Postal code for your credit card billing address."
3347
- },
3348
- /* @__PURE__ */ React15.createElement("i", { className: "fa fa-question-circle" })
3349
- ), /* @__PURE__ */ React15.createElement(
3350
- "span",
3351
- {
3352
- id: "ZIPCode-error",
3353
- style: { color: "red", display: "none" }
3354
- },
3355
- "This field is required"
3356
- ))), /* @__PURE__ */ React15.createElement("div", { className: "form-group top-amnt" }, /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement("label", null, "Payment amount"), /* @__PURE__ */ React15.createElement("div", { className: "amount-placeholder" }, /* @__PURE__ */ React15.createElement(
3357
- "input",
3358
- {
3359
- id: "Amount",
3360
- className: "form-control required",
3361
- name: "amount",
3362
- type: "text",
3363
- placeholder: "",
3364
- value: state.amount,
3365
- onChange: (e) => handleAmount(e),
3366
- onBlur: handleAmountBlur
3367
- }
3368
- ))), /* @__PURE__ */ React15.createElement("div", { className: "card-row" }, /* @__PURE__ */ React15.createElement("span", { className: "visa" }), /* @__PURE__ */ React15.createElement("span", { className: "mastercard" }), /* @__PURE__ */ React15.createElement("span", { className: "amex" }), /* @__PURE__ */ React15.createElement("span", { className: "discover" }))), /* @__PURE__ */ React15.createElement(
3369
- "button",
3370
- {
3371
- type: "button",
3372
- id: "submitButton",
3373
- onClick: () => handleSubmitPay(),
3374
- className: "btn btn-block btn-success submit-button"
3375
- },
3376
- "Submit"
3377
- )), /* @__PURE__ */ React15.createElement("div", { className: "powerd-by-part" }, /* @__PURE__ */ React15.createElement(
3378
- "svg",
3379
- {
3380
- xmlns: "http://www.w3.org/2000/svg",
3381
- width: "20",
3382
- height: "20",
3383
- viewBox: "0 0 26 26"
3384
- },
3385
- /* @__PURE__ */ React15.createElement(
3386
- "path",
3387
- {
3388
- fill: "currentColor",
3389
- 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"
3390
- }
3391
- )
3392
- ), "Secure payments powered by Fractal", /* @__PURE__ */ React15.createElement(
3393
- "img",
3394
- {
3395
- src: "https://ui.fractalpay.com/favicon.ico",
3396
- alt: "Fractal logo",
3397
- className: "powered-logo"
3398
- }
3399
- )))))))
3400
- ));
3401
- }
3402
-
3403
- // src/app/components/Payment/GetPaymentDynamic.tsx
3404
- import React17, { useEffect as useEffect4, useState as useState10 } from "react";
3405
- import { Modal as Modal7 } from "react-bootstrap";
3406
-
3407
- // src/app/components/Loader/MyLoadingAnimation.tsx
3408
- import React16 from "react";
3409
- function MyLoadingAnimation() {
3410
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(LoaderStyle_default, null), /* @__PURE__ */ React16.createElement("div", { className: "loading-animation" }, /* @__PURE__ */ React16.createElement("div", { className: "spinner" })));
3411
- }
3412
-
3413
- // src/app/components/Payment/GetPaymentDynamic.tsx
3414
- function GetPaymentDynamic(props) {
3415
- const { amount, fractalpayClientKey, orderID } = props;
3416
- const [loading, setLoading] = useState10(false);
3417
- const [show, setShow] = useState10(false);
3418
- const [iframeLoaded, setIframeLoaded] = useState10(false);
3419
- const [phoneNumber, setPhoneNumber] = useState10("");
3420
- const [errorMessage, setErrorMessage] = useState10("");
3421
- const [submitClicked, setSubmitClicked] = useState10(false);
3422
- const [isValidNumber, setIsValidNumber] = useState10(true);
3423
- const handleClose = () => {
3424
- setIframeLoaded(false);
3425
- setTimeout(() => {
3426
- setShow(false);
3427
- }, 1e3);
3428
- };
3429
- const handleShow = () => {
3430
- if (fractalpayClientKey) {
3431
- setShow(true);
3432
- setIframeLoaded(true);
3433
- } else {
3434
- console.error(ErrorText.fractalpayclientidrequired);
3435
- }
3436
- };
3437
- useEffect4(() => {
3438
- if (!fractalpayClientKey) {
3439
- console.error(ErrorText.fractalpayclientidrequired);
3440
- }
3441
- }, [fractalpayClientKey]);
3442
- const handlePhoneNumberChange = (e) => {
3443
- const number = e.target.value;
3444
- const isValid = /^\d*$/.test(number);
3445
- if (isValid) {
3446
- setPhoneNumber(number);
3447
- setIsValidNumber(number.length <= 10);
3448
- if (number.length > 10) {
3449
- setErrorMessage(ErrorText.phonenumbervalid);
3450
- } else {
3451
- setErrorMessage("");
3452
- }
3453
- } else {
3454
- setErrorMessage(ErrorText.phonenumbervalidnumberonly);
3455
- }
3456
- };
3457
- const handleLoad = () => {
3458
- setLoading(false);
3459
- };
3460
- useEffect4(() => {
3461
- const messageListener = (event) => {
3462
- var _a, _b;
3463
- const response = (_b = (_a = event == null ? void 0 : event.data) == null ? void 0 : _a.other) == null ? void 0 : _b.data;
3464
- if (response == null ? void 0 : response.result) {
3465
- setTimeout(() => {
3466
- handleClose();
3467
- }, 5e3);
3468
- }
3469
- };
3470
- window.addEventListener("message", messageListener);
3471
- return () => {
3472
- window.removeEventListener("message", messageListener);
3473
- };
3474
- }, []);
3475
- return /* @__PURE__ */ React17.createElement("div", null, /* @__PURE__ */ React17.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Pay"), /* @__PURE__ */ React17.createElement(Modal7, { show: show && iframeLoaded, id: "modal-pay", className: "modal-lg", onHide: handleClose }, /* @__PURE__ */ React17.createElement(Modal7.Header, { closeButton: true }), /* @__PURE__ */ React17.createElement(Modal7.Body, null, loading && /* @__PURE__ */ React17.createElement(MyLoadingAnimation, null), /* @__PURE__ */ React17.createElement(
3476
- "iframe",
3477
- {
3478
- src: `${baseUrl}widget-form/${amount}?fractalpay_public_key=${fractalpayClientKey}&order_id=${orderID}`,
3479
- height: "auto",
3480
- width: "100%",
3481
- style: { display: loading ? "none" : "block" },
3482
- onLoad: handleLoad
3483
- }
3484
- ))));
3485
- }
3486
1140
  export {
3487
- CompletedTransactions,
3488
- GetPaymentDynamic,
3489
- Payment,
3490
1141
  RequestPayment,
3491
- RequestPaymentAllInput,
3492
- RequestPaymentDynamic,
3493
- RequestPaymentonClick,
3494
- RqstPaymntInputField,
3495
- TockenizPay
1142
+ RequestPreAuthPayment
3496
1143
  };