@pinerohit11/testwidget 0.1.70 → 0.1.72

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.d.mts CHANGED
@@ -10,6 +10,9 @@ interface Props$1 {
10
10
  from?: string;
11
11
  amount: string;
12
12
  webname?: string;
13
+ discount?: string;
14
+ tax?: string;
15
+ surcharge?: string;
13
16
  }
14
17
  declare function RequestPayment(props: Props$1): React.JSX.Element;
15
18
 
@@ -23,6 +26,9 @@ interface Props {
23
26
  from?: string;
24
27
  amount: string;
25
28
  webname?: string;
29
+ discount?: string;
30
+ tax?: string;
31
+ surcharge?: string;
26
32
  }
27
33
  declare function RequestPreAuthPayment(props: Props): React.JSX.Element;
28
34
 
package/dist/index.d.ts CHANGED
@@ -10,6 +10,9 @@ interface Props$1 {
10
10
  from?: string;
11
11
  amount: string;
12
12
  webname?: string;
13
+ discount?: string;
14
+ tax?: string;
15
+ surcharge?: string;
13
16
  }
14
17
  declare function RequestPayment(props: Props$1): React.JSX.Element;
15
18
 
@@ -23,6 +26,9 @@ interface Props {
23
26
  from?: string;
24
27
  amount: string;
25
28
  webname?: string;
29
+ discount?: string;
30
+ tax?: string;
31
+ surcharge?: string;
26
32
  }
27
33
  declare function RequestPreAuthPayment(props: Props): React.JSX.Element;
28
34
 
