@fractalpay/fractalpay-next-dev 0.0.205 → 0.0.206
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 +138 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +31 -8290
- package/dist/index.mjs +3013 -0
- package/package.json +15 -12
- package/dist/index.js.map +0 -1
- package/types/fractal.d.ts +0 -11
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3013 @@
|
|
|
1
|
+
var Fa=Object.defineProperty,Ma=Object.defineProperties;var La=Object.getOwnPropertyDescriptors;var qi=Object.getOwnPropertySymbols;var ca=Object.prototype.hasOwnProperty,ua=Object.prototype.propertyIsEnumerable;var ma=(e,t,H)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:H}):e[t]=H,v=(e,t)=>{for(var H in t||(t={}))ca.call(t,H)&&ma(e,H,t[H]);if(qi)for(var H of qi(t))ua.call(t,H)&&ma(e,H,t[H]);return e},F=(e,t)=>Ma(e,La(t));var ii=(e,t)=>{var H={};for(var T in e)ca.call(e,T)&&t.indexOf(T)<0&&(H[T]=e[T]);if(e!=null&&qi)for(var T of qi(e))t.indexOf(T)<0&&ua.call(e,T)&&(H[T]=e[T]);return H};var Aa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var pa=Aa((Or,Ba)=>{Ba.exports={name:"@fractalpay/fractalpay-next-dev",version:"0.0.206",private:!1,scripts:{dev:"next dev -p 4001",build:"next build",start:"next start",lint:"next lint",bundle:"tsup src/app/index.ts"},dependencies:{"@stripe/react-stripe-js":"^5.3.0","@stripe/stripe-js":"^8.3.0","@types/yup":"^0.29.14",axios:"^1.8.1",bootstrap:"^5.3.3","credit-card-type":"^10.0.1",formik:"^2.4.6","node-forge":"^1.3.1","react-bootstrap":"^2.10.5","react-bs-datatable":"^3.15.0","react-datepicker":"^7.5.0","react-icons":"^5.5.0","react-number-format":"^5.4.3","react-toastify":"^10.0.6","socket.io-client":"^4.8.1","styled-components":"^6.1.15",sweetalert2:"^11.22.0",yup:"^1.6.1"},peerdependencies:{next:"15.0.5",react:">=18.0.0 <20.0.0","react-dom":">=18.0.0 <20.0.0"},devDependencies:{"@types/estree":"^1.0.8","@types/node":"^20","@types/node-forge":"^1.3.11","@types/react":"^18","@types/react-dom":"^18",autoprefixer:"^10.4.20","credit-card-type":"^10.0.1",eslint:"^8","eslint-config-next":"15.0.3",next:"^15.0.5",react:"^18.3.1","react-bs-datatable":"^3.15.0","react-datepicker":"^7.5.0","react-dom":"^18.3.1","react-toastify":"^10.0.6",tsup:"^8.4.0",typescript:"^5"},author:"Mukul",license:"MIT",keywords:["nextjs","next","typescript","tailwindcss"],main:"dist/index.js",publishConfig:{access:"public"}}});import"bootstrap/dist/js/bootstrap.bundle.min.js";import I,{useState as Un,useEffect as ya}from"react";import Xn from"react";import Ta from"react";var za=e=>Ta.createElement("style",null,`
|
|
2
|
+
|
|
3
|
+
.loader {
|
|
4
|
+
position: fixed; /* Fixed position to cover the viewport */
|
|
5
|
+
top: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
/* background: rgba(255, 255, 0, 0.01); Adjust the blur effect */
|
|
13
|
+
background-color: rgba(31, 29, 29, 0.52); /* Semi-transparent black background */
|
|
14
|
+
|
|
15
|
+
backdrop-filter: blur(.5px); /* Blur effect */
|
|
16
|
+
z-index: 999999999999 !important; /* Ensure it's on top of other elements */
|
|
17
|
+
transform: translate(0%, 0%) !important
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.lds-ellipsis {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
position: relative;
|
|
23
|
+
width: 80px;
|
|
24
|
+
height: 80px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.lds-ellipsis div {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 33px;
|
|
30
|
+
width: 13px;
|
|
31
|
+
height: 13px;
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
background: #000;
|
|
34
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.lds-ellipsis div:nth-child(1) {
|
|
38
|
+
left: 8px;
|
|
39
|
+
animation: lds-ellipsis1 0.6s infinite;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.lds-ellipsis div:nth-child(2) {
|
|
43
|
+
left: 8px;
|
|
44
|
+
animation: lds-ellipsis2 0.6s infinite;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.lds-ellipsis div:nth-child(3) {
|
|
48
|
+
left: 32px;
|
|
49
|
+
animation: lds-ellipsis2 0.6s infinite;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.lds-ellipsis div:nth-child(4) {
|
|
53
|
+
left: 56px;
|
|
54
|
+
animation: lds-ellipsis3 0.6s infinite;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@keyframes lds-ellipsis1 {
|
|
58
|
+
0% {
|
|
59
|
+
transform: scale(0);
|
|
60
|
+
}
|
|
61
|
+
100% {
|
|
62
|
+
transform: scale(1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@keyframes lds-ellipsis2 {
|
|
67
|
+
0% {
|
|
68
|
+
transform: translate(0, 0);
|
|
69
|
+
}
|
|
70
|
+
100% {
|
|
71
|
+
transform: translate(24px, 0);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@keyframes lds-ellipsis3 {
|
|
76
|
+
0% {
|
|
77
|
+
transform: scale(1);
|
|
78
|
+
}
|
|
79
|
+
100% {
|
|
80
|
+
transform: scale(0);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
`),ga=za;var Ia=e=>Xn.createElement(Xn.Fragment,null,Xn.createElement(ga,null),(e==null?void 0:e.loading)&&Xn.createElement("div",{className:"loader"},Xn.createElement("div",{className:"lds-ellipsis"},Xn.createElement("div",null),Xn.createElement("div",null),Xn.createElement("div",null),Xn.createElement("div",null)))),dn=Ia;var{name:Hi}=pa(),te="https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/";Hi==="@fractalpay/fractalpay-next-dev"?(Ae="https://dev-sky-node.fractalpay.com/",tt="https://dev-widget.fractalpay.com/",mn="https://api-dev.merchant-trends.com/",ai="https://token-cert.dcap.com/v1/client",ri="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw"):Hi==="@fractalpay/fractalpay-next-test"?(Ae="https://testapi.fractalpay.com/",tt="https://staging-widget.fractalpay.com/",mn="https://api-dev.merchant-trends.com/",ai="https://token-cert.dcap.com/v1/client",ri="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw"):Hi==="@fractalpay/fractalpay-next-testprod"?(Ae="https://sky-node-prod.fractalpay.com/",tt="https://widget-prod.fractalpay.com/",mn="https://api.merchant-trends.com/",ai="https://token.dcap.com/v1/client",ri="pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB"):Hi==="@fractalpay/fractalpay-next"?(Ae="https://api.fractalpay.com/",tt="https://widget.fractalpay.com/",mn="https://api.merchant-trends.com/",ai="https://token.dcap.com/v1/client",ri="pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB"):(tt="http://localhost:8082/",Ae="http://localhost:8081/",mn="https://api-dev.merchant-trends.com/",ai="https://token-cert.dcap.com/v1/client",ri="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw");var Ae,tt,mn,ai,ri;var Jt={namerequired:"Full Name is required",amountrequired:"Amount is required",amountpositive:"Amount should be positive",amountzero:"Amount should not be zero",amountenter:"Please enter an amount",amountvalid:"Please enter a valid amount",phoneoremailrequired:"Phone or Email is required",invalidemail:"Please enter a valid email",invalidemailformat:"Invalid email format",onlylettersallowed:"Only letters are allowed",phonenumberlength:"Phone number should be 10 digits",phonenumberrequired:"Please enter a phone number",phonenumbervalid:"Please enter a valid phone number",phonenumbervalidnumberonly:"Please enter a valid phone number (numbers only)",orderidenter:"Please enter an order ID",orderidrequired:"Order ID is required",networkresponseerror:"Network response was not ok",anerroroccured:"An error occurred. Please try again.",montherror:"Please write month only 1 to 12",fieldrequired:"This field is required",fractalpayclientidrequired:"Fractalpay client key is missing or empty."};import Ni from"react";import qa from"react";var Ha=e=>qa.createElement("style",null,`
|
|
85
|
+
.fractal-input::placeholder {
|
|
86
|
+
color: #35254D;
|
|
87
|
+
opacity: 1;
|
|
88
|
+
font-size: 15px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.fractal-input::-ms-input-placeholder {
|
|
92
|
+
color: #35254D;
|
|
93
|
+
font-size: 15px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.trigger{
|
|
97
|
+
text-align: center;
|
|
98
|
+
padding: 7px 13px;
|
|
99
|
+
background: #3e3e3e;
|
|
100
|
+
color: #fff;
|
|
101
|
+
font-size: 15px;
|
|
102
|
+
outline: none;
|
|
103
|
+
border: none;
|
|
104
|
+
border-radius: 5px;
|
|
105
|
+
font-family: cursive;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// .fractal-popup {
|
|
109
|
+
// position: fixed;
|
|
110
|
+
// z-index: 9999;
|
|
111
|
+
// top: 0;
|
|
112
|
+
// right: 0;
|
|
113
|
+
// bottom: 0;
|
|
114
|
+
// left: 0;
|
|
115
|
+
// width: 100%;
|
|
116
|
+
// // max-width:810px;
|
|
117
|
+
// height: 100%;
|
|
118
|
+
// background-color: rgba(0, 0, 0, 0.5);
|
|
119
|
+
// transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
|
|
120
|
+
// display: flex;
|
|
121
|
+
// justify-content: center;
|
|
122
|
+
// align-items: center;
|
|
123
|
+
// overflow:auto;
|
|
124
|
+
// }
|
|
125
|
+
|
|
126
|
+
.fractal-popup {
|
|
127
|
+
position: fixed;
|
|
128
|
+
z-index: 1050;
|
|
129
|
+
left: 0;
|
|
130
|
+
top: 0;
|
|
131
|
+
width: 100%;
|
|
132
|
+
height: 100%;
|
|
133
|
+
overflow: auto;
|
|
134
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
135
|
+
// padding:20px
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.fractal-popup-content {
|
|
139
|
+
margin:20px auto !important;
|
|
140
|
+
transform :none;
|
|
141
|
+
background-color: white;
|
|
142
|
+
padding:20px;
|
|
143
|
+
border-radius: 0.5rem;
|
|
144
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
position: relative;
|
|
147
|
+
// min-height : 585px;
|
|
148
|
+
max-width:810px;
|
|
149
|
+
width:90vw
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
// @media only screen and (min-width: 600px){
|
|
155
|
+
// .fractal-popup-content {
|
|
156
|
+
// max-width:810px;
|
|
157
|
+
// }
|
|
158
|
+
// }
|
|
159
|
+
// @media only screen and (max-width: 600px){
|
|
160
|
+
// .fractal-popup-content {
|
|
161
|
+
// width: 350px;
|
|
162
|
+
// }
|
|
163
|
+
// }
|
|
164
|
+
// @media only screen and (max-width: 450px){
|
|
165
|
+
// .fractal-popup-content {
|
|
166
|
+
// width: 300px;
|
|
167
|
+
// }
|
|
168
|
+
// }
|
|
169
|
+
.close-popup {
|
|
170
|
+
max-height:25px;
|
|
171
|
+
width:25px;
|
|
172
|
+
height: 25px;
|
|
173
|
+
color: #999;
|
|
174
|
+
position: absolute;
|
|
175
|
+
top: 2px;
|
|
176
|
+
right: 4px;
|
|
177
|
+
z-index: 7;
|
|
178
|
+
text-align: center;
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
border-radius: 0.25rem;
|
|
181
|
+
font-size: 30px;
|
|
182
|
+
line-height: 30px;
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.close-popup:hover {
|
|
189
|
+
color: #000;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.fractal-inpt-list {
|
|
193
|
+
margin-bottom: 15px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.fractal-label {
|
|
197
|
+
color: #727272;
|
|
198
|
+
margin-bottom: 3px;
|
|
199
|
+
font-family: "Inter", sans-serif;
|
|
200
|
+
font-weight: 500;
|
|
201
|
+
font-size: 12px;
|
|
202
|
+
display: block;
|
|
203
|
+
text-align: left;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.fractal-input {
|
|
207
|
+
display: block;
|
|
208
|
+
width: 100%;
|
|
209
|
+
padding: .320rem .75rem;
|
|
210
|
+
font-size: 1rem;
|
|
211
|
+
font-weight: 400;
|
|
212
|
+
line-height: 1.5;
|
|
213
|
+
color: #35254D;
|
|
214
|
+
appearance: none;
|
|
215
|
+
background-color:#ffffff;
|
|
216
|
+
background-clip: padding-box;
|
|
217
|
+
border:1px solid #dee2e6;
|
|
218
|
+
border-radius: 0.375rem;
|
|
219
|
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.fractal-input:focus {border:#86b7fe 1px solid; outline: none;}
|
|
223
|
+
|
|
224
|
+
.fractal-group {
|
|
225
|
+
position: relative;
|
|
226
|
+
display: flex;
|
|
227
|
+
align-items: stretch;
|
|
228
|
+
width: 100%;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.fractal-group-icons {
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
padding: 0.375rem 0.75rem;
|
|
235
|
+
font-size: 1rem;
|
|
236
|
+
font-weight: 400;
|
|
237
|
+
line-height: 1.5;
|
|
238
|
+
color: #212529;
|
|
239
|
+
text-align: center;
|
|
240
|
+
white-space: nowrap;
|
|
241
|
+
background-color: #f8f9fa;
|
|
242
|
+
border:#dee2e6 1px solid;
|
|
243
|
+
border-radius: 0.375rem 0 0 0.375rem ;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.fractal-group .fractal-input{
|
|
247
|
+
border-radius:0 0.375rem 0.375rem 0;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
.pay-button {
|
|
252
|
+
outline: 0;
|
|
253
|
+
height: 46px;
|
|
254
|
+
font-size: 16px;
|
|
255
|
+
background: #727272;
|
|
256
|
+
border: none;
|
|
257
|
+
display: block;
|
|
258
|
+
color: #fff;
|
|
259
|
+
width: 100%;
|
|
260
|
+
border-radius: 180px;
|
|
261
|
+
margin: 10px 0;
|
|
262
|
+
text-decoration: none;
|
|
263
|
+
cursor:pointer,
|
|
264
|
+
font-family:
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.pay-button:hover, .pay-button:focus {background: #222; color: #fff; cursor:pointer}
|
|
268
|
+
|
|
269
|
+
.fractal-powerd-by {
|
|
270
|
+
display: flex;
|
|
271
|
+
font-size: 12px;
|
|
272
|
+
text-align: center;
|
|
273
|
+
align-items: center;
|
|
274
|
+
justify-content: center;
|
|
275
|
+
margin: 5px 0 20px 0;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
/* ................................................................ */
|
|
285
|
+
|
|
286
|
+
.fractal-pay-popup {
|
|
287
|
+
position: fixed;
|
|
288
|
+
z-index: 9999;
|
|
289
|
+
top: 0;
|
|
290
|
+
right: 0;
|
|
291
|
+
bottom: 0;
|
|
292
|
+
left: 0;
|
|
293
|
+
width: 100%;
|
|
294
|
+
height: 100%;
|
|
295
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
296
|
+
transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
|
|
297
|
+
display: flex;
|
|
298
|
+
justify-content: center;
|
|
299
|
+
align-items: center;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.fractal-pay-popup-content {
|
|
303
|
+
background-color: white;
|
|
304
|
+
padding:0px;
|
|
305
|
+
border-radius: 0.5rem;
|
|
306
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
307
|
+
box-sizing: border-box;
|
|
308
|
+
position: relative;
|
|
309
|
+
height: 100%;
|
|
310
|
+
max-height:90%;
|
|
311
|
+
overflow: hidden;
|
|
312
|
+
}
|
|
313
|
+
.fractal-pay-popup-content iframe{height: 100% !important; }
|
|
314
|
+
.fractal-pay-popup-content iframe body{overflow: hidden;}
|
|
315
|
+
@media only screen and (min-width: 768px){
|
|
316
|
+
.fractal-pay-popup-content iframe{width: 768px;}
|
|
317
|
+
.fractal-pay-popup-content {
|
|
318
|
+
width: 750px;
|
|
319
|
+
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
@media only screen and (max-width: 600px){
|
|
323
|
+
.fractal-pay-popup-content {
|
|
324
|
+
width: 350px;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
@media only screen and (max-width: 450px){
|
|
328
|
+
.fractal-pay-popup-content {
|
|
329
|
+
width: 300px;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.request-payment-popup-container {
|
|
334
|
+
padding: 0px !important;
|
|
335
|
+
border-radius: 12px !important;
|
|
336
|
+
}
|
|
337
|
+
`),Yi=Ha;var Ya=({open:e,onClose:t,children:H,maxWidth:T})=>e?Ni.createElement(Ni.Fragment,null,Ni.createElement(Yi,null),Ni.createElement("div",{className:"fractal-popup"},Ni.createElement("div",{className:"fractal-popup-content request-payment-popup-container",style:{maxWidth:`${T!=null?T:"auto"}`}},H))):null,Nn=Ya;import Wa from"axios";import{PatternFormat as Ga}from"react-number-format";import $a from"react";var Ea=e=>$a.createElement("style",null,`
|
|
338
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
339
|
+
body {
|
|
340
|
+
font-family: 'Inter', sans-serif !important;
|
|
341
|
+
}
|
|
342
|
+
input{
|
|
343
|
+
font-family: 'Inter', sans-serif !important;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.paymentBtn {
|
|
347
|
+
background-color: black;
|
|
348
|
+
border: none;
|
|
349
|
+
color: white;
|
|
350
|
+
padding: 15px 32px;
|
|
351
|
+
text-align: center;
|
|
352
|
+
text-decoration: none;
|
|
353
|
+
display: inline-block;
|
|
354
|
+
font-size: 16px;
|
|
355
|
+
margin: 4px 2px;
|
|
356
|
+
cursor: pointer;
|
|
357
|
+
border-radius: 180px;
|
|
358
|
+
/* width: auto; */
|
|
359
|
+
}
|
|
360
|
+
/*****************************************REDESIGNING STYLES **************************************/
|
|
361
|
+
|
|
362
|
+
.request-payment-amount {
|
|
363
|
+
color: #161616;
|
|
364
|
+
text-align: center;
|
|
365
|
+
font-size: 42px;
|
|
366
|
+
font-style: normal;
|
|
367
|
+
font-weight: 600;
|
|
368
|
+
text-transform: uppercase;
|
|
369
|
+
margin: 8px 0px !important;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.request-payment-orderid {
|
|
373
|
+
color: #727272;
|
|
374
|
+
text-align: center;
|
|
375
|
+
font-size: 14px;
|
|
376
|
+
font-style: normal;
|
|
377
|
+
font-weight: 500;
|
|
378
|
+
margin: 0px;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.request-payment-pre-auth-merchantname {
|
|
382
|
+
color: #727272;
|
|
383
|
+
text-align: center;
|
|
384
|
+
font-size: 14px;
|
|
385
|
+
font-style: normal;
|
|
386
|
+
font-weight: 500;
|
|
387
|
+
margin-top: 10px !important;
|
|
388
|
+
margin-bottom: 0px !important;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.request-payment-merchantname {
|
|
392
|
+
color: #727272;
|
|
393
|
+
text-align: center;
|
|
394
|
+
font-size: 14px;
|
|
395
|
+
font-style: normal;
|
|
396
|
+
font-weight: 500;
|
|
397
|
+
margin-top: 20px !important;
|
|
398
|
+
margin-bottom: 0px !important;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.request-payment-close-popup {
|
|
402
|
+
position: absolute;
|
|
403
|
+
right: 20px;
|
|
404
|
+
top: 20px;
|
|
405
|
+
cursor: pointer;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.request-payment-amount-detail {
|
|
409
|
+
padding: 32px 0px;
|
|
410
|
+
border-bottom: 1px solid #E0DFE2;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.request-payment-popup-container {
|
|
414
|
+
padding: 0px !important;
|
|
415
|
+
border-radius: 12px !important;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.request-payment-input-form {
|
|
419
|
+
padding: 24px 48px 32px 48px;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.request-payment-input-label {
|
|
423
|
+
color: #727272;
|
|
424
|
+
font-size: 12px;
|
|
425
|
+
font-style: normal;
|
|
426
|
+
font-weight: 500;
|
|
427
|
+
margin-bottom: 6px !important;
|
|
428
|
+
text-align: start !important;
|
|
429
|
+
width: 100% !important;
|
|
430
|
+
margin-bottom: 6px !important;
|
|
431
|
+
text-transform: uppercase;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.request-payment-input-box {
|
|
435
|
+
border-radius: 8px;
|
|
436
|
+
border: 1px solid #E0DFE2;
|
|
437
|
+
padding: 11px;
|
|
438
|
+
display: block;
|
|
439
|
+
width: 100%;
|
|
440
|
+
color: #161616;
|
|
441
|
+
margin-top: 6px !important;
|
|
442
|
+
font-size: 14px;
|
|
443
|
+
font-style: normal;
|
|
444
|
+
font-weight: 500;
|
|
445
|
+
box-sizing: border-box;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.request-payment-list-div {
|
|
449
|
+
margin-bottom: 12px;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.request-payment-submit-button {
|
|
453
|
+
border-radius: 80px;
|
|
454
|
+
background: #161616;
|
|
455
|
+
height: 48px;
|
|
456
|
+
padding: 12px 24px;
|
|
457
|
+
margin-top: 20px;
|
|
458
|
+
color: #fff;
|
|
459
|
+
width: 100% !important;
|
|
460
|
+
border: none !important;
|
|
461
|
+
font-size: 16px;
|
|
462
|
+
font-style: normal;
|
|
463
|
+
font-weight: 500;
|
|
464
|
+
cursor: pointer;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.request-payment-submit-button:disabled {
|
|
468
|
+
cursor: not-allowed;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.request-payment-fractal-powerd-by {
|
|
472
|
+
color: #727272;
|
|
473
|
+
font-size: 14px;
|
|
474
|
+
font-style: normal;
|
|
475
|
+
font-weight: 500;
|
|
476
|
+
margin-top: 16px;
|
|
477
|
+
display: flex;
|
|
478
|
+
text-align: center;
|
|
479
|
+
align-items: center;
|
|
480
|
+
justify-content: center;
|
|
481
|
+
gap: 6px;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.request-payment-fractal-powerd-by span {
|
|
485
|
+
color: #61C699;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.request-payment-success-container {
|
|
489
|
+
display: flex;
|
|
490
|
+
padding: 120px 48px 32px 48px;
|
|
491
|
+
flex-direction: column;
|
|
492
|
+
justify-content: center;
|
|
493
|
+
align-items: center;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.request-payment-success-tick {
|
|
497
|
+
border-radius: 1000px;
|
|
498
|
+
background: rgba(97, 198, 153, 0.14);
|
|
499
|
+
display: flex;
|
|
500
|
+
width: 60px;
|
|
501
|
+
height: 60px;
|
|
502
|
+
justify-content: center;
|
|
503
|
+
align-items: center;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.request-payment-success-text {
|
|
507
|
+
color: #161616;
|
|
508
|
+
text-align: center;
|
|
509
|
+
font-size: 32px;
|
|
510
|
+
font-style: normal;
|
|
511
|
+
font-weight: 500;
|
|
512
|
+
line-height: 36px;
|
|
513
|
+
/* 112.5% */
|
|
514
|
+
letter-spacing: -0.64px;
|
|
515
|
+
margin-top: 20px;
|
|
516
|
+
margin-bottom: 5px !important;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.request-payment-success-subtext {
|
|
520
|
+
color: #727272;
|
|
521
|
+
text-align: center;
|
|
522
|
+
font-size: 14px;
|
|
523
|
+
font-style: normal;
|
|
524
|
+
font-weight: 500;
|
|
525
|
+
line-height: 18px;
|
|
526
|
+
letter-spacing: -0.28px;
|
|
527
|
+
margin-bottom: 6rem !important;
|
|
528
|
+
margin-top: 8px !important;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.request-payment-success-btn-div {
|
|
532
|
+
display: flex;
|
|
533
|
+
align-items: flex-start;
|
|
534
|
+
justify-content: center;
|
|
535
|
+
gap: 8px;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.request-payment-success-tick-div {
|
|
539
|
+
display: flex;
|
|
540
|
+
justify-content: center;
|
|
541
|
+
align-items: center;
|
|
542
|
+
margin-top: 32px;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.request-payment-success-btn1 {
|
|
546
|
+
cursor: pointer;
|
|
547
|
+
border-radius: 80px;
|
|
548
|
+
border: 1px solid #E0DFE2;
|
|
549
|
+
display: flex;
|
|
550
|
+
padding: 12px 32px;
|
|
551
|
+
justify-content: center;
|
|
552
|
+
align-items: center;
|
|
553
|
+
gap: 6px;
|
|
554
|
+
background-color: #fff;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.request-payment-success-btn2 {
|
|
558
|
+
border-radius: 80px;
|
|
559
|
+
cursor: pointer;
|
|
560
|
+
border: 1px solid #E0DFE2;
|
|
561
|
+
display: flex;
|
|
562
|
+
padding: 12px 32px;
|
|
563
|
+
justify-content: center;
|
|
564
|
+
align-items: center;
|
|
565
|
+
gap: 6px;
|
|
566
|
+
background-color: #161616;
|
|
567
|
+
color: #fff;
|
|
568
|
+
font-size: 14px;
|
|
569
|
+
font-style: normal;
|
|
570
|
+
font-weight: 500;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.request-payment-error-msg{
|
|
574
|
+
color: #dc3545;
|
|
575
|
+
|
|
576
|
+
font-size: 12px;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.frac-req-cash-discount{
|
|
580
|
+
justify-content: center;
|
|
581
|
+
gap: 8px;
|
|
582
|
+
align-items: center;
|
|
583
|
+
display: flex;
|
|
584
|
+
padding: 9px 14px 9px 10px;
|
|
585
|
+
font-family: Inter;
|
|
586
|
+
color: #161616;
|
|
587
|
+
font-style: normal;
|
|
588
|
+
font-weight: 500;
|
|
589
|
+
font-size: 14px;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.frac-req-cash-discount .frac-cashlabel{
|
|
593
|
+
color: #727272;
|
|
594
|
+
font-size: 12px;
|
|
595
|
+
font-style: normal;
|
|
596
|
+
font-weight: 500;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.partial-toggle-div {
|
|
600
|
+
display: flex;
|
|
601
|
+
align-items: center;
|
|
602
|
+
justify-content: center;
|
|
603
|
+
gap: 12px;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.partial-input[type="checkbox"] {
|
|
607
|
+
appearance: none;
|
|
608
|
+
-webkit-appearance: none;
|
|
609
|
+
width: 50px;
|
|
610
|
+
height: 26px;
|
|
611
|
+
background-color: #ccc;
|
|
612
|
+
border-radius: 13px;
|
|
613
|
+
position: relative;
|
|
614
|
+
cursor: pointer;
|
|
615
|
+
transition: background-color 0.3s ease;
|
|
616
|
+
border: none;
|
|
617
|
+
outline: none;
|
|
618
|
+
margin-right: 10px;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.partial-input[type="checkbox"]::before {
|
|
622
|
+
content: '';
|
|
623
|
+
position: absolute;
|
|
624
|
+
width: 22px;
|
|
625
|
+
height: 22px;
|
|
626
|
+
border-radius: 50%;
|
|
627
|
+
background-color: white;
|
|
628
|
+
top: 2px;
|
|
629
|
+
left: 2px;
|
|
630
|
+
transition: transform 0.3s ease;
|
|
631
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.partial-input[type="checkbox"]:checked {
|
|
635
|
+
background-color: #000000;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
.partial-input[type="checkbox"]:checked::before {
|
|
639
|
+
transform: translateX(24px);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.partial-input[type="checkbox"]:focus {
|
|
643
|
+
box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.partial-label {
|
|
647
|
+
user-select: none;
|
|
648
|
+
font-size: 14px;
|
|
649
|
+
}
|
|
650
|
+
`),$i=Ea;var ui=e=>{try{let t=JSON.parse(e);return typeof t=="object"&&t!==null}catch(t){return!1}},gi=[{value:"personal saving",label:"Personal Saving"},{value:"business saving",label:"Business Saving"},{value:"personal checking",label:"Personal Checking"},{value:"business checking",label:"Business Checking"}];function ye(e){let t=Number(e);return isNaN(t)?`$${e}`:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}var ja=te+"widget/mc-img.svg",Va=te+"widget/visa-img.svg",Oa=te+"widget/ae-img.svg",Ka=te+"widget/discover-img.svg",ki=te+"widget/card.svg",Za=te+"widget/bank.svg",ro=te+"widget/Trash.svg",oo=te+"widget/secure-img.png",so=te+"widget/pov-by.png",Ei=te+"widget/pax.svg",fa=te+"widget/Bank _New.svg",ha=e=>{switch(e==null?void 0:e.toLowerCase()){case"visa":return Va;case"mastercard":case"mc":case"m/c":return ja;case"amex":case"american express":case"ae":return Oa;case"discover":case"dcvr":return Ka;case"bank":return Za;default:return ki}},Tn=(e,t)=>{let H=e.replace(/\D/g,""),T=e.slice(0,t).replace(/\D/g,"").length,z="",B="";if(/^3[47]/.test(H)?(z=H.slice(0,15),B=z.replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(K,A,G,oe)=>[A,G,oe].filter(Boolean).join(" "))):(z=H.slice(0,16),B=z.replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(K,A,G,oe,w)=>[A,G,oe,w].filter(Boolean).join(" "))),T===0)return{formatted:B,cursor:0};let U=B.length,be=0;for(let K=0;K<B.length;K++)if(/\d/.test(B[K])&&be++,be===T){U=K+1;break}return{formatted:B,cursor:U}},Vn=e=>e==1?!1:(e==0,!0);function Ua(e){let t=e.merchantPublicKey,H=e==null?void 0:e.discount,T=e==null?void 0:e.tax,z=e==null?void 0:e.surcharge,[B,O]=Un(!1),[U,be]=Un(!1),[K,A]=Un({}),[G,oe]=Un(null),[w,C]=Un({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),[R,V]=Un(!1),[y,Se]=Un(void 0),[M,Te]=Un(""),[_e,ce]=Un(!1),[Ne,ft]=Un(null),Pe=x=>/^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(x),Fe=/[+-]?([0-9]*[.])?[0-9]+/,ue=x=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x),Ye=x=>/^[A-Za-z\s]*$/.test(x),De=(x,f)=>{let N=(parseFloat(f)||0)/100,je=x/(1+N);return Math.round(je*100)/100};ya(()=>{if(e!=null&&e.pass_fee){let x=De(e==null?void 0:e.amount,e==null?void 0:e.surcharge);Se(x)}},[e==null?void 0:e.pass_fee]);let gn=()=>{O(!1),A({})},nn=()=>O(!0),h=()=>{console.log(Ne,"apiresponse"),u(Ne),ce(!1)};function L(){C({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),Te("")}function u(x){let f={type:"preview.compiledcheck",other:F(v({},x),{status:!0})};window.parent.postMessage(f,"*")}let xe=async x=>{if(x.currentTarget.blur(),!U&&!(Object.keys(K).length>0)){if(A({}),!(w!=null&&w.email)&&G&&!Pe(G)){A(f=>F(v({},f),{phone:Jt.phonenumbervalid}));return}if(b())try{be(!0);let f={fractalpayPublicKey:t,amount:M,phone_number:G,order_id:w.order_id,action:"request",name:w.name,email:w.email,customer_id:e!=null&&e.customerId?e==null?void 0:e.customerId:"",discount:H,surcharge:z,tax:T,require_3ds:e==null?void 0:e.require_3ds,pass_fee:e==null?void 0:e.pass_fee,allow_partial:R},N=await Wa.post(`${tt}create-widget-order`,f,{headers:v({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})});(N==null?void 0:N.status)===200&&(ce(!0),O(!1),L(),ft(N==null?void 0:N.data)),be(!1)}catch(f){console.log(f),be(!1)}}},a=tt+"images/logo-img.png",o=x=>{let{value:f}=x.target,N=x.target.dataset.token;if(C(F(v({},w),{[N]:f})),N==="name"&&!Ye(f)){A(gt=>F(v({},gt),{[N]:Jt.onlylettersallowed}));return}let je=K;N==="email"&&!G&&(delete je.phone,A(je)),f&&(delete je[N],A(je)),N==="email"&&!f&&(delete je[N],A(je))},r=x=>{let{value:f}=x;if(Number(f)>0){let N=K;delete N.amount,A(N)}Te(f)},b=()=>{let x={};return M||(x.amount=Jt.amountrequired),w.email&&!ue(w==null?void 0:w.email)&&(x.email=Jt.invalidemail),!G&&!(w!=null&&w.email)&&(x.phone=Jt.phoneoremailrequired),!G&&!(w!=null&&w.email)&&(x.email=Jt.phoneoremailrequired),!G&&w.email&&!ue(w==null?void 0:w.email)&&(x.email=Jt.invalidemail),e.from==="merchant"&&!w.order_id&&(x.order_id=Jt.orderidrequired),A(x),Object.keys(x).length===0};ya(()=>{e&&(C(x=>F(v({},x),{order_id:e.orderID?e.orderID:"",name:e!=null&&e.name?e==null?void 0:e.name:"",email:e!=null&&e.email?e==null?void 0:e.email:""})),Te(e.amount?e.amount:""),oe(e.phone?`${e.phone}`:null))},[e]);let k=x=>{let f=x==null?void 0:x.value;if(f&&(f==null?void 0:f.length)>0&&(f==null?void 0:f.length)!==10){A(je=>F(v({},je),{phone:Jt.phonenumberlength})),oe(f);return}else oe(f);let N=K;delete N.phone,f&&!(w!=null&&w.email)&&delete N.email,A(N)};function P(x){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(x))}let Y=x=>{let f=x.target.checked;V(f)};return I.createElement(I.Fragment,null,I.createElement($i,null),I.createElement(dn,{loading:U}),I.createElement(I.Fragment,null,I.createElement("button",{className:"paymentBtn",onClick:nn},"Request Payment"),I.createElement(Nn,{open:B,onClose:()=>O(!1),maxWidth:"500px"},I.createElement("div",{style:{maxWidth:"500px"}},I.createElement("div",{className:"request-payment-amount-detail frac-form"},I.createElement("p",{className:"request-payment-merchantname"},"Pay ",e==null?void 0:e.webname),I.createElement("p",{className:"request-payment-amount"},P(e==null?void 0:e.amount)),y&&y>0&&I.createElement("div",{className:"frac-req-cash-discount"},I.createElement("div",{className:"frac-cashlabel"},Vn(e==null?void 0:e.showSurcharge)?"Surcharge":"Cash Discount"," :"),I.createElement("div",null,ye((Number(e.amount)-y).toFixed(2)))),(e==null?void 0:e.from)==="merchant"&&I.createElement("p",{className:"request-payment-orderid"},w==null?void 0:w.order_id),I.createElement("span",{className:"request-payment-close-popup",onClick:gn},I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},I.createElement("g",{clipPath:"url(#clip0_12425_52336)"},I.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"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_12425_52336"},I.createElement("rect",{width:"16",height:"16",fill:"white"})))))),I.createElement("form",{className:"request-payment-input-form"},I.createElement("div",{className:"request-payment-list-div"},I.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"FULL NAME"),I.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Full Name","data-token":"name",onChange:o,value:w==null?void 0:w.name}),K.name&&I.createElement("small",{className:"request-payment-error-msg"},K.name)),I.createElement("div",{className:"request-payment-list-div"},I.createElement("label",{htmlFor:"requestPhoneNumber",className:"request-payment-input-label"},"Phone Number"),I.createElement(Ga,{className:"request-payment-input-box",placeholder:"Mobile number",format:"+1 (###) ###-####",value:G,onValueChange:x=>{k(x)}}),K.phone&&I.createElement("small",{className:"request-payment-error-msg"},K.phone)),I.createElement("div",{className:"request-payment-list-div"},I.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"EMAIL"),I.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Email",onChange:o,"data-token":"email",value:w==null?void 0:w.email}),K.email&&I.createElement("small",{className:"request-payment-error-msg"},K.email)),I.createElement("div",{className:"partial-toggle-div"},I.createElement("input",{className:"partial-input",type:"checkbox",role:"switch",style:{cursor:"pointer"},checked:R,onChange:x=>Y(x),id:"partialSwitch"}),I.createElement("label",{className:"partial-label",htmlFor:"partialSwitch",style:{cursor:"pointer"}},"Allow Partial Payments?")),I.createElement("button",{type:"button",className:"request-payment-submit-button",onClick:xe,disabled:U},U?"Loading...":"Send Request"),I.createElement("div",{className:"request-payment-fractal-powerd-by"},I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},I.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 ",I.createElement("span",null,"Fractal"),I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"}),I.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"})))))),I.createElement(Nn,{open:_e,onClose:h,maxWidth:"500px"},I.createElement("div",{className:"fractal-popup-content",style:{padding:"0px",maxWidth:"500px"}},I.createElement("div",{className:"request-payment-success-container"},I.createElement("span",{className:"request-payment-close-popup",onClick:h},I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},I.createElement("g",{clipPath:"url(#clip0_12425_52336)"},I.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"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_12425_52336"},I.createElement("rect",{width:"16",height:"16",fill:"white"}))))),I.createElement("div",{className:"request-payment-success-tick-div"},I.createElement("div",{className:"request-payment-success-tick"},I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},I.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"})))),I.createElement("h6",{className:"request-payment-success-text"},"The request ",I.createElement("br",null),"was sent"),I.createElement("h6",{className:"request-payment-success-subtext"},"Please wait for the customer to pay"),I.createElement("div",{className:"request-payment-success-btn-div"},I.createElement("button",{onClick:h,className:"request-payment-success-btn2"},"Close")))))))}import"bootstrap/dist/js/bootstrap.bundle.min.js";import j,{useState as Rn,useEffect as Ja}from"react";import Qa from"axios";import{PatternFormat as Xa}from"react-number-format";function Da(e){let t=e.merchantPublicKey,H=e==null?void 0:e.discount,T=e==null?void 0:e.tax,z=e==null?void 0:e.surcharge,[B,O]=Rn(!1),[U,be]=Rn(!1),[K,A]=Rn({}),[G,oe]=Rn(null),[w,C]=Rn({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),[R,V]=Rn(""),[y,Se]=Rn(!1),[M,Te]=Rn(null),_e=o=>/^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(o),ce=/[+-]?([0-9]*[.])?[0-9]+/,Ne=o=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o),ft=o=>/^[A-Za-z\s]*$/.test(o),Pe=()=>{O(!1),A({})},Fe=()=>O(!0),ue=()=>{De(M),Se(!1)};function Ye(){C({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),V("")}function De(o){let r={type:"preview.compiledcheck",other:F(v({},o),{status:!0})};window.parent.postMessage(r,"*")}let gn=async o=>{if(o.currentTarget.blur(),!U&&!(Object.keys(K).length>0)){if(A({}),!(w!=null&&w.email)&&G&&!_e(G)){A(r=>F(v({},r),{phone:Jt.phonenumbervalid}));return}if(u())try{be(!0);let r={fractalpayPublicKey:t,amount:R,phone_number:G,order_id:w.order_id,action:"request",name:w.name,email:w.email,customer_id:e!=null&&e.customerId?e==null?void 0:e.customerId:"",discount:H,surcharge:z,tax:T,require_3ds:e==null?void 0:e.require_3ds},b=await Qa.post(`${tt}send-request-pre-auth-payment`,r,{headers:v({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})});(b==null?void 0:b.status)===200&&(Se(!0),O(!1),Ye(),Te(b==null?void 0:b.data)),be(!1)}catch(r){console.log(r),be(!1)}}},nn=tt+"images/logo-img.png",h=o=>{let{value:r}=o.target,b=o.target.dataset.token;if(C(F(v({},w),{[b]:r})),b==="name"&&!ft(r)){A(P=>F(v({},P),{[b]:Jt.onlylettersallowed}));return}let k=K;b==="email"&&!G&&(delete k.phone,A(k)),r&&(delete k[b],A(k)),b==="email"&&!r&&(delete k[b],A(k))},L=o=>{let{value:r}=o;if(Number(r)>0){let b=K;delete b.amount,A(b)}V(r)},u=()=>{let o={};return R||(o.amount=Jt.amountrequired),w.email&&!Ne(w==null?void 0:w.email)&&(o.email=Jt.invalidemail),!G&&!(w!=null&&w.email)&&(o.phone=Jt.phoneoremailrequired),!G&&!(w!=null&&w.email)&&(o.email=Jt.phoneoremailrequired),!G&&w.email&&!Ne(w==null?void 0:w.email)&&(o.email=Jt.invalidemail),e.from==="merchant"&&!w.order_id&&(o.order_id=Jt.orderidrequired),A(o),Object.keys(o).length===0};Ja(()=>{e&&(C(o=>F(v({},o),{order_id:e.orderID?e.orderID:"",name:e!=null&&e.name?e==null?void 0:e.name:"",email:e!=null&&e.email?e==null?void 0:e.email:""})),V(e.amount?e.amount:""),oe(e.phone?`${e.phone}`:null))},[e]);let xe=o=>{let r=o==null?void 0:o.value;if(r&&(r==null?void 0:r.length)>0&&(r==null?void 0:r.length)!==10){A(k=>F(v({},k),{phone:Jt.phonenumberlength})),oe(r);return}else oe(r);let b=K;delete b.phone,r&&!(w!=null&&w.email)&&delete b.email,A(b)};function a(o){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(o))}return j.createElement(j.Fragment,null,j.createElement($i,null),j.createElement(dn,{loading:U}),j.createElement(j.Fragment,null,j.createElement("button",{className:"paymentBtn",onClick:Fe},"Send Request"),j.createElement("div",{className:"frac-form"},j.createElement(Nn,{open:B,onClose:()=>O(!1),maxWidth:"500px"},j.createElement("div",{className:"request-payment-amount-detail"},j.createElement("p",{className:"request-payment-merchantname"},"Authorization Request"),j.createElement("p",{className:"request-payment-pre-auth-merchantname"},"Pay ",e==null?void 0:e.webname),j.createElement("p",{className:"request-payment-amount"},a(e==null?void 0:e.amount)),(e==null?void 0:e.from)==="merchant"&&j.createElement("p",{className:"request-payment-orderid"},w==null?void 0:w.order_id),j.createElement("span",{className:"request-payment-close-popup",onClick:Pe},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},j.createElement("g",{clipPath:"url(#clip0_12425_52336)"},j.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"})),j.createElement("defs",null,j.createElement("clipPath",{id:"clip0_12425_52336"},j.createElement("rect",{width:"16",height:"16",fill:"white"})))))),j.createElement("form",{className:"request-payment-input-form"},j.createElement("div",{className:"request-payment-list-div"},j.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"FULL NAME"),j.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Full Name","data-token":"name",onChange:h,value:w==null?void 0:w.name}),K.name&&j.createElement("small",{className:"request-payment-error-msg"},K.name)),j.createElement("div",{className:"request-payment-list-div"},j.createElement("label",{htmlFor:"requestPhoneNumber",className:"request-payment-input-label"},"Phone Number"),j.createElement(Xa,{className:"request-payment-input-box",placeholder:"Mobile number",format:"+1 (###) ###-####",value:G,onValueChange:o=>{xe(o)}}),K.phone&&j.createElement("small",{className:"request-payment-error-msg"},K.phone)),j.createElement("div",{className:"request-payment-list-div"},j.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"EMAIL"),j.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Email",onChange:h,"data-token":"email",value:w==null?void 0:w.email}),K.email&&j.createElement("small",{className:"request-payment-error-msg"},K.email)),j.createElement("button",{type:"button",className:"request-payment-submit-button",onClick:gn,disabled:U},U?"Loading...":"Send Request"),j.createElement("div",{className:"request-payment-fractal-powerd-by"},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},j.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 ",j.createElement("span",null,"Fractal"),j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}),j.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"}))))),j.createElement(Nn,{open:y,onClose:ue,maxWidth:"500px"},j.createElement("div",{className:"fractal-popup-content",style:{padding:"0px",maxWidth:"500px"}},j.createElement("div",{className:"request-payment-success-container"},j.createElement("span",{className:"request-payment-close-popup",onClick:ue},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},j.createElement("g",{clipPath:"url(#clip0_12425_52336)"},j.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"})),j.createElement("defs",null,j.createElement("clipPath",{id:"clip0_12425_52336"},j.createElement("rect",{width:"16",height:"16",fill:"white"}))))),j.createElement("div",{className:"request-payment-success-tick-div"},j.createElement("div",{className:"request-payment-success-tick"},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},j.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"})))),j.createElement("h6",{className:"request-payment-success-text"},"The request ",j.createElement("br",null),"was sent"),j.createElement("h6",{className:"request-payment-success-subtext"},"Please wait for the customer to pay"),j.createElement("div",{className:"request-payment-success-btn-div"},j.createElement("button",{onClick:ue,className:"request-payment-success-btn2"},"Close"))))))))}import i,{useEffect as xa,useState as Et}from"react";import Ra from"react";function oi(){let e="#000",t="#fff",H="#212529",T="#dee2e6";return Ra.createElement("style",null,`
|
|
651
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
652
|
+
body
|
|
653
|
+
{
|
|
654
|
+
font-family: 'Inter', sans-serif !important;
|
|
655
|
+
}
|
|
656
|
+
input
|
|
657
|
+
{
|
|
658
|
+
font-family: 'Inter', sans-serif !important;
|
|
659
|
+
}
|
|
660
|
+
.frac-form .form-group{
|
|
661
|
+
margin:0 !important
|
|
662
|
+
}
|
|
663
|
+
.frac-form .mb-4{
|
|
664
|
+
margin-bottom : 10px !important
|
|
665
|
+
}
|
|
666
|
+
.frac-form .save-ach-div{
|
|
667
|
+
display:flex !important;
|
|
668
|
+
gap:5px !important;
|
|
669
|
+
align-items:center
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.frac-form .card-cvv-in{
|
|
673
|
+
height : 36px !importantt;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.frac-form .pay-payment-amount{
|
|
677
|
+
text-align:start !important
|
|
678
|
+
}
|
|
679
|
+
.frac-form .pay-amount{
|
|
680
|
+
text-align:start !important
|
|
681
|
+
}
|
|
682
|
+
.frac-form .pay-main-logo{
|
|
683
|
+
text-align:start !important
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
.paymentBtn {
|
|
689
|
+
background-color: black;
|
|
690
|
+
border: none;
|
|
691
|
+
color: white;
|
|
692
|
+
padding: 15px 32px;
|
|
693
|
+
text-align: center;
|
|
694
|
+
text-decoration: none;
|
|
695
|
+
display: inline-block;
|
|
696
|
+
font-size: 16px;
|
|
697
|
+
margin: 4px 2px;
|
|
698
|
+
cursor: pointer;
|
|
699
|
+
border-radius: 180px;
|
|
700
|
+
/* width: auto; */
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
.main-logo {
|
|
704
|
+
text-align: center;
|
|
705
|
+
margin-bottom: 20px;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.main-logo img {
|
|
709
|
+
max-width: 180px;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.pay-main-box {
|
|
713
|
+
width: 365px !important;
|
|
714
|
+
height: 93%;
|
|
715
|
+
background: 0 0 #ffffff;
|
|
716
|
+
border-radius: 12px;
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
border: 1px solid #E0DFE2;
|
|
720
|
+
margin: 0 auto;
|
|
721
|
+
display: block;
|
|
722
|
+
padding: 0px 26px !important
|
|
723
|
+
}
|
|
724
|
+
.pay-main-box .pay-header {
|
|
725
|
+
display: flex;
|
|
726
|
+
justify-content: center;
|
|
727
|
+
align-items: center;
|
|
728
|
+
text-align: center;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.pay-main-box .pay-header button {
|
|
732
|
+
border: 0;
|
|
733
|
+
background: none;
|
|
734
|
+
padding: 0;
|
|
735
|
+
box-shadow: 0;
|
|
736
|
+
outline: inherit;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.pay-main-box h1 {
|
|
740
|
+
margin: 0;
|
|
741
|
+
flex: 1;
|
|
742
|
+
padding: 10px 0;
|
|
743
|
+
font-size: 23px;
|
|
744
|
+
font-weight: 500;
|
|
745
|
+
color: #35254D;
|
|
746
|
+
align-items: start;
|
|
747
|
+
display: flex;
|
|
748
|
+
}
|
|
749
|
+
.tab {
|
|
750
|
+
overflow: hidden;
|
|
751
|
+
padding: 5px;
|
|
752
|
+
border-radius: 8px;
|
|
753
|
+
display: flex;
|
|
754
|
+
justify-content: space-around;
|
|
755
|
+
margin-bottom:12px
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/* Style the buttons inside the tab */
|
|
759
|
+
.tab button {
|
|
760
|
+
float: left;
|
|
761
|
+
border: none;
|
|
762
|
+
outline: none;
|
|
763
|
+
cursor: pointer;
|
|
764
|
+
background:white;
|
|
765
|
+
padding: 11px 16px;
|
|
766
|
+
transition: 0.3s;
|
|
767
|
+
font-size: 16px;
|
|
768
|
+
width: 143px;
|
|
769
|
+
border-radius: 5px;
|
|
770
|
+
box-shadow: inherit;
|
|
771
|
+
outline: none;
|
|
772
|
+
color: ${e};
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/* Change background color of buttons on hover */
|
|
776
|
+
.tab button:hover {
|
|
777
|
+
background-color: #f0f0f0;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/* Create an active/current tablink class */
|
|
781
|
+
// .tab button.active {
|
|
782
|
+
// background-color: #ccc;
|
|
783
|
+
// }
|
|
784
|
+
|
|
785
|
+
/* Style the tab content */
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
.parent-pay-container{
|
|
789
|
+
padding: 24px;
|
|
790
|
+
}
|
|
791
|
+
.pay-container{
|
|
792
|
+
display: grid;
|
|
793
|
+
grid-template-columns: 2fr 3fr;
|
|
794
|
+
|
|
795
|
+
}
|
|
796
|
+
.pay-main{
|
|
797
|
+
padding-y: 20px}
|
|
798
|
+
|
|
799
|
+
.request-payment-close-popup {
|
|
800
|
+
position: absolute;
|
|
801
|
+
right: 20px;
|
|
802
|
+
top: 20px;
|
|
803
|
+
cursor: pointer;
|
|
804
|
+
}
|
|
805
|
+
.pay-conatiner-one{
|
|
806
|
+
border-right: 1px solid #E0DFE2;
|
|
807
|
+
}
|
|
808
|
+
.pay-conatiner-one-first{
|
|
809
|
+
min-height:530px
|
|
810
|
+
}
|
|
811
|
+
.pay-conatiner-one-last{
|
|
812
|
+
display:flex;
|
|
813
|
+
font-size:12px;
|
|
814
|
+
gap:5px;
|
|
815
|
+
max-width:250px;
|
|
816
|
+
align-items:center;
|
|
817
|
+
color:black !important
|
|
818
|
+
}
|
|
819
|
+
.pay-conatiner-one-last img{
|
|
820
|
+
width : 17px;
|
|
821
|
+
height:17px
|
|
822
|
+
}
|
|
823
|
+
.pay-conatiner-two{
|
|
824
|
+
padding: 0 5% 0;
|
|
825
|
+
}
|
|
826
|
+
.pay-logo-container{
|
|
827
|
+
border-bottom: 1px solid #E0DFE2
|
|
828
|
+
}
|
|
829
|
+
.pay-heading{
|
|
830
|
+
margin: 0;
|
|
831
|
+
flex: 1;
|
|
832
|
+
padding: 10px 0;
|
|
833
|
+
font-size: 23px;
|
|
834
|
+
font-weight: 500;
|
|
835
|
+
color: #35254D;
|
|
836
|
+
align-items: start;
|
|
837
|
+
display: flex;
|
|
838
|
+
}
|
|
839
|
+
.pay-main-logo > img{
|
|
840
|
+
width: 50%;
|
|
841
|
+
}
|
|
842
|
+
.pay-main-logo-res > img{
|
|
843
|
+
width: 50%;
|
|
844
|
+
display : none
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.pay-payment-amount{
|
|
848
|
+
display: block;
|
|
849
|
+
font-size: 12px;
|
|
850
|
+
color: #727272;
|
|
851
|
+
margin-bottom: 8px;
|
|
852
|
+
}
|
|
853
|
+
.pay-amount-conatiner{
|
|
854
|
+
margin-top: 6%;
|
|
855
|
+
}
|
|
856
|
+
.pay-amount{
|
|
857
|
+
color: #000000;
|
|
858
|
+
font-size: 38px;
|
|
859
|
+
display: block;
|
|
860
|
+
line-height: 110%;
|
|
861
|
+
letter-spacing: -1px;
|
|
862
|
+
}
|
|
863
|
+
.frac-form label{
|
|
864
|
+
font-family: 'IBM Plex Mono', monospace !important;
|
|
865
|
+
color: #727272 !important;
|
|
866
|
+
margin-bottom: 2px !important;
|
|
867
|
+
font-weight: 600 !important;
|
|
868
|
+
font-size: 12px !important;
|
|
869
|
+
display:block !important;
|
|
870
|
+
text-align : left !important
|
|
871
|
+
}
|
|
872
|
+
.form-control{
|
|
873
|
+
display: block;
|
|
874
|
+
width: 100%;
|
|
875
|
+
padding: .375rem .75rem;
|
|
876
|
+
font-size: 1rem;
|
|
877
|
+
font-weight: 400;
|
|
878
|
+
line-height: 1.5;
|
|
879
|
+
color: ${H};
|
|
880
|
+
-webkit-appearance: none;
|
|
881
|
+
-moz-appearance: none;
|
|
882
|
+
appearance: none;
|
|
883
|
+
background-color: ${t};
|
|
884
|
+
background-clip: padding-box;
|
|
885
|
+
border: 1px solid ${T};
|
|
886
|
+
border-radius: 0.375rem;
|
|
887
|
+
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
|
888
|
+
}
|
|
889
|
+
.form-control:focus{
|
|
890
|
+
border-color: #86b7fe;
|
|
891
|
+
outline: 0;
|
|
892
|
+
}
|
|
893
|
+
.toggle-num-wrapper {
|
|
894
|
+
position: relative;
|
|
895
|
+
}
|
|
896
|
+
.card-number-new{
|
|
897
|
+
border-bottom: none;
|
|
898
|
+
border-bottom-left-radius: 0px;
|
|
899
|
+
border-bottom-right-radius: 0px;
|
|
900
|
+
}
|
|
901
|
+
.card-crdi {
|
|
902
|
+
display: flex;
|
|
903
|
+
border: 1px solid ${T};
|
|
904
|
+
border-radius: 0.375rem;
|
|
905
|
+
}
|
|
906
|
+
.card-expiry-new{
|
|
907
|
+
border-top-left-radius: 0px;
|
|
908
|
+
border-top-right-radius: 0px;
|
|
909
|
+
}
|
|
910
|
+
.exp-date-year-container{
|
|
911
|
+
display: flex;
|
|
912
|
+
flex-wrap: wrap;
|
|
913
|
+
}
|
|
914
|
+
.exp-date-year-container .form-group{
|
|
915
|
+
flex:1;
|
|
916
|
+
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
.exp-date {
|
|
920
|
+
float: left;
|
|
921
|
+
// width: 30%
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
.exp-date input {
|
|
925
|
+
width: calc(100% + 1px);
|
|
926
|
+
border-top-right-radius: 0;
|
|
927
|
+
border-bottom-right-radius: 0;
|
|
928
|
+
border: 0;
|
|
929
|
+
border-right: 1px solid ${T};
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
.exp-year {
|
|
934
|
+
float: left;
|
|
935
|
+
// width: 30%
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
.exp-year input {
|
|
939
|
+
width: calc(100% + 1px);
|
|
940
|
+
border-radius: 0;
|
|
941
|
+
border-top: 0;
|
|
942
|
+
border-bottom: 0;
|
|
943
|
+
border-right: 1px solid ${T};
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.exp-date input:focus {
|
|
947
|
+
position: relative;
|
|
948
|
+
z-index: 10;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.security-digit {
|
|
952
|
+
float: right;
|
|
953
|
+
// width: 40%;
|
|
954
|
+
position: relative;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
.security-digit input {
|
|
958
|
+
border-top-left-radius: 0;
|
|
959
|
+
border-bottom-left-radius: 0;
|
|
960
|
+
border-top: 0;
|
|
961
|
+
border-bottom: 0;
|
|
962
|
+
border-right:0;
|
|
963
|
+
}
|
|
964
|
+
.card-expiry-new{
|
|
965
|
+
border-top-left-radius: 0px;
|
|
966
|
+
border-top-right-radius: 0px;
|
|
967
|
+
}
|
|
968
|
+
.form-control{box-sizing: border-box ;}
|
|
969
|
+
#PaymentForm .form-group{
|
|
970
|
+
padding:5px 0 ;
|
|
971
|
+
matgin: 0 !important
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
.toggle-label {
|
|
975
|
+
position: relative;
|
|
976
|
+
display: inline-block;
|
|
977
|
+
width: 40px;
|
|
978
|
+
height: 24px;
|
|
979
|
+
background-color: #ccc;
|
|
980
|
+
border-radius: 12px;
|
|
981
|
+
cursor: pointer;
|
|
982
|
+
transition: background-color 0.3s;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.toggle-label::before {
|
|
986
|
+
content: "";
|
|
987
|
+
position: absolute;
|
|
988
|
+
top: 2px;
|
|
989
|
+
left: 2px;
|
|
990
|
+
width: 20px;
|
|
991
|
+
height: 20px;
|
|
992
|
+
background: #ffffff;
|
|
993
|
+
border-radius: 50%;
|
|
994
|
+
transition: left 300ms linear;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.toggle-checkbox {
|
|
998
|
+
display: none;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
.toggle-checkbox:checked + .toggle-label {
|
|
1002
|
+
background-color: #4caf50;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
.toggle-checkbox:checked + .toggle-label::before {
|
|
1006
|
+
left: 18px;
|
|
1007
|
+
}
|
|
1008
|
+
.ach-scrl {
|
|
1009
|
+
max-height: 380px;
|
|
1010
|
+
min-height: 380px;
|
|
1011
|
+
overflow-y: auto;
|
|
1012
|
+
padding-right: 6px;
|
|
1013
|
+
}
|
|
1014
|
+
.mb-4{
|
|
1015
|
+
margin-bottom:4px
|
|
1016
|
+
}
|
|
1017
|
+
.ach-scrl::-webkit-scrollbar {
|
|
1018
|
+
width: 3px;
|
|
1019
|
+
background-color: #F5F5F5;
|
|
1020
|
+
}
|
|
1021
|
+
.ach-scrl::-webkit-scrollbar-thumb {
|
|
1022
|
+
background-color: #35254D;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
.error-span{
|
|
1026
|
+
color:red !important;
|
|
1027
|
+
font-size:12px !important;
|
|
1028
|
+
text-align: left !important;
|
|
1029
|
+
width: 100% !important;
|
|
1030
|
+
display: block;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
.charge-customer-name{
|
|
1034
|
+
color: #161616;
|
|
1035
|
+
font-family: Inter;
|
|
1036
|
+
font-size: 24px;
|
|
1037
|
+
font-style: normal;
|
|
1038
|
+
font-weight: 600;
|
|
1039
|
+
line-height: 32px;
|
|
1040
|
+
letter-spacing: -0.48px;
|
|
1041
|
+
text-transform: capitalize;
|
|
1042
|
+
margin-top:0;
|
|
1043
|
+
margin-bottom:16px !important;
|
|
1044
|
+
text-align:left !important
|
|
1045
|
+
}
|
|
1046
|
+
.card-ach-heading {
|
|
1047
|
+
color: #727272;
|
|
1048
|
+
font-family: Inter;
|
|
1049
|
+
font-size: 12px;
|
|
1050
|
+
font-style: normal;
|
|
1051
|
+
font-weight: 500;
|
|
1052
|
+
line-height: 18px;
|
|
1053
|
+
letter-spacing: -0.24px;
|
|
1054
|
+
margin : 0 0 10px !important;
|
|
1055
|
+
text-align : left
|
|
1056
|
+
}
|
|
1057
|
+
.card-list-div{
|
|
1058
|
+
max-height : 190px;
|
|
1059
|
+
overflow-y : auto;
|
|
1060
|
+
border:1px solid #E0DFE2;
|
|
1061
|
+
border-radius : 8px
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
.card-list-div::-webkit-scrollbar{
|
|
1066
|
+
width:2px;
|
|
1067
|
+
background-color:#F5F5F5
|
|
1068
|
+
}
|
|
1069
|
+
.card-list-div::-webkit-scrollbar-thumb{
|
|
1070
|
+
background-color:#35254D
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
.card-list-single-div{
|
|
1074
|
+
border-bottom: 1px solid #E0DFE2;
|
|
1075
|
+
padding : 8px 11px;
|
|
1076
|
+
display : flex ;
|
|
1077
|
+
align-items:center;
|
|
1078
|
+
justify-content : space-between;
|
|
1079
|
+
gap:12px
|
|
1080
|
+
}
|
|
1081
|
+
.card-list-single-div:last-child {
|
|
1082
|
+
border-bottom: none;
|
|
1083
|
+
}
|
|
1084
|
+
.card-lint-div-in{
|
|
1085
|
+
min-height:444px}
|
|
1086
|
+
.card-number-radio{
|
|
1087
|
+
display:flex;
|
|
1088
|
+
gap:12px;
|
|
1089
|
+
}
|
|
1090
|
+
.card-number-radio .card-number-last-four{
|
|
1091
|
+
color:#161616 !important;
|
|
1092
|
+
font-family:Inter !important;
|
|
1093
|
+
font-size:14px !important;
|
|
1094
|
+
font-weight:500 !important;
|
|
1095
|
+
font-style:normal !important;
|
|
1096
|
+
line-height : 18px !important;
|
|
1097
|
+
latter-spacing:-0.18px !important
|
|
1098
|
+
}
|
|
1099
|
+
.card-expiry-date{
|
|
1100
|
+
margin:0;
|
|
1101
|
+
color:#00000080;
|
|
1102
|
+
font-family:Inter;
|
|
1103
|
+
font-size:14px;
|
|
1104
|
+
font-weight:500;
|
|
1105
|
+
font-style"normal;
|
|
1106
|
+
line-height : 18px;
|
|
1107
|
+
latter-spacing:-0.18px
|
|
1108
|
+
}
|
|
1109
|
+
.pay-with-other-card {
|
|
1110
|
+
margin-top : 12px;
|
|
1111
|
+
padding:12px 32px;
|
|
1112
|
+
border :1px solid #E0DFE2;
|
|
1113
|
+
border-radius : 1000px;
|
|
1114
|
+
display: flex;
|
|
1115
|
+
justify-content : center;
|
|
1116
|
+
align-items:center;
|
|
1117
|
+
gap:10px;
|
|
1118
|
+
// width:100%;
|
|
1119
|
+
background:white;
|
|
1120
|
+
cursor:pointer;
|
|
1121
|
+
color:#161616;
|
|
1122
|
+
text-align:center
|
|
1123
|
+
font-family: Inter;
|
|
1124
|
+
font-size: 14px;
|
|
1125
|
+
font-style: normal;
|
|
1126
|
+
font-weight: 500;
|
|
1127
|
+
line-height: 24px;
|
|
1128
|
+
letter-spacing: -0.28px;
|
|
1129
|
+
// margin-bottom: 50px;
|
|
1130
|
+
}
|
|
1131
|
+
.charge-payment-back-btn {
|
|
1132
|
+
display: flex;
|
|
1133
|
+
padding: 5px 10px;
|
|
1134
|
+
align-items: center;
|
|
1135
|
+
gap: 6px;
|
|
1136
|
+
border-radius: 1000px;
|
|
1137
|
+
border: 1px solid #E0DFE2;
|
|
1138
|
+
background: #FFF;
|
|
1139
|
+
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
1140
|
+
font-size:16px;
|
|
1141
|
+
cursor:pointer;
|
|
1142
|
+
color:black
|
|
1143
|
+
}
|
|
1144
|
+
.res-charge-payment-back-btn{
|
|
1145
|
+
padding: 9px 16px;
|
|
1146
|
+
align-items: center;
|
|
1147
|
+
gap: 6px;
|
|
1148
|
+
margin-bottom: 20px;
|
|
1149
|
+
border-radius: 1000px;
|
|
1150
|
+
border: 1px solid #E0DFE2;
|
|
1151
|
+
background: #FFF;
|
|
1152
|
+
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
1153
|
+
font-size:16px;
|
|
1154
|
+
curso:pointer;
|
|
1155
|
+
color:black;
|
|
1156
|
+
display:none
|
|
1157
|
+
}
|
|
1158
|
+
.btn {
|
|
1159
|
+
padding: 11px 23px;
|
|
1160
|
+
background-color: black;
|
|
1161
|
+
color: white;
|
|
1162
|
+
border: none;
|
|
1163
|
+
border-radius: 6px;
|
|
1164
|
+
font-weight: bold;
|
|
1165
|
+
margin: 0 10px;
|
|
1166
|
+
cursor: pointer;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
.custom-swal-icon {
|
|
1170
|
+
margin: 20px auto;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
.custom-swal-popup {
|
|
1174
|
+
font-size: 16px;
|
|
1175
|
+
text-align: center;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
.frac-form .res-pay-con{
|
|
1179
|
+
display:none
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
.frac-cash-discount{
|
|
1183
|
+
border-radius: 8px;
|
|
1184
|
+
background: #F6F6F7;
|
|
1185
|
+
justify-content: space-between;
|
|
1186
|
+
align-items: center;
|
|
1187
|
+
display: flex;
|
|
1188
|
+
padding: 9px 14px 9px 10px;
|
|
1189
|
+
font-family: Inter;
|
|
1190
|
+
color: #161616;
|
|
1191
|
+
font-style: normal;
|
|
1192
|
+
font-weight: 500;
|
|
1193
|
+
font-size: 14px;
|
|
1194
|
+
margin: 12px 0;
|
|
1195
|
+
}
|
|
1196
|
+
.frac-cash-discount .frac-cashlabel{
|
|
1197
|
+
color: #727272;
|
|
1198
|
+
font-size: 12px;
|
|
1199
|
+
font-style: normal;
|
|
1200
|
+
font-weight: 500;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
frac-tooltip-wrapper {
|
|
1204
|
+
position: absolute;
|
|
1205
|
+
right:0;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
.frac-tooltip-icon {
|
|
1209
|
+
cursor: pointer;
|
|
1210
|
+
}
|
|
1211
|
+
.frac-tooltip-mn{
|
|
1212
|
+
position:relative;
|
|
1213
|
+
}
|
|
1214
|
+
.frac-tooltip-text {
|
|
1215
|
+
display: none;
|
|
1216
|
+
position: absolute;
|
|
1217
|
+
top:-15px;
|
|
1218
|
+
right: 22px;
|
|
1219
|
+
background: #161616;
|
|
1220
|
+
color: white;
|
|
1221
|
+
padding: 15px;
|
|
1222
|
+
border-radius: 10px;
|
|
1223
|
+
width: 200px;
|
|
1224
|
+
font-size:12px;
|
|
1225
|
+
word-break: break-word;
|
|
1226
|
+
white-space: normal;
|
|
1227
|
+
z-index: 999;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
.frac-tooltip-wrapper:hover .frac-tooltip-text {
|
|
1231
|
+
display: block;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
.frac-tooltip-text p,.frac-tooltip-text b {
|
|
1235
|
+
font-size : 12px !important;
|
|
1236
|
+
line-height : 1.5 !important;
|
|
1237
|
+
margin-bottom : 10px !important;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
@media (max-width: 768px) {
|
|
1241
|
+
.parent-pay-container{
|
|
1242
|
+
padding: 20px 5%;
|
|
1243
|
+
}
|
|
1244
|
+
.pay-container {
|
|
1245
|
+
grid-template-columns: 1fr;
|
|
1246
|
+
padding: 10px 5%;
|
|
1247
|
+
border:1px solid #E0DFE2;
|
|
1248
|
+
border-radius : 12px;
|
|
1249
|
+
gap:24px;
|
|
1250
|
+
}
|
|
1251
|
+
.pay-conatiner-one{
|
|
1252
|
+
border-right: none;
|
|
1253
|
+
}
|
|
1254
|
+
.pay-conatiner-one-first{
|
|
1255
|
+
min-height:0
|
|
1256
|
+
}
|
|
1257
|
+
.pay-main-logo > img{
|
|
1258
|
+
display: none;
|
|
1259
|
+
}
|
|
1260
|
+
.pay-main-logo-res > img {
|
|
1261
|
+
display:block;
|
|
1262
|
+
margin:auto
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
.pay-logo-container{
|
|
1266
|
+
border :none
|
|
1267
|
+
}
|
|
1268
|
+
// .res-charge-payment-back-btn {
|
|
1269
|
+
// display:flex !important
|
|
1270
|
+
// }
|
|
1271
|
+
// .charge-payment-back-btn{
|
|
1272
|
+
// display:none !important
|
|
1273
|
+
// }
|
|
1274
|
+
.fractal-popup-content{
|
|
1275
|
+
width: 90%;
|
|
1276
|
+
}
|
|
1277
|
+
// .frac-form .res-pay-con{
|
|
1278
|
+
// display:flex;
|
|
1279
|
+
// justify-content :space-between;
|
|
1280
|
+
// align-items:center;
|
|
1281
|
+
// padding-bottom : 10px
|
|
1282
|
+
// }
|
|
1283
|
+
// .frac-form .amt-pay-con{
|
|
1284
|
+
// display:none
|
|
1285
|
+
// }
|
|
1286
|
+
.pay-conatiner-one-last{
|
|
1287
|
+
display:none}
|
|
1288
|
+
.pay-conatiner-two{
|
|
1289
|
+
padding:0
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
}
|
|
1294
|
+
.amt-pay-con {
|
|
1295
|
+
padding-right: 24px;
|
|
1296
|
+
}
|
|
1297
|
+
@media (max-width : 512px){
|
|
1298
|
+
.tab button {
|
|
1299
|
+
padding: 6px 16px;
|
|
1300
|
+
}
|
|
1301
|
+
.amt-pay-con {
|
|
1302
|
+
padding-right: 0;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
.frac-cash-discount-fee {
|
|
1308
|
+
display: flex;
|
|
1309
|
+
padding: 11px;
|
|
1310
|
+
justify-content: space-between;
|
|
1311
|
+
align-items: center;
|
|
1312
|
+
align-self: stretch;
|
|
1313
|
+
border-radius: 8px;
|
|
1314
|
+
border: 1px solid #E0DFE2;
|
|
1315
|
+
background: #F6F6F7;
|
|
1316
|
+
margin-top: 24px;
|
|
1317
|
+
}
|
|
1318
|
+
.frac-cash-discount-fee small {
|
|
1319
|
+
color:#727272;
|
|
1320
|
+
font-size: 12px;
|
|
1321
|
+
font-weight: 500;
|
|
1322
|
+
}
|
|
1323
|
+
.frac-cash-discount-fee p{
|
|
1324
|
+
margin:0px;
|
|
1325
|
+
font-size: 14px;
|
|
1326
|
+
font-weight: 500;
|
|
1327
|
+
}
|
|
1328
|
+
.frac-card-payment-heading {
|
|
1329
|
+
font-size: 24px;
|
|
1330
|
+
font-style: normal;
|
|
1331
|
+
font-weight: 600;
|
|
1332
|
+
margin:0px;
|
|
1333
|
+
}
|
|
1334
|
+
.exp-date-year-container .form-group {
|
|
1335
|
+
padding: 0px !important;
|
|
1336
|
+
}
|
|
1337
|
+
.frac-heading-card-wrap {
|
|
1338
|
+
display: flex;
|
|
1339
|
+
align-items: center;
|
|
1340
|
+
margin-bottom:12px;
|
|
1341
|
+
}
|
|
1342
|
+
.frac-backarrow {
|
|
1343
|
+
margin-right: 10px;
|
|
1344
|
+
}
|
|
1345
|
+
.frac-charge-payment-back-btn-wrap , .frac-tab-2{
|
|
1346
|
+
display: none;
|
|
1347
|
+
}
|
|
1348
|
+
.frac-pay-conatiner-one{
|
|
1349
|
+
display: flex;
|
|
1350
|
+
flex-direction: column;
|
|
1351
|
+
justify-content: space-between;
|
|
1352
|
+
min-height: auto;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
.frac-partial-payment-input{
|
|
1356
|
+
margin-top: 12px !important;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
`)}import pi from"axios";import Nt from"react";import er from"react";function Ui(){return er.createElement("style",null,`
|
|
1360
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
1361
|
+
|
|
1362
|
+
body{
|
|
1363
|
+
display: flex;
|
|
1364
|
+
justify-content: center;
|
|
1365
|
+
align-items: center;
|
|
1366
|
+
padding-top: 30px;
|
|
1367
|
+
margin: 0;
|
|
1368
|
+
/* background-color: #f8f9fa; */
|
|
1369
|
+
flex-direction: column;
|
|
1370
|
+
}
|
|
1371
|
+
.payment-msg-container{
|
|
1372
|
+
min-height : 550px
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
.logo-container {
|
|
1376
|
+
display: flex;
|
|
1377
|
+
justify-content: center;
|
|
1378
|
+
align-items: center;
|
|
1379
|
+
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1380
|
+
z-index: 10;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
.client-logo {
|
|
1384
|
+
max-width: 100px;
|
|
1385
|
+
height: auto;
|
|
1386
|
+
object-fit: contain;
|
|
1387
|
+
display: block;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
.payment-success-container {
|
|
1391
|
+
display: flex;
|
|
1392
|
+
flex-direction: column;
|
|
1393
|
+
align-items: center;
|
|
1394
|
+
padding: 18px 20px 24px;
|
|
1395
|
+
width: 335px;
|
|
1396
|
+
height: 400px; /* Fixed height */
|
|
1397
|
+
background: #ffffff;
|
|
1398
|
+
border-radius: 12px;
|
|
1399
|
+
position: relative;
|
|
1400
|
+
/* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1401
|
+
border: 1px solid #e3e3e3; */
|
|
1402
|
+
justify-content: center;
|
|
1403
|
+
text-align: center;
|
|
1404
|
+
margin-top: 50px; /* Adjust this to move the content down */
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
.success-icon {
|
|
1408
|
+
display: flex;
|
|
1409
|
+
flex-direction: column;
|
|
1410
|
+
align-items: center;
|
|
1411
|
+
gap: 12px;
|
|
1412
|
+
width: 227px;
|
|
1413
|
+
height: 116px;
|
|
1414
|
+
z-index: 2;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
.circle {
|
|
1418
|
+
width: 40px;
|
|
1419
|
+
height: 40px;
|
|
1420
|
+
border: 1px solid #49b182;
|
|
1421
|
+
border-radius: 50%;
|
|
1422
|
+
display: flex;
|
|
1423
|
+
justify-content: center;
|
|
1424
|
+
align-items: center;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
.circle .fa-check-circle {
|
|
1428
|
+
font-size: 20px;
|
|
1429
|
+
color: #49b182;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
.success-text {
|
|
1433
|
+
display: flex;
|
|
1434
|
+
flex-direction: column;
|
|
1435
|
+
justify-content: center;
|
|
1436
|
+
align-items: center;
|
|
1437
|
+
gap: 4px;
|
|
1438
|
+
width: 227px;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
.payment-success-text {
|
|
1442
|
+
font-family: "Inter", sans-serif;
|
|
1443
|
+
font-weight: 500;
|
|
1444
|
+
font-size: 18px;
|
|
1445
|
+
line-height: 21px;
|
|
1446
|
+
text-align: center;
|
|
1447
|
+
letter-spacing: -0.02em;
|
|
1448
|
+
color: #161616;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
.thank-you-text {
|
|
1452
|
+
font-family: "Inter", sans-serif;
|
|
1453
|
+
font-weight: 500;
|
|
1454
|
+
font-size: 14px;
|
|
1455
|
+
line-height: 18px;
|
|
1456
|
+
text-align: center;
|
|
1457
|
+
letter-spacing: -0.02em;
|
|
1458
|
+
color: #161616;
|
|
1459
|
+
opacity: 0.5;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
.charge-payment-success-tick-div {
|
|
1463
|
+
display: flex;
|
|
1464
|
+
justify-content: center;
|
|
1465
|
+
align-items: center;
|
|
1466
|
+
margin-top: 32px;
|
|
1467
|
+
}
|
|
1468
|
+
.charge-payment-success-tick {
|
|
1469
|
+
border-radius: 1000px;
|
|
1470
|
+
background: rgba(97, 198, 153, 0.14);
|
|
1471
|
+
display: flex;
|
|
1472
|
+
width: 60px;
|
|
1473
|
+
height: 60px;
|
|
1474
|
+
justify-content: center;
|
|
1475
|
+
align-items: center;
|
|
1476
|
+
}
|
|
1477
|
+
.charge-payment-success-text {
|
|
1478
|
+
color: #161616;
|
|
1479
|
+
text-align: center;
|
|
1480
|
+
font-family: Inter;
|
|
1481
|
+
font-size: 32px;
|
|
1482
|
+
font-style: normal;
|
|
1483
|
+
font-weight: 500;
|
|
1484
|
+
line-height: 36px;
|
|
1485
|
+
letter-spacing: -0.64px;
|
|
1486
|
+
margin-top: 20px;
|
|
1487
|
+
margin-bottom: 5px !important;
|
|
1488
|
+
}
|
|
1489
|
+
.charge-payment-success-container {
|
|
1490
|
+
display: flex;
|
|
1491
|
+
padding: 120px 48px 32px 48px;
|
|
1492
|
+
flex-direction: column;
|
|
1493
|
+
justify-content: center;
|
|
1494
|
+
align-items: center;
|
|
1495
|
+
}
|
|
1496
|
+
.charge-payment-success-subtext {
|
|
1497
|
+
color: #727272;
|
|
1498
|
+
text-align: center;
|
|
1499
|
+
font-family: Inter;
|
|
1500
|
+
font-size: 14px;
|
|
1501
|
+
font-style: normal;
|
|
1502
|
+
font-weight: 500;
|
|
1503
|
+
line-height: 18px; /* 128.571% */
|
|
1504
|
+
letter-spacing: -0.28px;
|
|
1505
|
+
margin:14px 0 !important
|
|
1506
|
+
|
|
1507
|
+
}
|
|
1508
|
+
.charge-success-payment-button-div {
|
|
1509
|
+
display: flex;
|
|
1510
|
+
gap: 10px;
|
|
1511
|
+
align-items: baseline;
|
|
1512
|
+
}
|
|
1513
|
+
.charge-success-btn1 {
|
|
1514
|
+
display: flex;
|
|
1515
|
+
padding: 9px 16px;
|
|
1516
|
+
align-items: center;
|
|
1517
|
+
gap: 6px;
|
|
1518
|
+
border-radius: 1000px;
|
|
1519
|
+
border: 1px solid #e0dfe2;
|
|
1520
|
+
background: #fff;
|
|
1521
|
+
color: #161616;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
.charge-payment-success-btn-div {
|
|
1525
|
+
display: flex;
|
|
1526
|
+
align-items: flex-start;
|
|
1527
|
+
justify-content: center;
|
|
1528
|
+
gap: 8px;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
.charge-payment-success-btn1 {
|
|
1532
|
+
cursor: pointer;
|
|
1533
|
+
border-radius: 80px;
|
|
1534
|
+
border: 1px solid #e0dfe2;
|
|
1535
|
+
display: flex;
|
|
1536
|
+
padding: 12px 32px;
|
|
1537
|
+
justify-content: center;
|
|
1538
|
+
align-items: center;
|
|
1539
|
+
gap: 6px;
|
|
1540
|
+
background-color: #fff;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
.charge-payment-success-btn2 {
|
|
1544
|
+
border-radius: 80px;
|
|
1545
|
+
cursor: pointer;
|
|
1546
|
+
border: 1px solid #e0dfe2;
|
|
1547
|
+
display: flex;
|
|
1548
|
+
padding: 12px 32px;
|
|
1549
|
+
justify-content: center;
|
|
1550
|
+
align-items: center;
|
|
1551
|
+
gap: 6px;
|
|
1552
|
+
background-color: #161616;
|
|
1553
|
+
color: #fff;
|
|
1554
|
+
}`)}function ei(e,t,H){e.preventDefault();let z={type:"preview.compiledcheck",other:{msg:"Payment success!",status:t==="close",data:{tran_id:H,key:t}}};console.log("message:",z),window.parent.postMessage(z,"*")}function si({onClose:e,tranId:t}){return Nt.createElement(Nt.Fragment,null,Nt.createElement(Ui,null),Nt.createElement("div",{className:"payment-msg-container"},Nt.createElement("div",{className:"charge-payment-success-container"},Nt.createElement("div",{className:"charge-payment-success-tick-div"},Nt.createElement("div",{className:"charge-payment-success-tick"},Nt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},Nt.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"})))),Nt.createElement("h6",{className:"charge-payment-success-text"},"Your charge",Nt.createElement("br",null),"was successful"),Nt.createElement("h6",{className:"charge-payment-success-subtext"},"We\u2019ve processed your charge"),Nt.createElement("div",{className:"charge-success-payment-button-div"},Nt.createElement("button",{className:"charge-success-btn1",onClick:H=>ei(H,"print",t)},Nt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},Nt.createElement("path",{d:"M15.7729 8.7272C15.58 8.7272 15.395 8.80383 15.2586 8.94022C15.1222 9.07661 15.0456 9.2616 15.0456 9.45448V12.5185C15.045 13.0559 14.8313 13.5711 14.4513 13.9511C14.0713 14.3311 13.5561 14.5449 13.0187 14.5454H3.98149C3.44409 14.5449 2.92887 14.3311 2.54887 13.9511C2.16887 13.5711 1.95514 13.0559 1.95456 12.5185V9.45448C1.95456 9.2616 1.87794 9.07661 1.74154 8.94022C1.60515 8.80383 1.42017 8.7272 1.22728 8.7272C1.03439 8.7272 0.849407 8.80383 0.713015 8.94022C0.576624 9.07661 0.5 9.2616 0.5 9.45448V12.5185C0.500963 13.4416 0.86807 14.3265 1.52077 14.9792C2.17346 15.6319 3.05844 15.999 3.98149 16H13.0187C13.9417 15.999 14.8267 15.6319 15.4794 14.9792C16.1321 14.3265 16.4992 13.4416 16.5002 12.5185V9.45448C16.5002 9.2616 16.4235 9.07661 16.2871 8.94022C16.1507 8.80383 15.9658 8.7272 15.7729 8.7272Z",fill:"#161616"}),Nt.createElement("path",{d:"M4.65059 6.75861L7.7728 9.88082V0.72728C7.7728 0.534394 7.84942 0.349407 7.98581 0.213015C8.1222 0.0766239 8.30719 0 8.50008 0C8.69296 0 8.87795 0.0766239 9.01434 0.213015C9.15073 0.349407 9.22736 0.534394 9.22736 0.72728V9.88082L12.3496 6.75861C12.4867 6.62613 12.6704 6.55283 12.8611 6.55448C13.0518 6.55614 13.2342 6.63263 13.3691 6.76747C13.5039 6.90231 13.5804 7.08472 13.5821 7.27541C13.5837 7.46611 13.5104 7.64982 13.3779 7.78698L9.01427 12.1507C8.87788 12.287 8.69293 12.3636 8.50008 12.3636C8.30723 12.3636 8.12228 12.287 7.98589 12.1507L3.62221 7.78698C3.48973 7.64982 3.41643 7.46611 3.41808 7.27541C3.41974 7.08472 3.49623 6.90231 3.63107 6.76747C3.76592 6.63263 3.94833 6.55614 4.13902 6.55448C4.32971 6.55283 4.51342 6.62613 4.65059 6.75861Z",fill:"#161616"})),"Print receipt"),Nt.createElement("button",{className:"charge-success-btn1",onClick:H=>ei(H,"share",t)},Nt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},Nt.createElement("g",{clipPath:"url(#clip0_12420_50683)"},Nt.createElement("path",{d:"M9.30194 4.78664V2.31152C9.30194 2.09629 9.3862 1.88988 9.53631 1.73768C9.68634 1.5855 9.8899 1.5 10.1021 1.5C10.312 1.50089 10.5132 1.58542 10.6622 1.73534L16.2633 7.41595C16.3383 7.49142 16.3978 7.58117 16.4385 7.68001C16.4791 7.77894 16.5 7.885 16.5 7.99212C16.5 8.09924 16.4791 8.20531 16.4385 8.30423C16.3978 8.40307 16.3383 8.49283 16.2633 8.5683L10.6622 14.2489C10.5499 14.3606 10.4076 14.4362 10.2531 14.4663C10.0987 14.4964 9.93887 14.4797 9.79372 14.4182C9.64857 14.3568 9.52455 14.2532 9.43701 14.1206C9.34955 13.9881 9.30258 13.8323 9.30194 13.6727V11.157H8.62181C7.35764 11.1379 6.10443 11.3981 4.94932 11.9193C3.79422 12.4406 2.76481 13.2107 1.93249 14.1759C1.83215 14.3113 1.6926 14.4115 1.53337 14.4624C1.37406 14.5134 1.20306 14.5125 1.04431 14.4599C0.882759 14.4046 0.742811 14.2984 0.644952 14.1568C0.547092 14.0152 0.496363 13.8456 0.500203 13.6727C0.500203 6.27171 6.96548 5.00575 9.30194 4.78664ZM8.62181 9.51777C9.15695 9.51607 9.69162 9.55129 10.2221 9.62327C10.4115 9.6524 10.5844 9.74954 10.7092 9.89699C10.834 10.0444 10.9025 10.2324 10.9023 10.4267V11.717L14.567 7.99212L10.9023 4.26727V5.55758C10.9023 5.77281 10.8179 5.97922 10.6679 6.13141C10.5178 6.28359 10.3143 6.36909 10.1021 6.36909C9.37396 6.36909 3.61282 6.5314 2.36457 11.5871C4.17637 10.2324 6.3708 9.50665 8.62181 9.51777Z",fill:"#161616"})),Nt.createElement("defs",null,Nt.createElement("clipPath",{id:"clip0_12420_50683"},Nt.createElement("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.5)"})))),"Send receipt"))),Nt.createElement("div",{className:"charge-payment-success-btn-div"},Nt.createElement("button",{className:"charge-payment-success-btn1",onClick:H=>ei(H,"tran",t)},"Go to Transactions"),Nt.createElement("button",{className:"charge-payment-success-btn2",onClick:H=>{e(),ei(H,"close",t)}},"Close"))))}import Si from"sweetalert2";import{IoArrowBack as Vi}from"react-icons/io5";import{useEffect as ba}from"react";function _n(){return ba(()=>{let e=ai;if(typeof window!="undefined"&&!window.DatacapWebToken&&!document.querySelector(`script[src="${e}"]`)){let t=document.createElement("script");t.src=e,t.async=!0,t.onload=()=>{window.DatacapWebToken||console.warn("\u26A0\uFE0F Script loaded, but DatacapWebToken not found")},t.onerror=H=>{console.error("\u274C Failed to load Datacap script",H)},document.head.appendChild(t)}},[]),ba(()=>{let e="forge-cdn-script";if(!document.getElementById(e)){let t=document.createElement("script");t.src="https://cdn.jsdelivr.net/npm/node-forge@1.0.0/dist/forge.min.js",t.id=e,t.async=!0,document.head.appendChild(t)}return()=>{let t=document.getElementById(e);t&&document.head.removeChild(t)}},[]),null}import Pn from"react";import tr from"react";function Ji(){return tr.createElement("style",null,`
|
|
1555
|
+
.card-error .logo-container {
|
|
1556
|
+
display: flex;
|
|
1557
|
+
justify-content: center;
|
|
1558
|
+
align-items: center;
|
|
1559
|
+
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1560
|
+
z-index: 10;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
.card-error .client-logo {
|
|
1564
|
+
max-width: 100px;
|
|
1565
|
+
height: auto;
|
|
1566
|
+
object-fit: contain;
|
|
1567
|
+
display: block;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
.card-error .payment-error-container {
|
|
1571
|
+
display: flex;
|
|
1572
|
+
flex-direction: column;
|
|
1573
|
+
align-items: center;
|
|
1574
|
+
padding: 18px 20px 24px;
|
|
1575
|
+
// width: 335px;
|
|
1576
|
+
min-height: 250px; /* Fixed height */
|
|
1577
|
+
background: #FFFFFF;
|
|
1578
|
+
border-radius: 12px;
|
|
1579
|
+
position: relative;
|
|
1580
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1581
|
+
border: 1px solid #e3e3e3;
|
|
1582
|
+
justify-content: center;
|
|
1583
|
+
text-align: center;
|
|
1584
|
+
// margin-top: 50px; /* Adjust this to move the content down */
|
|
1585
|
+
margin: 50px auto 0 auto !important;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
.card-error .error-icon {
|
|
1589
|
+
display: flex;
|
|
1590
|
+
flex-direction: column;
|
|
1591
|
+
align-items: center;
|
|
1592
|
+
gap: 12px;
|
|
1593
|
+
min-height: 116px;
|
|
1594
|
+
z-index: 2;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
.card-error .circle {
|
|
1598
|
+
width: 50px;
|
|
1599
|
+
height: 50px;
|
|
1600
|
+
border: 1px solid red;
|
|
1601
|
+
border-radius: 50%;
|
|
1602
|
+
display: flex;
|
|
1603
|
+
justify-content: center;
|
|
1604
|
+
align-items: center;
|
|
1605
|
+
margin-bottom:20px
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
.card-error .circle .fa-times {
|
|
1609
|
+
font-size: 30px;
|
|
1610
|
+
color: red;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
.card-error .error-text {
|
|
1614
|
+
display: flex;
|
|
1615
|
+
flex-direction: column;
|
|
1616
|
+
justify-content: center;
|
|
1617
|
+
align-items: center;
|
|
1618
|
+
gap: 4px;
|
|
1619
|
+
// width: 227px;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
.card-error .payment-error-text {
|
|
1623
|
+
font-family: 'Inter', sans-serif;
|
|
1624
|
+
font-weight: 500;
|
|
1625
|
+
font-size: 18px;
|
|
1626
|
+
line-height: 21px;
|
|
1627
|
+
text-align: center;
|
|
1628
|
+
letter-spacing: -0.02em;
|
|
1629
|
+
color: #161616;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
.card-error .thank-you-text {
|
|
1633
|
+
font-family: 'Inter', sans-serif;
|
|
1634
|
+
font-weight: 500;
|
|
1635
|
+
font-size: 16px;
|
|
1636
|
+
line-height: 18px;
|
|
1637
|
+
text-align: center;
|
|
1638
|
+
letter-spacing: -0.02em;
|
|
1639
|
+
color: #161616 !important;
|
|
1640
|
+
opacity: 0.5;
|
|
1641
|
+
padding-top:10px
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
.card-error .error-btn-div{
|
|
1645
|
+
padding-top:30px;
|
|
1646
|
+
|
|
1647
|
+
}
|
|
1648
|
+
.card-error .error-btn-div button{
|
|
1649
|
+
border-radius: 0.25em;
|
|
1650
|
+
border:none;
|
|
1651
|
+
background: initial;
|
|
1652
|
+
background-color: #7066e0;
|
|
1653
|
+
box-shadow: var(--swal2-confirm-button-box-shadow);
|
|
1654
|
+
color: white;
|
|
1655
|
+
font-size: 1em;
|
|
1656
|
+
padding:10px 17px;
|
|
1657
|
+
cursor:pointer;
|
|
1658
|
+
}
|
|
1659
|
+
`)}var nr=({onClose:e,error:t})=>Pn.createElement(Pn.Fragment,null,Pn.createElement(Ji,null),Pn.createElement("div",{className:"card-error"},Pn.createElement("div",{className:"payment-error-container"},Pn.createElement("div",{className:"error-icon"},Pn.createElement("div",{className:"circle"},Pn.createElement("i",{className:"fa fa-times","aria-hidden":"true"})),Pn.createElement("div",{className:"error-text"},Pn.createElement("div",{className:"payment-error-text"},t),Pn.createElement("div",{className:"thank-you-text"},"Try again later ")),Pn.createElement("div",{className:"error-btn-div"},Pn.createElement("button",{onClick:e},"OK")))))),zn=nr;import{io as ir}from"socket.io-client";var ar=ir(tt,{transports:["websocket"],withCredentials:!1}),$t=ar;import Jn from"react";var Fn=e=>Jn.createElement(Jn.Fragment,null,Jn.createElement("div",{className:`frac-card-bank-radio ${e.activetab===e.value?"frac-active":""}`,onClick:()=>e.onChange(e.value),role:"radio"},Jn.createElement("div",{className:"frac-card-title-main"},Jn.createElement("img",{src:e.label.toLowerCase()==="card"?ki:e.label.toLowerCase()==="reader"?Ei:fa,className:"frac-payment-type-logo",alt:""}),Jn.createElement("div",{className:"frac-card-label"},Jn.createElement("div",{className:"frac-card-label-text"},e.label),Jn.createElement("div",{className:"frac-card-label-amount"},ye(e.amount)))),Jn.createElement("div",null,Jn.createElement("input",{name:"paymenttype",checked:e.activetab===e.value,type:"radio",value:e.value,onChange:t=>{e.onChange(t.target.value)}}))));import rr from"react";function Dn({}){return rr.createElement("style",null,`
|
|
1660
|
+
.frac-card-bank-radio-main{
|
|
1661
|
+
display: flex;
|
|
1662
|
+
flex-direction: column;
|
|
1663
|
+
align-items: flex-start;
|
|
1664
|
+
align-self: stretch;
|
|
1665
|
+
border-radius: 14px;
|
|
1666
|
+
border: 1px solid #E0DFE2;
|
|
1667
|
+
overflow: hidden;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
.frac-card-bank-radio{
|
|
1671
|
+
display: flex;
|
|
1672
|
+
padding: 12px 16px;
|
|
1673
|
+
justify-content: space-between;
|
|
1674
|
+
align-items: center;
|
|
1675
|
+
align-self: stretch;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
input[type="radio"] {
|
|
1679
|
+
accent-color: #000;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
.frac-card-title-main{
|
|
1683
|
+
display: flex;
|
|
1684
|
+
align-items: center;
|
|
1685
|
+
gap: 12px;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
.frac-card-label{
|
|
1689
|
+
display: flex;
|
|
1690
|
+
flex-direction: column;
|
|
1691
|
+
align-items: flex-start;
|
|
1692
|
+
gap: 2px;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
.frac-card-label-text{
|
|
1696
|
+
color: #727272;
|
|
1697
|
+
font-family: Inter;
|
|
1698
|
+
font-size: 12px;
|
|
1699
|
+
font-style: normal;
|
|
1700
|
+
font-weight: 500;
|
|
1701
|
+
line-height: 18px;
|
|
1702
|
+
letter-spacing: -0.24px;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
.frac-card-label-amount{
|
|
1706
|
+
color: #161616;
|
|
1707
|
+
text-align: center;
|
|
1708
|
+
font-family: Inter;
|
|
1709
|
+
font-size: 16px;
|
|
1710
|
+
font-style: normal;
|
|
1711
|
+
font-weight: 500;
|
|
1712
|
+
line-height: 140%;
|
|
1713
|
+
letter-spacing: -0.32px;
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
.frac-payment-type-logo{
|
|
1717
|
+
width: 24px;
|
|
1718
|
+
height: 24px;
|
|
1719
|
+
aspect-ratio: 1/1;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
.frac-card-bank-radio-main .frac-card-bank-radio:nth-child(2) {
|
|
1723
|
+
border-top: 1px solid #E0DFE2;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
.frac-card-bank-radio-main .frac-card-bank-radio:nth-child(3) {
|
|
1727
|
+
border-top: 1px solid #E0DFE2;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
.frac-card-bank-radio.frac-active {
|
|
1731
|
+
background: #F6F6F7;
|
|
1732
|
+
}
|
|
1733
|
+
`)}import cn from"react";var On=({listHeading:e="Card",ListItems:t,selectedCard:H,setSelectedCard:T,paymentGateway:z,handleDeleteCard:B,otherButtonAction:O,otherButtonLabel:U,headingClass:be})=>{let K=te+"widget/Trash.svg";return cn.createElement(cn.Fragment,null,cn.createElement("h6",{className:be||"card-ach-heading",style:{marginBottom:"10px !important"}},e),cn.createElement("div",{className:"card-lint-div-in"},cn.createElement("div",{className:"card-list-div"},t&&(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((A,G)=>{let oe=!1;return z&&(oe=z!=(A==null?void 0:A.payment_method_type)&&(A==null?void 0:A.card_type)!="Bank"),cn.createElement("div",{key:A==null?void 0:A.id,className:"card-list-single-div"},cn.createElement("div",{className:"card-number-radio"},cn.createElement("input",{disabled:oe,type:"radio",className:"cardRadio",name:"selected_card",id:"",checked:(H==null?void 0:H.id)===(A==null?void 0:A.id),onChange:w=>T(A)}),cn.createElement("label",{htmlFor:"",className:"card-number-last-four"},"**** ",A==null?void 0:A.cardlastfourdigit),(A==null?void 0:A.card_type)!="Bank"&&cn.createElement("h6",{className:"card-expiry-date"},A==null?void 0:A.expmonth,"/",A==null?void 0:A.expyear)),cn.createElement("div",{className:"card-number-radio"},cn.createElement("span",{className:"visa-card"},cn.createElement("img",{src:ha(A==null?void 0:A.card_type),alt:""})),cn.createElement("span",{className:"visa-card",style:{cursor:"pointer"},onClick:()=>B(A==null?void 0:A.id)},cn.createElement("img",{src:K,alt:""}))))}))),cn.createElement("div",{className:"pay-with-other-card",onClick:O},U,cn.createElement("img",{src:ki,alt:""}))))};import In from"react";var ji=({listHeading:e="Readers",ListItems:t,selectedPax:H,setSlectedPax:T,headingClass:z})=>In.createElement(In.Fragment,null,In.createElement("h6",{className:z||"card-ach-heading",style:{marginBottom:"10px !important"}},e),In.createElement("div",{className:"card-lint-div-in"},In.createElement("div",{className:"card-list-div"},t&&(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((B,O)=>In.createElement("div",{key:B==null?void 0:B.id,className:"card-list-single-div"},In.createElement("div",{className:"card-number-radio"},In.createElement("input",{type:"radio",className:"cardRadio",name:"selected_reader",id:"",checked:(H==null?void 0:H.id)===(B==null?void 0:B.id),onChange:U=>T(B)}),In.createElement("label",{htmlFor:"",className:"card-number-last-four"},B==null?void 0:B.device_name)),In.createElement("div",{className:"card-number-radio"},In.createElement("span",{className:"visa-card"},In.createElement("img",{src:Ei,alt:""})))))))));function or(e){var Re,mt,vt,jt,It,Yt,Qt,ct,Ke,Ot,Vt,an,rn,on,sn,ln,xn,Xt,Ze,Zt;let[t,H]=Et(!1),[T,z]=Et(!1),[B,O]=Et(""),[U,be]=Et(!1),[K,A]=Et(!1),[G,oe]=Et("card"),[w,C]=Et("card"),[R,V]=Et("form"),[y,Se]=Et("form"),[M,Te]=Et(!0),[_e,ce]=Et(!1),[Ne,ft]=Et(!1),Pe=e.merchantPublicKey,Fe=te+"widget/mc-img.svg",ue=te+"widget/visa-img.svg",Ye=te+"widget/ae-img.svg",De=te+"widget/discover-img.svg",gn=te+"widget/card.svg",nn=te+"widget/Trash.svg",h=te+"widget/bank.svg",L=te+"widget/secure-img.png",u=te+"widget/pov-by.png",xe=te+"widget/pax.svg",[a,o]=Et(),[r,b]=Et({}),[k,P]=Et(),[Y,x]=Et({}),[f,N]=Et([]),[je,gt]=Et([]),[$e,zt]=Et(),[ht,at]=Et(void 0),[ze,ge]=Et(Number(e==null?void 0:e.amount)),[$,Me]=Et(),[dt,X]=Et(""),Mt=()=>H(!0),Ge=()=>H(!1),Lt=(_,g)=>{let se=(parseFloat(g)||0)/100,pe=_/(1+se);return Math.round(pe*100)/100};xa(()=>{if(K){let _=Lt(e==null?void 0:e.amount,(e==null?void 0:e.surcharge)||0);ge(_)}},[K,e==null?void 0:e.pass_fee,e==null?void 0:e.amount,e==null?void 0:e.surcharge]);let S=()=>{A(!1),oe("card"),O(""),be(!1),X(""),P({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),x({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),o({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),b({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),ft(!1),ce(!1),zt({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""}),at(null),ge(0),C("card"),Te(!0),Se("form"),V("form"),z(!1),H(!1),gt([]),N([])},kn=()=>A(!0),At=_=>{oe(_)},xt=(_,g)=>{let se=_;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(se)){(g===""||/^[0-9]+$/.test(g))&&(b(ee=>F(v({},ee),{[se]:""})),o(ee=>F(v({},ee),{[se]:g})));return}b(ee=>F(v({},ee),{[se]:""})),o(ee=>F(v({},ee),{[se]:g}))},bn=_=>{var ee;let g=_.target,{formatted:se,cursor:pe}=Tn(g.value,(ee=g.selectionStart)!=null?ee:0);b(We=>F(v({},We),{cardNumber:""})),o(We=>F(v({},We),{cardNumber:se})),requestAnimationFrame(()=>{g.setSelectionRange(pe,pe)})},kt=_=>{let{name:g,value:se}=_.target,pe=["routingNumber","accountNumber","confirmAccountNumber"];if(g=="name"){/^[a-zA-Z\s]*$/.test(se)&&(x(ee=>F(v({},ee),{[g]:""})),P(ee=>F(v({},ee),{[g]:se})));return}if(pe.includes(g)){(se===""||/^[0-9]+$/.test(se))&&(x(ee=>F(v({},ee),{[g]:""})),P(ee=>F(v({},ee),{[g]:se})));return}x(ee=>F(v({},ee),{[g]:""})),P(ee=>F(v({},ee),{[g]:se}))},Wn=()=>{var ee,We,le,_t,Je,pt;let _={},g=a,se=parseInt((g==null?void 0:g.expiryMonth)||"",10),pe=(g==null?void 0:g.expiryYear)||"";if((ee=g==null?void 0:g.cardName)!=null&&ee.trim()||(_.cardName="Card name is required"),(We=g==null?void 0:g.cardNumber)!=null&&We.trim()||(_.cardNumber="Card number is required"),(!((le=g==null?void 0:g.expiryMonth)!=null&&le.trim())||!((_t=g==null?void 0:g.expiryYear)!=null&&_t.trim())||isNaN(se)||se<1||se>12||pe.length!==4)&&(_.expiryMonth="Invalid Expiration Date."),(Je=g==null?void 0:g.cvv)!=null&&Je.trim()||(_.cvv="CVV is required"),(pt=g==null?void 0:g.zipCode)!=null&&pt.trim()||(_.zipCode="ZIP code is required"),g!=null&&g.expiryMonth&&(g!=null&&g.expiryYear)&&g.expiryMonth.length<=2&&g.expiryYear.length===4){let Wt=parseInt(g.expiryMonth,10),p=parseInt(g.expiryYear,10),c=new Date,Z=c.getMonth()+1,ke=c.getFullYear();(p<ke||p===ke&&Wt<Z)&&(_.expiryMonth="Card is expired")}return b(_),Object.keys(_).length>0},Bn=()=>{var se,pe,ee,We,le,_t,Je,pt;let _={},g=k;return(se=g==null?void 0:g.name)!=null&&se.trim()||(_.name="Name is required"),(pe=g==null?void 0:g.accountNumber)!=null&&pe.trim()||(_.accountNumber="Account number is required"),(ee=g==null?void 0:g.accountNumber)!=null&&ee.trim()&&((We=g==null?void 0:g.accountNumber)==null?void 0:We.trim())!==((le=g==null?void 0:g.confirmAccountNumber)==null?void 0:le.trim())&&(_.confirmAccountNumber="Account numbers must match"),(_t=g==null?void 0:g.bankName)!=null&&_t.trim()||(_.bankName="Bank name is required"),(Je=g==null?void 0:g.routingNumber)!=null&&Je.trim()||(_.routingNumber="Routing Number is required"),g!=null&&g.routingNumber&&((pt=g==null?void 0:g.routingNumber)==null?void 0:pt.length)!==9&&(_.routingNumber="Routing number must be 9 digits"),((g==null?void 0:g.accountType)==="business saving"||(g==null?void 0:g.accountType)==="business checking")&&(!(g!=null&&g.companyName)||(g==null?void 0:g.companyName)==="")&&(_.companyName="Company Name is required for business accounts"),x(_),Object.keys(_).length>0},St=async _=>{var se,pe,ee,We,le,_t,Je,pt,Wt,p,c,Z,ke,ie,rt,ve;_.preventDefault();let g=document.activeElement;if(g instanceof HTMLElement&&g.blur(),G!=="ach"){if(Wn())return;{let Ie=DatacapWebToken.validateCardNumber(a==null?void 0:a.cardNumber.replaceAll(" ","")),ae=DatacapWebToken.validateExpirationDate(a==null?void 0:a.expiryMonth,a==null?void 0:a.expiryYear),st=DatacapWebToken.validateCVV(a==null?void 0:a.cvv),yt={};if(Ie||(yt.cardNumber="Invalid card Number"),ae||(yt.expiryMonth="Invalid Expiration Date."),st||(yt.cvv="Invalid CVV"),b(yt),Ie&&st&&ae){z(!0);try{let he={amount:`${e.amount||0}`,fractalpayPublicKey:Pe,orderId:e==null?void 0:e.orderID,customer_id:e==null?void 0:e.customerId,discount:e==null?void 0:e.discount,surcharge:e==null?void 0:e.surcharge,tax:e==null?void 0:e.tax,pass_fee:e==null?void 0:e.pass_fee},re=await pi.post(`${tt}create-widget-order`,he,{headers:v({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})}),Gt=async function(Bt){if(Bt.Error)O(Bt.Error),z(!1);else{let Qe=a==null?void 0:a.cardName,Gn=a==null?void 0:a.zipCode;Bt.name=Qe,Bt.postal_code=Gn,Bt.isCardSave=`${_e}`,Bt.isCharge=!0,Bt.posSalesIdEncode=re==null?void 0:re.data.data.posSalesIdEncode,$t.emit("sendMessage",Bt),$t.on(re==null?void 0:re.data.data.posSalesIdEncode,ut=>{if(ui(ut==null?void 0:ut.data)){let Be=JSON.parse(ut.data);Be!=null&&Be.result?(o({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),ce(!1),X(Be==null?void 0:Be.transactionId),be(!0),z(!1)):(z(!1),O((Be==null?void 0:Be.message)||"Something went wrong."))}else O("Something went wrong.")})}};if(($==null?void 0:$.paymentGateway)===32){let Bt={method:"POST",redirect:"follow"};try{let Qe=await pi.post(`${Ae}api/v1/widget/generate-session`,Bt),Gn=Number(a==null?void 0:a.expiryYear)%100,ut=a==null?void 0:a.cardNumber;ut=ut==null?void 0:ut.replace(/\s+/g,"");let Be=`${ut}=${Gn}${a==null?void 0:a.expiryMonth} ${a==null?void 0:a.cvv}`,Sn=forge.pki.publicKeyFromPem((pe=(se=Qe==null?void 0:Qe.data)==null?void 0:se.data)==null?void 0:pe.publicKeyPem).encrypt(Be,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),vn=forge.util.encode64(Sn),Pt={"Content-Type":"application/json","x-app-session-key":(We=(ee=Qe.data)==null?void 0:ee.data)==null?void 0:We.session_key},de=JSON.stringify({enc_track2_data:`${vn}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(_t=(le=Qe==null?void 0:Qe.data)==null?void 0:le.data)==null?void 0:_t.session_key}`});try{let Ct=await pi.post(`${mn}tokenizer/tokenize`,de,{headers:Pt}),Rt=JSON.stringify(F(v({},(Je=Ct==null?void 0:Ct.data)==null?void 0:Je.data),{isSaveCardChecked:_e,name:a==null?void 0:a.cardName,postal_code:a==null?void 0:a.zipCode,customer_id:e==null?void 0:e.customerId})),pn=JSON.stringify({pre_sales_id:`${(Wt=(pt=re==null?void 0:re.data)==null?void 0:pt.data)==null?void 0:Wt.posSalesIdEncode}`,token:`${(p=Ct==null?void 0:Ct.data)==null?void 0:p.data.token}`,json_response:`${Rt}`}),Yn={method:"POST",headers:JSON.stringify({"Content-Type":"application/json"}),body:pn,redirect:"follow",isChargeviafractal:!0};$t.emit("sendMessage",Yn),$t.on("chargeviafractalgateway",Kt=>{var ti;if(ui(Kt==null?void 0:Kt.data)){let wn=JSON.parse(Kt==null?void 0:Kt.data);wn!=null&&wn.result?(X((ti=wn==null?void 0:wn.data)==null?void 0:ti.transactionId),be(!0),z(!1)):(z(!1),O((wn==null?void 0:wn.message)||"Something went wrong."))}else O("Something went wrong.")})}catch(Ct){z(!1),O(((Z=(c=Ct==null?void 0:Ct.response)==null?void 0:c.data)==null?void 0:Z.message)||(Ct==null?void 0:Ct.message)||"Something went wrong.")}}catch(Qe){z(!1),O(((ie=(ke=Qe==null?void 0:Qe.response)==null?void 0:ke.data)==null?void 0:ie.message)||(Qe==null?void 0:Qe.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(re==null?void 0:re.data.data.dctoken,"PaymentForm",Gt)}catch(he){z(!1),O(((ve=(rt=he==null?void 0:he.response)==null?void 0:rt.data)==null?void 0:ve.message)||(he==null?void 0:he.message)||"Something went wrong.")}}}}else{if(Bn())return;{z(!0);let Ie=v({fractalpayPublicKey:Pe,label:(k==null?void 0:k.name)||"John Doe",account_number:k==null?void 0:k.accountNumber,routing_number:k==null?void 0:k.routingNumber,bank_name:k==null?void 0:k.bankName,account_type:k==null?void 0:k.accountType,amount:String(ze||0),isSaveAch:Ne,customer_id:e==null?void 0:e.customerId,order_id:e==null?void 0:e.orderID,tax:e==null?void 0:e.tax,discount:e==null?void 0:e.discount,surcharge:e==null?void 0:e.surcharge,isChargeACH:!0,company_name:(k==null?void 0:k.companyName)||""},(e==null?void 0:e.sessionToken)&&{sessionToken:e.sessionToken});$t.emit("sendMessage",Ie),$t.on("ach-incoming",ae=>{var st;(ae==null?void 0:ae.status)=="Failed"?typeof(ae==null?void 0:ae.message)=="object"?Object.values(ae==null?void 0:ae.message).forEach(yt=>{O(yt||"Something went wrong")}):O((ae==null?void 0:ae.message)||"Something went wrong"):(X((st=ae==null?void 0:ae.data)==null?void 0:st.transaction_id),be(!0),z(!1))})}}},qn=async()=>{var _,g,se,pe,ee,We,le,_t,Je,pt,Wt,p,c,Z,ke,ie,rt,ve,ot,Ie,ae,st,yt;Mt();try{let he={fractalpayPublicKey:Pe,customer_id:e==null?void 0:e.customerId,pass_fee:e==null?void 0:e.pass_fee,isReader:e==null?void 0:e.isReader},re=await pi.post(`${tt}get-payment-details`,he);if(Me((_=re==null?void 0:re.data)==null?void 0:_.data),(se=(g=re==null?void 0:re.data)==null?void 0:g.data)!=null&&se.paymentGateway||(S(),O("Something went wrong.")),(ee=(pe=re==null?void 0:re.data)==null?void 0:pe.data)!=null&&ee.card_list&&((_t=(le=(We=re==null?void 0:re.data)==null?void 0:We.data)==null?void 0:le.card_list)==null?void 0:_t.length)>0){let Gt=(Wt=(pt=(Je=re==null?void 0:re.data)==null?void 0:Je.data)==null?void 0:pt.card_list)==null?void 0:Wt.filter(Qe=>(Qe==null?void 0:Qe.card_type)=="Bank"),Bt=(Z=(c=(p=re==null?void 0:re.data)==null?void 0:p.data)==null?void 0:c.card_list)==null?void 0:Z.filter(Qe=>(Qe==null?void 0:Qe.card_type)!=="Bank");(Bt==null?void 0:Bt.length)>0&&V("list"),(Gt==null?void 0:Gt.length)>0&&Se("list"),N(Bt),gt(Gt)}else oe("card");(ie=(ke=re==null?void 0:re.data)==null?void 0:ke.data)!=null&&ie.paymentDeviceList&&((ot=(ve=(rt=re==null?void 0:re.data)==null?void 0:rt.data)==null?void 0:ve.paymentDeviceList)==null?void 0:ot.length)>0&&at((ae=(Ie=re==null?void 0:re.data)==null?void 0:Ie.data)==null?void 0:ae.paymentDeviceList[0]),Ge()}catch(he){console.log(he),Ge(),O(((yt=(st=he==null?void 0:he.response)==null?void 0:st.data)==null?void 0:yt.message)||(he==null?void 0:he.message)||"Something went wrong")}},Mn=async _=>{if(_.currentTarget.blur(),T)return;let g=e==null?void 0:e.customerId,se=String(e==null?void 0:e.discount),pe=String(e==null?void 0:e.surcharge),ee=String(e==null?void 0:e.tax),We=e==null?void 0:e.merchantPublicKey,le=e==null?void 0:e.orderID,_t=String(e==null?void 0:e.amount),Je=$e==null?void 0:$e.id,pt=$e==null?void 0:$e.card_type;if(We&&le&&_t&&ze)if(g)if(Je){let p=v({amount:pt==="Bank"?`${ze}`:_t,order_id:le,customer_id:g,card_id:Je,fractalpayPublicKey:We,isCardSave:_e,discount:se,surcharge:pe,tax:ee,pass_fee:e==null?void 0:e.pass_fee,require3ds:!1},(e==null?void 0:e.sessionToken)&&{sessionToken:e.sessionToken}),Wt=p,{isCardSave:c,pass_fee:Z,require3ds:ke}=Wt,ie=ii(Wt,["isCardSave","pass_fee","require3ds"]),ve=tt+(pt==="Bank"?"charge-ach":"charge-by-card"),ot={"Content-Type":"application/json"};z(!0),$t.emit("sendMessage",{url:ve,body:pt=="Bank"?ie:p,isChargebycard:!0}),$t.on("charge-by-card",Ie=>{var ae;(Ie==null?void 0:Ie.result)==!0||(Ie==null?void 0:Ie.status)==!0?(X((ae=Ie.data)==null?void 0:ae.transaction_id),be(!0),z(!1)):O((Ie==null?void 0:Ie.message)||"Something went wrong.")})}else O("Please Select A Card/ACH");else O("Please Select Customer");else O("Something went wrong.")},Ln=async _=>{var We,le,_t,Je,pt,Wt;if(_.currentTarget.blur(),T)return;let g=e==null?void 0:e.merchantPublicKey,se=e==null?void 0:e.orderID,pe=String(e==null?void 0:e.amount),ee=e==null?void 0:e.customerId;if(!(ht!=null&&ht.device_id)){O("Please Select A Payment Device");return}if(g&&se&&pe){z(!0);let p={amount:pe,fractalpayPublicKey:g,customer_order_id:se,device_id:ht==null?void 0:ht.device_id,customer_id:ee||""};try{let c=await pi.post(`${tt}charge-with-reader`,p);((We=c==null?void 0:c.data)==null?void 0:We.result)==!0?(X((_t=(le=c==null?void 0:c.data)==null?void 0:le.data)==null?void 0:_t.transaction_id),be(!0),z(!1)):(O(((Je=c==null?void 0:c.data)==null?void 0:Je.message)||"Something went wrong."),z(!1))}catch(c){O(((Wt=(pt=c==null?void 0:c.response)==null?void 0:pt.data)==null?void 0:Wt.message)||"Something went wrong."),z(!1)}}else O("Something went wrong.")},J=_=>{w==="card"?Mn(_):w==="reader"&&Ln(_)};xa(()=>{K&&Pe&&qn()},[Pe,K]);let E=async _=>{Si.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async g=>{if(g.isConfirmed){z(!0);try{let se={card_id:_,customer_id:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey},pe=await pi.post(`${tt}delete-customer-card`,se);z(!1),qn(),Si.fire({icon:"success",title:"Deleted!",text:"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})}catch(se){z(!1),Si.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else g.dismiss===Si.DismissReason.cancel&&Si.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},Ue=_=>{switch(_==null?void 0:_.toLowerCase()){case"visa":return ue;case"mastercard":case"mc":case"m/c":return Fe;case"amex":case"american express":case"ae":return Ye;case"discover":case"dcvr":return De;case"bank":return h;default:return _}},Ht=()=>{let _=ze||0;return(Number(e.amount)-_).toFixed(0)};return i.createElement(i.Fragment,null,i.createElement(_n,null),i.createElement(oi,null),i.createElement(Dn,null),i.createElement(i.Fragment,null,i.createElement("button",{className:"paymentBtn",onClick:kn},"Pay"),i.createElement(Nn,{open:K,onClose:S},B&&i.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},i.createElement(zn,{error:B,onClose:S})),U&&i.createElement(si,{onClose:S,tranId:dt}),!B&&!U&&i.createElement(i.Fragment,null,(t||T)&&i.createElement(dn,{loading:t||T}),i.createElement("div",{className:"frac-card-payment-page frac-form"},i.createElement("div",{className:"parent-pay-container"},i.createElement("span",{className:"request-payment-close-popup",onClick:S},i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},i.createElement("g",{clipPath:"url(#clip0_12425_52336)"},i.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"})),i.createElement("defs",null,i.createElement("clipPath",{id:"clip0_12425_52336"},i.createElement("rect",{width:"16",height:"16",fill:"white"}))))),i.createElement("div",{className:"pay-main-logo-res"},i.createElement("img",{src:$==null?void 0:$.logo,id:"pay-logos"})),i.createElement("div",{className:"pay-container"},i.createElement("div",{className:"pay-header pay-conatiner-one frac-pay-conatiner-one"},i.createElement("div",{className:"pay-conatiner-one-first"},i.createElement("div",{className:"pay-logo-container"},i.createElement("div",{className:"pay-main-logo"},i.createElement("img",{src:$==null?void 0:$.logo,id:"pay-logos"})),(f==null?void 0:f.length)>0&&G!=="cardList"&&i.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>oe("cardList")}," ",i.createElement(Vi,null)," Back")),i.createElement("div",{className:"amt-pay-con"},i.createElement("div",{className:"pay-amount-conatiner"},i.createElement("small",{className:"pay-payment-amount"},"Select paymet type")),i.createElement("div",{className:"frac-card-bank-radio-main"},i.createElement(Fn,{label:"Card",amount:(Re=Number(e==null?void 0:e.amount))==null?void 0:Re.toFixed(2),value:"card",onChange:At,activetab:G}),($==null?void 0:$.isSkyFiAccount)&&i.createElement(Fn,{label:"Bank",amount:(mt=Number(ze))==null?void 0:mt.toFixed(2),value:"ach",onChange:At,activetab:G}),(e==null?void 0:e.isReader)&&($==null?void 0:$.paymentDeviceList)&&((vt=$==null?void 0:$.paymentDeviceList)==null?void 0:vt.length)>0&&i.createElement(Fn,{label:"Reader",amount:(jt=Number(e==null?void 0:e.amount))==null?void 0:jt.toFixed(2),value:"reader",onChange:At,activetab:G})),!t&&(Vn($==null?void 0:$.showSurcharge)?ze&&ze>0&&(e!=null&&e.pass_fee)?i.createElement("div",{className:"frac-cash-discount-fee"},i.createElement("small",null,G==="card"||G==="reader"?"Cash Discount":"Cash Discount Savings"," "),i.createElement("p",null,ye((Number(e.amount)-ze).toFixed(2)))):null:ze&&ze>0&&(e!=null&&e.pass_fee)&&(G==="card"||G==="reader")?i.createElement("div",{className:"frac-cash-discount-fee"},i.createElement("small",null,G==="card"||G==="reader"?"Surcharge":null," "),i.createElement("p",null,ye((Number(e.amount)-ze).toFixed(2)))):null))),i.createElement("div",{className:"pay-conatiner-one-last"},i.createElement("img",{src:L,alt:""}),i.createElement("img",{src:u,alt:""}),"Secure payments powered by Fractal")),i.createElement("div",{className:"pay-tab pay-conatiner-two"},!t&&i.createElement("div",{className:"col-md-12"},i.createElement("div",{id:"payment-form-div"},G!=="cardList"?i.createElement("div",{className:"frac-charge-payment-back-btn-wrap "},(f==null?void 0:f.length)>0&&i.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>oe("cardList")}," ",i.createElement(Vi,null)," Back"),($==null?void 0:$.isSkyFiAccount)&&i.createElement("div",{className:"tab"},i.createElement("button",{className:"tablinks",onClick:_=>{At("card")},style:{border:G==="card"?"1px solid":""}},i.createElement("i",{className:"fas fa-credit-card me-2",style:{marginRight:"8px",fontSize:"15px"}}),"Card"),i.createElement("button",{className:"tablinks",onClick:_=>{At("ach")},style:{border:G==="ach"?"1px solid":""}},i.createElement("i",{className:"fas fa-university me-2",style:{marginRight:"8px",fontSize:"15px"}}),"Bank")),i.createElement("div",{className:"res-pay-con"},i.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},i.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),i.createElement("strong",{className:"pay-amount"},"$",(It=Number(e==null?void 0:e.amount))==null?void 0:It.toFixed(2))),G!="ach"&&i.createElement("div",null,i.createElement("div",null,i.createElement("img",{src:ue,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Fe,width:35,alt:""})),i.createElement("div",null,i.createElement("img",{src:Ye,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:De,width:35,alt:""}))))):i.createElement("div",null,i.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",$==null?void 0:$.customer_name),i.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," ",w==="card"?"Cards/Banks":"Readers"," "),i.createElement("div",{className:"res-pay-con"},i.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},i.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),i.createElement("strong",{className:"pay-amount"},"$",(Yt=Number(e==null?void 0:e.amount))==null?void 0:Yt.toFixed(2))),i.createElement("div",null,i.createElement("div",null,i.createElement("img",{src:ue,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Fe,width:35,alt:""})),i.createElement("div",null,i.createElement("img",{src:Ye,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:De,width:35,alt:""}))))),i.createElement("div",{id:"card",style:{display:G==="card"?"block":"none"},className:"tabcontent"},i.createElement("div",{className:"frac-card-payment"},i.createElement("div",{className:"frac-heading-card-wrap"},i.createElement("div",{className:"frac-backarrow"},(f==null?void 0:f.length)>0&&R==="form"&&i.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>V("list")}," ",i.createElement(Vi,null))),i.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),G!="ach"&&i.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},i.createElement("img",{src:ue,alt:"",width:33}),i.createElement("img",{src:Fe,width:33,alt:""}),i.createElement("img",{src:Ye,alt:"",width:33}),i.createElement("img",{src:De,width:33,alt:""}))),R==="list"?i.createElement(i.Fragment,null,i.createElement(On,{listHeading:"Cards",paymentGateway:$==null?void 0:$.paymentGateway,ListItems:f,selectedCard:$e,setSelectedCard:zt,handleDeleteCard:E,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{V("form")}}),i.createElement("div",{className:"form-group",style:{padding:"0"}},i.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",disabled:T,onClick:J},ye((Qt=Number(e==null?void 0:e.amount))==null?void 0:Qt.toFixed(2))))):i.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:St,onKeyDown:_=>{_.key==="Enter"&&T&&(_.preventDefault(),_.stopPropagation())}},i.createElement("div",{className:"ach-scrl",style:{minHeight:$!=null&&$.isSkyFiAccount&&(f==null?void 0:f.length)>0?"444px":$!=null&&$.isSkyFiAccount&&(f==null?void 0:f.length)==0?"456px":(f==null?void 0:f.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},i.createElement("div",{className:"form-group"},i.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),i.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"John Doe",value:(a==null?void 0:a.cardName)||"",onChange:_=>{let g=_.target.value;/^[a-zA-Z\s]*$/.test(g)&&xt("cardName",g)}}),(r==null?void 0:r.cardName)&&i.createElement("span",{className:"error-span"},r==null?void 0:r.cardName)),i.createElement("div",{className:"form-group"},i.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),i.createElement("div",{className:"toggle-num-wrapper"},i.createElement("input",{className:"form-control card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(a==null?void 0:a.cardNumber)||"",onChange:_=>bn(_),"data-token":"card_number"}),i.createElement("div",{className:"card-crdi card-expiry-new"},i.createElement("div",{className:"exp-date-year-container"},i.createElement("div",{className:"exp-date form-group"},i.createElement("input",{"data-token":"exp_month",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(a==null?void 0:a.expiryMonth)||"",onChange:_=>xt("expiryMonth",_.target.value)})),i.createElement("div",{className:"exp-year form-group"},i.createElement("input",{"data-token":"exp_year",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(a==null?void 0:a.expiryYear)||"",onChange:_=>xt("expiryYear",_.target.value)})),i.createElement("div",{className:"security-digit form-group"},i.createElement("input",{"data-token":"cvv",className:"form-control card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(a==null?void 0:a.cvv)||"",onChange:_=>xt("cvv",_.target.value)})))),(r==null?void 0:r.cardNumber)&&i.createElement("span",{className:"error-span"},r==null?void 0:r.cardNumber),i.createElement("p",{style:{margin:"0"}},r!=null&&r.expiryMonth||r!=null&&r.expiryYear?i.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},r==null?void 0:r.expiryMonth):"",(r==null?void 0:r.cvv)&&i.createElement("span",{className:"error-span"},r==null?void 0:r.cvv)))),i.createElement("div",{className:"form-group"},i.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),i.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"OID123456",disabled:!0,value:(ct=e==null?void 0:e.orderID)!=null?ct:"",style:{background:"#F6F6F7",color:"#727272"}})),i.createElement("div",{className:"form-group"},i.createElement("label",{htmlFor:"zip"},"ZIP"),i.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(Ke=a==null?void 0:a.zipCode)!=null?Ke:"",onChange:_=>xt("zipCode",_.target.value)}),(r==null?void 0:r.zipCode)&&i.createElement("span",{className:"error-span"},r==null?void 0:r.zipCode)),(e==null?void 0:e.customerId)&&i.createElement("div",{className:"form-group"},i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},i.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:_e,onChange:_=>ce(_.target.checked)}),i.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),i.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},i.createElement("g",{clipPath:"url(#clip0_12420_50192)"},i.createElement("rect",{width:"20",height:"20",fill:"white"}),i.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),i.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"})),i.createElement("defs",null,i.createElement("clipPath",{id:"clip0_12420_50192"},i.createElement("rect",{width:"20",height:"20",fill:"white"}))))))),i.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:"0"}},i.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ye((Ot=Number(e==null?void 0:e.amount))==null?void 0:Ot.toFixed(2)))))),i.createElement("div",{id:"ach",style:{display:G==="ach"?"block":"none"},className:"tabcontent"},i.createElement("div",{className:"frac-card-payment"},i.createElement("div",{className:"frac-heading-card-wrap"},i.createElement("div",{className:"frac-backarrow"},(je==null?void 0:je.length)>0&&y==="form"&&i.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Se("list")}," ",i.createElement(Vi,null))),i.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment"))),y==="list"?i.createElement(i.Fragment,null,i.createElement(On,{listHeading:"Banks",paymentGateway:$==null?void 0:$.paymentGateway,ListItems:je,selectedCard:$e,setSelectedCard:zt,handleDeleteCard:E,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{Se("form")}}),i.createElement("div",{className:"form-group",style:{padding:"0"}},i.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:J},ye((Vt=Number(ze))==null?void 0:Vt.toFixed(2))))):i.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:St,autoComplete:"off",onKeyDown:_=>{_.key==="Enter"&&T&&(_.preventDefault(),_.stopPropagation())}},i.createElement("div",{className:"ach-scrl",style:{minHeight:$!=null&&$.isSkyFiAccount&&(f==null?void 0:f.length)>0?"444px":$!=null&&$.isSkyFiAccount&&(f==null?void 0:f.length)==0?"436px":(f==null?void 0:f.length)>0?"462px":"520px",maxHeight:$!=null&&$.isSkyFiAccount&&(f==null?void 0:f.length)>0?"444px":((f==null?void 0:f.length)>0,"380px")}},i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),i.createElement("input",{type:"text",id:"nameonaccount",className:"form-control",maxLength:100,placeholder:"John Doe",name:"name",value:(an=k==null?void 0:k.name)!=null?an:"",onChange:kt}),(Y==null?void 0:Y.name)&&i.createElement("span",{className:"error-span"},Y==null?void 0:Y.name)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"routingnumber"},"Routing number"),i.createElement("input",{type:"text",id:"routingnumber",className:"form-control",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(rn=k==null?void 0:k.routingNumber)!=null?rn:"",onChange:kt}),(Y==null?void 0:Y.routingNumber)&&i.createElement("span",{className:"error-span"},Y==null?void 0:Y.routingNumber)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"accountnumber"},"Account number"),i.createElement("input",{type:"text",id:"accountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(on=k==null?void 0:k.accountNumber)!=null?on:"",onChange:kt}),(Y==null?void 0:Y.accountNumber)&&i.createElement("span",{className:"error-span"},Y==null?void 0:Y.accountNumber)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),i.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(sn=k==null?void 0:k.confirmAccountNumber)!=null?sn:"",onChange:kt}),(Y==null?void 0:Y.confirmAccountNumber)&&i.createElement("span",{className:"error-span"},Y==null?void 0:Y.confirmAccountNumber)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"bankname"},"Bank name"),i.createElement("input",{type:"text",id:"bankname",className:"form-control",maxLength:100,placeholder:"My Bank",name:"bankName",value:(ln=k==null?void 0:k.bankName)!=null?ln:"",onChange:kt}),(Y==null?void 0:Y.bankName)&&i.createElement("span",{className:"error-span"},Y==null?void 0:Y.bankName)),((k==null?void 0:k.accountType)==="business saving"||(k==null?void 0:k.accountType)==="business checking")&&i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"companyName"},"Company name"),i.createElement("input",{type:"text",id:"companyName",className:"form-control",maxLength:100,placeholder:"My Company",name:"companyName",value:(xn=k==null?void 0:k.companyName)!=null?xn:"",onChange:kt}),(Y==null?void 0:Y.companyName)&&i.createElement("span",{className:"error-span"},Y==null?void 0:Y.companyName)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"accounttype"},"Select account type"),i.createElement("select",{name:"accountType",id:"accounttype",className:"form-control",value:(Xt=k==null?void 0:k.accountType)!=null?Xt:"",onChange:kt},i.createElement("option",{value:""},"Select account"),gi.map(_=>i.createElement("option",{key:_.value,value:_.value},_.label)))),(e==null?void 0:e.customerId)&&i.createElement("div",{className:"form-group mb-4 save-ach-div",style:{paddingTop:"5px"}},i.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:Ne,onChange:_=>ft(_.target.checked)}),i.createElement("label",{htmlFor:"saveACH"},"Save ACH")),Ne&&i.createElement("div",{className:"form-group mb-4",style:{fontSize:"12px",color:"#727272"}},i.createElement("p",null,"If checked, I agree for ",i.createElement("b",null,"ecommerce")," to have my permission to charge this credit card for agreed upon purchases in the future."))),i.createElement("div",{className:"form-group "},i.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},ye((Ze=Number(ze))==null?void 0:Ze.toFixed(2)))))),i.createElement("div",{id:"reader",style:{display:G==="reader"?"block":"none"},className:"tabcontent"},i.createElement("div",{className:"frac-card-payment"},i.createElement("div",{className:"frac-heading-card-wrap"},i.createElement("div",{className:"frac-backarrow"}),i.createElement("h6",{className:"frac-card-payment-heading"},"Reader Payment"))),i.createElement(ji,{listHeading:"Reader",ListItems:$==null?void 0:$.paymentDeviceList,selectedPax:ht,setSlectedPax:at}),i.createElement("button",{onClick:Ln,className:"pay-button"},"$",(Zt=Number(e==null?void 0:e.amount))==null?void 0:Zt.toFixed(2)))))))))))))}import m,{useEffect as Qi,useState as un}from"react";import fi from"axios";import Xi from"sweetalert2";import{IoArrowBack as sr}from"react-icons/io5";function lr(H){var T=H,{showButton:e=!0}=T,t=ii(T,["showButton"]);var xt,bn,kt,Wn,Bn,St,qn,Mn,Ln;let[z,B]=un(!1),[O,U]=un(!1),[be,K]=un(""),[A,G]=un(!1),[oe,w]=un(!1),[C,R]=un("card"),[V,y]=un(!1),[Se,M]=un("card"),[Te,_e]=un("form"),ce=t.merchantPublicKey,[Ne,ft]=un(void 0);Qi(()=>{t.onTriggerPay&&t.onTriggerPay(()=>{ze()})},[t]);let Pe=te+"widget/mc-img.svg",Fe=te+"widget/visa-img.svg",ue=te+"widget/ae-img.svg",Ye=te+"widget/discover-img.svg",De=te+"widget/card.svg",gn=te+"widget/Trash.svg",nn=te+"widget/bank.svg",h=te+"widget/secure-img.png",L=te+"widget/pov-by.png",[u,xe]=un(),[a,o]=un({}),[r,b]=un([]),[k,P]=un(),[Y,x]=un(void 0),[f,N]=un(),[je,gt]=un(""),$e=(J,E)=>{let Ue=(parseFloat(E)||0)/100,Ht=J/(1+Ue);return Math.round(Ht*100)/100};Qi(()=>{if(t!=null&&t.pass_fee){let J=$e(t==null?void 0:t.amount,t==null?void 0:t.surcharge);x(J)}},[t==null?void 0:t.pass_fee]);let zt=()=>B(!0),ht=()=>B(!1),at=()=>{w(!1),R("card"),U(!1),K(""),G(!1),gt(""),xe({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),o({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),y(!1),P({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""})},ze=()=>w(!0),ge=(J,E)=>{let Ue=J;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(Ue)){(E===""||/^[0-9]+$/.test(E))&&(o(Re=>F(v({},Re),{[Ue]:""})),xe(Re=>F(v({},Re),{[Ue]:E})));return}o(Re=>F(v({},Re),{[Ue]:""})),xe(Re=>F(v({},Re),{[Ue]:E}))},$=J=>{var mt;let E=J.target,Ue=E.value.replace(/\D/g,""),{formatted:Ht,cursor:Re}=Tn(E.value,(mt=E.selectionStart)!=null?mt:0);o(vt=>F(v({},vt),{cardNumber:""})),xe(vt=>F(v({},vt),{cardNumber:Ht})),requestAnimationFrame(()=>{E.setSelectionRange(Re,Re)})},Me=()=>{var Re,mt,vt,jt,It,Yt;let J={},E=u,Ue=parseInt((E==null?void 0:E.expiryMonth)||"",10),Ht=(E==null?void 0:E.expiryYear)||"";if((Re=E==null?void 0:E.cardName)!=null&&Re.trim()||(J.cardName="Card name is required"),(mt=E==null?void 0:E.cardNumber)!=null&&mt.trim()||(J.cardNumber="Card number is required"),(!((vt=E==null?void 0:E.expiryMonth)!=null&&vt.trim())||!((jt=E==null?void 0:E.expiryYear)!=null&&jt.trim())||isNaN(Ue)||Ue<1||Ue>12||Ht.length!==4)&&(J.expiryMonth="Invalid Expiration Date."),(It=E==null?void 0:E.cvv)!=null&&It.trim()||(J.cvv="CVV is required"),(Yt=E==null?void 0:E.zipCode)!=null&&Yt.trim()||(J.zipCode="ZIP code is required"),E!=null&&E.expiryMonth&&(E!=null&&E.expiryYear)&&E.expiryMonth.length<=2&&E.expiryYear.length===4){let Qt=parseInt(E.expiryMonth,10),ct=parseInt(E.expiryYear,10),Ke=new Date,Ot=Ke.getMonth()+1,Vt=Ke.getFullYear();(ct<Vt||ct===Vt&&Qt<Ot)&&(J.expiryMonth="Card is expired")}return o(J),Object.keys(J).length>0},dt=async J=>{var Ue,Ht,Re,mt,vt,jt,It,Yt,Qt,ct,Ke,Ot,Vt,an,rn,on,sn,ln,xn;J.preventDefault();let E=document.activeElement;if(E instanceof HTMLElement&&E.blur(),!O&&C=="card"){if(Me())return;{let Ze=DatacapWebToken.validateCardNumber(u==null?void 0:u.cardNumber.replaceAll(" ","")),Zt=DatacapWebToken.validateExpirationDate(u==null?void 0:u.expiryMonth,u==null?void 0:u.expiryYear),_=DatacapWebToken.validateCVV(u==null?void 0:u.cvv),g={};if(Ze||(g.cardNumber="Invalid card Number"),Zt||(g.expiryMonth="Invalid Expiration Date."),_||(g.cvv="Invalid CVV"),o(g),Ze&&_&&Zt){U(!0);try{let se=async function(pe){if(pe.Error)K(pe.Error),U(!1);else{let ee=u==null?void 0:u.cardName,We=u==null?void 0:u.zipCode;pe.name=ee,pe.postal_code=We,pe.fractalpayPublicKey=t==null?void 0:t.merchantPublicKey,pe.amount=t==null?void 0:t.amount,pe.order_id=t==null?void 0:t.orderID,pe.preAuth_id=(t==null?void 0:t.preauthId)||"",pe.isCardSave=V,pe.customer_id=t==null?void 0:t.customerId,pe.link_token="",pe.gateway_id=f==null?void 0:f.paymentGateway,pe.discount=t==null?void 0:t.discount,pe.tax=t==null?void 0:t.tax,pe.surcharge=t==null?void 0:t.surcharge,pe.pass_fee=t==null?void 0:t.pass_fee,new Headers().append("Content-Type","application/json");let _t={method:"POST",body:JSON.stringify(pe),redirect:"follow"};$t.emit("sendMessage",v(F(v({},_t),{isChargePreauth:!0}),(t==null?void 0:t.sessionToken)&&{sessionToken:t.sessionToken})),$t.on("charge-preauth",Je=>{var pt;(Je==null?void 0:Je.status)=="Failed"?(U(!1),K((Je==null?void 0:Je.message)||"Something went wrong. Please try again later.")):(G(!0),gt((pt=Je==null?void 0:Je.data)==null?void 0:pt.transaction_id),U(!1),xe({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}))})}};if((f==null?void 0:f.paymentGateway)===32){let pe={method:"POST",redirect:"follow"};try{let ee=await fi.post(`${Ae}api/v1/widget/generate-session`,pe),We=Number(u==null?void 0:u.expiryYear)%100,le=u==null?void 0:u.cardNumber;le=le==null?void 0:le.replace(/\s+/g,"");let _t=`${le}=${We}${u==null?void 0:u.expiryMonth} ${u==null?void 0:u.cvv}`,pt=forge.pki.publicKeyFromPem((Ht=(Ue=ee==null?void 0:ee.data)==null?void 0:Ue.data)==null?void 0:Ht.publicKeyPem).encrypt(_t,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Wt=forge.util.encode64(pt),p={"Content-Type":"application/json","x-app-session-key":(mt=(Re=ee.data)==null?void 0:Re.data)==null?void 0:mt.session_key},c=JSON.stringify({enc_track2_data:`${Wt}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(jt=(vt=ee==null?void 0:ee.data)==null?void 0:vt.data)==null?void 0:jt.session_key}`});try{let Z=await fi.post(`${mn}tokenizer/tokenize`,c,{headers:p}),ke=JSON.stringify(F(v({},(It=Z==null?void 0:Z.data)==null?void 0:It.data),{name:u==null?void 0:u.cardName,postal_code:u==null?void 0:u.zipCode,customer_id:t==null?void 0:t.customerId,amount:t==null?void 0:t.amount,Token:`${(Qt=(Yt=Z==null?void 0:Z.data)==null?void 0:Yt.data)==null?void 0:Qt.token}`,fractalpayPublicKey:ce,order_id:t==null?void 0:t.orderID,preAuth_id:(t==null?void 0:t.preauthId)||"",isCardSave:V,discount:t==null?void 0:t.discount,surcharge:t==null?void 0:t.surcharge,tax:t==null?void 0:t.tax,link_token:"",ExpirationYear:u==null?void 0:u.expiryYear,ExpirationMonth:u==null?void 0:u.expiryMonth,CVV:u==null?void 0:u.cvv,Last4:(Ke=(ct=Z==null?void 0:Z.data)==null?void 0:ct.data)==null?void 0:Ke.last4,Brand:(Vt=(Ot=Z==null?void 0:Z.data)==null?void 0:Ot.data)==null?void 0:Vt.brand,gateway_id:f==null?void 0:f.paymentGateway,pass_fee:t==null?void 0:t.pass_fee})),rt={method:"POST",headers:{"Content-Type":"application/json"},body:ke,redirect:"follow"};$t.emit("sendMessage",v(F(v({},rt),{isFractalPreauth:!0}),(t==null?void 0:t.sessionToken)&&{sessionToken:t.sessionToken})),$t.on("fractal-charge-preauth",ve=>{var ot;(ve==null?void 0:ve.status)=="Failed"?(U(!1),K((ve==null?void 0:ve.message)||"Something went wrong , Try again later")):(gt((ot=ve==null?void 0:ve.data)==null?void 0:ot.transaction_id),G(!0),U(!1))})}catch(Z){console.log(Z),U(!1),K(((rn=(an=Z==null?void 0:Z.response)==null?void 0:an.data)==null?void 0:rn.message)||(Z==null?void 0:Z.message)||"Something went wrong , Try again later")}}catch(ee){U(!1),K(((sn=(on=ee==null?void 0:ee.response)==null?void 0:on.data)==null?void 0:sn.message)||(ee==null?void 0:ee.message)||"Something went wrong , Try again later")}}else DatacapWebToken.requestToken(f==null?void 0:f.dctoken,"PaymentForm",se)}catch(se){U(!1),K(((xn=(ln=se==null?void 0:se.response)==null?void 0:ln.data)==null?void 0:xn.message)||(se==null?void 0:se.message)||"Something went wrong.")}}}}},X=async()=>{var J,E,Ue,Ht,Re,mt,vt,jt,It,Yt,Qt,ct,Ke,Ot,Vt,an,rn,on,sn,ln,xn;zt();try{let Xt={fractalpayPublicKey:ce,customer_id:t==null?void 0:t.customerId,preauth:!0,isReader:!!(t!=null&&t.isReader)},Ze=await fi.post(`${tt}get-payment-details`,Xt);if(N((J=Ze==null?void 0:Ze.data)==null?void 0:J.data),(Ue=(E=Ze==null?void 0:Ze.data)==null?void 0:E.data)!=null&&Ue.paymentGateway||(at(),K("Something went wrong.")),(Re=(Ht=Ze==null?void 0:Ze.data)==null?void 0:Ht.data)!=null&&Re.card_list&&((jt=(vt=(mt=Ze==null?void 0:Ze.data)==null?void 0:mt.data)==null?void 0:vt.card_list)==null?void 0:jt.length)>0){R("card"),b((Yt=(It=Ze==null?void 0:Ze.data)==null?void 0:It.data)==null?void 0:Yt.card_list),((Ke=(ct=(Qt=Ze==null?void 0:Ze.data)==null?void 0:Qt.data)==null?void 0:ct.card_list)==null?void 0:Ke.length)>0&&_e("list");let Zt=(an=(Vt=(Ot=Ze==null?void 0:Ze.data)==null?void 0:Ot.data)==null?void 0:Vt.card_list)==null?void 0:an.filter(_=>(_==null?void 0:_.primary_card)==1);Zt!=null&&Zt[0]&&((rn=Zt==null?void 0:Zt[0])==null?void 0:rn.payment_method_type)==((sn=(on=Ze==null?void 0:Ze.data)==null?void 0:on.data)==null?void 0:sn.paymentGateway)&&P(Zt[0])}else R("card");ht()}catch(Xt){console.log(Xt),ht(),K(((xn=(ln=Xt==null?void 0:Xt.response)==null?void 0:ln.data)==null?void 0:xn.message)||(Xt==null?void 0:Xt.message)||"Something went wrong")}},Mt=async J=>{var Ke,Ot,Vt,an,rn,on,sn;if(J.currentTarget.blur(),O)return;let E=t==null?void 0:t.customerId,Ue=t==null?void 0:t.discount,Ht=t==null?void 0:t.surcharge,Re=t==null?void 0:t.tax,mt=t==null?void 0:t.merchantPublicKey,vt=t==null?void 0:t.orderID,jt=t==null?void 0:t.amount,It=k==null?void 0:k.id,Yt=k==null?void 0:k.card_type,Qt=(t==null?void 0:t.preauthId)||"";if(mt&&vt&&jt)if(E)if(It){let ln={amount:jt,order_id:vt,customer_id:E,card_id:It,fractalpayPublicKey:mt,isCardSave:Yt!="Bank",discount:Ue,surcharge:Ht,tax:Re,preAuth_id:Qt},ct=ln,{isCardSave:xn}=ct,Xt=ii(ct,["isCardSave"]),Zt=tt+"authorize-by-card",_=v({"Content-Type":"application/json"},(t==null?void 0:t.sessionToken)&&{"X-Session-Token":t.sessionToken});U(!0);try{let g=await fi.post(Zt,Yt=="Bank"?Xt:ln,{headers:_});(Ke=g==null?void 0:g.data)!=null&&Ke.result&&(gt((Vt=(Ot=g==null?void 0:g.data)==null?void 0:Ot.data)==null?void 0:Vt.transaction_id),G(!0),U(!1))}catch(g){U(!1),console.log(g),K(((rn=(an=g==null?void 0:g.response)==null?void 0:an.data)==null?void 0:rn.message)||((sn=(on=g==null?void 0:g.response)==null?void 0:on.data)==null?void 0:sn.status)||"Something went erong")}}else K("Please Select A Card/ACH");else K("Please Select Customer");else K("Something went wrong.")};Qi(()=>{oe&&ce&&X()},[ce,oe]);let Ge=async J=>{Xi.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async E=>{if(E.isConfirmed){U(!0);try{let Ue={card_id:J,customer_id:t==null?void 0:t.customerId,fractalpayPublicKey:t==null?void 0:t.merchantPublicKey},Ht=await fi.post(`${tt}delete-customer-card`,Ue);U(!1),X(),Xi.fire({icon:"success",title:"Deleted!",text:"The card has been deleted.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}catch(Ue){U(!1),Xi.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}})},Lt=J=>{switch(J==null?void 0:J.toLowerCase()){case"visa":return Fe;case"mastercard":case"mc":case"m/c":return Pe;case"amex":case"american express":case"ae":return ue;case"discover":case"dcvr":return Ye;case"bank":return nn;default:return J}},S=J=>{R(J)},kn=async J=>{var mt,vt,jt,It,Yt,Qt;if(J.currentTarget.blur(),O)return;let E=t==null?void 0:t.merchantPublicKey,Ue=t==null?void 0:t.orderID,Ht=String(t==null?void 0:t.amount),Re=t==null?void 0:t.customerId;if(!(Ne!=null&&Ne.device_id)){K("Please Select A Payment Device");return}if(E&&Ue&&Ht){U(!0);let ct={amount:Ht,fractalpayPublicKey:E,customer_order_id:Ue,device_id:Ne==null?void 0:Ne.device_id,customer_id:Re||"",is_auth:!0};try{let Ke=await fi.post(`${tt}charge-with-reader`,ct);((mt=Ke==null?void 0:Ke.data)==null?void 0:mt.result)==!0?(gt((jt=(vt=Ke==null?void 0:Ke.data)==null?void 0:vt.data)==null?void 0:jt.transaction_id),G(!0),U(!1)):(K(((It=Ke==null?void 0:Ke.data)==null?void 0:It.message)||"Something went wrong."),U(!1))}catch(Ke){K(((Qt=(Yt=Ke==null?void 0:Ke.response)==null?void 0:Yt.data)==null?void 0:Qt.message)||"Something went wrong."),U(!1)}}else K("Something went wrong.")},At=J=>{Se==="card"?Mt(J):Se==="reader"&&kn(J)};return m.createElement(m.Fragment,null,m.createElement(_n,null),m.createElement(oi,null),m.createElement(Dn,null),m.createElement(m.Fragment,null,e&&m.createElement("button",{className:"paymentBtn",onClick:ze},"PreAuth Payment"),m.createElement(Nn,{open:oe,onClose:at},be&&m.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},m.createElement(zn,{error:be,onClose:at})),A&&m.createElement(si,{onClose:at,tranId:je}),!be&&!A&&m.createElement(m.Fragment,null,(z||O)&&m.createElement(dn,{loading:z||O}),m.createElement("div",null,m.createElement("div",{className:"frac-card-payment-page frac-form"},m.createElement("div",{className:"parent-pay-container"},m.createElement("span",{className:"request-payment-close-popup",onClick:at},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},m.createElement("g",{clipPath:"url(#clip0_12425_52336)"},m.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"})),m.createElement("defs",null,m.createElement("clipPath",{id:"clip0_12425_52336"},m.createElement("rect",{width:"16",height:"16",fill:"white"}))))),m.createElement("div",{className:"pay-container"},m.createElement("div",{className:"pay-header pay-conatiner-one"},m.createElement("div",{className:"pay-conatiner-one-first"},m.createElement("div",{className:"pay-logo-container"},m.createElement("div",{className:"pay-main-logo"},m.createElement("img",{src:f==null?void 0:f.logo,id:"pay-logos"}))),m.createElement("div",{className:"amt-pay-con"},m.createElement("div",{className:"pay-amount-conatiner"},m.createElement("small",{className:"pay-payment-amount"},"Select paymet type")),m.createElement("div",{className:"frac-card-bank-radio-main"},m.createElement(Fn,{label:"Card",amount:(xt=Number(t==null?void 0:t.amount))==null?void 0:xt.toFixed(2),value:"card",onChange:S,activetab:C}),(t==null?void 0:t.isReader)&&(f==null?void 0:f.paymentDeviceList)&&((bn=f==null?void 0:f.paymentDeviceList)==null?void 0:bn.length)>0&&m.createElement(Fn,{label:"Reader",amount:(kt=Number(t==null?void 0:t.amount))==null?void 0:kt.toFixed(2),value:"reader",onChange:S,activetab:C})))),m.createElement("div",{className:"pay-conatiner-one-last"},m.createElement("img",{src:h,alt:""}),m.createElement("img",{src:L,alt:""}),"Secure payments powered by Fractal"),m.createElement("div",null)),!z&&m.createElement("div",{className:"pay-tab pay-conatiner-two"},m.createElement("div",{className:"col-md-12"},m.createElement("div",{id:"payment-form-div"},C!=="cardList"?m.createElement("div",null,m.createElement("div",{className:""},m.createElement("div",{className:"res-pay-con"},m.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},m.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),m.createElement("strong",{className:"pay-amount"},ye((Wn=Number(t==null?void 0:t.amount))==null?void 0:Wn.toFixed(2)))),m.createElement("div",null,m.createElement("div",null,m.createElement("img",{src:Fe,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Pe,width:35,alt:""})),m.createElement("div",null,m.createElement("img",{src:ue,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Ye,width:35,alt:""})))),Y&&Y>0&&m.createElement("div",{className:"res-pay-con frac-cash-discount"},m.createElement("div",{className:"frac-cashlabel"},Vn(f==null?void 0:f.showSurcharge)?"Surcharge":"Cash Discount"),m.createElement("div",null,ye(Y.toFixed(2)))))):m.createElement("div",null,m.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",f==null?void 0:f.customer_name),m.createElement("div",{className:"res-pay-con"},m.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},m.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),m.createElement("strong",{className:"pay-amount"},ye((Bn=Number(t==null?void 0:t.amount))==null?void 0:Bn.toFixed(2)))),m.createElement("div",null,m.createElement("div",null,m.createElement("img",{src:Fe,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Pe,width:35,alt:""})),m.createElement("div",null,m.createElement("img",{src:ue,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Ye,width:35,alt:""})))),m.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," Cards")),m.createElement("div",{id:"card",style:{display:C==="card"?"block":"none"},className:"tabcontent"},m.createElement("div",{className:"frac-card-payment"},m.createElement("div",{className:"frac-heading-card-wrap"},m.createElement("div",{className:"frac-backarrow"},(r==null?void 0:r.length)>0&&Te==="form"&&m.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>_e("list")}," ",m.createElement(sr,null)),Y&&Y>0&&m.createElement("div",{className:"res-pay-con frac-cash-discount"},m.createElement("div",{className:"frac-cashlabel"},Vn(f==null?void 0:f.showSurcharge)?"Surcharge":"Cash Discount"),m.createElement("div",null,ye(Y.toFixed(2))))),m.createElement("h6",{className:"frac-card-payment-heading"},"Card Authorization")),C!="ach"&&m.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},m.createElement("img",{src:Fe,alt:"",width:33}),m.createElement("img",{src:Pe,width:33,alt:""}),m.createElement("img",{src:ue,alt:"",width:33}),m.createElement("img",{src:Ye,width:33,alt:""}))),Te==="list"?m.createElement(m.Fragment,null,m.createElement(On,{listHeading:"Cards",paymentGateway:f==null?void 0:f.paymentGateway,ListItems:r,selectedCard:k,setSelectedCard:P,handleDeleteCard:Ge,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{_e("form")}}),m.createElement("div",{className:"form-group",style:{padding:"0"}},m.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:At},ye((St=Number(t==null?void 0:t.amount))==null?void 0:St.toFixed(2))))):m.createElement("div",{id:"card",style:{display:C==="card"?"block":"none"},className:"tabcontent"},m.createElement("form",{id:"PaymentForm",onSubmit:dt,onKeyDown:J=>{J.key==="Enter"&&O&&(J.preventDefault(),J.stopPropagation())}},m.createElement("div",{className:"ach-scrl",style:{minHeight:(r==null?void 0:r.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"cardHolderName"},"Name on Card"),m.createElement("input",{type:"text",className:"form-control",placeholder:"John Doe",value:(u==null?void 0:u.cardName)||"",onChange:J=>{let E=J.target.value;/^[a-zA-Z\s]*$/.test(E)&&ge("cardName",E)}}),(a==null?void 0:a.cardName)&&m.createElement("span",{className:"error-span"},a==null?void 0:a.cardName)),m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"cardNumber"},"Card Number"),m.createElement("div",{className:"toggle-num-wrapper"},m.createElement("input",{className:"form-control card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(u==null?void 0:u.cardNumber)||"",onChange:J=>$(J),"data-token":"card_number"}),m.createElement("div",{className:"card-crdi card-expiry-new"},m.createElement("div",{className:"exp-date-year-container"},m.createElement("div",{className:"exp-date form-group"},m.createElement("input",{"data-token":"exp_month",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(u==null?void 0:u.expiryMonth)||"",onChange:J=>ge("expiryMonth",J.target.value)})),m.createElement("div",{className:"exp-year form-group"},m.createElement("input",{"data-token":"exp_year",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(u==null?void 0:u.expiryYear)||"",onChange:J=>ge("expiryYear",J.target.value)})),m.createElement("div",{className:"security-digit form-group"},m.createElement("input",{"data-token":"cvv",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(u==null?void 0:u.cvv)||"",onChange:J=>ge("cvv",J.target.value)})))),(a==null?void 0:a.cardNumber)&&m.createElement("span",{className:"error-span"},a==null?void 0:a.cardNumber),m.createElement("p",{style:{margin:"0"}},a!=null&&a.expiryMonth||a!=null&&a.expiryYear?m.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},a==null?void 0:a.expiryMonth):"",(a==null?void 0:a.cvv)&&m.createElement("span",{className:"error-span"},a==null?void 0:a.cvv)))),m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),m.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"Enter Order id",disabled:!0,value:t==null?void 0:t.orderID,onChange:J=>ge("orderId",J.target.value),style:{background:"#F6F6F7",color:"#727272"}})),m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"zip"},"ZIP"),m.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(qn=u==null?void 0:u.zipCode)!=null?qn:"",onChange:J=>ge("zipCode",J.target.value)}),(a==null?void 0:a.zipCode)&&m.createElement("span",{className:"error-span"},a==null?void 0:a.zipCode)),(t==null?void 0:t.customerId)&&m.createElement("div",{className:"form-group"},m.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},m.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:V,onChange:J=>y(J.target.checked)}),m.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),m.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),m.createElement("div",{className:"frac-tooltip-wrapper"},m.createElement("div",{className:"frac-tooltip-icon"},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},m.createElement("g",{clipPath:"url(#clip0_12420_50192)"},m.createElement("rect",{width:"20",height:"20",fill:"white"}),m.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),m.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"})),m.createElement("defs",null,m.createElement("clipPath",{id:"clip0_12420_50192"},m.createElement("rect",{width:"20",height:"20",fill:"white"}))))),m.createElement("div",{className:"frac-tooltip-text"},m.createElement("p",null,"If checked, I agree to give the ",m.createElement("b",null,(f==null?void 0:f.bname)||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),m.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:0}},m.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ye((Mn=Number(t==null?void 0:t.amount))==null?void 0:Mn.toFixed(2))))))),m.createElement("div",{id:"reader",style:{display:C==="reader"?"block":"none"},className:"tabcontent"},m.createElement("div",{className:"frac-card-payment"},m.createElement("div",{className:"frac-heading-card-wrap"},m.createElement("div",{className:"frac-backarrow"},Y&&Y>0&&m.createElement("div",{className:"res-pay-con frac-cash-discount"},m.createElement("div",{className:"frac-cashlabel"},Vn(f==null?void 0:f.showSurcharge)?"Surcharge":"Cash Discount"),m.createElement("div",null,ye(Y.toFixed(2))))),m.createElement("h6",{className:"frac-card-payment-heading"},"Reader Authorization"))),m.createElement(ji,{listHeading:"Reader",ListItems:f==null?void 0:f.paymentDeviceList,selectedPax:Ne,setSlectedPax:ft}),m.createElement("button",{onClick:kn,className:"pay-button"},"$",(Ln=Number(t==null?void 0:t.amount))==null?void 0:Ln.toFixed(2))))))))))))))}import we,{useEffect as ur,useRef as _i,useState as li}from"react";import gr from"sweetalert2";import Pi from"axios";import dr from"react";function Di(){let e="#000",t="#fff",H="#212529",T="#dee2e6";return dr.createElement("style",null,`
|
|
1734
|
+
.add-card {
|
|
1735
|
+
max-width:380px;
|
|
1736
|
+
padding: 0 20px
|
|
1737
|
+
}
|
|
1738
|
+
.add-card .form-group {
|
|
1739
|
+
margin-bottom: 5px;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
.add-card .idle-green-btn {
|
|
1743
|
+
color: white;
|
|
1744
|
+
background-color: rgba(97, 198, 153, 1);
|
|
1745
|
+
border-radius: 100px;
|
|
1746
|
+
border: none !important;
|
|
1747
|
+
padding: 12px 24px 12px 24px;
|
|
1748
|
+
width: 100%;
|
|
1749
|
+
cursor:pointer
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
.add-card .idle-green-btn:hover {
|
|
1753
|
+
background-color: rgba(65, 164, 120, 1) !important;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
.add-card .idle-green-btn:focus {
|
|
1757
|
+
border: 2px solid rgba(90, 172, 136, 1) !important;
|
|
1758
|
+
background-color: rgba(97, 198, 153, 1) !important;
|
|
1759
|
+
padding: 10px 24px 10px 24px;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
.add-card .container-creditcard {
|
|
1763
|
+
width: 426px;
|
|
1764
|
+
padding: 24px;
|
|
1765
|
+
background-color: #FFFFFF;
|
|
1766
|
+
border-radius: 24px;
|
|
1767
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
1768
|
+
}
|
|
1769
|
+
.add-card .container-creditcard .request-payment-close-popup{
|
|
1770
|
+
position:absolute;
|
|
1771
|
+
// background:red
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
.add-card h2 {
|
|
1775
|
+
font-size: 24px;
|
|
1776
|
+
line-height: 32px;
|
|
1777
|
+
font-weight: 500;
|
|
1778
|
+
color: #35254D;
|
|
1779
|
+
margin-bottom: 24px;
|
|
1780
|
+
text-align: center;
|
|
1781
|
+
}
|
|
1782
|
+
.add-card .form-group {
|
|
1783
|
+
margin-top: 20px;
|
|
1784
|
+
margin-bottom : 10px
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
.add-card .credit-card {
|
|
1788
|
+
display: flex;
|
|
1789
|
+
flex-direction: column;
|
|
1790
|
+
justify-content: space-between;
|
|
1791
|
+
align-items: flex-start;
|
|
1792
|
+
padding: 20px;
|
|
1793
|
+
background-color: #35254D;
|
|
1794
|
+
color: #FFFFFF;
|
|
1795
|
+
border-radius: 15px;
|
|
1796
|
+
margin-bottom: 20px;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
.add-card .credit-card .chip {
|
|
1800
|
+
width: 50px;
|
|
1801
|
+
height: 30px;
|
|
1802
|
+
background-image: url('https://raw.githubusercontent.com/danieldasilvaa/creditcard-html-css/main/chip.png');
|
|
1803
|
+
background-size: cover;
|
|
1804
|
+
margin-bottom: 10px;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
.add-card .credit-card .card-number {
|
|
1808
|
+
font-size: 18px;
|
|
1809
|
+
letter-spacing: 2px;
|
|
1810
|
+
margin-bottom: 10px;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
.add-card .credit-card .card-info {
|
|
1814
|
+
font-size: 14px;
|
|
1815
|
+
margin-bottom: 5px;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
.add-card label {
|
|
1819
|
+
font-size: 12px;
|
|
1820
|
+
font-family: 'IBM Plex Mono', monospace;
|
|
1821
|
+
font-weight: 400;
|
|
1822
|
+
text-transform: uppercase;
|
|
1823
|
+
color: #35254D;
|
|
1824
|
+
margin-bottom: 6px;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
.add-card input[type="text"],
|
|
1828
|
+
.add-card input[type="number"],
|
|
1829
|
+
.add-card input[type="date"],
|
|
1830
|
+
.add-card input[type="email"],
|
|
1831
|
+
.add-card select {
|
|
1832
|
+
width: 100%;
|
|
1833
|
+
padding: 12px;
|
|
1834
|
+
font-size: 14px;
|
|
1835
|
+
font-weight: 500;
|
|
1836
|
+
color: #35254D;
|
|
1837
|
+
border: 1px solid #D4CDDF;
|
|
1838
|
+
border-radius: 6px;
|
|
1839
|
+
background-color: #FFFFFF;
|
|
1840
|
+
box-sizing: border-box;
|
|
1841
|
+
// margin-bottom: 20px;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
.add-card input[type="text"]::placeholder {
|
|
1845
|
+
color: #867C94;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
// .add-card input[type="submit"] {
|
|
1849
|
+
// width: 100%;
|
|
1850
|
+
// padding: 12px;
|
|
1851
|
+
// background-color: #161616;
|
|
1852
|
+
// color: #FFFFFF;
|
|
1853
|
+
// font-size: 14px;
|
|
1854
|
+
// font-weight: 500;
|
|
1855
|
+
// border: none;
|
|
1856
|
+
// border-radius: 1000px;
|
|
1857
|
+
// cursor: pointer;
|
|
1858
|
+
// text-align: center;
|
|
1859
|
+
// }
|
|
1860
|
+
|
|
1861
|
+
.add-card input[type="submit"]:hover {
|
|
1862
|
+
background-color: #000000;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
.add-card .error {
|
|
1866
|
+
font-size: 12px;
|
|
1867
|
+
color: red;
|
|
1868
|
+
margin-top: -15px;
|
|
1869
|
+
margin-bottom: 15px;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
/* Tab Styling */
|
|
1873
|
+
.add-card .tabs {
|
|
1874
|
+
display: flex;
|
|
1875
|
+
gap: 4px;
|
|
1876
|
+
margin-bottom: 24px;
|
|
1877
|
+
justify-content: center;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
.add-card .tab {
|
|
1881
|
+
display: flex;
|
|
1882
|
+
justify-content: center;
|
|
1883
|
+
align-items: center;
|
|
1884
|
+
padding: 6px 16px;
|
|
1885
|
+
font-size: 14px;
|
|
1886
|
+
font-weight: 500;
|
|
1887
|
+
border: 1px solid #D4CDDF;
|
|
1888
|
+
border-radius: 1000px;
|
|
1889
|
+
cursor: pointer;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
.add-card .tab.active {
|
|
1893
|
+
border-color: #35254D;
|
|
1894
|
+
color: #35254D;
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
.add-card .tab:hover {
|
|
1898
|
+
border-color: #867C94;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
/* Buttons */
|
|
1902
|
+
.add-card .button-close {
|
|
1903
|
+
display: inline-block;
|
|
1904
|
+
background-color: #161616;
|
|
1905
|
+
color: #FFFFFF;
|
|
1906
|
+
font-size: 14px;
|
|
1907
|
+
font-weight: 500;
|
|
1908
|
+
padding: 12px 32px;
|
|
1909
|
+
border-radius: 1000px;
|
|
1910
|
+
text-align: center;
|
|
1911
|
+
cursor: pointer;
|
|
1912
|
+
width: 48%;
|
|
1913
|
+
box-sizing: border-box;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
.add-card .button-close:hover {
|
|
1917
|
+
background-color: #000000;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
.add-card .btn-add1 {
|
|
1921
|
+
display: inline-block;
|
|
1922
|
+
background-color: #61c699;
|
|
1923
|
+
color: #FFFFFF;
|
|
1924
|
+
font-size: 14px;
|
|
1925
|
+
font-weight: 500;
|
|
1926
|
+
padding: 12px 32px;
|
|
1927
|
+
border-radius: 1000px;
|
|
1928
|
+
text-align: center;
|
|
1929
|
+
cursor: pointer;
|
|
1930
|
+
width: 48%;
|
|
1931
|
+
box-sizing: border-box;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
.add-card .btn-add1:hover {
|
|
1935
|
+
background-color: #B5E1CB;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
/* Combined Expiration Date and CVC Row */
|
|
1939
|
+
.add-card .exp-cvc-container {
|
|
1940
|
+
display: flex;
|
|
1941
|
+
justify-content: space-between;
|
|
1942
|
+
gap: 16px;
|
|
1943
|
+
margin-bottom: 5px;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
.add-card .exp-cvc-container input {
|
|
1947
|
+
flex: 1;
|
|
1948
|
+
padding: 12px;
|
|
1949
|
+
font-size: 14px;
|
|
1950
|
+
font-weight: 500;
|
|
1951
|
+
color: #35254D;
|
|
1952
|
+
border: 1px solid #D4CDDF;
|
|
1953
|
+
border-radius: 6px;
|
|
1954
|
+
background-color: #FFFFFF;
|
|
1955
|
+
box-sizing: border-box;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
.add-card .exp-cvc-container input::placeholder {
|
|
1959
|
+
color: #867C94;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
.card-scrl {
|
|
1963
|
+
overflow-y: auto;
|
|
1964
|
+
padding-right: 6px !important;
|
|
1965
|
+
}
|
|
1966
|
+
.card-scrl::-webkit-scrollbar {
|
|
1967
|
+
width: 3px;
|
|
1968
|
+
background-color: #F5F5F5;
|
|
1969
|
+
}
|
|
1970
|
+
.card-scrl::-webkit-scrollbar-thumb {
|
|
1971
|
+
background-color: #35254D;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
.custom-z-index {
|
|
1975
|
+
z-index: 9999 !important;
|
|
1976
|
+
}
|
|
1977
|
+
#add-credit-card-panel{
|
|
1978
|
+
padding: auto 10px !important}
|
|
1979
|
+
/* Responsive Design */
|
|
1980
|
+
@media screen and (max-width: 768px) {
|
|
1981
|
+
.add-card .container-creditcard {
|
|
1982
|
+
width: 90%;
|
|
1983
|
+
padding: 20px;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
.add-card input[type="submit"] {
|
|
1987
|
+
font-size: 12px;
|
|
1988
|
+
padding: 10px;
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
`)}import Kn from"react";import mr from"react";function Ri(){return mr.createElement("style",null,`
|
|
1993
|
+
.card-success .logo-container {
|
|
1994
|
+
display: flex;
|
|
1995
|
+
justify-content: center;
|
|
1996
|
+
align-items: center;
|
|
1997
|
+
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1998
|
+
z-index: 10;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
.card-success .client-logo {
|
|
2002
|
+
max-width: 100px;
|
|
2003
|
+
height: auto;
|
|
2004
|
+
object-fit: contain;
|
|
2005
|
+
display: block;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
.card-success .payment-success-container {
|
|
2009
|
+
display: flex;
|
|
2010
|
+
flex-direction: column;
|
|
2011
|
+
align-items: center;
|
|
2012
|
+
padding: 18px 20px 24px;
|
|
2013
|
+
width: 335px;
|
|
2014
|
+
height: 400px; /* Fixed height */
|
|
2015
|
+
background: #FFFFFF;
|
|
2016
|
+
border-radius: 12px;
|
|
2017
|
+
position: relative;
|
|
2018
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
2019
|
+
border: 1px solid #e3e3e3;
|
|
2020
|
+
justify-content: center;
|
|
2021
|
+
text-align: center;
|
|
2022
|
+
// margin-top: 50px; /* Adjust this to move the content down */
|
|
2023
|
+
margin: 50px auto 0 auto !important;
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
.card-success .success-icon {
|
|
2027
|
+
display: flex;
|
|
2028
|
+
flex-direction: column;
|
|
2029
|
+
align-items: center;
|
|
2030
|
+
gap: 12px;
|
|
2031
|
+
width: 227px;
|
|
2032
|
+
height: 116px;
|
|
2033
|
+
z-index: 2;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
.card-success .circle {
|
|
2037
|
+
width: 40px;
|
|
2038
|
+
height: 40px;
|
|
2039
|
+
border: 1px solid #49B182;
|
|
2040
|
+
border-radius: 50%;
|
|
2041
|
+
display: flex;
|
|
2042
|
+
justify-content: center;
|
|
2043
|
+
align-items: center;
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
.card-success .circle .fa-check-circle {
|
|
2047
|
+
font-size: 20px;
|
|
2048
|
+
color: #49B182;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
.card-success .success-text {
|
|
2052
|
+
display: flex;
|
|
2053
|
+
flex-direction: column;
|
|
2054
|
+
justify-content: center;
|
|
2055
|
+
align-items: center;
|
|
2056
|
+
gap: 4px;
|
|
2057
|
+
width: 227px;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
.card-success .payment-success-text {
|
|
2061
|
+
font-family: 'Inter', sans-serif;
|
|
2062
|
+
font-weight: 500;
|
|
2063
|
+
font-size: 18px;
|
|
2064
|
+
line-height: 21px;
|
|
2065
|
+
text-align: center;
|
|
2066
|
+
letter-spacing: -0.02em;
|
|
2067
|
+
color: #161616;
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
.card-success .thank-you-text {
|
|
2071
|
+
font-family: 'Inter', sans-serif;
|
|
2072
|
+
font-weight: 500;
|
|
2073
|
+
font-size: 14px;
|
|
2074
|
+
line-height: 18px;
|
|
2075
|
+
text-align: center;
|
|
2076
|
+
letter-spacing: -0.02em;
|
|
2077
|
+
color: #161616;
|
|
2078
|
+
opacity: 0.5;
|
|
2079
|
+
}
|
|
2080
|
+
`)}var cr=({onClose:e})=>Kn.createElement(Kn.Fragment,null,Kn.createElement(Ri,null),Kn.createElement("div",{className:"card-success"},Kn.createElement("div",{className:"payment-success-container"},Kn.createElement("div",{className:"success-icon"},Kn.createElement("div",{className:"circle"},Kn.createElement("i",{className:"fa fa-check-circle","aria-hidden":"true"})),Kn.createElement("div",{className:"success-text"},Kn.createElement("div",{className:"payment-success-text"},"Your card was added successfully."),Kn.createElement("div",{className:"thank-you-text"},"Thank you ")))))),va=cr;function pr(e){var nn;let[t,H]=li(!1),[T,z]=li(!1),[B,O]=li(""),[U,be]=li(!1),K=_i(null),A=_i(null),G=_i(null),oe=_i(null),w=_i(null),[C,R]=li(),[V,y]=li({}),[Se,M]=li(),Te=()=>H(!0),_e=()=>H(!1),ce=h=>{gr.fire({icon:"error",text:h,customClass:{popup:"custom-z-index"}})},Ne=()=>{be(!1),z(!1),O(""),R({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""})},ft=()=>be(!0),Pe=()=>{Ne()},Fe=(h,L)=>{var a,o,r;let u=h,xe=["expiryMonth","expiryYear","zipCode","cvv"];if(u==="expiryMonth"&&(L==null?void 0:L.length)===2&&((a=G==null?void 0:G.current)==null||a.focus()),u==="expiryYear"&&(L==null?void 0:L.length)===4&&((o=oe==null?void 0:oe.current)==null||o.focus()),u==="cvv"&&(L==null?void 0:L.length)===3&&((r=w==null?void 0:w.current)==null||r.focus()),xe.includes(u)){(L===""||/^[0-9]+$/.test(L))&&(y(b=>F(v({},b),{[u]:""})),R(b=>F(v({},b),{[u]:L})));return}y(b=>F(v({},b),{[u]:""})),console.log(L,u),R(b=>F(v({},b),{[u]:L}))},ue=h=>{var o,r;let L=h.target,u=L.value.replace(/\D/g,""),{formatted:xe,cursor:a}=Tn(L.value,(o=L.selectionStart)!=null?o:0);y(b=>F(v({},b),{cardNumber:""})),R(b=>F(v({},b),{cardNumber:xe})),console.log(u==null?void 0:u.length,"length"),(u==null?void 0:u.length)===16&&((r=A==null?void 0:A.current)==null||r.focus()),requestAnimationFrame(()=>{L.setSelectionRange(a,a)})},Ye=()=>{var a,o,r,b,k,P;let h={},L=C,u=parseInt((L==null?void 0:L.expiryMonth)||"",10),xe=(L==null?void 0:L.expiryYear)||"";if((a=L==null?void 0:L.cardName)!=null&&a.trim()||(h.cardName="Card name is required"),(o=L==null?void 0:L.cardNumber)!=null&&o.trim()||(h.cardNumber="Card number is required"),(r=L==null?void 0:L.expiryMonth)!=null&&r.trim()?(Number(L==null?void 0:L.expiryMonth)>12||Number(L==null?void 0:L.expiryMonth)<1)&&(h.expiryMonth="Invalid Expiration Month."):h.expiryMonth="Expiration month is required",(b=L==null?void 0:L.expiryYear)!=null&&b.trim()?((k=L==null?void 0:L.expiryYear)==null?void 0:k.trim().length)!==4||Number(L==null?void 0:L.expiryYear)<2025?h.expiryYear="Invalid Expiration Year.":(isNaN(u)||u<1||u>12||xe.length!==4)&&(h.expiryMonth="Invalid Expiration Date."):h.expiryYear="Expiration year is required",(P=L==null?void 0:L.cvv)!=null&&P.trim()||(h.cvv="CVC is required"),L!=null&&L.expiryMonth&&(L!=null&&L.expiryYear)&&L.expiryMonth.length<=2&&L.expiryYear.length===4){let Y=parseInt(L.expiryMonth,10),x=parseInt(L.expiryYear,10),f=new Date,N=f.getMonth()+1,je=f.getFullYear();(x<je||x===je&&Y<N)&&(h.expiryMonth="Card is expired")}return y(h),Object.keys(h).length>0},De=async()=>{var h,L,u;Te();try{let xe={fractalpayPublicKey:e==null?void 0:e.merchantPublicKey,customer_id:e==null?void 0:e.customerId,addcard:!0},a=await Pi.post(`${tt}get-payment-details`,xe);console.log(a),M((h=a==null?void 0:a.data)==null?void 0:h.data),(u=(L=a==null?void 0:a.data)==null?void 0:L.data)!=null&&u.paymentGateway||(Ne(),O("Something went wrong.")),_e()}catch(xe){console.log(xe),_e(),Ne(),O("Something went wrong.")}};return ur(()=>{e!=null&&e.merchantPublicKey&&De()},[e==null?void 0:e.merchantPublicKey]),we.createElement(we.Fragment,null,we.createElement(_n,null),we.createElement(Di,null),we.createElement(dn,{loading:t}),B&&we.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},we.createElement(zn,{error:B,onClose:Ne})),T&&we.createElement(va,{onClose:Pe}),!B&&!T&&we.createElement(we.Fragment,null,we.createElement("div",{className:"container-creditcard add-card modal-content",id:"add-credit-card-panel",style:{margin:"auto"}},we.createElement("form",{id:"creditCardForm",onSubmit:async h=>{var xe,a,o,r,b,k,P,Y,x,f,N,je,gt,$e,zt,ht;h.preventDefault(),h.currentTarget.blur();let L=document.activeElement;if(L instanceof HTMLElement&&L.blur(),t)return;let u=Ye();if(console.log(C),!u){let at=DatacapWebToken.validateCardNumber(C==null?void 0:C.cardNumber.replaceAll(" ","")),ze=DatacapWebToken.validateExpirationDate(C==null?void 0:C.expiryMonth,C==null?void 0:C.expiryYear),ge=DatacapWebToken.validateCVV(C==null?void 0:C.cvv),$={};if(at||($.cardNumber="Invalid card Number"),ze||($.expiryMonth="Invalid Expiration Date."),ge||($.cvv="Invalid CVV"),y($),at&&ge&&ze){Te();try{let Me=async function(dt){var X,Mt,Ge;if(console.log(dt),dt.Error)console.log(dt==null?void 0:dt.Error),O(dt.Error),_e();else{let Lt={userId:e==null?void 0:e.customerId,cardName:C==null?void 0:C.cardName,zip:C==null?void 0:C.zipCode,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey,token:dt};try{let S=await Pi.post(`${tt}add-card`,Lt);console.log(S),(X=S==null?void 0:S.data)!=null&&X.result&&(z(!0),_e(),R({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),ei(h,"close",""))}catch(S){console.log(S),_e(),O(((Ge=(Mt=S==null?void 0:S.response)==null?void 0:Mt.data)==null?void 0:Ge.message)||(S==null?void 0:S.message)||"Something went wrong.")}}};if((Se==null?void 0:Se.paymentGateway)===32){let dt={method:"POST",redirect:"follow"};try{let X=await Pi.post(`${Ae}api/v1/widget/generate-session`,dt),Mt=Number(C==null?void 0:C.expiryYear)%100,Ge=C==null?void 0:C.cardNumber;Ge=Ge==null?void 0:Ge.replace(/\s+/g,"");let Lt=`${Ge}=${Mt}${C==null?void 0:C.expiryMonth} ${C==null?void 0:C.cvv}`,kn=forge.pki.publicKeyFromPem((a=(xe=X==null?void 0:X.data)==null?void 0:xe.data)==null?void 0:a.publicKeyPem).encrypt(Lt,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),At=forge.util.encode64(kn),xt={"Content-Type":"application/json","x-app-session-key":(r=(o=X.data)==null?void 0:o.data)==null?void 0:r.session_key},bn=JSON.stringify({enc_track2_data:`${At}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(k=(b=X==null?void 0:X.data)==null?void 0:b.data)==null?void 0:k.session_key}`});try{let kt=await Pi.post(`${mn}tokenizer/tokenize`,bn,{headers:xt}),Wn=JSON.stringify(F(v({},(P=kt==null?void 0:kt.data)==null?void 0:P.data),{cvv:C==null?void 0:C.cvv,cardName:C==null?void 0:C.cardName,zip:C==null?void 0:C.zipCode,userId:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey})),Bn={"Content-Type":"application/json"};try{let St=await Pi.post(`${tt}add-card`,Wn,{headers:Bn});console.log(St),(Y=St==null?void 0:St.data)!=null&&Y.result&&(z(!0),_e(),ei(h,"close",""))}catch(St){_e(),O(((f=(x=St==null?void 0:St.response)==null?void 0:x.data)==null?void 0:f.message)||(St==null?void 0:St.message)||"Something went wrong.")}}catch(kt){_e(),O(((je=(N=kt==null?void 0:kt.response)==null?void 0:N.data)==null?void 0:je.message)||(kt==null?void 0:kt.message)||"Something went wrong.")}}catch(X){_e(),O((($e=(gt=X==null?void 0:X.response)==null?void 0:gt.data)==null?void 0:$e.message)||(X==null?void 0:X.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(Se==null?void 0:Se.dctoken,"creditCardForm",Me)}catch(Me){_e(),O(((ht=(zt=Me==null?void 0:Me.response)==null?void 0:zt.data)==null?void 0:ht.message)||(Me==null?void 0:Me.message)||"Something went wrong.")}}}},onKeyDown:h=>{h.key==="Enter"&&t&&(h.preventDefault(),h.stopPropagation())},style:{padding:"0 10px"}},we.createElement("div",{style:{maxHeight:"350px",minHeight:"0"},className:"card-scrl"},we.createElement("div",{className:"form-group",style:{marginTop:"0",marginBottom:"10px"}},we.createElement("label",{htmlFor:"cardNumber"},"Card Number"),we.createElement("input",{type:"text","data-token":"card_number",placeholder:"Enter card number",maxLength:19,inputMode:"numeric",value:(C==null?void 0:C.cardNumber)||"",onChange:h=>ue(h),ref:K}),(V==null?void 0:V.cardNumber)&&we.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cardNumber),we.createElement("br",null)),we.createElement("div",{className:"card-dtl"},we.createElement("div",{className:"exp-cvc-container",style:{margin:"0"}},we.createElement("div",{className:"form-group",style:{marginTop:"0"}},we.createElement("label",{htmlFor:"expMonth"},"MM"),we.createElement("input",{"data-token":"exp_month",className:"form-control required",type:"text",placeholder:"MM",maxLength:2,value:(C==null?void 0:C.expiryMonth)||"",onChange:h=>Fe("expiryMonth",h.target.value),ref:A}),(V==null?void 0:V.expiryMonth)&&we.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.expiryMonth)),we.createElement("div",{className:"form-group",style:{marginTop:"0"}},we.createElement("label",{htmlFor:"expYear"},"YYYY"),we.createElement("input",{"data-token":"exp_year",className:"form-control required",type:"text",placeholder:"YYYY",maxLength:4,value:(C==null?void 0:C.expiryYear)||"",onChange:h=>Fe("expiryYear",h.target.value),ref:G}),(V==null?void 0:V.expiryYear)&&we.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.expiryYear)),we.createElement("div",{className:"form-group",style:{marginTop:"0"}},we.createElement("label",{htmlFor:"cvc"},"CVC"),we.createElement("input",{"data-token":"cvv",className:"form-control required",type:"text",placeholder:"CVC",maxLength:4,value:(C==null?void 0:C.cvv)||"",onChange:h=>Fe("cvv",h.target.value),ref:oe}),(V==null?void 0:V.cvv)&&we.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cvv)))),we.createElement("div",{className:"form-group",style:{marginTop:"0"}},we.createElement("label",{htmlFor:"cardholderName"},"Name on card"),we.createElement("input",{type:"text",id:"cardholderName",name:"cardholderName",placeholder:"Name on card required",value:(C==null?void 0:C.cardName)||"",onChange:h=>{let L=h.target.value;/^[a-zA-Z\s]*$/.test(L)&&Fe("cardName",L)},ref:w}),(V==null?void 0:V.cardName)&&we.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cardName)),we.createElement("div",{className:"form-group",style:{marginTop:"0"}},we.createElement("label",{htmlFor:"zipcode"},"Zip"),we.createElement("input",{type:"text",id:"",name:"zipcode",placeholder:"Zip",value:(nn=C==null?void 0:C.zipCode)!=null?nn:"",onChange:h=>Fe("zipCode",h.target.value)}),(V==null?void 0:V.zipCode)&&we.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.zipCode))),we.createElement("input",{type:"submit",className:"idle-green-btn w-100",defaultValue:"Submit",disabled:t})))))}import q,{useState as hi}from"react";import Fi from"axios";var Oi={PROPAYKEY:"25",PAYARCKEY:"26",STRIPEKEYCC:"27",PAYRIXKEY:"28",SKYFIACHKEY:"29",JUSTIFIKEY:"30",INFINICEPTKEY:"31",FRACTALKEY:"32"};import fr from"react";function ea({}){return fr.createElement("style",null,`
|
|
2081
|
+
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap");
|
|
2082
|
+
|
|
2083
|
+
.creditformbox {
|
|
2084
|
+
// max-width: 550px;
|
|
2085
|
+
margin: 0 auto;
|
|
2086
|
+
font-family: Poppins !important;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
.name-row {
|
|
2090
|
+
display: grid;
|
|
2091
|
+
grid-gap: 10px;
|
|
2092
|
+
grid-template-columns:1fr 1fr;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
label {
|
|
2096
|
+
display: block;
|
|
2097
|
+
color: #383838;
|
|
2098
|
+
font-size: 16px;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
.form-group span.text-danger{
|
|
2102
|
+
color:red;
|
|
2103
|
+
}
|
|
2104
|
+
.form-group small.error{
|
|
2105
|
+
color:red;
|
|
2106
|
+
font-size:11px;
|
|
2107
|
+
}
|
|
2108
|
+
.name-row .form-group {
|
|
2109
|
+
display: block;
|
|
2110
|
+
width: 100%;
|
|
2111
|
+
margin-bottom: 15px;
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
.creditformbox input, .creditformbox select {
|
|
2115
|
+
border: 1.25px solid rgba(234, 236, 239, 1);
|
|
2116
|
+
color: rgba(94, 94, 94, 0.75);
|
|
2117
|
+
border-radius: 10px;
|
|
2118
|
+
width: -webkit-fill-available;
|
|
2119
|
+
padding: 10px 12px;
|
|
2120
|
+
font-size: .875rem;
|
|
2121
|
+
min-height: 20px;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
.form-pay-row {
|
|
2125
|
+
display: block;
|
|
2126
|
+
width: 100%;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
.form-pay-row .form-group {
|
|
2130
|
+
display: block;
|
|
2131
|
+
width: 100%;
|
|
2132
|
+
margin-bottom: 15px;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
.card-pay-row {
|
|
2136
|
+
display: flex;
|
|
2137
|
+
width: 100%;
|
|
2138
|
+
gap: 10px;
|
|
2139
|
+
flex-wrap: wrap;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
.card-pay-row .form-group {
|
|
2143
|
+
flex: 1;
|
|
2144
|
+
margin-bottom: 15px;
|
|
2145
|
+
min-width: 100px;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
.creditformbox input:focus {
|
|
2149
|
+
color: #212529;
|
|
2150
|
+
background-color: #fff;
|
|
2151
|
+
border-color: #86b7fe;
|
|
2152
|
+
outline: 0;
|
|
2153
|
+
box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
.checks-row{
|
|
2157
|
+
display:flex;
|
|
2158
|
+
align-items:start;
|
|
2159
|
+
gap:10px
|
|
2160
|
+
}
|
|
2161
|
+
.checks-row input {
|
|
2162
|
+
border: 1.25px solid rgba(234, 236, 239, 1);
|
|
2163
|
+
color: rgba(94, 94, 94, 0.75);
|
|
2164
|
+
border-radius: 10px;
|
|
2165
|
+
min-width: 16px !important;
|
|
2166
|
+
width:16px !important;
|
|
2167
|
+
padding: 10px 12px;
|
|
2168
|
+
font-size: .875rem;
|
|
2169
|
+
max-height: 16px !important;
|
|
2170
|
+
height: 16px !important;
|
|
2171
|
+
}
|
|
2172
|
+
// .checks-row input.is-valid:checked{
|
|
2173
|
+
// background-color: #198754;
|
|
2174
|
+
// border-color: #198754;
|
|
2175
|
+
// background-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e);
|
|
2176
|
+
// }
|
|
2177
|
+
.check-error{
|
|
2178
|
+
color:red;
|
|
2179
|
+
font-size:11px;
|
|
2180
|
+
padding-left:25px
|
|
2181
|
+
}
|
|
2182
|
+
.button-row{
|
|
2183
|
+
display: flex;
|
|
2184
|
+
width: 100%;
|
|
2185
|
+
gap: 10px;
|
|
2186
|
+
flex-wrap: wrap;
|
|
2187
|
+
margin-top: 20px !important
|
|
2188
|
+
}
|
|
2189
|
+
.button-row .btn{
|
|
2190
|
+
flex: 1;
|
|
2191
|
+
margin-top:20px;
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
.cancelbtn {
|
|
2195
|
+
font-size:15px;
|
|
2196
|
+
color: #000000 !important;
|
|
2197
|
+
background-color: transparent !important;
|
|
2198
|
+
background: transparent !important;
|
|
2199
|
+
border:1px solid #000000 !important;
|
|
2200
|
+
border-radius: 10px !important;
|
|
2201
|
+
padding: 10px 25px !important;
|
|
2202
|
+
cursor:pointer;
|
|
2203
|
+
font-size: 16px;
|
|
2204
|
+
}
|
|
2205
|
+
.cancelbtn:hover {
|
|
2206
|
+
background:#000000 !important;
|
|
2207
|
+
color:#ffffff !important;
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
.savebtn {
|
|
2211
|
+
font-size:15px;
|
|
2212
|
+
color: #2979FF;
|
|
2213
|
+
background-color: transparent;
|
|
2214
|
+
background: transparent;
|
|
2215
|
+
border:1px solid #2979FF;
|
|
2216
|
+
border-radius: 10px;
|
|
2217
|
+
padding: 10px 25px;
|
|
2218
|
+
cursor:pointer;
|
|
2219
|
+
font-size: 16px;
|
|
2220
|
+
}
|
|
2221
|
+
.savebtn:hover {
|
|
2222
|
+
background:#2979FF;
|
|
2223
|
+
color:#ffffff;
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
.toggle-label {
|
|
2227
|
+
position: relative;
|
|
2228
|
+
display: inline-block;
|
|
2229
|
+
width: 40px;
|
|
2230
|
+
height: 24px;
|
|
2231
|
+
background-color: #ccc;
|
|
2232
|
+
border-radius: 12px;
|
|
2233
|
+
cursor: pointer;
|
|
2234
|
+
transition: background-color 0.3s;
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
.toggle-label::before {
|
|
2238
|
+
content: "";
|
|
2239
|
+
position: absolute;
|
|
2240
|
+
top: 2px;
|
|
2241
|
+
left: 2px;
|
|
2242
|
+
width: 20px;
|
|
2243
|
+
height: 20px;
|
|
2244
|
+
background: #ffffff;
|
|
2245
|
+
border-radius: 50%;
|
|
2246
|
+
transition: left 300ms linear;
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
.toggle-checkbox {
|
|
2250
|
+
display: none;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
.toggle-checkbox:checked + .toggle-label {
|
|
2254
|
+
background-color: #4caf50;
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
.toggle-checkbox:checked + .toggle-label::before {
|
|
2258
|
+
left: 18px;
|
|
2259
|
+
}
|
|
2260
|
+
.pass-fee-toggle-div {
|
|
2261
|
+
display: flex;
|
|
2262
|
+
align-items: center;
|
|
2263
|
+
gap: 10px;
|
|
2264
|
+
padding-top: 10px;
|
|
2265
|
+
}
|
|
2266
|
+
`)}function hr({session_token:e,callback:t,isloading:H,onCancel:T,showChecks:z,merchantName:B,signCheckbox:O,checkedSignCheckbox:U,onCheckSign:be,cancelbtnClass:K,savebtnClass:A,inputClass:G,isDual:oe}){var a;let[w,C]=hi(!1),[R,V]=hi(!1),[y,Se]=hi(),[M,Te]=hi({}),[_e,ce]=hi(""),Ne=()=>C(!0),ft=()=>C(!1),[Pe,Fe]=hi(!1),ue=()=>{var P,Y,x,f,N,je,gt,$e;let o={},r=y,b=parseInt((r==null?void 0:r.expiryMonth)||"",10),k=(r==null?void 0:r.expiryYear)||"";return(P=r==null?void 0:r.firstName)!=null&&P.trim()||(o.firstName="Please enter a first name."),(Y=r==null?void 0:r.lastName)!=null&&Y.trim()||(o.lastName="Please enter a last name."),(x=r==null?void 0:r.cardNumber)!=null&&x.trim()||(o.cardNumber="Please enter a card number."),(f=r==null?void 0:r.expiryMonth)!=null&&f.trim()?(Number(r==null?void 0:r.expiryMonth)>12||Number(r==null?void 0:r.expiryMonth)<1)&&(o.expiryMonth="Invalid Expiration Month."):o.expiryMonth="Please enter an expiry month.",(N=r==null?void 0:r.expiryYear)!=null&&N.trim()?((je=r==null?void 0:r.expiryYear)==null?void 0:je.trim().length)!==4||Number(r==null?void 0:r.expiryYear)<2025?o.expiryYear="Invalid Expiration Year.":(isNaN(b)||b<1||b>12||k.length!==4)&&(o.expiryMonth="Invalid Expiration Date."):o.expiryYear="Please enter an expiry year.",(gt=r==null?void 0:r.cvv)!=null&>.trim()||(o.cvv="Please enter a CVV."),($e=r==null?void 0:r.zipCode)!=null&&$e.trim()||(o.zipCode="Please enter a zip code."),O&&!U&&(o.checkSign="You must authorize this before proceeding."),z&&!(r!=null&&r.authHold)&&(o.authHold="You must authorize this before proceeding."),z&&!(r!=null&&r.authorise)&&(o.authorise="Please confirm your authorization to continue."),Te(o),Object.keys(o).length>0},Ye=o=>{var Y;let r=o.target,b=r.value.replace(/\D/g,""),{formatted:k,cursor:P}=Tn(r.value,(Y=r.selectionStart)!=null?Y:0);Te(x=>F(v({},x),{cardNumber:""})),Se(x=>F(v({},x),{cardNumber:k})),requestAnimationFrame(()=>{r.setSelectionRange(P,P)})},De=(o,r)=>{let b=o;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(b)){(r===""||/^[0-9]+$/.test(r))&&(Te(P=>F(v({},P),{[b]:""})),Se(P=>F(v({},P),{[b]:r})));return}Te(P=>F(v({},P),{[b]:""})),Se(P=>F(v({},P),{[b]:r}))},gn=()=>{let o=DatacapWebToken.validateCardNumber(y==null?void 0:y.cardNumber.replaceAll(" ","")),r=DatacapWebToken.validateExpirationDate(y==null?void 0:y.expiryMonth,y==null?void 0:y.expiryYear),b=DatacapWebToken.validateCVV(y==null?void 0:y.cvv),k={};return o||(k.cardNumber="Invalid card Number"),r||(k.expiryMonth="Invalid Expiration Date."),b||(k.cvv="Invalid CVV"),Te(k),o&&b&&r},nn=async o=>{var r,b;if(o.Error)ce(o.Error),ft();else{let k={token:o.Token,resp:o},P=await Fi.post(`${Ae}api/v1/gateway/update/token/${e}`,k);if((P==null?void 0:P.status)==200){let Y=v(v({Token:(b=(r=P==null?void 0:P.data)==null?void 0:r.data)==null?void 0:b.gateway_token,Brand:o.Brand,ExpirationMonth:o.ExpirationMonth,ExpirationYear:o.ExpirationYear,Last4:o.Last4,Bin:o.Bin,CVV:o.CVV,postalCode:y==null?void 0:y.zipCode},z&&{authHold:y==null?void 0:y.authHold}),z&&{authorise:y==null?void 0:y.authorise});ft(),t(Y)}}},h=async()=>{var o,r,b,k,P,Y,x,f,N,je,gt,$e,zt,ht;try{let at={method:"POST",redirect:"follow"},ze=await Fi.post(`${Ae}api/v1/widget/generate-session`,at),ge=Number(y==null?void 0:y.expiryYear)%100,Me=`${(o=y==null?void 0:y.cardNumber)==null?void 0:o.replace(/\s+/g,"")}=${ge}${y==null?void 0:y.expiryMonth} ${y==null?void 0:y.cvv}`,X=forge.pki.publicKeyFromPem((b=(r=ze==null?void 0:ze.data)==null?void 0:r.data)==null?void 0:b.publicKeyPem).encrypt(Me,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Mt=forge.util.encode64(X),Ge={"Content-Type":"application/json","x-app-session-key":(P=(k=ze.data)==null?void 0:k.data)==null?void 0:P.session_key},Lt=JSON.stringify({enc_track2_data:Mt,algorithm:"RSAES_OAEP_SHA_1",session_key:(x=(Y=ze==null?void 0:ze.data)==null?void 0:Y.data)==null?void 0:x.session_key}),S=await Fi.post(`${mn}tokenizer/tokenize`,Lt,{headers:Ge});if((S==null?void 0:S.status)==200){let kn=(N=(f=S==null?void 0:S.data)==null?void 0:f.data)==null?void 0:N.token;try{let At=await Fi.post(`${Ae}api/v1/gateway/verify-and-save/${e}`,{token:kn});if((At==null?void 0:At.status)==200){let xt=(je=At==null?void 0:At.data)==null?void 0:je.data,bn={Token:xt.gateway_token,Brand:xt.card_data.brand,ExpirationMonth:xt.card_data.expire_mm,ExpirationYear:xt.card_data.expire_yy,Last4:xt.card_data.last4,Bin:xt.card_data.bin,postalCode:y==null?void 0:y.zipCode};t(bn),ft()}}catch(At){console.log(At,"error"),ft()}}}catch(at){let ze="Something went wrong!";try{let ge=((gt=at==null?void 0:at.response)==null?void 0:gt.data)||(at==null?void 0:at.message)||"",$=typeof ge=="string"?ge:JSON.stringify(ge),dt=(((zt=($e=$.split)==null?void 0:$e.call($,`
|
|
2267
|
+
`))==null?void 0:zt.filter(Boolean))||[]).at(-1)||"",X=(ht=dt.split)==null?void 0:ht.call(dt,": ");ze=(X==null?void 0:X.length)>1?X.pop().trim():dt.trim()||ze}catch(ge){ze="Something went wrong!"}ft(),ce(ze)}},L=async o=>{var P,Y,x,f,N,je,gt;o.preventDefault();let r=document.activeElement;if(r instanceof HTMLElement&&r.blur(),!(w||ue()||!gn())){Ne();try{let $e=await Fi.get(`${Ae}api/v1/gateway/token/${e}`,{params:{pass_fee:Pe}});if(($e==null?void 0:$e.status)==200){let zt=(Y=(P=$e==null?void 0:$e.data)==null?void 0:P.data)==null?void 0:Y.gateway_token;((f=(x=$e==null?void 0:$e.data)==null?void 0:x.data)==null?void 0:f.paymentGateway)==((N=Oi)==null?void 0:N.FRACTALKEY)?await h():DatacapWebToken.requestToken(zt,"creditCardForm",nn)}}catch($e){ft(),ce(((gt=(je=$e==null?void 0:$e.response)==null?void 0:je.data)==null?void 0:gt.message)||"Something went wrong!")}}},u=()=>{ce("")},xe=()=>{ce(""),Se({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:"",authHold:!1,authorise:!1,checkSign:!1}),T()};return console.log(Pe,"aoapoaa"),q.createElement(q.Fragment,null,q.createElement(_n,null),q.createElement(ea,null),q.createElement(dn,{loading:w||H}),_e&&q.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},q.createElement(zn,{error:_e,onClose:u})),!_e&&q.createElement("div",{className:"creditformbox"},q.createElement("form",{id:"creditCardForm",onSubmit:L,onKeyDown:o=>{o.key==="Enter"&&w&&(o.preventDefault(),o.stopPropagation())}},q.createElement("div",{className:"name-row"},q.createElement("div",{className:"form-group"},q.createElement("label",null," First Name ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(y==null?void 0:y.firstName)||"",onChange:o=>{let r=o.target.value;/^[a-zA-Z\s]*$/.test(r)&&De("firstName",r)},className:G}),(M==null?void 0:M.firstName)&&q.createElement("small",{className:"error"},M==null?void 0:M.firstName)),q.createElement("div",{className:"form-group"},q.createElement("label",null," Last Name ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(y==null?void 0:y.lastName)||"",onChange:o=>{let r=o.target.value;/^[a-zA-Z\s]*$/.test(r)&&De("lastName",r)},className:G}),(M==null?void 0:M.lastName)&&q.createElement("small",{className:"error"},M==null?void 0:M.lastName))),q.createElement("div",{className:"form-pay-row"},q.createElement("div",{className:"form-group"},q.createElement("label",null," Card Number ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(y==null?void 0:y.cardNumber)||"",onChange:o=>Ye(o),className:G}),(M==null?void 0:M.cardNumber)&&q.createElement("small",{className:"error"},M==null?void 0:M.cardNumber))),q.createElement("div",{className:"card-pay-row"},q.createElement("div",{className:"form-group"},q.createElement("label",null," Exp Month ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(y==null?void 0:y.expiryMonth)||"",onChange:o=>De("expiryMonth",o.target.value),className:G}),(M==null?void 0:M.expiryMonth)&&q.createElement("small",{className:"error"},M==null?void 0:M.expiryMonth)),q.createElement("div",{className:"form-group"},q.createElement("label",null," Exp Year ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(y==null?void 0:y.expiryYear)||"",onChange:o=>De("expiryYear",o.target.value),className:G}),(M==null?void 0:M.expiryYear)&&q.createElement("small",{className:"error"},M==null?void 0:M.expiryYear)),q.createElement("div",{className:"form-group"},q.createElement("label",null," CVV ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(y==null?void 0:y.cvv)||"",onChange:o=>De("cvv",o.target.value),className:G}),(M==null?void 0:M.cvv)&&q.createElement("small",{className:"error"},M==null?void 0:M.cvv)),q.createElement("div",{className:"form-group"},q.createElement("label",null," Zip ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(a=y==null?void 0:y.zipCode)!=null?a:"",onChange:o=>De("zipCode",o.target.value),className:G}),(M==null?void 0:M.zipCode)&&q.createElement("small",{className:"error"},M==null?void 0:M.zipCode))),oe&&q.createElement("div",{className:"pass-fee-toggle-div"},q.createElement("input",{type:"checkbox",id:"pass_fee",className:"toggle-checkbox",checked:Pe,onChange:o=>{Fe(o.target.checked)}}),q.createElement("label",{htmlFor:"pass_fee",className:"toggle-label"}),q.createElement("label",{htmlFor:"save_card"},"Cash Discount")),O&&q.createElement("div",{className:"checks-row"},q.createElement("input",{name:"discalosure",type:"checkbox",id:"disclosureCheck",checked:U,onChange:o=>be(o.target.checked)}),q.createElement("label",{htmlFor:"disclosureCheck",className:"form-check-label"},"Please agree to the following in order to add Payment method.")),O&&(M==null?void 0:M.checkSign)&&q.createElement("small",{className:"check-error"},M==null?void 0:M.checkSign),z&&q.createElement(q.Fragment,null,q.createElement("div",{className:"checks-row"},q.createElement("input",{name:"authHold",type:"checkbox",id:"authHold",checked:!!(y!=null&&y.authHold),onChange:o=>De("authHold",o.target.checked)}),q.createElement("label",{htmlFor:"authHold",className:"form-check-label"},"To securely save your card on file, we will place a temporary authorization hold of $1.00. This is not a charge and will be released by your card issuer shortly after verification.")),(M==null?void 0:M.authHold)&&q.createElement("small",{className:"check-error"},M==null?void 0:M.authHold),q.createElement("div",{className:"checks-row "},q.createElement("input",{name:"authorise",type:"checkbox",id:"authorise",checked:!!(y!=null&&y.authorise),onChange:o=>De("authorise",o.target.checked)}),q.createElement("label",{htmlFor:"authorise",className:"form-check-label see-more"},R?q.createElement(q.Fragment,null,q.createElement("span",null,"By providing your payment information, you authorize"," ",q.createElement("strong",null,B),", a Sky Systemz merchant, to securely store your card on file for future payments. Your card information will be encrypted and stored in compliance with PCI-DSS (Payment Card Industry Data Security Standard) regulations using Sky Systemz\u2019s secure payment technology. This information will be used solely for transactions you authorize with"," ",q.createElement("strong",null,B),". You may request the removal of your stored payment information at any time by contacting"," ",q.createElement("strong",null,B)," directly. By signing or proceeding with this transaction, you acknowledge and agree to this card on file authorization.",q.createElement("a",{href:"#",onClick:o=>{o.preventDefault(),V(!1)}},"See less ..."))):q.createElement(q.Fragment,null,q.createElement("span",null,"By providing your payment information, you authorize ",B,", a Sky Systemz merchant, to securely store your card on file for future pay..."," "),q.createElement("a",{href:"#",onClick:o=>{o.preventDefault(),V(!0)}},"See more ...")))),(M==null?void 0:M.authorise)&&q.createElement("small",{className:"check-error"},M==null?void 0:M.authorise)),q.createElement("div",{className:"button-row"},q.createElement("button",{className:`cancelbtn ${K} `,type:"button",onClick:xe},"Cancel"),q.createElement("button",{className:`savebtn ${A} `,disabled:w,type:"submit"},"Save")))))}import n,{useEffect as Ki,useRef as yr,useState as Ft}from"react";import Mi from"axios";import Li from"sweetalert2";import{IoArrowBack as Zi}from"react-icons/io5";import{NumericFormat as br}from"react-number-format";function xr(e){var Ot,Vt,an,rn,on,sn,ln,xn,Xt,Ze,Zt,_,g,se,pe,ee,We,le,_t,Je,pt,Wt;let t=yr(null);Ki(()=>{e.onTriggerPay&&e.onTriggerPay(()=>{qn()})},[e]);let H=te+"widget/mc-img.svg",T=te+"widget/visa-img.svg",z=te+"widget/ae-img.svg",B=te+"widget/discover-img.svg",O=te+"widget/card.svg",U=te+"widget/Trash.svg",be=te+"widget/bank.svg",K=te+"widget/secure-img.png",A=te+"widget/pov-by.png",G=te+"widget/pax.svg",[oe,w]=Ft(!1),[C,R]=Ft(!1),[V,y]=Ft(""),[Se,M]=Ft(!1),[Te,_e]=Ft(!1),[ce,Ne]=Ft("card"),[ft,Pe]=Ft("card"),[Fe,ue]=Ft("form"),[Ye,De]=Ft("form"),[gn,nn]=Ft(!0),[h,L]=Ft(!1),[u,xe]=Ft(!1),a=e.merchantPublicKey,[o,r]=Ft(),[b,k]=Ft({}),[P,Y]=Ft(),[x,f]=Ft({}),[N,je]=Ft([]),[gt,$e]=Ft([]),[zt,ht]=Ft(),[at,ze]=Ft(),[ge,$]=Ft(Number(e==null?void 0:e.amount)),[Me,dt]=Ft(Number(e==null?void 0:e.amount)),[X,Mt]=Ft(""),[Ge,Lt]=Ft("");console.log(X,"partialAmount");let[S,kn]=Ft(),[At,xt]=Ft(""),bn=()=>w(!0),kt=()=>w(!1),Wn=(p,c)=>{let Z=(parseFloat(c)||0)/100;return p-p*Z},Bn=(p,c)=>{let Z=(Number(c)||0)/100;return+p+ +(p*Z)};Ki(()=>{Te&&(e!=null&&e.pass_fee?(dt(Number(e==null?void 0:e.amount)),$(Number(e==null?void 0:e.cashDiscount))):(dt(Number(e==null?void 0:e.amount)),$(Number(e==null?void 0:e.amount))))},[Te,e==null?void 0:e.pass_fee,e==null?void 0:e.amount,e==null?void 0:e.surcharge]);let St=()=>{_e(!1),Ne("card"),y(""),M(!1),xt(""),Y({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),f({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),r({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),k({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),xe(!1),L(!1),ht({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""}),ze({}),$(0),Pe("card"),nn(!0),De("form"),ue("form"),R(!1),w(!1),$e([]),je([]),Mt(""),Lt("")},qn=()=>_e(!0),Mn=p=>{Ne(p)},Ln=(p,c)=>{let Z=p;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(Z)){(c===""||/^[0-9]+$/.test(c))&&(k(ie=>F(v({},ie),{[Z]:""})),r(ie=>F(v({},ie),{[Z]:c})));return}k(ie=>F(v({},ie),{[Z]:""})),r(ie=>F(v({},ie),{[Z]:c}))},J=p=>{var rt;let c=p.target,Z=c.value.replace(/\D/g,""),{formatted:ke,cursor:ie}=Tn(c.value,(rt=c.selectionStart)!=null?rt:0);k(ve=>F(v({},ve),{cardNumber:""})),r(ve=>F(v({},ve),{cardNumber:ke})),requestAnimationFrame(()=>{c.setSelectionRange(ie,ie)})},E=p=>{let{name:c,value:Z}=p.target,ke=["routingNumber","accountNumber","confirmAccountNumber"];if(c=="name"){/^[a-zA-Z\s]*$/.test(Z)&&(f(ie=>F(v({},ie),{[c]:""})),Y(ie=>F(v({},ie),{[c]:Z})));return}if(ke.includes(c)){(Z===""||/^[0-9]+$/.test(Z))&&(f(ie=>F(v({},ie),{[c]:""})),Y(ie=>F(v({},ie),{[c]:Z})));return}f(ie=>F(v({},ie),{[c]:""})),Y(ie=>F(v({},ie),{[c]:Z}))},Ue=()=>{var ie,rt,ve,ot,Ie,ae;let p={},c=o,Z=parseInt((c==null?void 0:c.expiryMonth)||"",10),ke=(c==null?void 0:c.expiryYear)||"";if((ie=c==null?void 0:c.cardName)!=null&&ie.trim()||(p.cardName="Card name is required"),(rt=c==null?void 0:c.cardNumber)!=null&&rt.trim()||(p.cardNumber="Card number is required"),(!((ve=c==null?void 0:c.expiryMonth)!=null&&ve.trim())||!((ot=c==null?void 0:c.expiryYear)!=null&&ot.trim())||isNaN(Z)||Z<1||Z>12||ke.length!==4)&&(p.expiryMonth="Invalid Expiration Date."),(Ie=c==null?void 0:c.cvv)!=null&&Ie.trim()||(p.cvv="CVV is required"),(ae=c==null?void 0:c.zipCode)!=null&&ae.trim()||(p.zipCode="ZIP code is required"),c!=null&&c.expiryMonth&&(c!=null&&c.expiryYear)&&c.expiryMonth.length<=2&&c.expiryYear.length===4){let st=parseInt(c.expiryMonth,10),yt=parseInt(c.expiryYear,10),he=new Date,re=he.getMonth()+1,Gt=he.getFullYear();(yt<Gt||yt===Gt&&st<re)&&(p.expiryMonth="Card is expired")}return k(p),Object.keys(p).length>0},Ht=()=>{var Z,ke,ie,rt,ve,ot,Ie,ae;let p={},c=P;return(Z=c==null?void 0:c.name)!=null&&Z.trim()||(p.name="Name is required"),(ke=c==null?void 0:c.accountNumber)!=null&&ke.trim()||(p.accountNumber="Account number is required"),(ie=c==null?void 0:c.accountNumber)!=null&&ie.trim()&&((rt=c==null?void 0:c.accountNumber)==null?void 0:rt.trim())!==((ve=c==null?void 0:c.confirmAccountNumber)==null?void 0:ve.trim())&&(p.confirmAccountNumber="Account numbers must match"),(ot=c==null?void 0:c.bankName)!=null&&ot.trim()||(p.bankName="Bank name is required"),(Ie=c==null?void 0:c.routingNumber)!=null&&Ie.trim()||(p.routingNumber="Routing Number is required"),c!=null&&c.routingNumber&&((ae=c==null?void 0:c.routingNumber)==null?void 0:ae.length)!==9&&(p.routingNumber="Routing number must be 9 digits"),((c==null?void 0:c.accountType)==="business saving"||(c==null?void 0:c.accountType)==="business checking")&&(!(c!=null&&c.companyName)||(c==null?void 0:c.companyName)==="")&&(p.companyName="Company Name is required for business accounts"),f(p),Object.keys(p).length>0},Re=async p=>{var Z,ke,ie,rt,ve,ot,Ie,ae,st,yt,he,re,Gt,Bt,Qe;p.preventDefault();let c=document.activeElement;if(c instanceof HTMLElement&&c.blur(),!C&&!Ge)if(ce!=="ach"){if(Ue())return;{let ut=DatacapWebToken.validateCardNumber(o==null?void 0:o.cardNumber.replaceAll(" ","")),Be=DatacapWebToken.validateExpirationDate(o==null?void 0:o.expiryMonth,o==null?void 0:o.expiryYear),Hn=DatacapWebToken.validateCVV(o==null?void 0:o.cvv),Sn={};if(ut||(Sn.cardNumber="Invalid card Number"),Be||(Sn.expiryMonth="Invalid Expiration Date."),Hn||(Sn.cvv="Invalid CVV"),k(Sn),ut&&Hn&&Be){R(!0);try{let vn=async function(Pt){var de,Ct;if(Pt.Error)y(Pt.Error),R(!1);else{let Rt=o==null?void 0:o.cardName,pn=o==null?void 0:o.zipCode;Pt.name=Rt,Pt.postal_code=pn,Pt.isCardSave=`${h}`,Pt.isCharge=!0,Pt.posSalesIdEncode=(de=S==null?void 0:S.orderDetails)==null?void 0:de.orderId,Pt.partial_amount=X&&!Ge?X:Me,$t.emit("sendMessage",Pt);let di=(Ct=S==null?void 0:S.orderDetails)==null?void 0:Ct.orderId;$t.on(di,Yn=>{if(ui(Yn==null?void 0:Yn.data)){let Kt=JSON.parse(Yn.data);Kt!=null&&Kt.result?(r({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),L(!1),xt(Kt==null?void 0:Kt.transactionId),M(!0),R(!1)):(R(!1),y((Kt==null?void 0:Kt.message)||"Something went wrong."))}else y("Something went wrong.")})}};if((S==null?void 0:S.paymentGateway)===32){let Pt={method:"POST",redirect:"follow"};try{let de=await Mi.post(`${Ae}api/v1/widget/generate-session`,Pt),Ct=Number(o==null?void 0:o.expiryYear)%100,Rt=o==null?void 0:o.cardNumber;Rt=Rt==null?void 0:Rt.replace(/\s+/g,"");let pn=`${Rt}=${Ct}${o==null?void 0:o.expiryMonth} ${o==null?void 0:o.cvv}`,Yn=forge.pki.publicKeyFromPem((ke=(Z=de==null?void 0:de.data)==null?void 0:Z.data)==null?void 0:ke.publicKeyPem).encrypt(pn,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Kt=forge.util.encode64(Yn),ti={"Content-Type":"application/json","x-app-session-key":(rt=(ie=de.data)==null?void 0:ie.data)==null?void 0:rt.session_key},wn=JSON.stringify({enc_track2_data:`${Kt}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(ot=(ve=de==null?void 0:de.data)==null?void 0:ve.data)==null?void 0:ot.session_key}`});try{let fn=await Mi.post(`${mn}tokenizer/tokenize`,wn,{headers:ti}),Ai=JSON.stringify(F(v({},(Ie=fn==null?void 0:fn.data)==null?void 0:Ie.data),{isSaveCardChecked:h,name:o==null?void 0:o.cardName,postal_code:o==null?void 0:o.zipCode,customer_id:e==null?void 0:e.customerId,partial_amount:X&&!Ge?X:Me})),Ti=JSON.stringify({pre_sales_id:`${(ae=S==null?void 0:S.orderDetails)==null?void 0:ae.orderId}`,token:`${(st=fn==null?void 0:fn.data)==null?void 0:st.data.token}`,json_response:`${Ai}`}),zi={method:"POST",headers:JSON.stringify({"Content-Type":"application/json"}),body:Ti,redirect:"follow",isChargeviafractal:!0};$t.emit("sendMessage",zi),$t.on("chargeviafractalgateway",Qn=>{var s;if(ui(Qn==null?void 0:Qn.data)){let l=JSON.parse(Qn==null?void 0:Qn.data);l!=null&&l.result?(xt((s=l==null?void 0:l.data)==null?void 0:s.transactionId),M(!0),R(!1)):(R(!1),y((l==null?void 0:l.message)||"Something went wrong."))}else y("Something went wrong.")})}catch(fn){R(!1),y(((he=(yt=fn==null?void 0:fn.response)==null?void 0:yt.data)==null?void 0:he.message)||(fn==null?void 0:fn.message)||"Something went wrong.")}}catch(de){R(!1),y(((Gt=(re=de==null?void 0:de.response)==null?void 0:re.data)==null?void 0:Gt.message)||(de==null?void 0:de.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(S==null?void 0:S.dctoken,"PaymentForm",vn)}catch(vn){R(!1),y(((Qe=(Bt=vn==null?void 0:vn.response)==null?void 0:Bt.data)==null?void 0:Qe.message)||(vn==null?void 0:vn.message)||"Something went wrong.")}}}}else{if(Ht())return;{R(!0);let ut={fractalpayPublicKey:a,label:(P==null?void 0:P.name)||"John Doe",account_number:P==null?void 0:P.accountNumber,routing_number:P==null?void 0:P.routingNumber,bank_name:P==null?void 0:P.bankName,account_type:P==null?void 0:P.accountType,amount:X&&!Ge?X:String(ge||0),isSaveAch:u,customer_id:e==null?void 0:e.customerId,order_id:e==null?void 0:e.orderID,tax:e==null?void 0:e.tax,discount:e==null?void 0:e.discount,surcharge:e==null?void 0:e.surcharge,isChargeACH:!0,company_name:(P==null?void 0:P.companyName)||"",orderGuid:e==null?void 0:e.orderGuid};$t.emit("sendMessage",ut),$t.on("ach-incoming",Be=>{var Hn;(Be==null?void 0:Be.status)=="Failed"?typeof(Be==null?void 0:Be.message)=="object"?Object.values(Be==null?void 0:Be.message).forEach(Sn=>{y(Sn||"Something went wrong")}):y((Be==null?void 0:Be.message)||"Something went wrong"):(xt((Hn=Be==null?void 0:Be.data)==null?void 0:Hn.transaction_id),M(!0),R(!1))})}}},mt=async()=>{var p,c,Z,ke,ie,rt,ve,ot,Ie,ae,st,yt,he,re,Gt,Bt,Qe,Gn,ut,Be,Hn,Sn,vn;bn();try{let Pt={fractalpayPublicKey:a,customer_id:e==null?void 0:e.customerId,pass_fee:e==null?void 0:e.pass_fee,orderGuid:e==null?void 0:e.orderGuid},de=await Mi.post(`${tt}get-payment-details`,Pt);if(kn((p=de==null?void 0:de.data)==null?void 0:p.data),(Z=(c=de==null?void 0:de.data)==null?void 0:c.data)!=null&&Z.paymentGateway||(St(),y("Something went wrong.")),(ie=(ke=de==null?void 0:de.data)==null?void 0:ke.data)!=null&&ie.card_list&&((ot=(ve=(rt=de==null?void 0:de.data)==null?void 0:rt.data)==null?void 0:ve.card_list)==null?void 0:ot.length)>0){let Ct=(st=(ae=(Ie=de==null?void 0:de.data)==null?void 0:Ie.data)==null?void 0:ae.card_list)==null?void 0:st.filter(pn=>(pn==null?void 0:pn.card_type)=="Bank"),Rt=(re=(he=(yt=de==null?void 0:de.data)==null?void 0:yt.data)==null?void 0:he.card_list)==null?void 0:re.filter(pn=>(pn==null?void 0:pn.card_type)!=="Bank");console.log(Ct,"hohgohoo",Rt),(Rt==null?void 0:Rt.length)>0&&ue("list"),(Ct==null?void 0:Ct.length)>0&&De("list"),je(Rt),$e(Ct)}else Ne("card");(Bt=(Gt=de==null?void 0:de.data)==null?void 0:Gt.data)!=null&&Bt.paymentDeviceList&&((ut=(Gn=(Qe=de==null?void 0:de.data)==null?void 0:Qe.data)==null?void 0:Gn.paymentDeviceList)==null?void 0:ut.length)>0&&ze((Hn=(Be=de==null?void 0:de.data)==null?void 0:Be.data)==null?void 0:Hn.paymentDeviceList[0]),kt()}catch(Pt){console.log(Pt),kt(),y(((vn=(Sn=Pt==null?void 0:Pt.response)==null?void 0:Sn.data)==null?void 0:vn.message)||(Pt==null?void 0:Pt.message)||"Something went wrong")}},vt=async p=>{if(p.currentTarget.blur(),C)return;let c=e==null?void 0:e.customerId,Z=String(e==null?void 0:e.discount),ke=String(e==null?void 0:e.surcharge),ie=String(e==null?void 0:e.tax),rt=e==null?void 0:e.merchantPublicKey,ve=e==null?void 0:e.orderID,ot=X&&!Ge?X:String(Me),Ie=zt==null?void 0:zt.id,ae=zt==null?void 0:zt.card_type;if(!Ge)if(rt&&ve&&ot&&ge)if(c)if(Ie){let yt;X&&!Ge?yt=X:ae==="Bank"?yt=ge:yt=Me;let he={amount:yt,order_id:ve,customer_id:c,card_id:Ie,fractalpayPublicKey:rt,isCardSave:h,discount:Z,surcharge:ke,tax:ie,orderGuid:e==null?void 0:e.orderGuid,pass_fee:e==null?void 0:e.pass_fee,require3ds:!1};X&&!Ge&&ae!=="Bank"&&(he.ispartialPayment=!0);let st=he,{isCardSave:re}=st,Gt=ii(st,["isCardSave"]),Qe=tt+(ae==="Bank"?"charge-ach":"charge-by-card"),Gn={"Content-Type":"application/json"};R(!0),$t.emit("sendMessage",{url:Qe,body:ae=="Bank"?Gt:he,isChargebycard:!0}),$t.on("charge-by-card",ut=>{var Be;(ut==null?void 0:ut.result)==!0||(ut==null?void 0:ut.status)==!0?(xt((Be=ut.data)==null?void 0:Be.transaction_id),M(!0),R(!1)):y((ut==null?void 0:ut.message)||"Something went wrong.")})}else y("Please Select A Card/ACH");else y("Please Select Customer");else y("Something went wrong.")},jt=async p=>{var rt,ve,ot,Ie,ae,st;if(p.currentTarget.blur(),C)return;let c=e==null?void 0:e.merchantPublicKey,Z=e==null?void 0:e.orderID,ke=X&&!Ge?X:String(Me),ie=e==null?void 0:e.customerId;if(!(at!=null&&at.device_id)){y("Please Select A Payment Device");return}if(c&&Z&&ke){R(!0);let yt={amount:ke,fractalpayPublicKey:c,customer_order_id:Z,device_id:at==null?void 0:at.device_id,customer_id:ie||""};try{let he=await Mi.post(`${tt}charge-with-reader`,yt);((rt=he==null?void 0:he.data)==null?void 0:rt.result)==!0?(xt((ot=(ve=he==null?void 0:he.data)==null?void 0:ve.data)==null?void 0:ot.transaction_id),M(!0),R(!1)):(y(((Ie=he==null?void 0:he.data)==null?void 0:Ie.message)||"Something went wrong."),R(!1))}catch(he){y(((st=(ae=he==null?void 0:he.response)==null?void 0:ae.data)==null?void 0:st.message)||"Something went wrong."),R(!1)}}else y("Something went wrong.")},It=p=>{ft==="card"?vt(p):ft==="reader"&&jt(p)};Ki(()=>{Te&&a&&mt()},[a,Te]);let Yt=async p=>{Li.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async c=>{if(c.isConfirmed){R(!0);try{let Z={card_id:p,customer_id:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey},ke=await Mi.post(`${tt}delete-customer-card`,Z);R(!1),mt(),Li.fire({icon:"success",title:"Deleted!",text:"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})}catch(Z){R(!1),Li.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else c.dismiss===Li.DismissReason.cancel&&Li.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},Qt=p=>{switch(p==null?void 0:p.toLowerCase()){case"visa":return T;case"mastercard":case"mc":case"m/c":return H;case"amex":case"american express":case"ae":return z;case"discover":case"dcvr":return B;case"bank":return be;default:return p}},ct=()=>{let p=ge||0;return(Number(Me)-p).toFixed(0)};console.log(Fe,"activeinCard","activeinBank",Ye);let Ke=p=>{var c,Z,ke,ie;console.log(p,"values"),ce==="ach"?((c=Number(ge))==null?void 0:c.toFixed(2))<(p==null?void 0:p.floatValue)||(p==null?void 0:p.floatValue)<=0?(Mt(p==null?void 0:p.value),Lt(`Partial amount cannot exceed ${ye((Z=Number(ge))==null?void 0:Z.toFixed(2))}`)):(Mt(p==null?void 0:p.value),Lt("")):((ke=Number(Me))==null?void 0:ke.toFixed(2))<(p==null?void 0:p.floatValue)||(p==null?void 0:p.floatValue)<=0?(Mt(p==null?void 0:p.value),Lt(`Partial amount cannot exceed ${ye((ie=Number(Me))==null?void 0:ie.toFixed(2))}`)):(Mt(p==null?void 0:p.value),Lt(""))};return Ki(()=>{let p=Number(ce==="ach"?ge:Me),c=Number(X);X&&(c<=0||c>p)?Lt(`Partial amount cannot exceed ${ye(p.toFixed(2))}`):Lt("")},[ce,X,ge,Me]),console.log(ce,"activetab"),n.createElement(n.Fragment,null,n.createElement(_n,null),n.createElement(oi,null),n.createElement(Dn,null),n.createElement(n.Fragment,null,n.createElement("button",{ref:t,style:{display:"none"},className:"paymentBtn",onClick:qn},"Pay"),n.createElement(Nn,{open:Te,onClose:St},V&&n.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},n.createElement(zn,{error:V,onClose:St})),Se&&n.createElement(si,{onClose:St,tranId:At}),!V&&!Se&&n.createElement(n.Fragment,null,(oe||C)&&n.createElement(dn,{loading:oe||C}),n.createElement("div",{className:"frac-card-payment-page frac-form"},n.createElement("div",{className:"parent-pay-container"},n.createElement("span",{className:"request-payment-close-popup",onClick:St},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},n.createElement("g",{clipPath:"url(#clip0_12425_52336)"},n.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"})),n.createElement("defs",null,n.createElement("clipPath",{id:"clip0_12425_52336"},n.createElement("rect",{width:"16",height:"16",fill:"white"}))))),n.createElement("div",{className:"pay-main-logo-res"},n.createElement("img",{src:S==null?void 0:S.logo,id:"pay-logos"})),n.createElement("div",{className:"pay-container"},n.createElement("div",{className:"pay-header pay-conatiner-one frac-pay-conatiner-one"},n.createElement("div",{className:"pay-conatiner-one-first"},n.createElement("div",{className:"pay-logo-container"},n.createElement("div",{className:"pay-main-logo"},n.createElement("img",{src:S==null?void 0:S.logo,id:"pay-logos"})),(N==null?void 0:N.length)>0&&ce!=="cardList"&&n.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>Ne("cardList")}," ",n.createElement(Zi,null)," Back")),n.createElement("div",{className:"amt-pay-con"},n.createElement("div",{className:"pay-amount-conatiner"},n.createElement("small",{className:"pay-payment-amount"},"Select payment type")),n.createElement("div",{className:"frac-card-bank-radio-main"},n.createElement(Fn,{label:"Card",amount:(Ot=Number(Me))==null?void 0:Ot.toFixed(2),value:"card",onChange:Mn,activetab:ce}),(S==null?void 0:S.isSkyFiAccount)&&n.createElement(Fn,{label:"Bank",amount:(Vt=Number(ge))==null?void 0:Vt.toFixed(2),value:"ach",onChange:Mn,activetab:ce})),Vn(S==null?void 0:S.showSurcharge)?ge&&ge>0&&(e!=null&&e.pass_fee)?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,ce==="card"?"Cash Discount":"Cash Discount Savings"," "),n.createElement("p",null,ye((Number(Me)-ge).toFixed(2)))):null:ge&&ge>0&&(e!=null&&e.pass_fee)&&ce==="card"?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,ce==="card"?"Surcharge":null," "),n.createElement("p",null,ye((Number(Me)-ge).toFixed(2)))):null,(e==null?void 0:e.allowPartial)&&n.createElement("div",{className:"frac-partial-payment-input"},n.createElement("label",{htmlFor:"partialpayment"},"Partial Payment"),n.createElement(br,{prefix:"$",className:"form-control",value:X,onValueChange:p=>{Ke(p)},thousandSeparator:!0,placeholder:"Enter partial amount",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0}),Ge&&n.createElement("span",{className:"error-span"},Ge)))),n.createElement("div",{className:"pay-conatiner-one-last"},n.createElement("img",{src:K,alt:""}),n.createElement("img",{src:A,alt:""}),"Secure payments powered by Fractal")),n.createElement("div",{className:"pay-tab pay-conatiner-two"},!oe&&n.createElement("div",{className:"col-md-12"},n.createElement("div",{id:"payment-form-div"},ce!=="cardList"?n.createElement("div",{className:"frac-charge-payment-back-btn-wrap "},(N==null?void 0:N.length)>0&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Ne("cardList")}," ",n.createElement(Zi,null)," Back"),(S==null?void 0:S.isSkyFiAccount)&&n.createElement("div",{className:"tab"},n.createElement("button",{className:"tablinks",onClick:p=>{Mn("card")},style:{border:ce==="card"?"1px solid":""}},n.createElement("i",{className:"fas fa-credit-card me-2",style:{marginRight:"8px",fontSize:"15px"}}),"Card"),n.createElement("button",{className:"tablinks",onClick:p=>{Mn("ach")},style:{border:ce==="ach"?"1px solid":""}},n.createElement("i",{className:"fas fa-university me-2",style:{marginRight:"8px",fontSize:"15px"}}),"Bank")),n.createElement("div",{className:"res-pay-con"},n.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},n.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),n.createElement("strong",{className:"pay-amount"},"$",(an=Number(Me))==null?void 0:an.toFixed(2))),ce!="ach"&&n.createElement("div",null,n.createElement("div",null,n.createElement("img",{src:T,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:H,width:35,alt:""})),n.createElement("div",null,n.createElement("img",{src:z,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:B,width:35,alt:""})))),!oe&&Vn(S==null?void 0:S.showSurcharge)?ge&&ge>0&&(e!=null&&e.pass_fee)?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,ce==="card"?"Cash Discount":"Cash Discount Savings"," "),n.createElement("p",null,ye((Number(Me)-ge).toFixed(2)))):null:ge&&ge>0&&(e!=null&&e.pass_fee)&&ce==="card"?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,ce==="card"?"Surcharge":null," "),n.createElement("p",null,ye((Number(Me)-ge).toFixed(2)))):null):n.createElement("div",null,n.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",S==null?void 0:S.customer_name),n.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," ",ft==="card"?"Cards/Banks":"Readers"," "),n.createElement("div",{className:"res-pay-con"},n.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},n.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),n.createElement("strong",{className:"pay-amount"},"$",(rn=Number(Me))==null?void 0:rn.toFixed(2))),n.createElement("div",null,n.createElement("div",null,n.createElement("img",{src:T,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:H,width:35,alt:""})),n.createElement("div",null,n.createElement("img",{src:z,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:B,width:35,alt:""}))))),n.createElement("div",{id:"card",style:{display:ce==="card"?"block":"none"},className:"tabcontent"},n.createElement("div",{className:"frac-card-payment"},n.createElement("div",{className:"frac-heading-card-wrap"},n.createElement("div",{className:"frac-backarrow"},(N==null?void 0:N.length)>0&&Fe==="form"&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>ue("list")}," ",n.createElement(Zi,null))),n.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),ce!="ach"&&n.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},n.createElement("img",{src:T,alt:"",width:33}),n.createElement("img",{src:H,width:33,alt:""}),n.createElement("img",{src:z,alt:"",width:33}),n.createElement("img",{src:B,width:33,alt:""}))),Fe==="list"?n.createElement(n.Fragment,null,n.createElement(On,{listHeading:"Cards",paymentGateway:S==null?void 0:S.paymentGateway,ListItems:N,selectedCard:zt,setSelectedCard:ht,handleDeleteCard:Yt,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{ue("form")}}),n.createElement("div",{className:"form-group",style:{padding:"0"}},n.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:It},X&&!Ge?ye((on=Number(X))==null?void 0:on.toFixed(2)):ye((sn=Number(Me))==null?void 0:sn.toFixed(2))))):n.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:Re,onKeyDown:p=>{p.key==="Enter"&&C&&(p.preventDefault(),p.stopPropagation())}},n.createElement("div",{className:"ach-scrl",style:{minHeight:S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)>0?"444px":S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)==0?"456px":(N==null?void 0:N.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),n.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"John Doe",value:(o==null?void 0:o.cardName)||"",onChange:p=>{let c=p.target.value;/^[a-zA-Z\s]*$/.test(c)&&Ln("cardName",c)}}),(b==null?void 0:b.cardName)&&n.createElement("span",{className:"error-span"},b==null?void 0:b.cardName)),n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),n.createElement("div",{className:"toggle-num-wrapper"},n.createElement("input",{className:"form-control card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(o==null?void 0:o.cardNumber)||"",onChange:p=>J(p),"data-token":"card_number"}),n.createElement("div",{className:"card-crdi card-expiry-new"},n.createElement("div",{className:"exp-date-year-container"},n.createElement("div",{className:"exp-date form-group"},n.createElement("input",{"data-token":"exp_month",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(o==null?void 0:o.expiryMonth)||"",onChange:p=>Ln("expiryMonth",p.target.value)})),n.createElement("div",{className:"exp-year form-group"},n.createElement("input",{"data-token":"exp_year",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(o==null?void 0:o.expiryYear)||"",onChange:p=>Ln("expiryYear",p.target.value)})),n.createElement("div",{className:"security-digit form-group"},n.createElement("input",{"data-token":"cvv",className:"form-control card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(o==null?void 0:o.cvv)||"",onChange:p=>Ln("cvv",p.target.value)})))),(b==null?void 0:b.cardNumber)&&n.createElement("span",{className:"error-span"},b==null?void 0:b.cardNumber),n.createElement("p",{style:{margin:"0"}},b!=null&&b.expiryMonth||b!=null&&b.expiryYear?n.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},b==null?void 0:b.expiryMonth):"",(b==null?void 0:b.cvv)&&n.createElement("span",{className:"error-span"},b==null?void 0:b.cvv)))),n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),n.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"Order Id",disabled:!0,value:(ln=e==null?void 0:e.orderID)!=null?ln:"",style:{background:"#F6F6F7",color:"#727272"}})),n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"zip"},"ZIP"),n.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(xn=o==null?void 0:o.zipCode)!=null?xn:"",onChange:p=>Ln("zipCode",p.target.value)}),(b==null?void 0:b.zipCode)&&n.createElement("span",{className:"error-span"},b==null?void 0:b.zipCode)),(e==null?void 0:e.customerId)&&n.createElement("div",{className:"form-group"},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},n.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:h,onChange:p=>L(p.target.checked)}),n.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),n.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},n.createElement("g",{clipPath:"url(#clip0_12420_50192)"},n.createElement("rect",{width:"20",height:"20",fill:"white"}),n.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),n.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"})),n.createElement("defs",null,n.createElement("clipPath",{id:"clip0_12420_50192"},n.createElement("rect",{width:"20",height:"20",fill:"white"}))))))),n.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:"0"}},(S==null?void 0:S.paymentDeviceList)&&((Xt=S==null?void 0:S.paymentDeviceList)==null?void 0:Xt.length)>0&&n.createElement("button",{type:"button",style:{marginBottom:"10px"},className:"pay-button",onClick:()=>nn(!gn)},gn?"Pay With Reader":"Pay With Card"),n.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},X&&!Ge?ye((Ze=Number(X))==null?void 0:Ze.toFixed(2)):ye((Zt=Number(Me))==null?void 0:Zt.toFixed(2)))))),n.createElement("div",{id:"ach",style:{display:ce==="ach"?"block":"none"},className:"tabcontent"},n.createElement("div",{className:"frac-card-payment"},n.createElement("div",{className:"frac-heading-card-wrap"},n.createElement("div",{className:"frac-backarrow"},(gt==null?void 0:gt.length)>0&&Ye==="form"&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>De("list")}," ",n.createElement(Zi,null))),n.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment"))),Ye==="list"?n.createElement(n.Fragment,null,n.createElement(On,{listHeading:"Banks",paymentGateway:S==null?void 0:S.paymentGateway,ListItems:gt,selectedCard:zt,setSelectedCard:ht,handleDeleteCard:Yt,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{De("form")}}),n.createElement("div",{className:"form-group",style:{padding:"0"}},n.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:It},X&&!Ge?ye((_=Number(X))==null?void 0:_.toFixed(2)):ye((g=Number(ge))==null?void 0:g.toFixed(2))))):n.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:Re,autoComplete:"off",onKeyDown:p=>{p.key==="Enter"&&C&&(p.preventDefault(),p.stopPropagation())}},n.createElement("div",{className:"ach-scrl",style:{minHeight:S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)>0?"444px":S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)==0?"436px":(N==null?void 0:N.length)>0?"462px":"520px",maxHeight:S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)>0?"444px":((N==null?void 0:N.length)>0,"380px")}},n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),n.createElement("input",{type:"text",id:"nameonaccount",className:"form-control",maxLength:100,placeholder:"John Doe",name:"name",value:(se=P==null?void 0:P.name)!=null?se:"",onChange:E}),(x==null?void 0:x.name)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.name)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"routingnumber"},"Routing number"),n.createElement("input",{type:"text",id:"routingnumber",className:"form-control",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(pe=P==null?void 0:P.routingNumber)!=null?pe:"",onChange:E}),(x==null?void 0:x.routingNumber)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.routingNumber)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"accountnumber"},"Account number"),n.createElement("input",{type:"text",id:"accountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(ee=P==null?void 0:P.accountNumber)!=null?ee:"",onChange:E}),(x==null?void 0:x.accountNumber)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.accountNumber)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),n.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(We=P==null?void 0:P.confirmAccountNumber)!=null?We:"",onChange:E}),(x==null?void 0:x.confirmAccountNumber)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.confirmAccountNumber)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"bankname"},"Bank name"),n.createElement("input",{type:"text",id:"bankname",className:"form-control",maxLength:100,placeholder:"My Bank",name:"bankName",value:(le=P==null?void 0:P.bankName)!=null?le:"",onChange:E}),(x==null?void 0:x.bankName)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.bankName)),((P==null?void 0:P.accountType)==="business saving"||(P==null?void 0:P.accountType)==="business checking")&&n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"companyName"},"Company name"),n.createElement("input",{type:"text",id:"companyName",className:"form-control",maxLength:100,placeholder:"My Company",name:"companyName",value:(_t=P==null?void 0:P.companyName)!=null?_t:"",onChange:E}),(x==null?void 0:x.companyName)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.companyName)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"accounttype"},"Select account type"),n.createElement("select",{name:"accountType",id:"accounttype",className:"form-control",value:(Je=P==null?void 0:P.accountType)!=null?Je:"",onChange:E},n.createElement("option",{value:""},"Select account"),gi.map(p=>n.createElement("option",{key:p.value,value:p.value},p.label)))),(e==null?void 0:e.customerId)&&n.createElement("div",{className:"form-group mb-4 save-ach-div",style:{paddingTop:"5px"}},n.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:u,onChange:p=>xe(p.target.checked)}),n.createElement("label",{htmlFor:"saveACH"},"Save ACH")),u&&n.createElement("div",{className:"form-group mb-4",style:{fontSize:"12px",color:"#727272"}},n.createElement("p",null,"If checked, I agree for ",n.createElement("b",null,"ecommerce")," to have my permission to charge this credit card for agreed upon purchases in the future."))),n.createElement("div",{className:"form-group "},n.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},X&&!Ge?ye((pt=Number(X))==null?void 0:pt.toFixed(2)):ye((Wt=Number(ge))==null?void 0:Wt.toFixed(2))))))))))))))))}import Zn,{useEffect as oa,useState as bi,useMemo as Tr}from"react";import vr from"react";function ta(){let e="#000",t="#fff",H="#212529",T="#dee2e6";return vr.createElement("style",null,`
|
|
2268
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
2269
|
+
body
|
|
2270
|
+
{
|
|
2271
|
+
font-family: 'Inter', sans-serif;
|
|
2272
|
+
}
|
|
2273
|
+
input
|
|
2274
|
+
{
|
|
2275
|
+
font-family: 'Inter', sans-serif !important;
|
|
2276
|
+
}
|
|
2277
|
+
.frac-form .form-group-frac{
|
|
2278
|
+
margin:0 !important
|
|
2279
|
+
}
|
|
2280
|
+
.frac-form .mb-4{
|
|
2281
|
+
margin-bottom : 10px !important
|
|
2282
|
+
}
|
|
2283
|
+
.frac-form .save-ach-div{
|
|
2284
|
+
display:flex !important;
|
|
2285
|
+
gap:5px !important;
|
|
2286
|
+
align-items:center
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
.frac-form .card-cvv-in{
|
|
2290
|
+
height : 36px !importantt;
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
.frac-form .pay-payment-amount{
|
|
2294
|
+
text-align:start !important
|
|
2295
|
+
}
|
|
2296
|
+
.frac-form .pay-amount{
|
|
2297
|
+
text-align:start !important
|
|
2298
|
+
}
|
|
2299
|
+
.frac-form .pay-main-logo{
|
|
2300
|
+
text-align:start !important
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
|
|
2304
|
+
|
|
2305
|
+
.paymentBtn {
|
|
2306
|
+
background-color: black;
|
|
2307
|
+
border: none;
|
|
2308
|
+
color: white;
|
|
2309
|
+
padding: 15px 32px;
|
|
2310
|
+
text-align: center;
|
|
2311
|
+
text-decoration: none;
|
|
2312
|
+
display: inline-block;
|
|
2313
|
+
font-size: 16px;
|
|
2314
|
+
margin: 4px 2px;
|
|
2315
|
+
cursor: pointer;
|
|
2316
|
+
border-radius: 180px;
|
|
2317
|
+
/* width: auto; */
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
.main-logo {
|
|
2321
|
+
text-align: center;
|
|
2322
|
+
margin-bottom: 20px;
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
.main-logo img {
|
|
2326
|
+
max-width: 180px;
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
.pay-main-box {
|
|
2330
|
+
width: 365px !important;
|
|
2331
|
+
height: 93%;
|
|
2332
|
+
background: 0 0 #ffffff;
|
|
2333
|
+
border-radius: 12px;
|
|
2334
|
+
|
|
2335
|
+
|
|
2336
|
+
border: 1px solid #E0DFE2;
|
|
2337
|
+
margin: 0 auto;
|
|
2338
|
+
display: block;
|
|
2339
|
+
padding: 0px 26px !important
|
|
2340
|
+
}
|
|
2341
|
+
.pay-main-box .pay-header {
|
|
2342
|
+
display: flex;
|
|
2343
|
+
justify-content: center;
|
|
2344
|
+
align-items: center;
|
|
2345
|
+
text-align: center;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
.pay-main-box .pay-header button {
|
|
2349
|
+
border: 0;
|
|
2350
|
+
background: none;
|
|
2351
|
+
padding: 0;
|
|
2352
|
+
box-shadow: 0;
|
|
2353
|
+
outline: inherit;
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
.pay-main-box h1 {
|
|
2357
|
+
margin: 0;
|
|
2358
|
+
flex: 1;
|
|
2359
|
+
padding: 10px 0;
|
|
2360
|
+
font-size: 23px;
|
|
2361
|
+
font-weight: 500;
|
|
2362
|
+
color: #35254D;
|
|
2363
|
+
align-items: start;
|
|
2364
|
+
display: flex;
|
|
2365
|
+
}
|
|
2366
|
+
.tab {
|
|
2367
|
+
overflow: hidden;
|
|
2368
|
+
padding: 5px;
|
|
2369
|
+
border-radius: 8px;
|
|
2370
|
+
display: flex;
|
|
2371
|
+
justify-content: space-around;
|
|
2372
|
+
margin-bottom:12px
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
/* Style the buttons inside the tab */
|
|
2376
|
+
.tab button {
|
|
2377
|
+
float: left;
|
|
2378
|
+
border: none;
|
|
2379
|
+
outline: none;
|
|
2380
|
+
cursor: pointer;
|
|
2381
|
+
background:white;
|
|
2382
|
+
padding: 11px 16px;
|
|
2383
|
+
transition: 0.3s;
|
|
2384
|
+
font-size: 16px;
|
|
2385
|
+
width: 143px;
|
|
2386
|
+
border-radius: 5px;
|
|
2387
|
+
box-shadow: inherit;
|
|
2388
|
+
outline: none;
|
|
2389
|
+
color: ${e};
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
/* Change background color of buttons on hover */
|
|
2393
|
+
.tab button:hover {
|
|
2394
|
+
background-color: #f0f0f0;
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
/* Create an active/current tablink class */
|
|
2398
|
+
// .tab button.active {
|
|
2399
|
+
// background-color: #ccc;
|
|
2400
|
+
// }
|
|
2401
|
+
|
|
2402
|
+
/* Style the tab content */
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
.parent-pay-container{
|
|
2406
|
+
padding: 24px;
|
|
2407
|
+
}
|
|
2408
|
+
.pay-container{
|
|
2409
|
+
display: grid;
|
|
2410
|
+
grid-template-columns: 2fr 3fr;
|
|
2411
|
+
|
|
2412
|
+
}
|
|
2413
|
+
.pay-main{
|
|
2414
|
+
padding-y: 20px}
|
|
2415
|
+
|
|
2416
|
+
.request-payment-close-popup {
|
|
2417
|
+
position: absolute;
|
|
2418
|
+
right: 20px;
|
|
2419
|
+
top: 20px;
|
|
2420
|
+
cursor: pointer;
|
|
2421
|
+
}
|
|
2422
|
+
.pay-conatiner-one{
|
|
2423
|
+
border-right: 1px solid #E0DFE2;
|
|
2424
|
+
display: flex;
|
|
2425
|
+
flex-direction: column;
|
|
2426
|
+
justify-content: space-between;
|
|
2427
|
+
}
|
|
2428
|
+
.pay-conatiner-one-first{
|
|
2429
|
+
|
|
2430
|
+
min-height:inherit !important;
|
|
2431
|
+
}
|
|
2432
|
+
.pay-conatiner-one-last{
|
|
2433
|
+
display:flex;
|
|
2434
|
+
font-size:12px;
|
|
2435
|
+
gap:5px;
|
|
2436
|
+
max-width:250px;
|
|
2437
|
+
align-items:center;
|
|
2438
|
+
color:black !important
|
|
2439
|
+
}
|
|
2440
|
+
.pay-conatiner-one-last img{
|
|
2441
|
+
width : 17px;
|
|
2442
|
+
height:17px
|
|
2443
|
+
}
|
|
2444
|
+
.pay-conatiner-two{
|
|
2445
|
+
padding: 0 5% 0;
|
|
2446
|
+
}
|
|
2447
|
+
.pay-logo-container{
|
|
2448
|
+
border-bottom: 1px solid #E0DFE2
|
|
2449
|
+
}
|
|
2450
|
+
.pay-heading{
|
|
2451
|
+
margin: 0;
|
|
2452
|
+
flex: 1;
|
|
2453
|
+
padding: 10px 0;
|
|
2454
|
+
font-size: 23px;
|
|
2455
|
+
font-weight: 500;
|
|
2456
|
+
color: #35254D;
|
|
2457
|
+
align-items: start;
|
|
2458
|
+
display: flex;
|
|
2459
|
+
}
|
|
2460
|
+
.pay-main-logo > img{
|
|
2461
|
+
width: 50%;
|
|
2462
|
+
}
|
|
2463
|
+
.pay-main-logo-res > img{
|
|
2464
|
+
width: 50%;
|
|
2465
|
+
display : none
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
.pay-payment-amount{
|
|
2469
|
+
display: block;
|
|
2470
|
+
font-size: 12px;
|
|
2471
|
+
color: #727272;
|
|
2472
|
+
margin-bottom: 8px;
|
|
2473
|
+
}
|
|
2474
|
+
.pay-amount-conatiner{
|
|
2475
|
+
margin-top: 6%;
|
|
2476
|
+
}
|
|
2477
|
+
.pay-amount{
|
|
2478
|
+
color: #000000;
|
|
2479
|
+
font-size: 38px;
|
|
2480
|
+
display: block;
|
|
2481
|
+
line-height: 110%;
|
|
2482
|
+
letter-spacing: -1px;
|
|
2483
|
+
}
|
|
2484
|
+
.frac-form label{
|
|
2485
|
+
font-family: 'IBM Plex Mono', monospace !important;
|
|
2486
|
+
color: #727272 !important;
|
|
2487
|
+
margin-bottom: 2px !important;
|
|
2488
|
+
font-weight: 600 !important;
|
|
2489
|
+
font-size: 12px !important;
|
|
2490
|
+
display:block !important;
|
|
2491
|
+
text-align : left !important
|
|
2492
|
+
}
|
|
2493
|
+
.form-control-frac{
|
|
2494
|
+
display: block;
|
|
2495
|
+
width: 100%;
|
|
2496
|
+
padding: .375rem .75rem;
|
|
2497
|
+
font-size: 1rem;
|
|
2498
|
+
font-weight: 400;
|
|
2499
|
+
line-height: 1.5;
|
|
2500
|
+
color: ${H};
|
|
2501
|
+
-webkit-appearance: none;
|
|
2502
|
+
-moz-appearance: none;
|
|
2503
|
+
appearance: none;
|
|
2504
|
+
background-color: ${t};
|
|
2505
|
+
background-clip: padding-box;
|
|
2506
|
+
border: 1px solid ${T};
|
|
2507
|
+
border-radius: 0.375rem;
|
|
2508
|
+
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
|
2509
|
+
}
|
|
2510
|
+
.form-control-frac:focus{
|
|
2511
|
+
border-color: #86b7fe;
|
|
2512
|
+
outline: 0;
|
|
2513
|
+
}
|
|
2514
|
+
.toggle-num-wrapper {
|
|
2515
|
+
position: relative;
|
|
2516
|
+
}
|
|
2517
|
+
.card-number-new{
|
|
2518
|
+
border-bottom: none;
|
|
2519
|
+
border-bottom-left-radius: 0px;
|
|
2520
|
+
border-bottom-right-radius: 0px;
|
|
2521
|
+
}
|
|
2522
|
+
.card-crdi {
|
|
2523
|
+
display: flex;
|
|
2524
|
+
border: 1px solid ${T};
|
|
2525
|
+
border-radius: 0.375rem;
|
|
2526
|
+
}
|
|
2527
|
+
.card-expiry-new{
|
|
2528
|
+
border-top-left-radius: 0px;
|
|
2529
|
+
border-top-right-radius: 0px;
|
|
2530
|
+
}
|
|
2531
|
+
.exp-date-year-container{
|
|
2532
|
+
display: flex;
|
|
2533
|
+
flex-wrap: wrap;
|
|
2534
|
+
}
|
|
2535
|
+
.exp-date-year-container .form-group-frac{
|
|
2536
|
+
flex:1;
|
|
2537
|
+
padding: 0px !important
|
|
2538
|
+
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
.exp-date {
|
|
2542
|
+
float: left;
|
|
2543
|
+
// width: 30%
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
.exp-date input {
|
|
2547
|
+
width: calc(100% + 1px);
|
|
2548
|
+
border-top-right-radius: 0;
|
|
2549
|
+
border-bottom-right-radius: 0;
|
|
2550
|
+
border: 0;
|
|
2551
|
+
border-right: 1px solid ${T};
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
|
|
2555
|
+
.exp-year {
|
|
2556
|
+
float: left;
|
|
2557
|
+
// width: 30%
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
.exp-year input {
|
|
2561
|
+
width: calc(100% + 1px);
|
|
2562
|
+
border-radius: 0;
|
|
2563
|
+
border-top: 0;
|
|
2564
|
+
border-bottom: 0;
|
|
2565
|
+
border-right: 1px solid ${T};
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
.exp-date input:focus {
|
|
2569
|
+
position: relative;
|
|
2570
|
+
z-index: 10;
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
.security-digit {
|
|
2574
|
+
float: right;
|
|
2575
|
+
// width: 40%;
|
|
2576
|
+
position: relative;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
.security-digit input {
|
|
2580
|
+
border-top-left-radius: 0;
|
|
2581
|
+
border-bottom-left-radius: 0;
|
|
2582
|
+
border-top: 0;
|
|
2583
|
+
border-bottom: 0;
|
|
2584
|
+
border-right:0;
|
|
2585
|
+
}
|
|
2586
|
+
.card-expiry-new{
|
|
2587
|
+
border-top-left-radius: 0px;
|
|
2588
|
+
border-top-right-radius: 0px;
|
|
2589
|
+
}
|
|
2590
|
+
.form-control-frac{box-sizing: border-box ;}
|
|
2591
|
+
#PaymentForm .form-group-frac{
|
|
2592
|
+
padding:5px 0 ;
|
|
2593
|
+
matgin: 0 !important
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
.toggle-label {
|
|
2597
|
+
position: relative;
|
|
2598
|
+
display: inline-block;
|
|
2599
|
+
width: 40px;
|
|
2600
|
+
height: 24px;
|
|
2601
|
+
background-color: #ccc;
|
|
2602
|
+
border-radius: 12px;
|
|
2603
|
+
cursor: pointer;
|
|
2604
|
+
transition: background-color 0.3s;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
.toggle-label::before {
|
|
2608
|
+
content: "";
|
|
2609
|
+
position: absolute;
|
|
2610
|
+
top: 2px;
|
|
2611
|
+
left: 2px;
|
|
2612
|
+
width: 20px;
|
|
2613
|
+
height: 20px;
|
|
2614
|
+
background: #ffffff;
|
|
2615
|
+
border-radius: 50%;
|
|
2616
|
+
transition: left 300ms linear;
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
.toggle-checkbox {
|
|
2620
|
+
display: none;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
.toggle-checkbox:checked + .toggle-label {
|
|
2624
|
+
background-color: #4caf50;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
.toggle-checkbox:checked + .toggle-label::before {
|
|
2628
|
+
left: 18px;
|
|
2629
|
+
}
|
|
2630
|
+
.ach-scrl {
|
|
2631
|
+
max-height: 380px;
|
|
2632
|
+
min-height: 380px;
|
|
2633
|
+
overflow-y: auto;
|
|
2634
|
+
padding-right: 6px;
|
|
2635
|
+
}
|
|
2636
|
+
.mb-4{
|
|
2637
|
+
margin-bottom:4px
|
|
2638
|
+
}
|
|
2639
|
+
.ach-scrl::-webkit-scrollbar {
|
|
2640
|
+
width: 3px;
|
|
2641
|
+
background-color: #F5F5F5;
|
|
2642
|
+
}
|
|
2643
|
+
.ach-scrl::-webkit-scrollbar-thumb {
|
|
2644
|
+
background-color: #35254D;
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
.error-span{
|
|
2648
|
+
color:red !important;
|
|
2649
|
+
font-size:12px !important;
|
|
2650
|
+
text-align: left !important;
|
|
2651
|
+
width: 100% !important;
|
|
2652
|
+
display: block;
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
.charge-customer-name-frac{
|
|
2656
|
+
color: #161616;
|
|
2657
|
+
font-family: Inter;
|
|
2658
|
+
font-size: 24px;
|
|
2659
|
+
font-style: normal;
|
|
2660
|
+
font-weight: 600;
|
|
2661
|
+
line-height: 32px;
|
|
2662
|
+
letter-spacing: -0.48px;
|
|
2663
|
+
text-transform: capitalize;
|
|
2664
|
+
margin-top:0;
|
|
2665
|
+
margin-bottom:16px !important;
|
|
2666
|
+
text-align:left !important
|
|
2667
|
+
}
|
|
2668
|
+
.card-ach-heading-frac {
|
|
2669
|
+
color: #727272;
|
|
2670
|
+
font-family: Inter;
|
|
2671
|
+
font-size: 12px;
|
|
2672
|
+
font-style: normal;
|
|
2673
|
+
font-weight: 500;
|
|
2674
|
+
line-height: 18px;
|
|
2675
|
+
letter-spacing: -0.24px;
|
|
2676
|
+
margin : 0 0 10px !important;
|
|
2677
|
+
text-align : left
|
|
2678
|
+
}
|
|
2679
|
+
.card-list-div{
|
|
2680
|
+
max-height : 190px;
|
|
2681
|
+
overflow-y : auto;
|
|
2682
|
+
border:1px solid #E0DFE2;
|
|
2683
|
+
border-radius : 8px
|
|
2684
|
+
}
|
|
2685
|
+
|
|
2686
|
+
|
|
2687
|
+
.card-list-div::-webkit-scrollbar{
|
|
2688
|
+
width:2px;
|
|
2689
|
+
background-color:#F5F5F5
|
|
2690
|
+
}
|
|
2691
|
+
.card-list-div::-webkit-scrollbar-thumb{
|
|
2692
|
+
background-color:#35254D
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
.card-list-single-div{
|
|
2696
|
+
border-bottom: 1px solid #E0DFE2;
|
|
2697
|
+
padding : 8px 11px;
|
|
2698
|
+
display : flex ;
|
|
2699
|
+
align-items:center;
|
|
2700
|
+
justify-content : space-between;
|
|
2701
|
+
gap:12px
|
|
2702
|
+
}
|
|
2703
|
+
.card-list-single-div:last-child {
|
|
2704
|
+
border-bottom: none;
|
|
2705
|
+
}
|
|
2706
|
+
.card-lint-div-in{
|
|
2707
|
+
min-height:444px}
|
|
2708
|
+
.card-number-radio{
|
|
2709
|
+
display:flex;
|
|
2710
|
+
gap:12px;
|
|
2711
|
+
}
|
|
2712
|
+
.card-number-radio .card-number-last-four{
|
|
2713
|
+
color:#161616 !important;
|
|
2714
|
+
font-family:Inter !important;
|
|
2715
|
+
font-size:14px !important;
|
|
2716
|
+
font-weight:500 !important;
|
|
2717
|
+
font-style:normal !important;
|
|
2718
|
+
line-height : 18px !important;
|
|
2719
|
+
latter-spacing:-0.18px !important
|
|
2720
|
+
}
|
|
2721
|
+
.card-expiry-date{
|
|
2722
|
+
margin:0;
|
|
2723
|
+
color:#00000080;
|
|
2724
|
+
font-family:Inter;
|
|
2725
|
+
font-size:14px;
|
|
2726
|
+
font-weight:500;
|
|
2727
|
+
font-style"normal;
|
|
2728
|
+
line-height : 18px;
|
|
2729
|
+
latter-spacing:-0.18px
|
|
2730
|
+
}
|
|
2731
|
+
.pay-with-other-card {
|
|
2732
|
+
margin-top : 12px;
|
|
2733
|
+
padding:12px 32px;
|
|
2734
|
+
border :1px solid #E0DFE2;
|
|
2735
|
+
border-radius : 1000px;
|
|
2736
|
+
display: flex;
|
|
2737
|
+
justify-content : center;
|
|
2738
|
+
align-items:center;
|
|
2739
|
+
gap:10px;
|
|
2740
|
+
// width:100%;
|
|
2741
|
+
background:white;
|
|
2742
|
+
cursor:pointer;
|
|
2743
|
+
color:#161616;
|
|
2744
|
+
text-align:center
|
|
2745
|
+
font-family: Inter;
|
|
2746
|
+
font-size: 14px;
|
|
2747
|
+
font-style: normal;
|
|
2748
|
+
font-weight: 500;
|
|
2749
|
+
line-height: 24px;
|
|
2750
|
+
letter-spacing: -0.28px;
|
|
2751
|
+
// margin-bottom: 50px;
|
|
2752
|
+
}
|
|
2753
|
+
.charge-payment-back-btn {
|
|
2754
|
+
display: flex;
|
|
2755
|
+
padding: 6px 12px !important ;
|
|
2756
|
+
align-items: center;
|
|
2757
|
+
gap: 6px;
|
|
2758
|
+
border-radius: 1000px;
|
|
2759
|
+
border: 1px solid #E0DFE2;
|
|
2760
|
+
background: #FFF;
|
|
2761
|
+
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
2762
|
+
font-size:16px;
|
|
2763
|
+
curso:pointer;
|
|
2764
|
+
color:black
|
|
2765
|
+
}
|
|
2766
|
+
.res-charge-payment-back-btn{
|
|
2767
|
+
padding: 9px 16px;
|
|
2768
|
+
align-items: center;
|
|
2769
|
+
gap: 6px;
|
|
2770
|
+
margin-bottom: 20px;
|
|
2771
|
+
border-radius: 1000px;
|
|
2772
|
+
border: 1px solid #E0DFE2;
|
|
2773
|
+
background: #FFF;
|
|
2774
|
+
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
2775
|
+
font-size:16px;
|
|
2776
|
+
curso:pointer;
|
|
2777
|
+
color:black;
|
|
2778
|
+
display:none
|
|
2779
|
+
}
|
|
2780
|
+
.btn {
|
|
2781
|
+
padding: 11px 23px;
|
|
2782
|
+
background-color: black;
|
|
2783
|
+
color: white;
|
|
2784
|
+
border: none;
|
|
2785
|
+
border-radius: 6px;
|
|
2786
|
+
font-weight: bold;
|
|
2787
|
+
margin: 0 10px;
|
|
2788
|
+
cursor: pointer;
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
.custom-swal-icon {
|
|
2792
|
+
margin: 20px auto;
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
.custom-swal-popup {
|
|
2796
|
+
font-size: 16px;
|
|
2797
|
+
text-align: center;
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
.frac-form .res-pay-con{
|
|
2801
|
+
display:none
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
.saveachtext p, .saveachtext b {
|
|
2805
|
+
font-size: 12px !important;
|
|
2806
|
+
color: #727272 !important;
|
|
2807
|
+
}
|
|
2808
|
+
|
|
2809
|
+
.cardicon-img img {
|
|
2810
|
+
margin-top: -2px !important;
|
|
2811
|
+
}
|
|
2812
|
+
|
|
2813
|
+
.bankicon-img img {
|
|
2814
|
+
margin-top: -4px !important;
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
.cardicon {
|
|
2818
|
+
margin-right : 8px !important;
|
|
2819
|
+
width : 18px !important;
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
.bankicon {
|
|
2823
|
+
margin-right : 8px !important;
|
|
2824
|
+
width : 18px !important;
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
|
|
2828
|
+
.frac-tooltip-wrapper {
|
|
2829
|
+
position: absolute;
|
|
2830
|
+
right:0;
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
.frac-tooltip-icon {
|
|
2834
|
+
cursor: pointer;
|
|
2835
|
+
}
|
|
2836
|
+
.frac-tooltip-mn{
|
|
2837
|
+
position:relative;
|
|
2838
|
+
}
|
|
2839
|
+
.frac-tooltip-text {
|
|
2840
|
+
display: none;
|
|
2841
|
+
position: absolute;
|
|
2842
|
+
top:-15px;
|
|
2843
|
+
right: 22px;
|
|
2844
|
+
background: #161616;
|
|
2845
|
+
color: white;
|
|
2846
|
+
padding: 15px;
|
|
2847
|
+
border-radius: 10px;
|
|
2848
|
+
width: 200px;
|
|
2849
|
+
font-size:12px;
|
|
2850
|
+
word-break: break-word;
|
|
2851
|
+
white-space: normal;
|
|
2852
|
+
z-index: 999;
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
.frac-tooltip-wrapper:hover .frac-tooltip-text {
|
|
2856
|
+
display: block;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
.frac-tooltip-text p,.frac-tooltip-text b {
|
|
2860
|
+
font-size : 12px !important;
|
|
2861
|
+
line-height : 1.5 !important;
|
|
2862
|
+
margin-bottom : 10px !important;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
.amt-pay-con {
|
|
2866
|
+
padding-right: 24px;
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
|
|
2870
|
+
|
|
2871
|
+
@media (max-width: 768px) {
|
|
2872
|
+
.card-lint-div-in {
|
|
2873
|
+
min-height: auto;
|
|
2874
|
+
margin-bottom: 10px;
|
|
2875
|
+
}
|
|
2876
|
+
.ach-scrl {
|
|
2877
|
+
min-height: auto !important;
|
|
2878
|
+
margin-bottom: 10px;
|
|
2879
|
+
}
|
|
2880
|
+
.request-payment-close-popup {
|
|
2881
|
+
right: 12px !important;
|
|
2882
|
+
top: 12px !important;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
.parent-pay-container{
|
|
2886
|
+
padding:24px;
|
|
2887
|
+
}
|
|
2888
|
+
.pay-container {
|
|
2889
|
+
grid-template-columns: 1fr;
|
|
2890
|
+
padding: 10px 5%;
|
|
2891
|
+
border:1px solid #E0DFE2;
|
|
2892
|
+
border-radius : 12px
|
|
2893
|
+
}
|
|
2894
|
+
.pay-conatiner-one{
|
|
2895
|
+
border-right: none;
|
|
2896
|
+
}
|
|
2897
|
+
.pay-conatiner-one-first{
|
|
2898
|
+
min-height:0
|
|
2899
|
+
}
|
|
2900
|
+
.pay-main-logo > img{
|
|
2901
|
+
display: none;
|
|
2902
|
+
}
|
|
2903
|
+
.pay-main-logo-res > img {
|
|
2904
|
+
display:block;
|
|
2905
|
+
margin:auto
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2908
|
+
.pay-logo-container{
|
|
2909
|
+
border :none
|
|
2910
|
+
}
|
|
2911
|
+
// .res-charge-payment-back-btn {
|
|
2912
|
+
// display:flex !important
|
|
2913
|
+
// }
|
|
2914
|
+
// .charge-payment-back-btn{
|
|
2915
|
+
// display:none !important
|
|
2916
|
+
// }
|
|
2917
|
+
|
|
2918
|
+
.frac-new-form .pay-amount-conatiner {
|
|
2919
|
+
margin-top: 0px;
|
|
2920
|
+
margin-bottom: 24px;
|
|
2921
|
+
}
|
|
2922
|
+
.frac-form .res-pay-con{
|
|
2923
|
+
display:flex;
|
|
2924
|
+
justify-content :space-between;
|
|
2925
|
+
align-items:center;
|
|
2926
|
+
padding-bottom : 10px
|
|
2927
|
+
}
|
|
2928
|
+
.amt-pay-con {
|
|
2929
|
+
padding-right: 0px;
|
|
2930
|
+
}
|
|
2931
|
+
.pay-conatiner-one-last{
|
|
2932
|
+
display:none}
|
|
2933
|
+
.pay-conatiner-two{
|
|
2934
|
+
padding:0
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
|
|
2938
|
+
}
|
|
2939
|
+
@media (max-width : 512px){
|
|
2940
|
+
.tab button {
|
|
2941
|
+
padding: 6px 16px;
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
|
|
2947
|
+
.frac-cash-discount-fee {
|
|
2948
|
+
display: flex;
|
|
2949
|
+
padding: 11px;
|
|
2950
|
+
justify-content: space-between;
|
|
2951
|
+
align-items: center;
|
|
2952
|
+
align-self: stretch;
|
|
2953
|
+
border-radius: 8px;
|
|
2954
|
+
border: 1px solid #E0DFE2;
|
|
2955
|
+
background: #F6F6F7;
|
|
2956
|
+
margin-top: 24px;
|
|
2957
|
+
}
|
|
2958
|
+
.frac-cash-discount-fee small {
|
|
2959
|
+
color:#727272;
|
|
2960
|
+
font-size: 12px;
|
|
2961
|
+
font-weight: 500;
|
|
2962
|
+
}
|
|
2963
|
+
.frac-cash-discount-fee p{
|
|
2964
|
+
margin:0px;
|
|
2965
|
+
font-size: 14px;
|
|
2966
|
+
font-weight: 500;
|
|
2967
|
+
}
|
|
2968
|
+
.frac-card-payment-heading {
|
|
2969
|
+
font-size: 24px;
|
|
2970
|
+
font-style: normal;
|
|
2971
|
+
font-weight: 600;
|
|
2972
|
+
margin:0px;
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
.frac-heading-card-wrap {
|
|
2976
|
+
display: flex;
|
|
2977
|
+
align-items: center;
|
|
2978
|
+
margin-bottom:12px;
|
|
2979
|
+
}
|
|
2980
|
+
.frac-backarrow {
|
|
2981
|
+
margin-right: 10px;
|
|
2982
|
+
}
|
|
2983
|
+
.frac-charge-payment-back-btn-wrap , .frac-tab-2{
|
|
2984
|
+
display: none;
|
|
2985
|
+
}
|
|
2986
|
+
.frac-pay-conatiner-one{
|
|
2987
|
+
display: flex;
|
|
2988
|
+
flex-direction: column;
|
|
2989
|
+
justify-content: space-between;
|
|
2990
|
+
min-height: auto;
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
.frac-form .saveachlabel {
|
|
2994
|
+
margin-bottom : 0px !important;
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2997
|
+
.frac-partial-payment-input{
|
|
2998
|
+
margin-top: 12px !important;
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
.challengeUrlclass-frac{
|
|
3002
|
+
height : 90vh;
|
|
3003
|
+
width : 100%;
|
|
3004
|
+
border-radius : 8px;
|
|
3005
|
+
border : none;
|
|
3006
|
+
}
|
|
3007
|
+
|
|
3008
|
+
|
|
3009
|
+
|
|
3010
|
+
|
|
3011
|
+
|
|
3012
|
+
`)}import d,{useCallback as Mr,useEffect as Wi,useRef as ia,useState as lt}from"react";import yn from"axios";import yi from"sweetalert2";import{useEffect as Cr,useRef as wr}from"react";function Ca({challengeUrl:e,fractalToken:t,stripeIntentId:H,onSuccess:T,onError:z,containerRef:B}){let O=wr(null);return Cr(()=>{if(!e||typeof window=="undefined")return;let U=B.current;if(!U)return;O.current&&U.contains(O.current)&&U.removeChild(O.current);let be=document.createElement("iframe");be.className="challengeUrlclass-frac",be.src=e,O.current=be,U.appendChild(be);let K=A=>{var G;((G=A.data)==null?void 0:G.type)==="3ds-authentication-challenge-complete"&&(U.innerHTML="",A.data.status==="succeeded"?T(t,H):z(A.data.status))};return window.addEventListener("message",K),()=>{window.removeEventListener("message",K),O.current&&U.contains(O.current)&&U.removeChild(O.current)}},[e,B,t,H,T,z]),null}import{Elements as _r}from"@stripe/react-stripe-js";import{loadStripe as Pr}from"@stripe/stripe-js";import{PaymentElement as wa,useElements as Nr,useStripe as kr}from"@stripe/react-stripe-js";import Sr from"axios";import{useState as Na}from"react";var ka=({onSuccess:e,showLoader:t,setError:H,session_token:T,callback:z,hideLoader:B,handleClose:O,amount:U,isPreAuth:be})=>{var V;let K=kr(),A=Nr(),[G,oe]=Na(!1),[w,C]=Na(null);return React.createElement("form",{onSubmit:async y=>{var Se,M,Te,_e,ce,Ne,ft;if(y.preventDefault(),!K||!A){console.warn("stripe nopt loaded");return}console.log("Stripe:",K),console.log("Elements:",A),console.log("PaymentElement:",A.getElement(wa)),t(),oe(!0);try{let{error:Pe,paymentIntent:Fe}=await K.confirmPayment({elements:A,confirmParams:{},redirect:"if_required"});if(oe(!1),Pe)console.log(Pe,"paymentIntent error"),H(Pe.message||"Payment failed.");else if((Fe==null?void 0:Fe.status)==="succeeded"){if(C("\u2705 Payment successful!"),e){console.log(Fe,"paymentIntent");try{let ue=await Sr.post(`${Ae}api/v1/gateway/secure-charge/${T}`,{stripe_id:Fe==null?void 0:Fe.id});if(console.log(ue,"chargeDetails"),(Se=ue==null?void 0:ue.data)!=null&&Se.result){let Ye=(M=ue==null?void 0:ue.data)==null?void 0:M.data;console.log(Ye,"callbackdata"),z(F(v({},Ye),{isPreAuth:be})),O(),B()}console.log((Te=ue==null?void 0:ue.data)==null?void 0:Te.data,"chargeDetails")}catch(ue){console.log(ue==null?void 0:ue.response,"error"),H(((ce=(_e=ue==null?void 0:ue.response)==null?void 0:_e.data)==null?void 0:ce.message)||"Something went wrong"),B()}}setTimeout(()=>window.close(),1500)}else C("Processing payment...")}catch(Pe){console.log(Pe==null?void 0:Pe.response,"error"),H(((ft=(Ne=Pe==null?void 0:Pe.response)==null?void 0:Ne.data)==null?void 0:ft.message)||"Something went wrong"),B()}}},React.createElement(wa,null),React.createElement("button",{className:"pay-button",disabled:G||!K},G?"Processing...":`${ye((V=Number(U))==null?void 0:V.toFixed(2))}`))};var Fr=Pr(ri);function na({clientSecret:e,onSuccess:t,showLoader:H,setError:T,session_token:z,callback:B,hideLoader:O,handleClose:U,amount:be,isPreAuth:K}){return e?React.createElement(_r,{stripe:Fr,options:{clientSecret:e}},React.createElement(ka,{onSuccess:t,showLoader:H,hideLoader:O,setError:T,session_token:z,callback:B,handleClose:U,amount:be,isPreAuth:K})):null}import{IoArrowBack as aa}from"react-icons/io5";import{NumericFormat as Lr}from"react-number-format";var Ar=({amount:e,bankAmount:t,submitBtnText:H="Pay",session_token:T,customerId:z,callback:B,merchantName:O="merchant",isPreAuth:U,surcharge:be="0",submitBtnClass:K,submitBtnIcon:A,isRequest:G,pass_fee:oe,pass_fee_amount:w,require3ds:C=!1,autoTrigger:R=!1,show:V,setShow:y,setHandleCloseRef:Se,isPartial:M,bankSurcharge:Te,partialRef:_e,loadingPrev:ce=!1,orderGuid:Ne,remainingAmount:ft})=>{var Pt,de,Ct,Rt,pn,di,Yn,Kt,ti,wn,fn,Ai,Ti,Gi,zi,Qn;let Pe=ia(!1),Fe=ia(!1),ue=ia(null),[Ye,De]=lt("card"),[gn,nn]=lt("card"),[h,L]=lt(),[u,xe]=lt({}),[a,o]=lt(),[r,b]=lt({}),[k,P]=lt(!1),[Y,x]=lt(!1),[f,N]=lt(""),[je,gt]=lt(!1),[$e,zt]=lt(""),[ht,at]=lt(!1),[ze,ge]=lt(!1),[$,Me]=lt([]),[dt,X]=lt([]),[Mt,Ge]=lt(),[Lt,S]=lt(Number(e)),[kn,At]=lt("form"),[xt,bn]=lt("form"),[kt,Wn]=lt(!1),[Bn,St]=lt(0),[qn,Mn]=lt(""),[Ln,J]=lt(null),[E,Ue]=lt(!1),[Ht,Re]=lt(!1),[mt,vt]=lt(null),[jt,It]=lt(!1),[Yt,Qt]=lt(Ne||null),[ct,Ke]=lt(""),[Ot,Vt]=lt(""),[an,rn]=lt(""),on=te+"widget/mc-img.svg",sn=te+"widget/visa-img.svg",ln=te+"widget/ae-img.svg",xn=te+"widget/discover-img.svg",Xt=te+"widget/card.svg",Ze=te+"widget/Trash.svg",Zt=te+"widget/bank.svg",_=te+"widget/secure-img.png",g=te+"widget/pov-by.png",se=te+"widget/pax.svg",pe=te+"widget/cardicon.svg",ee=te+"widget/bankicon.svg",We=()=>at(!0),le=()=>at(!1),_t=(s,l)=>{let Q=(parseFloat(l)||0)/100,me=s/(1+Q);return Math.round(me*100)/100},Je=async s=>{var l,Q,me,D,ne,Ve,nt,it,fe,Ce,W,et,bt,qt,An,Xe,$n,En;try{let Oe={pass_fee_amount:Number(e)-Lt,pass_fee:oe,Token:s==null?void 0:s.Token,amount:ct||e,postal_code:s==null?void 0:s.postalCode,require3ds:C,isPartial:M,orderGuid:Yt||Ne};C&&(s!=null&&s.stripe_3ds_auth_id)&&(Oe.stripe_3ds_auth_id=s==null?void 0:s.stripe_3ds_auth_id);let Dt=await yn.post(`${Ae}api/v1/gateway/charge/${T}`,Oe);if((l=Dt==null?void 0:Dt.data)!=null&&l.result){let Tt;if(Y&&z)try{let Ee={postal_code:h==null?void 0:h.zipCode,customer_id:z,gateway_token:(s==null?void 0:s.gateway_token)||(s==null?void 0:s.Token)};Tt=await yn.post(`${Ae}api/v1/gateway/add-card/${T}`,Ee),(Q=Tt==null?void 0:Tt.data)!=null&&Q.result&&(Tt=(me=Tt==null?void 0:Tt.data)==null?void 0:me.data)}catch(Ee){console.log(Ee,"error"),le(),B({error:((ne=(D=Ee==null?void 0:Ee.response)==null?void 0:D.data)==null?void 0:ne.message)||"Something went wrong!",result:(nt=(Ve=Ee==null?void 0:Ee.response)==null?void 0:Ve.data)==null?void 0:nt.result,statusCode:(it=Ee==null?void 0:Ee.response)==null?void 0:it.status}),N(((Ce=(fe=Ee==null?void 0:Ee.response)==null?void 0:fe.data)==null?void 0:Ce.message)||"Something went wrong!")}let jn={cardDetails:v(v({},Tt),s),callback:F(v({},(W=Dt==null?void 0:Dt.data)==null?void 0:W.data),{name:h==null?void 0:h.cardName,isPreAuth:U})};Y||delete jn.cardDetails,B(jn),le(),st()}}catch(Oe){N(((bt=(et=Oe==null?void 0:Oe.response)==null?void 0:et.data)==null?void 0:bt.message)||"Something went wrong!"),B({error:((An=(qt=Oe==null?void 0:Oe.response)==null?void 0:qt.data)==null?void 0:An.message)||"Something went wrong!",result:($n=(Xe=Oe==null?void 0:Oe.response)==null?void 0:Xe.data)==null?void 0:$n.result,statusCode:(En=Oe==null?void 0:Oe.response)==null?void 0:En.status}),le()}},pt=async s=>{var l,Q,me,D,ne,Ve,nt,it,fe,Ce,W,et,bt,qt,An,Xe,$n,En;try{let Oe={Token:s==null?void 0:s.Token,amount:e,postal_code:s==null?void 0:s.postalCode},Dt=await yn.post(`${Ae}api/v1/gateway/preauth/${T}`,Oe);if((l=Dt==null?void 0:Dt.data)!=null&&l.result){let Tt;if(Y&&z)try{let Ee={postal_code:h==null?void 0:h.zipCode,customer_id:z,gateway_token:(s==null?void 0:s.Token)||(s==null?void 0:s.gateway_token)};Tt=await yn.post(`${Ae}api/v1/gateway/add-card/${T}`,Ee),(Q=Tt==null?void 0:Tt.data)!=null&&Q.result&&(Tt=(me=Tt==null?void 0:Tt.data)==null?void 0:me.data)}catch(Ee){console.log(Ee,"error"),le(),N(((ne=(D=Ee==null?void 0:Ee.response)==null?void 0:D.data)==null?void 0:ne.message)||"Something went wrong!"),B({error:((nt=(Ve=Ee==null?void 0:Ee.response)==null?void 0:Ve.data)==null?void 0:nt.message)||"Something went wrong!",result:(fe=(it=Ee==null?void 0:Ee.response)==null?void 0:it.data)==null?void 0:fe.result,statusCode:(Ce=Ee==null?void 0:Ee.response)==null?void 0:Ce.status})}let jn={cardDetails:v(v({},Tt),s),callback:F(v({},(W=Dt==null?void 0:Dt.data)==null?void 0:W.data),{name:h==null?void 0:h.cardName,isPreAuth:U})};Y||delete jn.cardDetails,B(jn),le(),st()}}catch(Oe){N(((bt=(et=Oe==null?void 0:Oe.response)==null?void 0:et.data)==null?void 0:bt.message)||"Something went wrong!"),B({error:((An=(qt=Oe==null?void 0:Oe.response)==null?void 0:qt.data)==null?void 0:An.message)||"Something went wrong!",result:($n=(Xe=Oe==null?void 0:Oe.response)==null?void 0:Xe.data)==null?void 0:$n.result,statusCode:(En=Oe==null?void 0:Oe.response)==null?void 0:En.status}),le()}},Wt=async s=>{var l,Q,me,D,ne,Ve,nt,it,fe;if(s.Error)N(s.Error),B({error:s.Error||"Something went wrong!"}),le();else{let Ce={token:s.Token,resp:s};try{let W=await yn.post(`${Ae}api/v1/gateway/update/token/${T}`,Ce);if((W==null?void 0:W.status)==200){let et={Token:(Q=(l=W==null?void 0:W.data)==null?void 0:l.data)==null?void 0:Q.gateway_token,Brand:s.Brand,ExpirationMonth:s.ExpirationMonth,ExpirationYear:s.ExpirationYear,Last4:s.Last4,Bin:s.Bin,CVV:s.CVV,postalCode:h==null?void 0:h.zipCode},bt;U?pt(et):Je(et)}}catch(W){console.log(W,"error"),le(),N(((D=(me=W==null?void 0:W.response)==null?void 0:me.data)==null?void 0:D.message)||"Something went wrong!"),B({error:((Ve=(ne=W==null?void 0:W.response)==null?void 0:ne.data)==null?void 0:Ve.message)||"Something went wrong!",result:(it=(nt=W==null?void 0:W.response)==null?void 0:nt.data)==null?void 0:it.result,statusCode:(fe=W==null?void 0:W.response)==null?void 0:fe.status})}}},p=s=>{De(s)},c=()=>{var Q,me,D,ne,Ve,nt,it,fe;let s={},l=a;return(Q=l==null?void 0:l.name)!=null&&Q.trim()||(s.name="Name is required"),(me=l==null?void 0:l.accountNumber)!=null&&me.trim()||(s.accountNumber="Account number is required"),(D=l==null?void 0:l.accountNumber)!=null&&D.trim()&&((ne=l==null?void 0:l.accountNumber)==null?void 0:ne.trim())!==((Ve=l==null?void 0:l.confirmAccountNumber)==null?void 0:Ve.trim())&&(s.confirmAccountNumber="Account numbers must match"),(nt=l==null?void 0:l.bankName)!=null&&nt.trim()||(s.bankName="Bank name is required"),(it=l==null?void 0:l.routingNumber)!=null&&it.trim()||(s.routingNumber="Routing Number is required"),l!=null&&l.routingNumber&&((fe=l==null?void 0:l.routingNumber)==null?void 0:fe.length)!==9&&(s.routingNumber="Routing number must be 9 digits"),((l==null?void 0:l.accountType)==="business saving"||(l==null?void 0:l.accountType)==="business checking")&&(!(l!=null&&l.companyName)||(l==null?void 0:l.companyName)==="")&&(s.companyName="Company Name is required for business accounts"),b(s),Object.keys(s).length>0},Z=async(s,l)=>{var Q,me,D,ne,Ve,nt,it,fe;try{let Ce=s,W=await yn.post(`${Ae}api/v1/gateway/verify-and-save/${T}`,{token:Ce,require3ds:C,pass_fee:oe});if((W==null?void 0:W.status)==200){let et=(Q=W==null?void 0:W.data)==null?void 0:Q.data,bt={Token:et.gateway_token,Brand:et.card_data.brand,ExpirationMonth:et.card_data.expire_mm,ExpirationYear:et.card_data.expire_yy,Last4:et.card_data.last4,Bin:et.card_data.bin,postalCode:h==null?void 0:h.zipCode,stripe_3ds_auth_id:l};U?pt(bt):Je(bt)}}catch(Ce){console.log(Ce,"error"),N(((D=(me=Ce==null?void 0:Ce.response)==null?void 0:me.data)==null?void 0:D.message)||"Something went wrong!"),B({error:((Ve=(ne=Ce==null?void 0:Ce.response)==null?void 0:ne.data)==null?void 0:Ve.message)||"Something went wrong!",result:(it=(nt=Ce==null?void 0:Ce.response)==null?void 0:nt.data)==null?void 0:it.result,statusCode:(fe=Ce==null?void 0:Ce.response)==null?void 0:fe.status}),le()}},ke=async()=>{var s,l,Q,me,D,ne,Ve,nt,it,fe,Ce,W,et,bt,qt,An,Xe,$n,En,Oe,Dt,Tt,jn,Ee,xi,vi,wt,Ci,Ii,ni,Ut,Le;try{let en={method:"POST",redirect:"follow"},hn=await yn.post(`${Ae}api/v1/widget/generate-session`,en),mi=Number(h==null?void 0:h.expiryYear)%100,sa=`${(s=h==null?void 0:h.cardNumber)==null?void 0:s.replace(/\s+/g,"")}=${mi}${h==null?void 0:h.expiryMonth} ${h==null?void 0:h.cvv}`,ci=forge.pki.publicKeyFromPem((Q=(l=hn==null?void 0:hn.data)==null?void 0:l.data)==null?void 0:Q.publicKeyPem).encrypt(sa,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Sa=forge.util.encode64(ci),_a={"Content-Type":"application/json","x-app-session-key":(D=(me=hn.data)==null?void 0:me.data)==null?void 0:D.session_key},la={enc_track2_data:Sa,algorithm:"RSAES_OAEP_SHA_1",session_key:(Ve=(ne=hn==null?void 0:hn.data)==null?void 0:ne.data)==null?void 0:Ve.session_key};if(C&&typeof window!="undefined"&&typeof navigator!="undefined"){let tn=(nt=navigator.languages)!=null?nt:[navigator.language],da=Array.isArray(tn)?tn[0]:tn;la.three_ds_data={amount:Math.round(ct?parseFloat(ct)*100:parseFloat(e)*100),currency:"usd",channel:{type:"browser",browser:{language:typeof da=="string"?da:null,color_depth:(fe=(it=window.screen)==null?void 0:it.colorDepth)!=null?fe:null,java_enabled:typeof navigator.javaEnabled=="function"?navigator.javaEnabled():!1,screen_height:(W=(Ce=window.screen)==null?void 0:Ce.height)!=null?W:null,screen_width:(bt=(et=window.screen)==null?void 0:et.width)!=null?bt:null,timezoneOffset:new Date().getTimezoneOffset()}}}}let Pa=JSON.stringify(la),Cn=await yn.post(`${mn}tokenizer/tokenize`,Pa,{headers:_a});if((Cn==null?void 0:Cn.status)==200){let tn=(An=(qt=Cn==null?void 0:Cn.data)==null?void 0:qt.data)==null?void 0:An.stripe_three_ds_response;C&&!tn&&tn.status==="200 OK"&&((Xe=tn==null?void 0:tn.data)!=null&&Xe.challenge_url)&&N("Something went wrong. Please try again later."),C?($n=tn==null?void 0:tn.data)!=null&&$n.challenge_url?(le(),vt(F(v({},tn==null?void 0:tn.data),{fractalToken:(jn=(Tt=Cn==null?void 0:Cn.data)==null?void 0:Tt.data)==null?void 0:jn.token}))):Z((Oe=(En=Cn==null?void 0:Cn.data)==null?void 0:En.data)==null?void 0:Oe.token,(Dt=tn==null?void 0:tn.data)==null?void 0:Dt.id):Z((xi=(Ee=Cn==null?void 0:Cn.data)==null?void 0:Ee.data)==null?void 0:xi.token,null)}}catch(en){le(),console.log(en,"error");let hn="Something went wrong!";try{let mi=((vi=en==null?void 0:en.response)==null?void 0:vi.data)||(en==null?void 0:en.message)||"",Bi=typeof mi=="string"?mi:JSON.stringify(mi),wi=(((Ci=(wt=Bi.split)==null?void 0:wt.call(Bi,`
|
|
3013
|
+
`))==null?void 0:Ci.filter(Boolean))||[]).at(-1)||"",ci=(Ii=wi.split)==null?void 0:Ii.call(wi,": ");hn=(ci==null?void 0:ci.length)>1?ci.pop().trim():wi.trim()||hn}catch(mi){hn="Something went wrong!"}N(hn),B({error:hn,result:(Ut=(ni=en==null?void 0:en.response)==null?void 0:ni.data)==null?void 0:Ut.result,statusCode:(Le=en==null?void 0:en.response)==null?void 0:Le.status})}},ie=()=>{var D,ne,Ve,nt,it,fe;let s={},l=h,Q=parseInt((l==null?void 0:l.expiryMonth)||"",10),me=(l==null?void 0:l.expiryYear)||"";if((D=l==null?void 0:l.cardName)!=null&&D.trim()||(s.cardName="Card name is required"),(ne=l==null?void 0:l.cardNumber)!=null&&ne.trim()||(s.cardNumber="Card number is required"),(!((Ve=l==null?void 0:l.expiryMonth)!=null&&Ve.trim())||!((nt=l==null?void 0:l.expiryYear)!=null&&nt.trim())||isNaN(Q)||Q<1||Q>12||me.length!==4)&&(s.expiryMonth="Invalid Expiration Date."),(it=l==null?void 0:l.cvv)!=null&&it.trim()||(s.cvv="CVV is required"),(fe=l==null?void 0:l.zipCode)!=null&&fe.trim()||(s.zipCode="ZIP code is required"),l!=null&&l.expiryMonth&&(l!=null&&l.expiryYear)&&l.expiryMonth.length<=2&&l.expiryYear.length===4){let Ce=parseInt(l.expiryMonth,10),W=parseInt(l.expiryYear,10),et=new Date,bt=et.getMonth()+1,qt=et.getFullYear();(W<qt||W===qt&&Ce<bt)&&(s.expiryMonth="Card is expired")}return xe(s),Object.keys(s).length>0},rt=()=>{let s=DatacapWebToken.validateCardNumber(h==null?void 0:h.cardNumber.replaceAll(" ","")),l=DatacapWebToken.validateExpirationDate(h==null?void 0:h.expiryMonth,h==null?void 0:h.expiryYear),Q=DatacapWebToken.validateCVV(h==null?void 0:h.cvv),me={};return s||(me.cardNumber="Invalid card Number"),l||(me.expiryMonth="Invalid Expiration Date."),Q||(me.cvv="Invalid CVV"),xe(me),s&&Q&&l},ve=async s=>{var Q,me,D,ne,Ve,nt,it,fe,Ce,W,et,bt,qt,An,Xe,$n,En,Oe,Dt,Tt,jn,Ee,xi,vi;s.preventDefault();let l=document.activeElement;if(l instanceof HTMLElement&&l.blur(),!ht&&!Ot){if(Ye!=="ach"){if(ie()||!rt())return}else if(c())return;try{We();let wt=await yn.get(`${Ae}api/v1/gateway/token/${T}`,{params:{require3ds:C,pass_fee:oe}});if((wt==null?void 0:wt.status)==200){let Ci=(me=(Q=wt==null?void 0:wt.data)==null?void 0:Q.data)==null?void 0:me.gateway_token,Ii=(ne=(D=wt==null?void 0:wt.data)==null?void 0:D.data)==null?void 0:ne.paymentGateway;if(Ye!=="ach")Ii==((Ve=Oi)==null?void 0:Ve.FRACTALKEY)?await ke():DatacapWebToken.requestToken(Ci,"PaymentForm",Wt);else{let ni;try{let Ut=await yn.post(`${Ae}api/v1/gateway/bank-charge/${T}`,{label:a==null?void 0:a.name,account_number:a==null?void 0:a.accountNumber,routing_number:a==null?void 0:a.routingNumber,bank_name:a==null?void 0:a.bankName,account_type:a==null?void 0:a.accountType,amount:`${t}`,customer_id:null,isSaveAch:!1,tax:"0.00",discount:"0.00",surcharge:"0.00",order_id:"",company_name:(a==null?void 0:a.companyName)||""});if((nt=Ut==null?void 0:Ut.data)!=null&&nt.result){if(k&&z)try{let Le=await yn.post(`${Ae}api/v1/gateway/add-bank/${T}`,{name:a==null?void 0:a.name,account_number:a==null?void 0:a.accountNumber,routing_number:a==null?void 0:a.routingNumber,bank_name:a==null?void 0:a.bankName,account_type:a==null?void 0:a.accountType,customer_id:z||"",company_name:(a==null?void 0:a.companyName)||""});Le.data.result&&(ni={bankDetails:F(v({},(it=Le==null?void 0:Le.data)==null?void 0:it.data),{account_type:a==null?void 0:a.accountType})})}catch(Le){le(),N(((Ce=(fe=Le==null?void 0:Le.response)==null?void 0:fe.data)==null?void 0:Ce.message)||"Something went wrong!"),B({error:((et=(W=Le==null?void 0:Le.response)==null?void 0:W.data)==null?void 0:et.message)||"Something went wrong!",result:(qt=(bt=Le==null?void 0:Le.response)==null?void 0:bt.data)==null?void 0:qt.result,statusCode:(An=Le==null?void 0:Le.response)==null?void 0:An.status})}ni=F(v({},ni),{callback:F(v({},(Xe=Ut==null?void 0:Ut.data)==null?void 0:Xe.data),{name:a==null?void 0:a.name,isPreAuth:U})}),B(ni),st(),le()}}catch(Ut){console.log(Ut,"errororor");let Le=($n=Ut==null?void 0:Ut.response)==null?void 0:$n.data;typeof(Le==null?void 0:Le.message)=="object"?Object.values(Le==null?void 0:Le.message).forEach(en=>{var hn;N(en||"Something went wrong"),B({error:en||"Something went wrong!",result:(Le==null?void 0:Le.result)||!1,statusCode:(hn=Ut==null?void 0:Ut.response)==null?void 0:hn.status})}):(N((Le==null?void 0:Le.message)||"Something went wrong"),B({error:(Le==null?void 0:Le.message)||"Something went wrong!",result:(Le==null?void 0:Le.result)||!1,statusCode:(En=Ut==null?void 0:Ut.response)==null?void 0:En.status})),le()}}}}catch(wt){le(),B({error:((Dt=(Oe=wt==null?void 0:wt.response)==null?void 0:Oe.data)==null?void 0:Dt.message)||"Something went wrong!",result:(jn=(Tt=wt==null?void 0:wt.response)==null?void 0:Tt.data)==null?void 0:jn.result,statusCode:(Ee=wt==null?void 0:wt.response)==null?void 0:Ee.status}),N(((vi=(xi=wt==null?void 0:wt.response)==null?void 0:xi.data)==null?void 0:vi.message)||"Something went wrong!")}}},ot=(s,l)=>{let Q=s;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(Q)){(l===""||/^[0-9]+$/.test(l))&&(xe(D=>F(v({},D),{[Q]:""})),L(D=>F(v({},D),{[Q]:l})));return}xe(D=>F(v({},D),{[Q]:""})),L(D=>F(v({},D),{[Q]:l}))},Ie=s=>{var ne;let l=s.target,Q=l.value.replace(/\D/g,""),{formatted:me,cursor:D}=Tn(l.value,(ne=l.selectionStart)!=null?ne:0);xe(Ve=>F(v({},Ve),{cardNumber:""})),L(Ve=>F(v({},Ve),{cardNumber:me})),requestAnimationFrame(()=>{l.setSelectionRange(D,D)})},ae=s=>{let{name:l,value:Q}=s.target,me=["routingNumber","accountNumber","confirmAccountNumber"];if(l=="name"){/^[a-zA-Z\s]*$/.test(Q)&&(b(D=>F(v({},D),{[l]:""})),o(D=>F(v({},D),{[l]:Q})));return}if(me.includes(l)){(Q===""||/^[0-9]+$/.test(Q))&&(b(D=>F(v({},D),{[l]:""})),o(D=>F(v({},D),{[l]:Q})));return}b(D=>F(v({},D),{[l]:""})),o(D=>F(v({},D),{[l]:Q}))},st=()=>{y(!1),De("card"),N(""),gt(!1),zt(""),o({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),b({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),L({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),xe({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),P(!1),x(!1),bn("form"),At("form"),Wn(!1),St(0),S(0),Me([]),J(null),Mn(null),Ue(!1),Re(!1),vt(null),Qt(null),Ke(""),Vt(""),rn("")},yt=async()=>{var s,l,Q,me,D,ne,Ve,nt,it;We();try{let fe={isPreAuth:U,customerId:z},Ce=await yn.post(`${Ae}api/v1/gateway/card-list/${T}`,fe),W=((l=(s=Ce==null?void 0:Ce.data)==null?void 0:s.data)==null?void 0:l.cardList)||[],et=W==null?void 0:W.filter(qt=>(qt==null?void 0:qt.card_type)=="Bank"),bt=W==null?void 0:W.filter(qt=>(qt==null?void 0:qt.card_type)!=="Bank");bt&&(bt==null?void 0:bt.length)>0?(De("card"),At("list"),Me(bt)):(De("card"),Me([])),et&&(et==null?void 0:et.length)>0?(bn("list"),X(et)):X([]),le()}catch(fe){console.log(fe),le(),B({error:((me=(Q=fe==null?void 0:fe.response)==null?void 0:Q.data)==null?void 0:me.message)||"Something went wrong!",result:(ne=(D=fe==null?void 0:fe.response)==null?void 0:D.data)==null?void 0:ne.result,statusCode:(Ve=fe==null?void 0:fe.response)==null?void 0:Ve.status}),N(((it=(nt=fe==null?void 0:fe.response)==null?void 0:nt.data)==null?void 0:it.message)||(fe==null?void 0:fe.message)||"Something went wrong")}},he=s=>{switch(s==null?void 0:s.toLowerCase()){case"visa":return sn;case"mastercard":case"mc":case"m/c":return on;case"amex":case"american express":case"ae":return ln;case"discover":case"dcvr":return xn;case"bank":return Zt;default:return s}},re=async s=>{yi.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async l=>{var Q,me;if(l.isConfirmed){ge(!0);try{let D={card_id:s,customer_id:z},ne=await yn.patch(`${Ae}api/v1/gateway/delete-card/${T}`,D);(Q=ne==null?void 0:ne.data)!=null&&Q.result?(ge(!1),yt(),yi.fire({icon:"success",title:"Deleted!",text:((me=ne==null?void 0:ne.data)==null?void 0:me.message)||"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})):(ge(!1),yi.fire({icon:"error",title:"Failure!",text:"Card not deleted.",timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}}))}catch(D){ge(!1),yi.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else l.dismiss===yi.DismissReason.cancel&&yi.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},Gt=async s=>{var D,ne,Ve,nt,it,fe,Ce,W,et;if(s.currentTarget.blur(),ht)return;let l=z,Q=Mt==null?void 0:Mt.id,me=Mt==null?void 0:Mt.card_type;if(!Ot)if(e)if(l)if(Q){let bt={amount:(me==null?void 0:me.toLowerCase())==="bank"?`${t}`:ct||e,customer_id:l,card_id:Q,pass_fee:oe,pass_fee_amount:Number(e)-Lt};M&&(bt.orderGuid=Yt||Ne,ct&&(bt.ispartialPayment=!0)),U&&(bt.isPreauth=!0);let qt=Ae+"api/v1/gateway/charge-by-saved-details/"+T,An={"Content-Type":"application/json"};try{We();let Xe=await yn.post(qt,bt);(D=Xe==null?void 0:Xe.data)!=null&&D.result&&(B({callback:F(v({},(ne=Xe==null?void 0:Xe.data)==null?void 0:ne.data),{isPreAuth:U})}),le(),st())}catch(Xe){console.log(Xe==null?void 0:Xe.response,"error by saved details"),B({error:((nt=(Ve=Xe==null?void 0:Xe.response)==null?void 0:Ve.data)==null?void 0:nt.message)||"Something went wrong!",result:(fe=(it=Xe==null?void 0:Xe.response)==null?void 0:it.data)==null?void 0:fe.result,statusCode:(Ce=Xe==null?void 0:Xe.response)==null?void 0:Ce.status}),le(),N(((et=(W=Xe==null?void 0:Xe.response)==null?void 0:W.data)==null?void 0:et.message)||"Something went wrong!")}}else N("Please Select A Card/Bank"),B({error:"Please Select A Card/Bank"});else N("Please Select Customer"),B({error:"Please Select Customer"});else N("Something went wrong."),B({error:"Something went wrong."})},Bt=async()=>{var s,l,Q,me,D,ne,Ve,nt,it,fe,Ce;try{We();let W=await yn.get(`${Ae}api/v1/gateway/get-payment-details/${T}`);(W==null?void 0:W.status)==200&&(Wn((l=(s=W==null?void 0:W.data)==null?void 0:s.data)==null?void 0:l.isBankActive),St(Number((me=(Q=W==null?void 0:W.data)==null?void 0:Q.data)==null?void 0:me.fee)||0),le())}catch(W){console.log((ne=(D=W==null?void 0:W.response)==null?void 0:D.data)==null?void 0:ne.result,"error while getting payment details"),B({error:((nt=(Ve=W==null?void 0:W.response)==null?void 0:Ve.data)==null?void 0:nt.message)||"Something went wrong!",result:(fe=(it=W==null?void 0:W.response)==null?void 0:it.data)==null?void 0:fe.result,statusCode:(Ce=W==null?void 0:W.response)==null?void 0:Ce.status}),le()}},Qe=async()=>{var s,l,Q,me,D;if(!jt){It(!0);try{let ne=await yn.post(`${Ae}api/v1/gateway/create-pay-order/${T}`,{amount:e,cashDiscount:Lt,bankAmount:t,bankSurcharge:Te,customerId:z,passFee:oe,passFeeAmount:w||Number(e)-Lt,require3ds:C,isPartial:M});(s=ne==null?void 0:ne.data)!=null&&s.result&&(It(!1),Qt((Q=(l=ne==null?void 0:ne.data)==null?void 0:l.data)==null?void 0:Q.orderGuid),rn((D=(me=ne==null?void 0:ne.data)==null?void 0:me.data)==null?void 0:D.remainingAmount),Pe.current=!0)}catch(ne){console.log("error in creating order",ne),It(!1)}}};Wi(()=>{!V&&!R&&(Pe.current=!1,Fe.current=!1)},[V,R]),Wi(()=>{!Pe.current&&(V||R)&&(Bt(),M&&!_e&&Qe())},[V,R,M]),Wi(()=>{if((V||R)&&w){let s=Number(e)-Number(w);s&&!isNaN(s)&&S(s)}else if((V||R)&&oe&&Bn){let s=_t(e,Bn);s&&!isNaN(s)&&S(s)}else S(Number(e));!Fe.current&&z&&(V||R)&&!G&&(Fe.current=!0,yt())},[z,V,e,Bn,R]);let Gn=()=>U?"Cards":"Cards/Bank",ut=Mr(async()=>{try{Ue(!0);let l=await(await fetch(`${Ae}api/v1/gateway/create-payment-intent/${T}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:e,require3ds:C,pass_fee:oe})})).json();l.is3dEnable?(Ue(!1),Mn(l.clientSecret),Re(l.is3dEnable)):(Ue(!1),Re(l.is3dEnable)),l.result||N(l.error||(l==null?void 0:l.message)||"Failed to get client secret")}catch(s){console.log(s.response,"err.response"),N(s.message)}},[e]),Be=()=>{},Hn=(s,l)=>{We(),Z(s,l),vt(null)},Sn=s=>{console.error("3DS Auth failed \u274C",s),N(`3DS Authentication ${s}`)};Wi(()=>{Se&&Se(()=>st)},[]);let vn=s=>{var l,Q;((l=Number(an||ft))==null?void 0:l.toFixed(2))<(s==null?void 0:s.floatValue)||(s==null?void 0:s.floatValue)<0?(Ke(s==null?void 0:s.value),Vt(`Partial amount cannot exceed ${ye((Q=Number(an||ft))==null?void 0:Q.toFixed(2))}`)):(s==null?void 0:s.floatValue)==0?(Ke(s==null?void 0:s.value),Vt("Partial amount must be greater than 0")):(Ke(s==null?void 0:s.value),Vt(""))};return d.createElement(d.Fragment,null,E&&d.createElement(dn,{loading:E}),f&&d.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},d.createElement(zn,{error:f,onClose:st})),!f&&d.createElement(d.Fragment,null,(ht||ze)&&d.createElement(dn,{loading:ht||ze||ce||jt}),d.createElement("div",{className:"frac-card-payment-page frac-form frac-new-form"},d.createElement("div",{ref:ue,style:{width:"100%",height:"100%"}}),mt!=null&&mt.challenge_url?d.createElement(Ca,{containerRef:ue,challengeUrl:mt.challenge_url,fractalToken:mt.fractalToken,stripeIntentId:mt.id,onSuccess:Hn,onError:Sn}):d.createElement("div",{className:"parent-pay-container"},d.createElement("span",{style:{display:R?"none":"block"},className:"request-payment-close-popup",onClick:st},d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},d.createElement("g",{clipPath:"url(#clip0_12425_52336)"},d.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"})),d.createElement("defs",null,d.createElement("clipPath",{id:"clip0_12425_52336"},d.createElement("rect",{width:"16",height:"16",fill:"white"}))))),d.createElement("div",{className:"pay-main-logo-res"}),d.createElement("div",{className:"pay-container"},d.createElement("div",{className:"pay-header pay-conatiner-one"},d.createElement("div",{className:"pay-conatiner-one-first"},d.createElement("div",{className:"pay-logo-container"},d.createElement("div",{className:"pay-main-logo"}),d.createElement("h1",{className:"pay-heading"},"Pay"),($==null?void 0:$.length)>0&&Ye!=="cardList"&&d.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>De("cardList")}," ",d.createElement(aa,null)," Back")),d.createElement("div",{className:"amt-pay-con"},d.createElement("div",{className:"pay-amount-conatiner"},d.createElement("small",{className:"pay-payment-amount"},"Select payment type"),d.createElement("div",{className:"frac-card-bank-radio-main"},d.createElement(Fn,{label:"Card",amount:(Pt=Number(e))==null?void 0:Pt.toFixed(2),value:"card",onChange:p,activetab:Ye}),!U&&kt&&!M&&d.createElement(Fn,{label:"Bank",amount:(de=Number(t))==null?void 0:de.toFixed(2),value:"ach",onChange:p,activetab:Ye})),oe&&Ye==="card"&&Lt&&Number(e)-Number(Lt)>0?d.createElement("div",{className:"frac-cash-discount-fee"},d.createElement("small",null,Ye==="card"?"Cash Discount":"Cash Discount Savings"," "),d.createElement("p",null,ye((Number(e)-Number(Lt)).toFixed(2)))):null,M&&d.createElement("div",{className:"frac-partial-payment-input"},d.createElement("label",{htmlFor:"partialpayment"},"Partial Payment"),d.createElement(Lr,{prefix:"$",className:"form-control-frac",value:ct,onValueChange:s=>{vn(s)},thousandSeparator:!0,placeholder:"Enter partial amount",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,isAllowed:s=>{let{floatValue:l=0,value:Q}=s;return Q===""||Q==="0"||Q.startsWith("0.")?!0:l===0?!1:l>0}}),Ot&&d.createElement("span",{className:"error-span"},Ot))))),d.createElement("div",{className:"pay-conatiner-one-last"},d.createElement("img",{src:_,alt:""}),d.createElement("img",{src:g,alt:""}),"Secure payments powered by Fractal")),d.createElement("div",{className:"pay-tab pay-conatiner-two"},d.createElement("div",{className:"col-md-12"},d.createElement("div",{id:"payment-form-div"},Ht?qn&&d.createElement(na,{onSuccess:Be,clientSecret:qn,amount:e,showLoader:We,hideLoader:le,callback:B,session_token:T,handleClose:st,setError:N,isPreAuth:U}):d.createElement(d.Fragment,null,d.createElement("div",{id:"ach",style:{display:Ye==="card"?"block":"none"},className:"tabcontent"},d.createElement("div",{className:"frac-heading-card-wrap"},d.createElement("div",{className:"frac-backarrow"},($==null?void 0:$.length)>0&&kn==="form"&&d.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>At("list")}," ",d.createElement(aa,null))),d.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),d.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},d.createElement("img",{src:sn,alt:"",width:33}),d.createElement("img",{src:on,width:33,alt:""}),d.createElement("img",{src:ln,alt:"",width:33}),d.createElement("img",{src:xn,width:33,alt:""})),kn==="list"&&($==null?void 0:$.length)>0?d.createElement(d.Fragment,null,d.createElement(On,{headingClass:"card-ach-heading-frac",listHeading:"Card",ListItems:$,selectedCard:Mt,setSelectedCard:Ge,handleDeleteCard:re,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{At("form")}}),d.createElement("div",{className:"form-group-frac",style:{padding:"0"}},d.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Gt},ct?ye((Ct=Number(ct))==null?void 0:Ct.toFixed(2)):ye((Rt=Number(e))==null?void 0:Rt.toFixed(2))))):d.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:ve,onKeyDown:s=>{s.key==="Enter"&&ht&&(s.preventDefault(),s.stopPropagation())}},d.createElement("div",{className:"ach-scrl",style:{minHeight:"398px",maxHeight:"398px",overflow:"auto",marginRight:"5px"}},d.createElement("div",{className:"form-group-frac"},d.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),d.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"John Doe",value:(h==null?void 0:h.cardName)||"",onChange:s=>{let l=s.target.value;/^[a-zA-Z\s]*$/.test(l)&&ot("cardName",l)}}),(u==null?void 0:u.cardName)&&d.createElement("span",{className:"error-span"},u==null?void 0:u.cardName)),d.createElement("div",{className:"form-group-frac"},d.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),d.createElement("div",{className:"toggle-num-wrapper"},d.createElement("input",{className:"form-control-frac card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(h==null?void 0:h.cardNumber)||"",onChange:s=>Ie(s),"data-token":"card_number"}),d.createElement("div",{className:"card-crdi card-expiry-new"},d.createElement("div",{className:"exp-date-year-container"},d.createElement("div",{className:"exp-date form-group-frac"},d.createElement("input",{"data-token":"exp_month",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(h==null?void 0:h.expiryMonth)||"",onChange:s=>ot("expiryMonth",s.target.value)})),d.createElement("div",{className:"exp-year form-group-frac"},d.createElement("input",{"data-token":"exp_year",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(h==null?void 0:h.expiryYear)||"",onChange:s=>ot("expiryYear",s.target.value)})),d.createElement("div",{className:"security-digit form-group-frac"},d.createElement("input",{"data-token":"cvv",className:"form-control-frac card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(h==null?void 0:h.cvv)||"",onChange:s=>ot("cvv",s.target.value)})))),(u==null?void 0:u.cardNumber)&&d.createElement("span",{className:"error-span"},u==null?void 0:u.cardNumber),d.createElement("p",{style:{margin:"0"}},u!=null&&u.expiryMonth||u!=null&&u.expiryYear?d.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},u==null?void 0:u.expiryMonth):"",(u==null?void 0:u.cvv)&&d.createElement("span",{className:"error-span"},u==null?void 0:u.cvv)))),d.createElement("div",{className:"form-group-frac"},d.createElement("label",{htmlFor:"zip"},"ZIP"),d.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"000000",value:(pn=h==null?void 0:h.zipCode)!=null?pn:"",onChange:s=>ot("zipCode",s.target.value)}),(u==null?void 0:u.zipCode)&&d.createElement("span",{className:"error-span"},u==null?void 0:u.zipCode)),z&&d.createElement("div",{className:"form-group-frac"},d.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},d.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:Y,onChange:s=>x(s.target.checked)}),d.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),d.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),d.createElement("div",{className:"frac-tooltip-wrapper"},d.createElement("div",{className:"frac-tooltip-icon"},d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},d.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),d.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"}))),d.createElement("div",{className:"frac-tooltip-text"},d.createElement("p",null,"If checked, I agree to give the ",d.createElement("b",null,O||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),d.createElement("div",{className:"form-group-frac",style:{marginTop:"20px",padding:"0"}},d.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ct?ye((di=Number(ct))==null?void 0:di.toFixed(2)):ye((Yn=Number(e))==null?void 0:Yn.toFixed(2)))))),d.createElement("div",{id:"ach",style:{display:Ye==="ach"?"block":"none"},className:"tabcontent"},d.createElement(d.Fragment,null,d.createElement("div",{className:"frac-heading-card-wrap"},d.createElement("div",{className:"frac-backarrow"},(dt==null?void 0:dt.length)>0&&xt==="form"&&d.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>bn("list")}," ",d.createElement(aa,null))),d.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment")),xt==="list"&&(dt==null?void 0:dt.length)>0?d.createElement(d.Fragment,null,d.createElement(On,{headingClass:"card-ach-heading-frac",listHeading:"Banks",ListItems:dt,selectedCard:Mt,setSelectedCard:Ge,handleDeleteCard:re,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{bn("form")}}),d.createElement("div",{className:"form-group-frac",style:{padding:"0"}},d.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Gt},ye((Kt=Number(t))==null?void 0:Kt.toFixed(2))))):d.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:ve,autoComplete:"off",onKeyDown:s=>{s.key==="Enter"&&ht&&(s.preventDefault(),s.stopPropagation())}},d.createElement("div",{className:"ach-scrl",style:{minHeight:"444px",maxHeight:"444px"}},d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),d.createElement("input",{type:"text",id:"nameonaccount",className:"form-control-frac",maxLength:100,placeholder:"John Doe",name:"name",value:(ti=a==null?void 0:a.name)!=null?ti:"",onChange:ae}),(r==null?void 0:r.name)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.name)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"routingnumber"},"Routing number"),d.createElement("input",{type:"text",id:"routingnumber",className:"form-control-frac",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(wn=a==null?void 0:a.routingNumber)!=null?wn:"",onChange:ae}),(r==null?void 0:r.routingNumber)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.routingNumber)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"accountnumber"},"Account number"),d.createElement("input",{type:"text",id:"accountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(fn=a==null?void 0:a.accountNumber)!=null?fn:"",onChange:ae}),(r==null?void 0:r.accountNumber)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.accountNumber)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),d.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(Ai=a==null?void 0:a.confirmAccountNumber)!=null?Ai:"",onChange:ae}),(r==null?void 0:r.confirmAccountNumber)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.confirmAccountNumber)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"bankname"},"Bank name"),d.createElement("input",{type:"text",id:"bankname",className:"form-control-frac",maxLength:100,placeholder:"My Bank",name:"bankName",value:(Ti=a==null?void 0:a.bankName)!=null?Ti:"",onChange:ae}),(r==null?void 0:r.bankName)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.bankName)),((a==null?void 0:a.accountType)==="business saving"||(a==null?void 0:a.accountType)==="business checking")&&d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"companyName"},"Company name"),d.createElement("input",{type:"text",id:"companyName",className:"form-control-frac",maxLength:100,placeholder:"My Company",name:"companyName",value:(Gi=a==null?void 0:a.companyName)!=null?Gi:"",onChange:ae}),(r==null?void 0:r.companyName)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.companyName)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"accounttype"},"Select account type"),d.createElement("select",{name:"accountType",id:"accounttype",className:"form-control-frac",value:(zi=a==null?void 0:a.accountType)!=null?zi:"",onChange:ae},d.createElement("option",{value:""},"Select account"),gi.map(s=>d.createElement("option",{key:s.value,value:s.value},s.label)))),z&&d.createElement("div",{className:"form-group-frac mb-4 save-ach-div",style:{paddingTop:"5px"}},d.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:k,onChange:s=>P(s.target.checked)}),d.createElement("label",{className:"saveachlabel",htmlFor:"saveACH"},"Save ACH")),k&&d.createElement("div",{className:"form-group-frac mb-4 saveachtext"},d.createElement("p",null,"If checked, I agree to give the ",d.createElement("b",null,O||"merchant")," permission to charge this bank account for agreed-upon purchases in the future."))),d.createElement("div",{className:"form-group-frac "},d.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},ye((Qn=Number(t))==null?void 0:Qn.toFixed(2))))))))))))))))},ra=Ar;import zr from"axios";var Ir=({amount:e,bankAmount:t,submitBtnText:H="Pay",session_token:T,customerId:z,callback:B,merchantName:O="merchant",isPreAuth:U,surcharge:be="0",submitBtnClass:K,submitBtnIcon:A,isRequest:G,pass_fee:oe,pass_fee_amount:w,require3ds:C=!1,autoTrigger:R=!1,isPartial:V,bankSurcharge:y,partialRef:Se,onTriggerPay:M})=>{let[Te,_e]=bi(!1),[ce,Ne]=bi(!1),[ft,Pe]=bi(()=>()=>{}),[Fe,ue]=bi(null),[Ye,De]=bi(null),gn=Tr(()=>({amount:e,bankAmount:t,submitBtnText:H,session_token:T,customerId:z,callback:B,merchantName:O,isPreAuth:U,surcharge:be,submitBtnClass:K,submitBtnIcon:A,isRequest:G,pass_fee:oe,pass_fee_amount:w,require3ds:C,autoTrigger:R,setShow:_e,setHandleCloseRef:Pe,isPartial:V,bankSurcharge:y,partialRef:Se}),[e,t,H,T,z,B,O,U,be,K,A,G,oe,w,C,R,V,y,Se]),[nn,h]=bi(gn);oa(()=>{Te&&h(gn)},[Te,gn]);let L=async()=>{var u;Ne(!0);try{let xe=await zr.get(`${Ae}api/v1/gateway/get-order-details/${T}`,{params:{isPartial:V,partialRef:Se}});if((u=xe==null?void 0:xe.data)!=null&&u.result){let a=xe.data.data;a!=null&&a.orderGuid&&(ue(a==null?void 0:a.orderGuid),De(a==null?void 0:a.remainingAmount)),h(o=>F(v({},o),{amount:a.amount,pass_fee_amount:a.pass_fee_amount,pass_fee:a.pass_fee}))}}catch(xe){console.log("error while getting skyosorderdeatils",xe)}finally{Ne(!1)}};return oa(()=>{Te&&V&&Se&&L()},[Te,V,Se]),oa(()=>{M&&M(()=>{_e(!0)})},[M]),Zn.createElement(Zn.Fragment,null,Zn.createElement("link",{href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"}),Zn.createElement(_n,null),Zn.createElement(ta,null),Zn.createElement(Dn,null),Zn.createElement(Yi,null),!R&&Zn.createElement("button",{className:K||"paymentBtn",style:{display:M?"none":"block"},onClick:()=>_e(!0)},H,A),R?Zn.createElement(ra,F(v({show:Te,loadingPrev:ce},nn),{orderGuid:Fe,remainingAmount:Ye})):Zn.createElement(Nn,{open:Te,onClose:ft},Zn.createElement(ra,F(v({show:Te,loadingPrev:ce},nn),{orderGuid:Fe,remainingAmount:Ye}))))};export{pr as AddCard,hr as CardOnFile,or as GetPaymentPage,xr as PartialPayment,Ir as PaymentWidget,lr as PreAuthPayment,Ua as RequestPayment,Da as RequestPreAuthPayment};
|