package/dist/index.js CHANGED
@@ -53,7 +53,6 @@ __export(index_exports, {
53
53
  module.exports = __toCommonJS(index_exports);
54
54
 
55
55
  // src/app/components/RequestPayment/RequestPayment.tsx
56
- var import_bootstrap_bundle_min = require("bootstrap/dist/js/bootstrap.bundle.min.js");
57
56
  var import_react6 = __toESM(require("react"));
58
57
 
59
58
  // src/app/components/Loader/Loader.tsx
@@ -63,9 +62,9 @@ var import_react2 = __toESM(require("react"));
63
62
  var import_react = __toESM(require("react"));
64
63
  var LoaderStyle = (props) => {
65
64
  return /* @__PURE__ */ import_react.default.createElement("style", null, `
66
- .loader {
67
- position: fixed;
68
- /* Fixed position to cover the viewport */
65
+
66
+ .loader {
67
+ position: fixed; /* Fixed position to cover the viewport */
69
68
  top: 0;
70
69
  left: 0;
71
70
  width: 100%;
@@ -74,13 +73,10 @@ var LoaderStyle = (props) => {
74
73
  justify-content: center;
75
74
  align-items: center;
76
75
  /* background: rgba(255, 255, 0, 0.01); Adjust the blur effect */
77
- background-color: rgba(255, 255, 255, 0.521);
78
- /* Semi-transparent black background */
76
+ background-color: rgba(255, 255, 255, 0.521); /* Semi-transparent black background */
79
77
 
80
- backdrop-filter: blur(.5px);
81
- /* Blur effect */
82
- z-index: 9999;
83
- /* Ensure it's on top of other elements */
78
+ backdrop-filter: blur(.5px); /* Blur effect */
79
+ z-index: 999999999999; /* Ensure it's on top of other elements */
84
80
  }
85
81
 
86
82
  .lds-ellipsis {
@@ -124,7 +120,6 @@ var LoaderStyle = (props) => {
124
120
  0% {
125
121
  transform: scale(0);
126
122
  }
127
-
128
123
  100% {
129
124
  transform: scale(1);
130
125
  }
@@ -134,7 +129,6 @@ var LoaderStyle = (props) => {
134
129
  0% {
135
130
  transform: translate(0, 0);
136
131
  }
137
-
138
132
  100% {
139
133
  transform: translate(24px, 0);
140
134
  }
@@ -144,37 +138,11 @@ var LoaderStyle = (props) => {
144
138
  0% {
145
139
  transform: scale(1);
146
140
  }
147
-
148
141
  100% {
149
142
  transform: scale(0);
150
143
  }
151
144
  }
152
145
 
153
-
154
- .loading-animation {
155
- position: absolute;
156
- top: 50%;
157
- left: 50%;
158
- transform: translate(-50%, -50%);
159
- }
160
-
161
- .spinner {
162
- width: 40px;
163
- height: 40px;
164
- border-radius: 50%;
165
- border: 4px solid #f3f3f3;
166
- border-top: 4px solid black;
167
- animation: spin 1s linear infinite;
168
- }
169
-
170
- @keyframes spin {
171
- 0% {
172
- transform: rotate(0deg);
173
- }
174
- 100% {
175
- transform: rotate(360deg);
176
- }
177
- }
178
146
  `);
179
147
  };
180
148
  var LoaderStyle_default = LoaderStyle;
@@ -721,6 +689,9 @@ var RequestPaymentstyles_default = RequestPaymentstyles;
721
689
  // src/app/components/RequestPayment/RequestPayment.tsx
722
690
  function RequestPayment(props) {
723
691
  const fractalpayClientKey = props.fractalpayClientKey;
692
+ const discount = props == null ? void 0 : props.discount;
693
+ const tax = props == null ? void 0 : props.tax;
694
+ const surcharge = props == null ? void 0 : props.surcharge;
724
695
  const [show, setShow] = (0, import_react6.useState)(false);
725
696
  const [loading, setLoading] = (0, import_react6.useState)(false);
726
697
  const [errors, setErrors] = (0, import_react6.useState)({});
@@ -790,9 +761,13 @@ function RequestPayment(props) {
790
761
  action: "request",
791
762
  name: requestDetails.name,
792
763
  email: requestDetails.email,
793
- customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : ""
764
+ customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : "",
765
+ discount,
766
+ surcharge,
767
+ tax
794
768
  };
795
- let response = await import_axios.default.post(`${baseUrl}create-widget-order`, formData);
769
+ const response = await import_axios.default.post("/api/payment-request", formData);
770
+ console.log(response, "response");
796
771
  if ((response == null ? void 0 : response.status) === 200) {
797
772
  setShowConfirmationModal(true);
798
773
  setShow(false);
@@ -946,12 +921,15 @@ function RequestPayment(props) {
946
921
  }
947
922
 
948
923
  // src/app/components/RequestPayment/RequestPreAuthPayment.tsx
949
- var import_bootstrap_bundle_min2 = require("bootstrap/dist/js/bootstrap.bundle.min.js");
924
+ var import_bootstrap_bundle_min = require("bootstrap/dist/js/bootstrap.bundle.min.js");
950
925
  var import_react7 = __toESM(require("react"));
951
926
  var import_axios2 = __toESM(require("axios"));
952
927
  var import_react_number_format2 = require("react-number-format");
953
928
  function RequestPreAuthPayment(props) {
954
929
  const fractalpayClientKey = props.fractalpayClientKey;
930
+ const discount = props == null ? void 0 : props.discount;
931
+ const tax = props == null ? void 0 : props.tax;
932
+ const surcharge = props == null ? void 0 : props.surcharge;
955
933
  const [show, setShow] = (0, import_react7.useState)(false);
956
934
  const [loading, setLoading] = (0, import_react7.useState)(false);
957
935
  const [errors, setErrors] = (0, import_react7.useState)({});
@@ -1021,7 +999,10 @@ function RequestPreAuthPayment(props) {
1021
999
  action: "request",
1022
1000
  name: requestDetails.name,
1023
1001
  email: requestDetails.email,
1024
- customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : ""
1002
+ customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : "",
1003
+ discount,
1004
+ surcharge,
1005
+ tax
1025
1006
  };
1026
1007
  let response = await import_axios2.default.post(`${baseUrl}send-request-pre-auth-payment`, formData);
1027
1008
  if ((response == null ? void 0 : response.status) === 200) {
@@ -1118,7 +1099,7 @@ function RequestPreAuthPayment(props) {
1118
1099
  maximumFractionDigits: 2
1119
1100
  }).format(Number(amount2));
1120
1101
  }
1121
- return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ import_react7.default.createElement(Loader_default, { loading }), /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Request Pre Auth Payment"), /* @__PURE__ */ import_react7.default.createElement(
1102
+ return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(RequestPaymentstyles_default, null), /* @__PURE__ */ import_react7.default.createElement(Loader_default, { loading }), /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement("button", { className: "paymentBtn", onClick: handleShow }, "Send Request"), /* @__PURE__ */ import_react7.default.createElement(
1122
1103
  CustomModal2_default,
1123
1104
  {
1124
1105
  open: show,
package/dist/index.mjs CHANGED
@@ -19,7 +19,6 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
 
21
21
  // src/app/components/RequestPayment/RequestPayment.tsx
22
- import "bootstrap/dist/js/bootstrap.bundle.min.js";
23
22
  import React6, { useState, useEffect } from "react";
24
23
 
25
24
  // src/app/components/Loader/Loader.tsx
@@ -29,9 +28,9 @@ import React2 from "react";
29
28
  import React from "react";
30
29
  var LoaderStyle = (props) => {
31
30
  return /* @__PURE__ */ React.createElement("style", null, `
32
- .loader {
33
- position: fixed;
34
- /* Fixed position to cover the viewport */
31
+
32
+ .loader {
33
+ position: fixed; /* Fixed position to cover the viewport */
35
34
  top: 0;
36
35
  left: 0;
37
36
  width: 100%;
@@ -40,13 +39,10 @@ var LoaderStyle = (props) => {
40
39
  justify-content: center;
41
40
  align-items: center;
42
41
  /* background: rgba(255, 255, 0, 0.01); Adjust the blur effect */
43
- background-color: rgba(255, 255, 255, 0.521);
44
- /* Semi-transparent black background */
42
+ background-color: rgba(255, 255, 255, 0.521); /* Semi-transparent black background */
45
43
 
46
- backdrop-filter: blur(.5px);
47
- /* Blur effect */
48
- z-index: 9999;
49
- /* Ensure it's on top of other elements */
44
+ backdrop-filter: blur(.5px); /* Blur effect */
45
+ z-index: 999999999999; /* Ensure it's on top of other elements */
50
46
  }
51
47
 
52
48
  .lds-ellipsis {
@@ -90,7 +86,6 @@ var LoaderStyle = (props) => {
90
86
  0% {
91
87
  transform: scale(0);
92
88
  }
93
-
94
89
  100% {
95
90
  transform: scale(1);
96
91
  }
@@ -100,7 +95,6 @@ var LoaderStyle = (props) => {
100
95
  0% {
101
96
  transform: translate(0, 0);
102
97
  }
103
-
104
98
  100% {
105
99
  transform: translate(24px, 0);
106
100
  }
@@ -110,37 +104,11 @@ var LoaderStyle = (props) => {
110
104
  0% {
111
105
  transform: scale(1);
112
106
  }
113
-
114
107
  100% {
115
108
  transform: scale(0);
116
109
  }
117
110
  }
118
111
 
119
-
120
- .loading-animation {
121
- position: absolute;
122
- top: 50%;
123
- left: 50%;
124
- transform: translate(-50%, -50%);
125
- }
126
-
127
- .spinner {
128
- width: 40px;
129
- height: 40px;
130
- border-radius: 50%;
131
- border: 4px solid #f3f3f3;
132
- border-top: 4px solid black;
133
- animation: spin 1s linear infinite;
134
- }
135
-
136
- @keyframes spin {
137
- 0% {
138
- transform: rotate(0deg);
139
- }
140
- 100% {
141
- transform: rotate(360deg);
142
- }
143
- }
144
112
  `);
145
113
  };
146
114
  var LoaderStyle_default = LoaderStyle;
@@ -687,6 +655,9 @@ var RequestPaymentstyles_default = RequestPaymentstyles;
687
655
  // src/app/components/RequestPayment/RequestPayment.tsx
688
656
  function RequestPayment(props) {
689
657
  const fractalpayClientKey = props.fractalpayClientKey;
658
+ const discount = props == null ? void 0 : props.discount;
659
+ const tax = props == null ? void 0 : props.tax;
660
+ const surcharge = props == null ? void 0 : props.surcharge;
690
661
  const [show, setShow] = useState(false);
691
662
  const [loading, setLoading] = useState(false);
692
663
  const [errors, setErrors] = useState({});
@@ -756,9 +727,13 @@ function RequestPayment(props) {
756
727
  action: "request",
757
728
  name: requestDetails.name,
758
729
  email: requestDetails.email,
759
- customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : ""
730
+ customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : "",
731
+ discount,
732
+ surcharge,
733
+ tax
760
734
  };
761
- let response = await axios.post(`${baseUrl}create-widget-order`, formData);
735
+ const response = await axios.post("/api/payment-request", formData);
736
+ console.log(response, "response");
762
737
  if ((response == null ? void 0 : response.status) === 200) {
763
738
  setShowConfirmationModal(true);
764
739
  setShow(false);
@@ -918,6 +893,9 @@ import axios2 from "axios";
918
893
  import { PatternFormat as PatternFormat2 } from "react-number-format";
919
894
  function RequestPreAuthPayment(props) {
920
895
  const fractalpayClientKey = props.fractalpayClientKey;
896
+ const discount = props == null ? void 0 : props.discount;
897
+ const tax = props == null ? void 0 : props.tax;
898
+ const surcharge = props == null ? void 0 : props.surcharge;
921
899
  const [show, setShow] = useState2(false);
922
900
  const [loading, setLoading] = useState2(false);
923
901
  const [errors, setErrors] = useState2({});
@@ -987,7 +965,10 @@ function RequestPreAuthPayment(props) {
987
965
  action: "request",
988
966
  name: requestDetails.name,
989
967
  email: requestDetails.email,
990
- customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : ""
968
+ customer_id: (props == null ? void 0 : props.customerId) ? props == null ? void 0 : props.customerId : "",
969
+ discount,
970
+ surcharge,
971
+ tax
991
972
  };
992
973
  let response = await axios2.post(`${baseUrl}send-request-pre-auth-payment`, formData);
993
974
  if ((response == null ? void 0 : response.status) === 200) {
@@ -1084,7 +1065,7 @@ function RequestPreAuthPayment(props) {
1084
1065
  maximumFractionDigits: 2
1085
1066
  }).format(Number(amount2));
1086
1067
  }
1087
- 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(
1068
+ 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 }, "Send Request"), /* @__PURE__ */ React7.createElement(
1088
1069
  CustomModal2_default,
1089
1070
  {
1090
1071
  open: show,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinerohit11/testwidget",
3
- "version": "0.1.70",
3
+ "version": "0.1.72",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "next dev -p 4001",