@fractalpay/fractalpay-next-dev 0.0.202 → 0.0.204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8186 -28
- package/dist/index.js.map +1 -0
- package/package.json +12 -15
- package/dist/index.d.mts +0 -137
- package/dist/index.mjs +0 -3097
package/dist/index.mjs
DELETED
|
@@ -1,3097 +0,0 @@
|
|
|
1
|
-
var Mi=Object.defineProperty,zi=Object.defineProperties;var Li=Object.getOwnPropertyDescriptors;var Ma=Object.getOwnPropertySymbols;var ci=Object.prototype.hasOwnProperty,ui=Object.prototype.propertyIsEnumerable;var mi=(e,t,q)=>t in e?Mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:q}):e[t]=q,w=(e,t)=>{for(var q in t||(t={}))ci.call(t,q)&&mi(e,q,t[q]);if(Ma)for(var q of Ma(t))ui.call(t,q)&&mi(e,q,t[q]);return e},L=(e,t)=>zi(e,Li(t));var ra=(e,t)=>{var q={};for(var I in e)ci.call(e,I)&&t.indexOf(I)<0&&(q[I]=e[I]);if(e!=null&&Ma)for(var I of Ma(e))t.indexOf(I)<0&&ui.call(e,I)&&(q[I]=e[I]);return q};var Ti=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var pi=Ti((Ro,qi)=>{qi.exports={name:"@fractalpay/fractalpay-next-dev",version:"0.0.202",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 Y,{useState as Wn,useEffect as yi}from"react";import ea from"react";import Ii from"react";var Ai=e=>Ii.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
|
-
`),gi=Ai;var Bi=e=>ea.createElement(ea.Fragment,null,ea.createElement(gi,null),(e==null?void 0:e.loading)&&ea.createElement("div",{className:"loader"},ea.createElement("div",{className:"lds-ellipsis"},ea.createElement("div",null),ea.createElement("div",null),ea.createElement("div",null),ea.createElement("div",null)))),dn=Bi;var{name:za}=pi(),X="https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/";za==="@fractalpay/fractalpay-next-dev"?(lt="http://192.168.1.63:8082/",Ve="http://192.168.1.63:8081/",la="https://api-dev.merchant-trends.com/",sa="https://token-cert.dcap.com/v1/client",da="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw"):za==="@fractalpay/fractalpay-next-test"?(Ve="https://testapi.fractalpay.com/",lt="https://staging-widget.fractalpay.com/",la="https://api-dev.merchant-trends.com/",sa="https://token-cert.dcap.com/v1/client",da="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw"):za==="@fractalpay/fractalpay-next-testprod"?(Ve="https://sky-node-prod.fractalpay.com/",lt="https://widget-prod.fractalpay.com/",la="https://api.merchant-trends.com/",sa="https://token.dcap.com/v1/client",da="pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB"):za==="@fractalpay/fractalpay-next"?(Ve="https://api.fractalpay.com/",lt="https://widget.fractalpay.com/",la="https://api.merchant-trends.com/",sa="https://token.dcap.com/v1/client",da="pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB"):(lt="http://localhost:8082/",Ve="http://localhost:8081/",la="https://api-dev.merchant-trends.com/",sa="https://token-cert.dcap.com/v1/client",da="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw");var Ve,lt,la,sa,da;var tn={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 va from"react";import Hi from"react";var Yi=e=>Hi.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
|
-
`),La=Yi;var Vi=({open:e,onClose:t,children:q,maxWidth:I})=>e?va.createElement(va.Fragment,null,va.createElement(La,null),va.createElement("div",{className:"fractal-popup"},va.createElement("div",{className:"fractal-popup-content request-payment-popup-container",style:{maxWidth:`${I!=null?I:"auto"}`}},q))):null,wn=Vi;import Wi from"axios";import{PatternFormat as Ui}from"react-number-format";import $i from"react";var ji=e=>$i.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
|
-
`),Ta=ji;var pa=e=>{try{let t=JSON.parse(e);return typeof t=="object"&&t!==null}catch(t){return!1}},fa=[{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 ge(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 Oi=X+"widget/mc-img.svg",Ei=X+"widget/visa-img.svg",Ki=X+"widget/ae-img.svg",Zi=X+"widget/discover-img.svg",Ca=X+"widget/card.svg",Gi=X+"widget/bank.svg",fr=X+"widget/Trash.svg",hr=X+"widget/secure-img.png",yr=X+"widget/pov-by.png",Ia=X+"widget/pax.svg",fi=X+"widget/Bank _New.svg",hi=e=>{switch(e==null?void 0:e.toLowerCase()){case"visa":return Ei;case"mastercard":case"mc":case"m/c":return Oi;case"amex":case"american express":case"ae":return Ki;case"discover":case"dcvr":return Zi;case"bank":return Gi;default:return Ca}},An=(e,t)=>{let q=e.replace(/\D/g,""),I=e.slice(0,t).replace(/\D/g,"").length,P="",F="";if(/^3[47]/.test(q)?(P=q.slice(0,15),F=P.replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(G,z,J,ye)=>[z,J,ye].filter(Boolean).join(" "))):(P=q.slice(0,16),F=P.replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(G,z,J,ye,v)=>[z,J,ye,v].filter(Boolean).join(" "))),I===0)return{formatted:F,cursor:0};let Z=F.length,qe=0;for(let G=0;G<F.length;G++)if(/\d/.test(F[G])&&qe++,qe===I){Z=G+1;break}return{formatted:F,cursor:Z}},On=e=>e==1?!1:(e==0,!0);function Ji(e){let t=e.merchantPublicKey,q=e==null?void 0:e.discount,I=e==null?void 0:e.tax,P=e==null?void 0:e.surcharge,[F,H]=Wn(!1),[Z,qe]=Wn(!1),[G,z]=Wn({}),[J,ye]=Wn(null),[v,de]=Wn({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),[te,M]=Wn(!1),[C,V]=Wn(void 0),[h,me]=Wn(""),[zt,ve]=Wn(!1),[Ne,st]=Wn(null),He=o=>/^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(o),xt=/[+-]?([0-9]*[.])?[0-9]+/,ce=o=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o),Me=o=>/^[A-Za-z\s]*$/.test(o),it=(o,m)=>{let b=(parseFloat(m)||0)/100,g=o/(1+b);return Math.round(g*100)/100};yi(()=>{if(e!=null&&e.pass_fee){let o=it(e==null?void 0:e.amount,e==null?void 0:e.surcharge);V(o)}},[e==null?void 0:e.pass_fee]);let Ft=()=>{H(!1),z({})},Dt=()=>H(!0),O=()=>{console.log(Ne,"apiresponse"),W(Ne),ve(!1)};function Je(){de({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),me("")}function W(o){let m={type:"preview.compiledcheck",other:L(w({},o),{status:!0})};window.parent.postMessage(m,"*")}let B=async o=>{if(o.currentTarget.blur(),!Z&&!(Object.keys(G).length>0)){if(z({}),!(v!=null&&v.email)&&J&&!He(J)){z(m=>L(w({},m),{phone:tn.phonenumbervalid}));return}if(N())try{qe(!0);let m={fractalpayPublicKey:t,amount:h,phone_number:J,order_id:v.order_id,action:"request",name:v.name,email:v.email,customer_id:e!=null&&e.customerId?e==null?void 0:e.customerId:"",discount:q,surcharge:P,tax:I,require_3ds:e==null?void 0:e.require_3ds,pass_fee:e==null?void 0:e.pass_fee,allow_partial:te},b=await Wi.post(`${lt}create-widget-order`,m,{headers:w({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})});(b==null?void 0:b.status)===200&&(ve(!0),H(!1),Je(),st(b==null?void 0:b.data)),qe(!1)}catch(m){console.log(m),qe(!1)}}},i=lt+"images/logo-img.png",x=o=>{let{value:m}=o.target,b=o.target.dataset.token;if(de(L(w({},v),{[b]:m})),b==="name"&&!Me(m)){z(Ce=>L(w({},Ce),{[b]:tn.onlylettersallowed}));return}let g=G;b==="email"&&!J&&(delete g.phone,z(g)),m&&(delete g[b],z(g)),b==="email"&&!m&&(delete g[b],z(g))},s=o=>{let{value:m}=o;if(Number(m)>0){let b=G;delete b.amount,z(b)}me(m)},N=()=>{let o={};return h||(o.amount=tn.amountrequired),v.email&&!ce(v==null?void 0:v.email)&&(o.email=tn.invalidemail),!J&&!(v!=null&&v.email)&&(o.phone=tn.phoneoremailrequired),!J&&!(v!=null&&v.email)&&(o.email=tn.phoneoremailrequired),!J&&v.email&&!ce(v==null?void 0:v.email)&&(o.email=tn.invalidemail),e.from==="merchant"&&!v.order_id&&(o.order_id=tn.orderidrequired),z(o),Object.keys(o).length===0};yi(()=>{e&&(de(o=>L(w({},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:""})),me(e.amount?e.amount:""),ye(e.phone?`${e.phone}`:null))},[e]);let T=o=>{let m=o==null?void 0:o.value;if(m&&(m==null?void 0:m.length)>0&&(m==null?void 0:m.length)!==10){z(g=>L(w({},g),{phone:tn.phonenumberlength})),ye(m);return}else ye(m);let b=G;delete b.phone,m&&!(v!=null&&v.email)&&delete b.email,z(b)};function E(o){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(o))}let A=o=>{let m=o.target.checked;M(m)};return Y.createElement(Y.Fragment,null,Y.createElement(Ta,null),Y.createElement(dn,{loading:Z}),Y.createElement(Y.Fragment,null,Y.createElement("button",{className:"paymentBtn",onClick:Dt},"Request Payment"),Y.createElement(wn,{open:F,onClose:()=>H(!1),maxWidth:"500px"},Y.createElement("div",{style:{maxWidth:"500px"}},Y.createElement("div",{className:"request-payment-amount-detail frac-form"},Y.createElement("p",{className:"request-payment-merchantname"},"Pay ",e==null?void 0:e.webname),Y.createElement("p",{className:"request-payment-amount"},E(e==null?void 0:e.amount)),C&&C>0&&Y.createElement("div",{className:"frac-req-cash-discount"},Y.createElement("div",{className:"frac-cashlabel"},On(e==null?void 0:e.showSurcharge)?"Surcharge":"Cash Discount"," :"),Y.createElement("div",null,ge((Number(e.amount)-C).toFixed(2)))),(e==null?void 0:e.from)==="merchant"&&Y.createElement("p",{className:"request-payment-orderid"},v==null?void 0:v.order_id),Y.createElement("span",{className:"request-payment-close-popup",onClick:Ft},Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},Y.createElement("g",{clipPath:"url(#clip0_12425_52336)"},Y.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"})),Y.createElement("defs",null,Y.createElement("clipPath",{id:"clip0_12425_52336"},Y.createElement("rect",{width:"16",height:"16",fill:"white"})))))),Y.createElement("form",{className:"request-payment-input-form"},Y.createElement("div",{className:"request-payment-list-div"},Y.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"FULL NAME"),Y.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Full Name","data-token":"name",onChange:x,value:v==null?void 0:v.name}),G.name&&Y.createElement("small",{className:"request-payment-error-msg"},G.name)),Y.createElement("div",{className:"request-payment-list-div"},Y.createElement("label",{htmlFor:"requestPhoneNumber",className:"request-payment-input-label"},"Phone Number"),Y.createElement(Ui,{className:"request-payment-input-box",placeholder:"Mobile number",format:"+1 (###) ###-####",value:J,onValueChange:o=>{T(o)}}),G.phone&&Y.createElement("small",{className:"request-payment-error-msg"},G.phone)),Y.createElement("div",{className:"request-payment-list-div"},Y.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"EMAIL"),Y.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Email",onChange:x,"data-token":"email",value:v==null?void 0:v.email}),G.email&&Y.createElement("small",{className:"request-payment-error-msg"},G.email)),Y.createElement("div",{className:"partial-toggle-div"},Y.createElement("input",{className:"partial-input",type:"checkbox",role:"switch",style:{cursor:"pointer"},checked:te,onChange:o=>A(o),id:"partialSwitch"}),Y.createElement("label",{className:"partial-label",htmlFor:"partialSwitch",style:{cursor:"pointer"}},"Allow Partial Payments?")),Y.createElement("button",{type:"button",className:"request-payment-submit-button",onClick:B,disabled:Z},Z?"Loading...":"Send Request"),Y.createElement("div",{className:"request-payment-fractal-powerd-by"},Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},Y.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 ",Y.createElement("span",null,"Fractal"),Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"}),Y.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"})))))),Y.createElement(wn,{open:zt,onClose:O,maxWidth:"500px"},Y.createElement("div",{className:"fractal-popup-content",style:{padding:"0px",maxWidth:"500px"}},Y.createElement("div",{className:"request-payment-success-container"},Y.createElement("span",{className:"request-payment-close-popup",onClick:O},Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},Y.createElement("g",{clipPath:"url(#clip0_12425_52336)"},Y.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"})),Y.createElement("defs",null,Y.createElement("clipPath",{id:"clip0_12425_52336"},Y.createElement("rect",{width:"16",height:"16",fill:"white"}))))),Y.createElement("div",{className:"request-payment-success-tick-div"},Y.createElement("div",{className:"request-payment-success-tick"},Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},Y.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"})))),Y.createElement("h6",{className:"request-payment-success-text"},"The request ",Y.createElement("br",null),"was sent"),Y.createElement("h6",{className:"request-payment-success-subtext"},"Please wait for the customer to pay"),Y.createElement("div",{className:"request-payment-success-btn-div"},Y.createElement("button",{onClick:O,className:"request-payment-success-btn2"},"Close")))))))}import"bootstrap/dist/js/bootstrap.bundle.min.js";import K,{useState as ia,useEffect as Qi}from"react";import Xi from"axios";import{PatternFormat as Di}from"react-number-format";function Ri(e){let t=e.merchantPublicKey,q=e==null?void 0:e.discount,I=e==null?void 0:e.tax,P=e==null?void 0:e.surcharge,[F,H]=ia(!1),[Z,qe]=ia(!1),[G,z]=ia({}),[J,ye]=ia(null),[v,de]=ia({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),[te,M]=ia(""),[C,V]=ia(!1),[h,me]=ia(null),zt=x=>/^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(x),ve=/[+-]?([0-9]*[.])?[0-9]+/,Ne=x=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x),st=x=>/^[A-Za-z\s]*$/.test(x),He=()=>{H(!1),z({})},xt=()=>H(!0),ce=()=>{it(h),V(!1)};function Me(){de({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),M("")}function it(x){let s={type:"preview.compiledcheck",other:L(w({},x),{status:!0})};window.parent.postMessage(s,"*")}let Ft=async x=>{if(x.currentTarget.blur(),!Z&&!(Object.keys(G).length>0)){if(z({}),!(v!=null&&v.email)&&J&&!zt(J)){z(s=>L(w({},s),{phone:tn.phonenumbervalid}));return}if(W())try{qe(!0);let s={fractalpayPublicKey:t,amount:te,phone_number:J,order_id:v.order_id,action:"request",name:v.name,email:v.email,customer_id:e!=null&&e.customerId?e==null?void 0:e.customerId:"",discount:q,surcharge:P,tax:I,require_3ds:e==null?void 0:e.require_3ds},N=await Xi.post(`${lt}send-request-pre-auth-payment`,s,{headers:w({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})});(N==null?void 0:N.status)===200&&(V(!0),H(!1),Me(),me(N==null?void 0:N.data)),qe(!1)}catch(s){console.log(s),qe(!1)}}},Dt=lt+"images/logo-img.png",O=x=>{let{value:s}=x.target,N=x.target.dataset.token;if(de(L(w({},v),{[N]:s})),N==="name"&&!st(s)){z(E=>L(w({},E),{[N]:tn.onlylettersallowed}));return}let T=G;N==="email"&&!J&&(delete T.phone,z(T)),s&&(delete T[N],z(T)),N==="email"&&!s&&(delete T[N],z(T))},Je=x=>{let{value:s}=x;if(Number(s)>0){let N=G;delete N.amount,z(N)}M(s)},W=()=>{let x={};return te||(x.amount=tn.amountrequired),v.email&&!Ne(v==null?void 0:v.email)&&(x.email=tn.invalidemail),!J&&!(v!=null&&v.email)&&(x.phone=tn.phoneoremailrequired),!J&&!(v!=null&&v.email)&&(x.email=tn.phoneoremailrequired),!J&&v.email&&!Ne(v==null?void 0:v.email)&&(x.email=tn.invalidemail),e.from==="merchant"&&!v.order_id&&(x.order_id=tn.orderidrequired),z(x),Object.keys(x).length===0};Qi(()=>{e&&(de(x=>L(w({},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:""})),M(e.amount?e.amount:""),ye(e.phone?`${e.phone}`:null))},[e]);let B=x=>{let s=x==null?void 0:x.value;if(s&&(s==null?void 0:s.length)>0&&(s==null?void 0:s.length)!==10){z(T=>L(w({},T),{phone:tn.phonenumberlength})),ye(s);return}else ye(s);let N=G;delete N.phone,s&&!(v!=null&&v.email)&&delete N.email,z(N)};function i(x){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(x))}return K.createElement(K.Fragment,null,K.createElement(Ta,null),K.createElement(dn,{loading:Z}),K.createElement(K.Fragment,null,K.createElement("button",{className:"paymentBtn",onClick:xt},"Send Request"),K.createElement("div",{className:"frac-form"},K.createElement(wn,{open:F,onClose:()=>H(!1),maxWidth:"500px"},K.createElement("div",{className:"request-payment-amount-detail"},K.createElement("p",{className:"request-payment-merchantname"},"Authorization Request"),K.createElement("p",{className:"request-payment-pre-auth-merchantname"},"Pay ",e==null?void 0:e.webname),K.createElement("p",{className:"request-payment-amount"},i(e==null?void 0:e.amount)),(e==null?void 0:e.from)==="merchant"&&K.createElement("p",{className:"request-payment-orderid"},v==null?void 0:v.order_id),K.createElement("span",{className:"request-payment-close-popup",onClick:He},K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},K.createElement("g",{clipPath:"url(#clip0_12425_52336)"},K.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"})),K.createElement("defs",null,K.createElement("clipPath",{id:"clip0_12425_52336"},K.createElement("rect",{width:"16",height:"16",fill:"white"})))))),K.createElement("form",{className:"request-payment-input-form"},K.createElement("div",{className:"request-payment-list-div"},K.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"FULL NAME"),K.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Full Name","data-token":"name",onChange:O,value:v==null?void 0:v.name}),G.name&&K.createElement("small",{className:"request-payment-error-msg"},G.name)),K.createElement("div",{className:"request-payment-list-div"},K.createElement("label",{htmlFor:"requestPhoneNumber",className:"request-payment-input-label"},"Phone Number"),K.createElement(Di,{className:"request-payment-input-box",placeholder:"Mobile number",format:"+1 (###) ###-####",value:J,onValueChange:x=>{B(x)}}),G.phone&&K.createElement("small",{className:"request-payment-error-msg"},G.phone)),K.createElement("div",{className:"request-payment-list-div"},K.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"EMAIL"),K.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Email",onChange:O,"data-token":"email",value:v==null?void 0:v.email}),G.email&&K.createElement("small",{className:"request-payment-error-msg"},G.email)),K.createElement("button",{type:"button",className:"request-payment-submit-button",onClick:Ft,disabled:Z},Z?"Loading...":"Send Request"),K.createElement("div",{className:"request-payment-fractal-powerd-by"},K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},K.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 ",K.createElement("span",null,"Fractal"),K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}),K.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"}))))),K.createElement(wn,{open:C,onClose:ce,maxWidth:"500px"},K.createElement("div",{className:"fractal-popup-content",style:{padding:"0px",maxWidth:"500px"}},K.createElement("div",{className:"request-payment-success-container"},K.createElement("span",{className:"request-payment-close-popup",onClick:ce},K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},K.createElement("g",{clipPath:"url(#clip0_12425_52336)"},K.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"})),K.createElement("defs",null,K.createElement("clipPath",{id:"clip0_12425_52336"},K.createElement("rect",{width:"16",height:"16",fill:"white"}))))),K.createElement("div",{className:"request-payment-success-tick-div"},K.createElement("div",{className:"request-payment-success-tick"},K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},K.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"})))),K.createElement("h6",{className:"request-payment-success-text"},"The request ",K.createElement("br",null),"was sent"),K.createElement("h6",{className:"request-payment-success-subtext"},"Please wait for the customer to pay"),K.createElement("div",{className:"request-payment-success-btn-div"},K.createElement("button",{onClick:ce,className:"request-payment-success-btn2"},"Close"))))))))}import a,{useEffect as Ka,useRef as uo,useState as jt}from"react";import eo from"react";function ma(){let e="#000",t="#fff",q="#212529",I="#dee2e6";return eo.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: ${q};
|
|
880
|
-
-webkit-appearance: none;
|
|
881
|
-
-moz-appearance: none;
|
|
882
|
-
appearance: none;
|
|
883
|
-
background-color: ${t};
|
|
884
|
-
background-clip: padding-box;
|
|
885
|
-
border: 1px solid ${I};
|
|
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 ${I};
|
|
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 ${I};
|
|
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 ${I};
|
|
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
|
-
#paymentForm .form-group{
|
|
975
|
-
padding:5px 0 ;
|
|
976
|
-
matgin: 0 !important
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
.toggle-label {
|
|
980
|
-
position: relative;
|
|
981
|
-
display: inline-block;
|
|
982
|
-
width: 40px;
|
|
983
|
-
height: 24px;
|
|
984
|
-
background-color: #ccc;
|
|
985
|
-
border-radius: 12px;
|
|
986
|
-
cursor: pointer;
|
|
987
|
-
transition: background-color 0.3s;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
.toggle-label::before {
|
|
991
|
-
content: "";
|
|
992
|
-
position: absolute;
|
|
993
|
-
top: 2px;
|
|
994
|
-
left: 2px;
|
|
995
|
-
width: 20px;
|
|
996
|
-
height: 20px;
|
|
997
|
-
background: #ffffff;
|
|
998
|
-
border-radius: 50%;
|
|
999
|
-
transition: left 300ms linear;
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
.toggle-checkbox {
|
|
1003
|
-
display: none;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
.toggle-checkbox:checked + .toggle-label {
|
|
1007
|
-
background-color: #4caf50;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
.toggle-checkbox:checked + .toggle-label::before {
|
|
1011
|
-
left: 18px;
|
|
1012
|
-
}
|
|
1013
|
-
.ach-scrl {
|
|
1014
|
-
max-height: 380px;
|
|
1015
|
-
min-height: 380px;
|
|
1016
|
-
overflow-y: auto;
|
|
1017
|
-
padding-right: 6px;
|
|
1018
|
-
}
|
|
1019
|
-
.mb-4{
|
|
1020
|
-
margin-bottom:4px
|
|
1021
|
-
}
|
|
1022
|
-
.ach-scrl::-webkit-scrollbar {
|
|
1023
|
-
width: 3px;
|
|
1024
|
-
background-color: #F5F5F5;
|
|
1025
|
-
}
|
|
1026
|
-
.ach-scrl::-webkit-scrollbar-thumb {
|
|
1027
|
-
background-color: #35254D;
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
.error-span{
|
|
1031
|
-
color:red !important;
|
|
1032
|
-
font-size:12px !important;
|
|
1033
|
-
text-align: left !important;
|
|
1034
|
-
width: 100% !important;
|
|
1035
|
-
display: block;
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
.charge-customer-name{
|
|
1039
|
-
color: #161616;
|
|
1040
|
-
font-family: Inter;
|
|
1041
|
-
font-size: 24px;
|
|
1042
|
-
font-style: normal;
|
|
1043
|
-
font-weight: 600;
|
|
1044
|
-
line-height: 32px;
|
|
1045
|
-
letter-spacing: -0.48px;
|
|
1046
|
-
text-transform: capitalize;
|
|
1047
|
-
margin-top:0;
|
|
1048
|
-
margin-bottom:16px !important;
|
|
1049
|
-
text-align:left !important
|
|
1050
|
-
}
|
|
1051
|
-
.card-ach-heading {
|
|
1052
|
-
color: #727272;
|
|
1053
|
-
font-family: Inter;
|
|
1054
|
-
font-size: 12px;
|
|
1055
|
-
font-style: normal;
|
|
1056
|
-
font-weight: 500;
|
|
1057
|
-
line-height: 18px;
|
|
1058
|
-
letter-spacing: -0.24px;
|
|
1059
|
-
margin : 0 0 10px !important;
|
|
1060
|
-
text-align : left
|
|
1061
|
-
}
|
|
1062
|
-
.card-list-div{
|
|
1063
|
-
max-height : 190px;
|
|
1064
|
-
overflow-y : auto;
|
|
1065
|
-
border:1px solid #E0DFE2;
|
|
1066
|
-
border-radius : 8px
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
.card-list-div::-webkit-scrollbar{
|
|
1071
|
-
width:2px;
|
|
1072
|
-
background-color:#F5F5F5
|
|
1073
|
-
}
|
|
1074
|
-
.card-list-div::-webkit-scrollbar-thumb{
|
|
1075
|
-
background-color:#35254D
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
.card-list-single-div{
|
|
1079
|
-
border-bottom: 1px solid #E0DFE2;
|
|
1080
|
-
padding : 8px 11px;
|
|
1081
|
-
display : flex ;
|
|
1082
|
-
align-items:center;
|
|
1083
|
-
justify-content : space-between;
|
|
1084
|
-
gap:12px
|
|
1085
|
-
}
|
|
1086
|
-
.card-list-single-div:last-child {
|
|
1087
|
-
border-bottom: none;
|
|
1088
|
-
}
|
|
1089
|
-
.card-lint-div-in{
|
|
1090
|
-
min-height:444px}
|
|
1091
|
-
.card-number-radio{
|
|
1092
|
-
display:flex;
|
|
1093
|
-
gap:12px;
|
|
1094
|
-
}
|
|
1095
|
-
.card-number-radio .card-number-last-four{
|
|
1096
|
-
color:#161616 !important;
|
|
1097
|
-
font-family:Inter !important;
|
|
1098
|
-
font-size:14px !important;
|
|
1099
|
-
font-weight:500 !important;
|
|
1100
|
-
font-style:normal !important;
|
|
1101
|
-
line-height : 18px !important;
|
|
1102
|
-
latter-spacing:-0.18px !important
|
|
1103
|
-
}
|
|
1104
|
-
.card-expiry-date{
|
|
1105
|
-
margin:0;
|
|
1106
|
-
color:#00000080;
|
|
1107
|
-
font-family:Inter;
|
|
1108
|
-
font-size:14px;
|
|
1109
|
-
font-weight:500;
|
|
1110
|
-
font-style"normal;
|
|
1111
|
-
line-height : 18px;
|
|
1112
|
-
latter-spacing:-0.18px
|
|
1113
|
-
}
|
|
1114
|
-
.pay-with-other-card {
|
|
1115
|
-
margin-top : 12px;
|
|
1116
|
-
padding:12px 32px;
|
|
1117
|
-
border :1px solid #E0DFE2;
|
|
1118
|
-
border-radius : 1000px;
|
|
1119
|
-
display: flex;
|
|
1120
|
-
justify-content : center;
|
|
1121
|
-
align-items:center;
|
|
1122
|
-
gap:10px;
|
|
1123
|
-
// width:100%;
|
|
1124
|
-
background:white;
|
|
1125
|
-
cursor:pointer;
|
|
1126
|
-
color:#161616;
|
|
1127
|
-
text-align:center
|
|
1128
|
-
font-family: Inter;
|
|
1129
|
-
font-size: 14px;
|
|
1130
|
-
font-style: normal;
|
|
1131
|
-
font-weight: 500;
|
|
1132
|
-
line-height: 24px;
|
|
1133
|
-
letter-spacing: -0.28px;
|
|
1134
|
-
// margin-bottom: 50px;
|
|
1135
|
-
}
|
|
1136
|
-
.charge-payment-back-btn {
|
|
1137
|
-
display: flex;
|
|
1138
|
-
padding: 5px 10px;
|
|
1139
|
-
align-items: center;
|
|
1140
|
-
gap: 6px;
|
|
1141
|
-
border-radius: 1000px;
|
|
1142
|
-
border: 1px solid #E0DFE2;
|
|
1143
|
-
background: #FFF;
|
|
1144
|
-
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
1145
|
-
font-size:16px;
|
|
1146
|
-
cursor:pointer;
|
|
1147
|
-
color:black
|
|
1148
|
-
}
|
|
1149
|
-
.res-charge-payment-back-btn{
|
|
1150
|
-
padding: 9px 16px;
|
|
1151
|
-
align-items: center;
|
|
1152
|
-
gap: 6px;
|
|
1153
|
-
margin-bottom: 20px;
|
|
1154
|
-
border-radius: 1000px;
|
|
1155
|
-
border: 1px solid #E0DFE2;
|
|
1156
|
-
background: #FFF;
|
|
1157
|
-
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
1158
|
-
font-size:16px;
|
|
1159
|
-
curso:pointer;
|
|
1160
|
-
color:black;
|
|
1161
|
-
display:none
|
|
1162
|
-
}
|
|
1163
|
-
.btn {
|
|
1164
|
-
padding: 11px 23px;
|
|
1165
|
-
background-color: black;
|
|
1166
|
-
color: white;
|
|
1167
|
-
border: none;
|
|
1168
|
-
border-radius: 6px;
|
|
1169
|
-
font-weight: bold;
|
|
1170
|
-
margin: 0 10px;
|
|
1171
|
-
cursor: pointer;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
.custom-swal-icon {
|
|
1175
|
-
margin: 20px auto;
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
.custom-swal-popup {
|
|
1179
|
-
font-size: 16px;
|
|
1180
|
-
text-align: center;
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
.frac-form .res-pay-con{
|
|
1184
|
-
display:none
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
.frac-cash-discount{
|
|
1188
|
-
border-radius: 8px;
|
|
1189
|
-
background: #F6F6F7;
|
|
1190
|
-
justify-content: space-between;
|
|
1191
|
-
align-items: center;
|
|
1192
|
-
display: flex;
|
|
1193
|
-
padding: 9px 14px 9px 10px;
|
|
1194
|
-
font-family: Inter;
|
|
1195
|
-
color: #161616;
|
|
1196
|
-
font-style: normal;
|
|
1197
|
-
font-weight: 500;
|
|
1198
|
-
font-size: 14px;
|
|
1199
|
-
margin: 12px 0;
|
|
1200
|
-
}
|
|
1201
|
-
.frac-cash-discount .frac-cashlabel{
|
|
1202
|
-
color: #727272;
|
|
1203
|
-
font-size: 12px;
|
|
1204
|
-
font-style: normal;
|
|
1205
|
-
font-weight: 500;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
frac-tooltip-wrapper {
|
|
1209
|
-
position: absolute;
|
|
1210
|
-
right:0;
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
.frac-tooltip-icon {
|
|
1214
|
-
cursor: pointer;
|
|
1215
|
-
}
|
|
1216
|
-
.frac-tooltip-mn{
|
|
1217
|
-
position:relative;
|
|
1218
|
-
}
|
|
1219
|
-
.frac-tooltip-text {
|
|
1220
|
-
display: none;
|
|
1221
|
-
position: absolute;
|
|
1222
|
-
top:-15px;
|
|
1223
|
-
right: 22px;
|
|
1224
|
-
background: #161616;
|
|
1225
|
-
color: white;
|
|
1226
|
-
padding: 15px;
|
|
1227
|
-
border-radius: 10px;
|
|
1228
|
-
width: 200px;
|
|
1229
|
-
font-size:12px;
|
|
1230
|
-
word-break: break-word;
|
|
1231
|
-
white-space: normal;
|
|
1232
|
-
z-index: 999;
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
.frac-tooltip-wrapper:hover .frac-tooltip-text {
|
|
1236
|
-
display: block;
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
.frac-tooltip-text p,.frac-tooltip-text b {
|
|
1240
|
-
font-size : 12px !important;
|
|
1241
|
-
line-height : 1.5 !important;
|
|
1242
|
-
margin-bottom : 10px !important;
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
@media (max-width: 768px) {
|
|
1246
|
-
.parent-pay-container{
|
|
1247
|
-
padding: 20px 5%;
|
|
1248
|
-
}
|
|
1249
|
-
.pay-container {
|
|
1250
|
-
grid-template-columns: 1fr;
|
|
1251
|
-
padding: 10px 5%;
|
|
1252
|
-
border:1px solid #E0DFE2;
|
|
1253
|
-
border-radius : 12px;
|
|
1254
|
-
gap:24px;
|
|
1255
|
-
}
|
|
1256
|
-
.pay-conatiner-one{
|
|
1257
|
-
border-right: none;
|
|
1258
|
-
}
|
|
1259
|
-
.pay-conatiner-one-first{
|
|
1260
|
-
min-height:0
|
|
1261
|
-
}
|
|
1262
|
-
.pay-main-logo > img{
|
|
1263
|
-
display: none;
|
|
1264
|
-
}
|
|
1265
|
-
.pay-main-logo-res > img {
|
|
1266
|
-
display:block;
|
|
1267
|
-
margin:auto
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
.pay-logo-container{
|
|
1271
|
-
border :none
|
|
1272
|
-
}
|
|
1273
|
-
// .res-charge-payment-back-btn {
|
|
1274
|
-
// display:flex !important
|
|
1275
|
-
// }
|
|
1276
|
-
// .charge-payment-back-btn{
|
|
1277
|
-
// display:none !important
|
|
1278
|
-
// }
|
|
1279
|
-
.fractal-popup-content{
|
|
1280
|
-
width: 90%;
|
|
1281
|
-
}
|
|
1282
|
-
// .frac-form .res-pay-con{
|
|
1283
|
-
// display:flex;
|
|
1284
|
-
// justify-content :space-between;
|
|
1285
|
-
// align-items:center;
|
|
1286
|
-
// padding-bottom : 10px
|
|
1287
|
-
// }
|
|
1288
|
-
// .frac-form .amt-pay-con{
|
|
1289
|
-
// display:none
|
|
1290
|
-
// }
|
|
1291
|
-
.pay-conatiner-one-last{
|
|
1292
|
-
display:none}
|
|
1293
|
-
.pay-conatiner-two{
|
|
1294
|
-
padding:0
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
}
|
|
1299
|
-
.amt-pay-con {
|
|
1300
|
-
padding-right: 24px;
|
|
1301
|
-
}
|
|
1302
|
-
@media (max-width : 512px){
|
|
1303
|
-
.tab button {
|
|
1304
|
-
padding: 6px 16px;
|
|
1305
|
-
}
|
|
1306
|
-
.amt-pay-con {
|
|
1307
|
-
padding-right: 0;
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
.frac-cash-discount-fee {
|
|
1313
|
-
display: flex;
|
|
1314
|
-
padding: 11px;
|
|
1315
|
-
justify-content: space-between;
|
|
1316
|
-
align-items: center;
|
|
1317
|
-
align-self: stretch;
|
|
1318
|
-
border-radius: 8px;
|
|
1319
|
-
border: 1px solid #E0DFE2;
|
|
1320
|
-
background: #F6F6F7;
|
|
1321
|
-
margin-top: 24px;
|
|
1322
|
-
}
|
|
1323
|
-
.frac-cash-discount-fee small {
|
|
1324
|
-
color:#727272;
|
|
1325
|
-
font-size: 12px;
|
|
1326
|
-
font-weight: 500;
|
|
1327
|
-
}
|
|
1328
|
-
.frac-cash-discount-fee p{
|
|
1329
|
-
margin:0px;
|
|
1330
|
-
font-size: 14px;
|
|
1331
|
-
font-weight: 500;
|
|
1332
|
-
}
|
|
1333
|
-
.frac-card-payment-heading {
|
|
1334
|
-
font-size: 24px;
|
|
1335
|
-
font-style: normal;
|
|
1336
|
-
font-weight: 600;
|
|
1337
|
-
margin:0px;
|
|
1338
|
-
}
|
|
1339
|
-
.exp-date-year-container .form-group {
|
|
1340
|
-
padding: 0px !important;
|
|
1341
|
-
}
|
|
1342
|
-
.frac-heading-card-wrap {
|
|
1343
|
-
display: flex;
|
|
1344
|
-
align-items: center;
|
|
1345
|
-
margin-bottom:12px;
|
|
1346
|
-
}
|
|
1347
|
-
.frac-backarrow {
|
|
1348
|
-
margin-right: 10px;
|
|
1349
|
-
}
|
|
1350
|
-
.frac-charge-payment-back-btn-wrap , .frac-tab-2{
|
|
1351
|
-
display: none;
|
|
1352
|
-
}
|
|
1353
|
-
.frac-pay-conatiner-one{
|
|
1354
|
-
display: flex;
|
|
1355
|
-
flex-direction: column;
|
|
1356
|
-
justify-content: space-between;
|
|
1357
|
-
min-height: auto;
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
.frac-partial-payment-input{
|
|
1361
|
-
margin-top: 12px !important;
|
|
1362
|
-
}
|
|
1363
|
-
div#cvv {
|
|
1364
|
-
border-top-left-radius: 0;
|
|
1365
|
-
border-bottom-left-radius: 0;
|
|
1366
|
-
border-top: 0;
|
|
1367
|
-
border-bottom: 0;
|
|
1368
|
-
border-right: 0;
|
|
1369
|
-
}
|
|
1370
|
-
div#exp_year {
|
|
1371
|
-
height: 36px;
|
|
1372
|
-
width: calc(100% + 1px);
|
|
1373
|
-
border-radius: 0;
|
|
1374
|
-
border-top: 0;
|
|
1375
|
-
border-bottom: 0;
|
|
1376
|
-
border-right: 1px solid #dee2e6;
|
|
1377
|
-
}
|
|
1378
|
-
div#exp_month {
|
|
1379
|
-
width: calc(100% + 1px);
|
|
1380
|
-
border-top-right-radius: 0;
|
|
1381
|
-
border-bottom-right-radius: 0;
|
|
1382
|
-
border: 0;
|
|
1383
|
-
border-right: 1px solid #dee2e6;
|
|
1384
|
-
}
|
|
1385
|
-
`)}import Na from"axios";import St from"react";import to from"react";function Oa(){return to.createElement("style",null,`
|
|
1386
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
1387
|
-
|
|
1388
|
-
body{
|
|
1389
|
-
display: flex;
|
|
1390
|
-
justify-content: center;
|
|
1391
|
-
align-items: center;
|
|
1392
|
-
padding-top: 30px;
|
|
1393
|
-
margin: 0;
|
|
1394
|
-
/* background-color: #f8f9fa; */
|
|
1395
|
-
flex-direction: column;
|
|
1396
|
-
}
|
|
1397
|
-
.payment-msg-container{
|
|
1398
|
-
min-height : 550px
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
.logo-container {
|
|
1402
|
-
display: flex;
|
|
1403
|
-
justify-content: center;
|
|
1404
|
-
align-items: center;
|
|
1405
|
-
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1406
|
-
z-index: 10;
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
.client-logo {
|
|
1410
|
-
max-width: 100px;
|
|
1411
|
-
height: auto;
|
|
1412
|
-
object-fit: contain;
|
|
1413
|
-
display: block;
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
.payment-success-container {
|
|
1417
|
-
display: flex;
|
|
1418
|
-
flex-direction: column;
|
|
1419
|
-
align-items: center;
|
|
1420
|
-
padding: 18px 20px 24px;
|
|
1421
|
-
width: 335px;
|
|
1422
|
-
height: 400px; /* Fixed height */
|
|
1423
|
-
background: #ffffff;
|
|
1424
|
-
border-radius: 12px;
|
|
1425
|
-
position: relative;
|
|
1426
|
-
/* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1427
|
-
border: 1px solid #e3e3e3; */
|
|
1428
|
-
justify-content: center;
|
|
1429
|
-
text-align: center;
|
|
1430
|
-
margin-top: 50px; /* Adjust this to move the content down */
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
|
-
.success-icon {
|
|
1434
|
-
display: flex;
|
|
1435
|
-
flex-direction: column;
|
|
1436
|
-
align-items: center;
|
|
1437
|
-
gap: 12px;
|
|
1438
|
-
width: 227px;
|
|
1439
|
-
height: 116px;
|
|
1440
|
-
z-index: 2;
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
.circle {
|
|
1444
|
-
width: 40px;
|
|
1445
|
-
height: 40px;
|
|
1446
|
-
border: 1px solid #49b182;
|
|
1447
|
-
border-radius: 50%;
|
|
1448
|
-
display: flex;
|
|
1449
|
-
justify-content: center;
|
|
1450
|
-
align-items: center;
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
.circle .fa-check-circle {
|
|
1454
|
-
font-size: 20px;
|
|
1455
|
-
color: #49b182;
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
.success-text {
|
|
1459
|
-
display: flex;
|
|
1460
|
-
flex-direction: column;
|
|
1461
|
-
justify-content: center;
|
|
1462
|
-
align-items: center;
|
|
1463
|
-
gap: 4px;
|
|
1464
|
-
width: 227px;
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
.payment-success-text {
|
|
1468
|
-
font-family: "Inter", sans-serif;
|
|
1469
|
-
font-weight: 500;
|
|
1470
|
-
font-size: 18px;
|
|
1471
|
-
line-height: 21px;
|
|
1472
|
-
text-align: center;
|
|
1473
|
-
letter-spacing: -0.02em;
|
|
1474
|
-
color: #161616;
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
.thank-you-text {
|
|
1478
|
-
font-family: "Inter", sans-serif;
|
|
1479
|
-
font-weight: 500;
|
|
1480
|
-
font-size: 14px;
|
|
1481
|
-
line-height: 18px;
|
|
1482
|
-
text-align: center;
|
|
1483
|
-
letter-spacing: -0.02em;
|
|
1484
|
-
color: #161616;
|
|
1485
|
-
opacity: 0.5;
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
.charge-payment-success-tick-div {
|
|
1489
|
-
display: flex;
|
|
1490
|
-
justify-content: center;
|
|
1491
|
-
align-items: center;
|
|
1492
|
-
margin-top: 32px;
|
|
1493
|
-
}
|
|
1494
|
-
.charge-payment-success-tick {
|
|
1495
|
-
border-radius: 1000px;
|
|
1496
|
-
background: rgba(97, 198, 153, 0.14);
|
|
1497
|
-
display: flex;
|
|
1498
|
-
width: 60px;
|
|
1499
|
-
height: 60px;
|
|
1500
|
-
justify-content: center;
|
|
1501
|
-
align-items: center;
|
|
1502
|
-
}
|
|
1503
|
-
.charge-payment-success-text {
|
|
1504
|
-
color: #161616;
|
|
1505
|
-
text-align: center;
|
|
1506
|
-
font-family: Inter;
|
|
1507
|
-
font-size: 32px;
|
|
1508
|
-
font-style: normal;
|
|
1509
|
-
font-weight: 500;
|
|
1510
|
-
line-height: 36px;
|
|
1511
|
-
letter-spacing: -0.64px;
|
|
1512
|
-
margin-top: 20px;
|
|
1513
|
-
margin-bottom: 5px !important;
|
|
1514
|
-
}
|
|
1515
|
-
.charge-payment-success-container {
|
|
1516
|
-
display: flex;
|
|
1517
|
-
padding: 120px 48px 32px 48px;
|
|
1518
|
-
flex-direction: column;
|
|
1519
|
-
justify-content: center;
|
|
1520
|
-
align-items: center;
|
|
1521
|
-
}
|
|
1522
|
-
.charge-payment-success-subtext {
|
|
1523
|
-
color: #727272;
|
|
1524
|
-
text-align: center;
|
|
1525
|
-
font-family: Inter;
|
|
1526
|
-
font-size: 14px;
|
|
1527
|
-
font-style: normal;
|
|
1528
|
-
font-weight: 500;
|
|
1529
|
-
line-height: 18px; /* 128.571% */
|
|
1530
|
-
letter-spacing: -0.28px;
|
|
1531
|
-
margin:14px 0 !important
|
|
1532
|
-
|
|
1533
|
-
}
|
|
1534
|
-
.charge-success-payment-button-div {
|
|
1535
|
-
display: flex;
|
|
1536
|
-
gap: 10px;
|
|
1537
|
-
align-items: baseline;
|
|
1538
|
-
}
|
|
1539
|
-
.charge-success-btn1 {
|
|
1540
|
-
display: flex;
|
|
1541
|
-
padding: 9px 16px;
|
|
1542
|
-
align-items: center;
|
|
1543
|
-
gap: 6px;
|
|
1544
|
-
border-radius: 1000px;
|
|
1545
|
-
border: 1px solid #e0dfe2;
|
|
1546
|
-
background: #fff;
|
|
1547
|
-
color: #161616;
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1550
|
-
.charge-payment-success-btn-div {
|
|
1551
|
-
display: flex;
|
|
1552
|
-
align-items: flex-start;
|
|
1553
|
-
justify-content: center;
|
|
1554
|
-
gap: 8px;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
.charge-payment-success-btn1 {
|
|
1558
|
-
cursor: pointer;
|
|
1559
|
-
border-radius: 80px;
|
|
1560
|
-
border: 1px solid #e0dfe2;
|
|
1561
|
-
display: flex;
|
|
1562
|
-
padding: 12px 32px;
|
|
1563
|
-
justify-content: center;
|
|
1564
|
-
align-items: center;
|
|
1565
|
-
gap: 6px;
|
|
1566
|
-
background-color: #fff;
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
.charge-payment-success-btn2 {
|
|
1570
|
-
border-radius: 80px;
|
|
1571
|
-
cursor: pointer;
|
|
1572
|
-
border: 1px solid #e0dfe2;
|
|
1573
|
-
display: flex;
|
|
1574
|
-
padding: 12px 32px;
|
|
1575
|
-
justify-content: center;
|
|
1576
|
-
align-items: center;
|
|
1577
|
-
gap: 6px;
|
|
1578
|
-
background-color: #161616;
|
|
1579
|
-
color: #fff;
|
|
1580
|
-
}`)}function oa(e,t,q){e.preventDefault();let P={type:"preview.compiledcheck",other:{msg:"Payment success!",status:t==="close",data:{tran_id:q,key:t}}};console.log("message:",P),window.parent.postMessage(P,"*")}function ca({onClose:e,tranId:t}){return St.createElement(St.Fragment,null,St.createElement(Oa,null),St.createElement("div",{className:"payment-msg-container"},St.createElement("div",{className:"charge-payment-success-container"},St.createElement("div",{className:"charge-payment-success-tick-div"},St.createElement("div",{className:"charge-payment-success-tick"},St.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},St.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"})))),St.createElement("h6",{className:"charge-payment-success-text"},"Your charge",St.createElement("br",null),"was successful"),St.createElement("h6",{className:"charge-payment-success-subtext"},"We\u2019ve processed your charge"),St.createElement("div",{className:"charge-success-payment-button-div"},St.createElement("button",{className:"charge-success-btn1",onClick:q=>oa(q,"print",t)},St.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},St.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"}),St.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"),St.createElement("button",{className:"charge-success-btn1",onClick:q=>oa(q,"share",t)},St.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},St.createElement("g",{clipPath:"url(#clip0_12420_50683)"},St.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"})),St.createElement("defs",null,St.createElement("clipPath",{id:"clip0_12420_50683"},St.createElement("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.5)"})))),"Send receipt"))),St.createElement("div",{className:"charge-payment-success-btn-div"},St.createElement("button",{className:"charge-payment-success-btn1",onClick:q=>oa(q,"tran",t)},"Go to Transactions"),St.createElement("button",{className:"charge-payment-success-btn2",onClick:q=>{e(),oa(q,"close",t)}},"Close"))))}import wa from"sweetalert2";import{IoArrowBack as Ba}from"react-icons/io5";import{useEffect as bi}from"react";function Pn(){return bi(()=>{let e=sa;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=q=>{console.error("\u274C Failed to load Datacap script",q)},document.head.appendChild(t)}},[]),bi(()=>{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 Mn from"react";import no from"react";function Ea(){return no.createElement("style",null,`
|
|
1581
|
-
.card-error .logo-container {
|
|
1582
|
-
display: flex;
|
|
1583
|
-
justify-content: center;
|
|
1584
|
-
align-items: center;
|
|
1585
|
-
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1586
|
-
z-index: 10;
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
.card-error .client-logo {
|
|
1590
|
-
max-width: 100px;
|
|
1591
|
-
height: auto;
|
|
1592
|
-
object-fit: contain;
|
|
1593
|
-
display: block;
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
.card-error .payment-error-container {
|
|
1597
|
-
display: flex;
|
|
1598
|
-
flex-direction: column;
|
|
1599
|
-
align-items: center;
|
|
1600
|
-
padding: 18px 20px 24px;
|
|
1601
|
-
// width: 335px;
|
|
1602
|
-
min-height: 250px; /* Fixed height */
|
|
1603
|
-
background: #FFFFFF;
|
|
1604
|
-
border-radius: 12px;
|
|
1605
|
-
position: relative;
|
|
1606
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1607
|
-
border: 1px solid #e3e3e3;
|
|
1608
|
-
justify-content: center;
|
|
1609
|
-
text-align: center;
|
|
1610
|
-
// margin-top: 50px; /* Adjust this to move the content down */
|
|
1611
|
-
margin: 50px auto 0 auto !important;
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
|
-
.card-error .error-icon {
|
|
1615
|
-
display: flex;
|
|
1616
|
-
flex-direction: column;
|
|
1617
|
-
align-items: center;
|
|
1618
|
-
gap: 12px;
|
|
1619
|
-
min-height: 116px;
|
|
1620
|
-
z-index: 2;
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
.card-error .circle {
|
|
1624
|
-
width: 50px;
|
|
1625
|
-
height: 50px;
|
|
1626
|
-
border: 1px solid red;
|
|
1627
|
-
border-radius: 50%;
|
|
1628
|
-
display: flex;
|
|
1629
|
-
justify-content: center;
|
|
1630
|
-
align-items: center;
|
|
1631
|
-
margin-bottom:20px
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
.card-error .circle .fa-times {
|
|
1635
|
-
font-size: 30px;
|
|
1636
|
-
color: red;
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
.card-error .error-text {
|
|
1640
|
-
display: flex;
|
|
1641
|
-
flex-direction: column;
|
|
1642
|
-
justify-content: center;
|
|
1643
|
-
align-items: center;
|
|
1644
|
-
gap: 4px;
|
|
1645
|
-
// width: 227px;
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
.card-error .payment-error-text {
|
|
1649
|
-
font-family: 'Inter', sans-serif;
|
|
1650
|
-
font-weight: 500;
|
|
1651
|
-
font-size: 18px;
|
|
1652
|
-
line-height: 21px;
|
|
1653
|
-
text-align: center;
|
|
1654
|
-
letter-spacing: -0.02em;
|
|
1655
|
-
color: #161616;
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
.card-error .thank-you-text {
|
|
1659
|
-
font-family: 'Inter', sans-serif;
|
|
1660
|
-
font-weight: 500;
|
|
1661
|
-
font-size: 16px;
|
|
1662
|
-
line-height: 18px;
|
|
1663
|
-
text-align: center;
|
|
1664
|
-
letter-spacing: -0.02em;
|
|
1665
|
-
color: #161616 !important;
|
|
1666
|
-
opacity: 0.5;
|
|
1667
|
-
padding-top:10px
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
.card-error .error-btn-div{
|
|
1671
|
-
padding-top:30px;
|
|
1672
|
-
|
|
1673
|
-
}
|
|
1674
|
-
.card-error .error-btn-div button{
|
|
1675
|
-
border-radius: 0.25em;
|
|
1676
|
-
border:none;
|
|
1677
|
-
background: initial;
|
|
1678
|
-
background-color: #7066e0;
|
|
1679
|
-
box-shadow: var(--swal2-confirm-button-box-shadow);
|
|
1680
|
-
color: white;
|
|
1681
|
-
font-size: 1em;
|
|
1682
|
-
padding:10px 17px;
|
|
1683
|
-
cursor:pointer;
|
|
1684
|
-
}
|
|
1685
|
-
`)}var ao=({onClose:e,error:t})=>Mn.createElement(Mn.Fragment,null,Mn.createElement(Ea,null),Mn.createElement("div",{className:"card-error"},Mn.createElement("div",{className:"payment-error-container"},Mn.createElement("div",{className:"error-icon"},Mn.createElement("div",{className:"circle"},Mn.createElement("i",{className:"fa fa-times","aria-hidden":"true"})),Mn.createElement("div",{className:"error-text"},Mn.createElement("div",{className:"payment-error-text"},t),Mn.createElement("div",{className:"thank-you-text"},"Try again later ")),Mn.createElement("div",{className:"error-btn-div"},Mn.createElement("button",{onClick:e},"OK")))))),zn=ao;import{io}from"socket.io-client";var oo=io(lt,{transports:["websocket"],withCredentials:!1}),Et=oo;import Un from"react";var Ln=e=>Un.createElement(Un.Fragment,null,Un.createElement("div",{className:`frac-card-bank-radio ${e.activetab===e.value?"frac-active":""}`,onClick:()=>e.onChange(e.value),role:"radio"},Un.createElement("div",{className:"frac-card-title-main"},Un.createElement("img",{src:e.label.toLowerCase()==="card"?Ca:e.label.toLowerCase()==="reader"?Ia:fi,className:"frac-payment-type-logo",alt:""}),Un.createElement("div",{className:"frac-card-label"},Un.createElement("div",{className:"frac-card-label-text"},e.label),Un.createElement("div",{className:"frac-card-label-amount"},ge(e.amount)))),Un.createElement("div",null,Un.createElement("input",{name:"paymenttype",checked:e.activetab===e.value,type:"radio",value:e.value,onChange:t=>{e.onChange(t.target.value)}}))));import ro from"react";function ta({}){return ro.createElement("style",null,`
|
|
1686
|
-
.frac-card-bank-radio-main{
|
|
1687
|
-
display: flex;
|
|
1688
|
-
flex-direction: column;
|
|
1689
|
-
align-items: flex-start;
|
|
1690
|
-
align-self: stretch;
|
|
1691
|
-
border-radius: 14px;
|
|
1692
|
-
border: 1px solid #E0DFE2;
|
|
1693
|
-
overflow: hidden;
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
.frac-card-bank-radio{
|
|
1697
|
-
display: flex;
|
|
1698
|
-
padding: 12px 16px;
|
|
1699
|
-
justify-content: space-between;
|
|
1700
|
-
align-items: center;
|
|
1701
|
-
align-self: stretch;
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
input[type="radio"] {
|
|
1705
|
-
accent-color: #000;
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
.frac-card-title-main{
|
|
1709
|
-
display: flex;
|
|
1710
|
-
align-items: center;
|
|
1711
|
-
gap: 12px;
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
.frac-card-label{
|
|
1715
|
-
display: flex;
|
|
1716
|
-
flex-direction: column;
|
|
1717
|
-
align-items: flex-start;
|
|
1718
|
-
gap: 2px;
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
.frac-card-label-text{
|
|
1722
|
-
color: #727272;
|
|
1723
|
-
font-family: Inter;
|
|
1724
|
-
font-size: 12px;
|
|
1725
|
-
font-style: normal;
|
|
1726
|
-
font-weight: 500;
|
|
1727
|
-
line-height: 18px;
|
|
1728
|
-
letter-spacing: -0.24px;
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
.frac-card-label-amount{
|
|
1732
|
-
color: #161616;
|
|
1733
|
-
text-align: center;
|
|
1734
|
-
font-family: Inter;
|
|
1735
|
-
font-size: 16px;
|
|
1736
|
-
font-style: normal;
|
|
1737
|
-
font-weight: 500;
|
|
1738
|
-
line-height: 140%;
|
|
1739
|
-
letter-spacing: -0.32px;
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
.frac-payment-type-logo{
|
|
1743
|
-
width: 24px;
|
|
1744
|
-
height: 24px;
|
|
1745
|
-
aspect-ratio: 1/1;
|
|
1746
|
-
}
|
|
1747
|
-
|
|
1748
|
-
.frac-card-bank-radio-main .frac-card-bank-radio:nth-child(2) {
|
|
1749
|
-
border-top: 1px solid #E0DFE2;
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
.frac-card-bank-radio-main .frac-card-bank-radio:nth-child(3) {
|
|
1753
|
-
border-top: 1px solid #E0DFE2;
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
.frac-card-bank-radio.frac-active {
|
|
1757
|
-
background: #F6F6F7;
|
|
1758
|
-
}
|
|
1759
|
-
`)}import mn from"react";var En=({listHeading:e="Card",ListItems:t,selectedCard:q,setSelectedCard:I,paymentGateway:P,handleDeleteCard:F,otherButtonAction:H,otherButtonLabel:Z,headingClass:qe})=>{let G=X+"widget/Trash.svg";return mn.createElement(mn.Fragment,null,mn.createElement("h6",{className:qe||"card-ach-heading",style:{marginBottom:"10px !important"}},e),mn.createElement("div",{className:"card-lint-div-in"},mn.createElement("div",{className:"card-list-div"},t&&(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((z,J)=>{let ye=!1;return P&&(ye=P!=(z==null?void 0:z.payment_method_type)&&(z==null?void 0:z.card_type)!="Bank"),mn.createElement("div",{key:z==null?void 0:z.id,className:"card-list-single-div"},mn.createElement("div",{className:"card-number-radio"},mn.createElement("input",{disabled:ye,type:"radio",className:"cardRadio",name:"selected_card",id:"",checked:(q==null?void 0:q.id)===(z==null?void 0:z.id),onChange:v=>I(z)}),mn.createElement("label",{htmlFor:"",className:"card-number-last-four"},"**** ",z==null?void 0:z.cardlastfourdigit),(z==null?void 0:z.card_type)!="Bank"&&mn.createElement("h6",{className:"card-expiry-date"},z==null?void 0:z.expmonth,"/",z==null?void 0:z.expyear)),mn.createElement("div",{className:"card-number-radio"},mn.createElement("span",{className:"visa-card"},mn.createElement("img",{src:hi(z==null?void 0:z.card_type),alt:""})),mn.createElement("span",{className:"visa-card",style:{cursor:"pointer"},onClick:()=>F(z==null?void 0:z.id)},mn.createElement("img",{src:G,alt:""}))))}))),mn.createElement("div",{className:"pay-with-other-card",onClick:H},Z,mn.createElement("img",{src:Ca,alt:""}))))};import Bn from"react";var Aa=({listHeading:e="Readers",ListItems:t,selectedPax:q,setSlectedPax:I,headingClass:P})=>Bn.createElement(Bn.Fragment,null,Bn.createElement("h6",{className:P||"card-ach-heading",style:{marginBottom:"10px !important"}},e),Bn.createElement("div",{className:"card-lint-div-in"},Bn.createElement("div",{className:"card-list-div"},t&&(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((F,H)=>Bn.createElement("div",{key:F==null?void 0:F.id,className:"card-list-single-div"},Bn.createElement("div",{className:"card-number-radio"},Bn.createElement("input",{type:"radio",className:"cardRadio",name:"selected_reader",id:"",checked:(q==null?void 0:q.id)===(F==null?void 0:F.id),onChange:Z=>I(F)}),Bn.createElement("label",{htmlFor:"",className:"card-number-last-four"},F==null?void 0:F.device_name)),Bn.createElement("div",{className:"card-number-radio"},Bn.createElement("span",{className:"visa-card"},Bn.createElement("img",{src:Ia,alt:""})))))))));import{useEffect as lo}from"react";function Kn(){return lo(()=>{let src=`${la}tokenizer/static/js/fractal_tokenizer.js`;if(document.querySelector(`script[src="${src}"]`))return;let script=document.createElement("script");script.src=src,script.async=!0,script.onload=()=>{try{let TokenizerClass=eval("FractalTokenizer");TokenizerClass&&(window.FractalTokenizer=TokenizerClass)}catch(e){console.error("FractalTokenizer not accessible:",e)}},document.head.appendChild(script)},[]),null}import{useEffect as so,useRef as mo}from"react";var co=({fractalStyles:e,tokenizerRef:t,isAddCard:q=!1,isSky:I=!1})=>{let P=mo(null);return so(()=>{if(!window.FractalTokenizer)return;let F=new window.FractalTokenizer({styles:e});return P.current=F,t.current=F,F.mountField("card_number","card_number"),F.mountField("exp_month","exp_month"),F.mountField("exp_year","exp_year"),F.mountField("cvv","cvv"),console.log("Fractal fields mounted"),()=>{var H;try{(H=F.destroy)==null||H.call(F)}catch(Z){}t.current=null}},[]),React.createElement(React.Fragment,null,q?React.createElement(React.Fragment,null,React.createElement("div",{id:"card_number",className:"form-control card-number-new",style:{height:"46px"}}),React.createElement("div",{className:"card-dtl"},React.createElement("div",{className:"exp-cvc-container exp-cvc-container-wrap",style:{margin:0}},React.createElement("div",{className:"form-group",style:{marginTop:0}},React.createElement("label",{htmlFor:"expMonth"},"MM"),React.createElement("div",{id:"exp_month",className:"form-control required card-cvv-in"})),React.createElement("div",{className:"form-group",style:{marginTop:0}},React.createElement("label",{htmlFor:"expYear"},"YY"),React.createElement("div",{id:"exp_year",className:"form-control required card-cvv-in"})),React.createElement("div",{className:"form-group",style:{marginTop:0}},React.createElement("label",{htmlFor:"cvc"},"CVC"),React.createElement("div",{id:"cvv",className:"form-control card-cvv-in required"}))))):React.createElement(React.Fragment,null,React.createElement("div",{id:"card_number",className:"form-control card-number-new",style:{height:`${I?"36px":"46px"}`}}),React.createElement("div",{className:"card-crdi card-expiry-new"},React.createElement("div",{className:"exp-date-year-container"},React.createElement("div",{className:"exp-date form-group"},React.createElement("div",{id:"exp_month",className:"form-control required card-cvv-in",style:{height:"36px"}})),React.createElement("div",{className:"exp-year form-group"},React.createElement("div",{id:"exp_year",className:"form-control required card-cvv-in",style:{height:"36px"}})),React.createElement("div",{className:"security-digit form-group"},React.createElement("div",{id:"cvv",className:"form-control card-cvv-in required",style:{height:"36px"}}))))))},Jn=co;function go(e){var ct,Lt,Ct,Qe,qt,Kt,Zt,Gt,De,Xt,ln,gn,pn,fn,Tt,Re,pt,Fe,Ke,Rt,Ht,et,Xn;let[t,q]=jt(!1),[I,P]=jt(!1),[F,H]=jt(""),[Z,qe]=jt(""),[G,z]=jt(!1),[J,ye]=jt(!1),[v,de]=jt("card"),[te,M]=jt("card"),[C,V]=jt("form"),[h,me]=jt("form"),[zt,ve]=jt(!0),[Ne,st]=jt(!1),[He,xt]=jt(!1),ce=e.merchantPublicKey,Me=X+"widget/mc-img.svg",it=X+"widget/visa-img.svg",Ft=X+"widget/ae-img.svg",Dt=X+"widget/discover-img.svg",O=X+"widget/card.svg",Je=X+"widget/Trash.svg",W=X+"widget/bank.svg",B=X+"widget/secure-img.png",i=X+"widget/pov-by.png",x=X+"widget/pax.svg",[s,N]=jt(),[T,E]=jt({}),[A,o]=jt(),[m,b]=jt({}),[g,Ce]=jt([]),[dt,ze]=jt([]),[Oe,yt]=jt(),[we,be]=jt(void 0),[D,ae]=jt(Number(e==null?void 0:e.amount)),[k,ue]=jt(),[pe,R]=jt(""),ot=uo(null),yn={input:{"font-family":"'Inter', sans-serif","font-size":"16px",color:"#212529","background-color":"transparent",padding:"0px",appearance:"none",outline:"none",border:"none","box-shadow":"none"},":focus":{color:"#212529",outline:"none",border:"none"},"::placeholder":{color:"#212529"}},mt=()=>q(!0),_=()=>q(!1),Qn=(S,p)=>{let Le=(parseFloat(p)||0)/100,ft=S/(1+Le);return Math.round(ft*100)/100};Ka(()=>{if(J){let S=Qn(e==null?void 0:e.amount,(e==null?void 0:e.surcharge)||0);ae(S)}},[J,e==null?void 0:e.pass_fee,e==null?void 0:e.amount,e==null?void 0:e.surcharge]);let Cn=()=>{ye(!1),de("card"),H(""),z(!1),R(""),o({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),b({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),N({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),E({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),xt(!1),st(!1),yt({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""}),be(null),ae(0),M("card"),ve(!0),me("form"),V("form"),P(!1),q(!1),ze([]),Ce([])},kn=()=>ye(!0),Sn=S=>{de(S)},rn=(S,p)=>{let Le=S;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(Le)){(p===""||/^[0-9]+$/.test(p))&&(E(Pe=>L(w({},Pe),{[Le]:""})),N(Pe=>L(w({},Pe),{[Le]:p})));return}E(Pe=>L(w({},Pe),{[Le]:""})),N(Pe=>L(w({},Pe),{[Le]:p}))},na=S=>{var Pe;let p=S.target,{formatted:Le,cursor:ft}=An(p.value,(Pe=p.selectionStart)!=null?Pe:0);E(Nt=>L(w({},Nt),{cardNumber:""})),N(Nt=>L(w({},Nt),{cardNumber:Le})),requestAnimationFrame(()=>{p.setSelectionRange(ft,ft)})},Nn=S=>{let{name:p,value:Le}=S.target,ft=["routingNumber","accountNumber","confirmAccountNumber"];if(p=="name"){/^[a-zA-Z\s]*$/.test(Le)&&(b(Pe=>L(w({},Pe),{[p]:""})),o(Pe=>L(w({},Pe),{[p]:Le})));return}if(ft.includes(p)){(Le===""||/^[0-9]+$/.test(Le))&&(b(Pe=>L(w({},Pe),{[p]:""})),o(Pe=>L(w({},Pe),{[p]:Le})));return}b(Pe=>L(w({},Pe),{[p]:""})),o(Pe=>L(w({},Pe),{[p]:Le}))},Fn=()=>{var Le,ft,Pe,Nt,Ot,Wt;let S={},p=s;if((k==null?void 0:k.paymentGateway)!==32){(Le=p==null?void 0:p.cardNumber)!=null&&Le.trim()||(S.cardNumber="Card number is required");let Yt=parseInt((p==null?void 0:p.expiryMonth)||"",10),Ut=(p==null?void 0:p.expiryYear)||"";if((!((ft=p==null?void 0:p.expiryMonth)!=null&&ft.trim())||!((Pe=p==null?void 0:p.expiryYear)!=null&&Pe.trim())||isNaN(Yt)||Yt<1||Yt>12||Ut.length!==4)&&(S.expiryMonth="Invalid Expiration Date."),(Nt=p==null?void 0:p.cvv)!=null&&Nt.trim()||(S.cvv="CVV is required"),p!=null&&p.expiryMonth&&(p!=null&&p.expiryYear)&&p.expiryMonth.length<=2&&p.expiryYear.length===4){let en=parseInt(p.expiryMonth,10),f=parseInt(p.expiryYear,10),u=new Date,fe=u.getMonth()+1,Te=u.getFullYear();(f<Te||f===Te&&en<fe)&&(S.expiryMonth="Card is expired")}}return(Ot=p==null?void 0:p.cardName)!=null&&Ot.trim()||(S.cardName="Card name is required"),(Wt=p==null?void 0:p.zipCode)!=null&&Wt.trim()||(S.zipCode="ZIP code is required"),E(S),Object.keys(S).length>0},aa=()=>{var Le,ft,Pe,Nt,Ot,Wt,Yt,Ut;let S={},p=A;return(Le=p==null?void 0:p.name)!=null&&Le.trim()||(S.name="Name is required"),(ft=p==null?void 0:p.accountNumber)!=null&&ft.trim()||(S.accountNumber="Account number is required"),(Pe=p==null?void 0:p.accountNumber)!=null&&Pe.trim()&&((Nt=p==null?void 0:p.accountNumber)==null?void 0:Nt.trim())!==((Ot=p==null?void 0:p.confirmAccountNumber)==null?void 0:Ot.trim())&&(S.confirmAccountNumber="Account numbers must match"),(Wt=p==null?void 0:p.bankName)!=null&&Wt.trim()||(S.bankName="Bank name is required"),(Yt=p==null?void 0:p.routingNumber)!=null&&Yt.trim()||(S.routingNumber="Routing Number is required"),p!=null&&p.routingNumber&&((Ut=p==null?void 0:p.routingNumber)==null?void 0:Ut.length)!==9&&(S.routingNumber="Routing number must be 9 digits"),((p==null?void 0:p.accountType)==="business saving"||(p==null?void 0:p.accountType)==="business checking")&&(!(p!=null&&p.companyName)||(p==null?void 0:p.companyName)==="")&&(S.companyName="Company Name is required for business accounts"),b(S),Object.keys(S).length>0},_n=async S=>{var Le,ft,Pe,Nt,Ot,Wt,Yt,Ut,en,f,u,fe,Te,ne;S.preventDefault();let p=document.activeElement;if(p instanceof HTMLElement&&p.blur(),v!=="ach"){if(Fn())return;{let $e=!0,ke=!0,Ye=!0;if((k==null?void 0:k.paymentGateway)!==32){let je=DatacapWebToken.validateCardNumber(s==null?void 0:s.cardNumber.replaceAll(" ","")),tt=DatacapWebToken.validateExpirationDate(s==null?void 0:s.expiryMonth,s==null?void 0:s.expiryYear),It=DatacapWebToken.validateCVV(s==null?void 0:s.cvv),re={};je||(re.cardNumber="Invalid card Number"),tt||(re.expiryMonth="Invalid Expiration Date."),It||(re.cvv="Invalid CVV"),E(re)}if($e&&Ye&&ke){P(!0);try{let je={amount:`${e.amount||0}`,fractalpayPublicKey:ce,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},tt=await Na.post(`${lt}create-widget-order`,je,{headers:w({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})}),It=async function(re){if(re.Error)H(re.Error),P(!1);else{let ee=s==null?void 0:s.cardName,ht=s==null?void 0:s.zipCode;re.name=ee,re.postal_code=ht,re.isCardSave=`${Ne}`,re.isCharge=!0,re.posSalesIdEncode=tt==null?void 0:tt.data.data.posSalesIdEncode,Et.emit("sendMessage",re),Et.on(tt==null?void 0:tt.data.data.posSalesIdEncode,an=>{if(pa(an==null?void 0:an.data)){let bt=JSON.parse(an.data);bt!=null&&bt.result?(N({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),st(!1),R(bt==null?void 0:bt.transactionId),z(!0),P(!1)):(P(!1),H((bt==null?void 0:bt.message)||"Something went wrong."))}else H("Something went wrong.")})}};if((k==null?void 0:k.paymentGateway)===32){let re={method:"POST",redirect:"follow"};try{let ee=await Na.post(`${Ve}api/v1/widget/generate-session`,re);try{console.log(ee,"sesionResult");let ht=await ot.current.createToken({public_key_pem:((ft=(Le=ee==null?void 0:ee.data)==null?void 0:Le.data)==null?void 0:ft.publicKeyPem)||((Nt=(Pe=ee==null?void 0:ee.data)==null?void 0:Pe.data)==null?void 0:Nt.public_key_pem),session_key:(Wt=(Ot=ee==null?void 0:ee.data)==null?void 0:Ot.data)==null?void 0:Wt.session_key});console.log(ht,"tokenizeData");let an=JSON.stringify(L(w({},ht),{isSaveCardChecked:Ne,name:s==null?void 0:s.cardName,postal_code:s==null?void 0:s.zipCode,customer_id:e==null?void 0:e.customerId})),bt=JSON.stringify({pre_sales_id:`${(Ut=(Yt=tt==null?void 0:tt.data)==null?void 0:Yt.data)==null?void 0:Ut.posSalesIdEncode}`,token:`${ht==null?void 0:ht.token}`,json_response:`${an}`}),Jt={method:"POST",headers:JSON.stringify({"Content-Type":"application/json"}),body:bt,redirect:"follow",isChargeviafractal:!0};Et.emit("sendMessage",Jt),Et.on("chargeviafractalgateway",wt=>{var Qt;if(pa(wt==null?void 0:wt.data)){let Ee=JSON.parse(wt==null?void 0:wt.data);Ee!=null&&Ee.result?(R((Qt=Ee==null?void 0:Ee.data)==null?void 0:Qt.transactionId),z(!0),P(!1)):(P(!1),H((Ee==null?void 0:Ee.message)||"Something went wrong."))}else H("Something went wrong.")})}catch(ht){P(!1),qe(((f=(en=ht==null?void 0:ht.response)==null?void 0:en.data)==null?void 0:f.message)||(ht==null?void 0:ht.message)||"Something went wrong.")}}catch(ee){P(!1),H(((fe=(u=ee==null?void 0:ee.response)==null?void 0:u.data)==null?void 0:fe.message)||(ee==null?void 0:ee.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(tt==null?void 0:tt.data.data.dctoken,"PaymentForm",It)}catch(je){P(!1),H(((ne=(Te=je==null?void 0:je.response)==null?void 0:Te.data)==null?void 0:ne.message)||(je==null?void 0:je.message)||"Something went wrong.")}}}}else{if(aa())return;{P(!0);let $e=w({fractalpayPublicKey:ce,label:(A==null?void 0:A.name)||"John Doe",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:String(D||0),isSaveAch:He,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:(A==null?void 0:A.companyName)||""},(e==null?void 0:e.sessionToken)&&{sessionToken:e.sessionToken});Et.emit("sendMessage",$e),Et.on("ach-incoming",ke=>{var Ye;(ke==null?void 0:ke.status)=="Failed"?typeof(ke==null?void 0:ke.message)=="object"?Object.values(ke==null?void 0:ke.message).forEach(je=>{H(je||"Something went wrong")}):H((ke==null?void 0:ke.message)||"Something went wrong"):(R((Ye=ke==null?void 0:ke.data)==null?void 0:Ye.transaction_id),z(!0),P(!1))})}}},un=async()=>{var S,p,Le,ft,Pe,Nt,Ot,Wt,Yt,Ut,en,f,u,fe,Te,ne,vt,$e,ke,Ye,je,tt,It;mt();try{let re={fractalpayPublicKey:ce,customer_id:e==null?void 0:e.customerId,pass_fee:e==null?void 0:e.pass_fee,isReader:e==null?void 0:e.isReader},ee=await Na.post(`${lt}get-payment-details`,re);if(ue((S=ee==null?void 0:ee.data)==null?void 0:S.data),(Le=(p=ee==null?void 0:ee.data)==null?void 0:p.data)!=null&&Le.paymentGateway||(Cn(),H("Something went wrong.")),(Pe=(ft=ee==null?void 0:ee.data)==null?void 0:ft.data)!=null&&Pe.card_list&&((Wt=(Ot=(Nt=ee==null?void 0:ee.data)==null?void 0:Nt.data)==null?void 0:Ot.card_list)==null?void 0:Wt.length)>0){let ht=(en=(Ut=(Yt=ee==null?void 0:ee.data)==null?void 0:Yt.data)==null?void 0:Ut.card_list)==null?void 0:en.filter(bt=>(bt==null?void 0:bt.card_type)=="Bank"),an=(fe=(u=(f=ee==null?void 0:ee.data)==null?void 0:f.data)==null?void 0:u.card_list)==null?void 0:fe.filter(bt=>(bt==null?void 0:bt.card_type)!=="Bank");(an==null?void 0:an.length)>0&&V("list"),(ht==null?void 0:ht.length)>0&&me("list"),Ce(an),ze(ht)}else de("card");(ne=(Te=ee==null?void 0:ee.data)==null?void 0:Te.data)!=null&&ne.paymentDeviceList&&((ke=($e=(vt=ee==null?void 0:ee.data)==null?void 0:vt.data)==null?void 0:$e.paymentDeviceList)==null?void 0:ke.length)>0&&be((je=(Ye=ee==null?void 0:ee.data)==null?void 0:Ye.data)==null?void 0:je.paymentDeviceList[0]),_()}catch(re){console.log(re),_(),H(((It=(tt=re==null?void 0:re.response)==null?void 0:tt.data)==null?void 0:It.message)||(re==null?void 0:re.message)||"Something went wrong")}},Hn=async S=>{if(S.currentTarget.blur(),I)return;let p=e==null?void 0:e.customerId,Le=String(e==null?void 0:e.discount),ft=String(e==null?void 0:e.surcharge),Pe=String(e==null?void 0:e.tax),Nt=e==null?void 0:e.merchantPublicKey,Ot=e==null?void 0:e.orderID,Wt=String(e==null?void 0:e.amount),Yt=Oe==null?void 0:Oe.id,Ut=Oe==null?void 0:Oe.card_type;if(Nt&&Ot&&Wt&&D)if(p)if(Yt){let f=w({amount:Ut==="Bank"?`${D}`:Wt,order_id:Ot,customer_id:p,card_id:Yt,fractalpayPublicKey:Nt,isCardSave:Ne,discount:Le,surcharge:ft,tax:Pe,pass_fee:e==null?void 0:e.pass_fee,require3ds:!1},(e==null?void 0:e.sessionToken)&&{sessionToken:e.sessionToken}),en=f,{isCardSave:u,pass_fee:fe,require3ds:Te}=en,ne=ra(en,["isCardSave","pass_fee","require3ds"]),$e=lt+(Ut==="Bank"?"charge-ach":"charge-by-card"),ke={"Content-Type":"application/json"};P(!0),Et.emit("sendMessage",{url:$e,body:Ut=="Bank"?ne:f,isChargebycard:!0}),Et.on("charge-by-card",Ye=>{var je;(Ye==null?void 0:Ye.result)==!0||(Ye==null?void 0:Ye.status)==!0?(R((je=Ye.data)==null?void 0:je.transaction_id),z(!0),P(!1)):H((Ye==null?void 0:Ye.message)||"Something went wrong.")})}else H("Please Select A Card/ACH");else H("Please Select Customer");else H("Something went wrong.")},bn=async S=>{var Nt,Ot,Wt,Yt,Ut,en;if(S.currentTarget.blur(),I)return;let p=e==null?void 0:e.merchantPublicKey,Le=e==null?void 0:e.orderID,ft=String(e==null?void 0:e.amount),Pe=e==null?void 0:e.customerId;if(!(we!=null&&we.device_id)){H("Please Select A Payment Device");return}if(p&&Le&&ft){P(!0);let f={amount:ft,fractalpayPublicKey:p,customer_order_id:Le,device_id:we==null?void 0:we.device_id,customer_id:Pe||""};try{let u=await Na.post(`${lt}charge-with-reader`,f);((Nt=u==null?void 0:u.data)==null?void 0:Nt.result)==!0?(R((Wt=(Ot=u==null?void 0:u.data)==null?void 0:Ot.data)==null?void 0:Wt.transaction_id),z(!0),P(!1)):(H(((Yt=u==null?void 0:u.data)==null?void 0:Yt.message)||"Something went wrong."),P(!1))}catch(u){H(((en=(Ut=u==null?void 0:u.response)==null?void 0:Ut.data)==null?void 0:en.message)||"Something went wrong."),P(!1)}}else H("Something went wrong.")},$=S=>{te==="card"?Hn(S):te==="reader"&&bn(S)};Ka(()=>{J&&ce&&un()},[ce,J]);let j=async S=>{wa.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 p=>{if(p.isConfirmed){P(!0);try{let Le={card_id:S,customer_id:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey},ft=await Na.post(`${lt}delete-customer-card`,Le);P(!1),un(),wa.fire({icon:"success",title:"Deleted!",text:"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})}catch(Le){P(!1),wa.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else p.dismiss===wa.DismissReason.cancel&&wa.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},Xe=S=>{switch(S==null?void 0:S.toLowerCase()){case"visa":return it;case"mastercard":case"mc":case"m/c":return Me;case"amex":case"american express":case"ae":return Ft;case"discover":case"dcvr":return Dt;case"bank":return W;default:return S}},_t=()=>{let S=D||0;return(Number(e.amount)-S).toFixed(0)};return Ka(()=>{if(typeof FractalTokenizer=="undefined")return;let S=new FractalTokenizer({styles:{}})},[]),a.createElement(a.Fragment,null,a.createElement(Pn,null),a.createElement(Kn,null),a.createElement(ma,null),a.createElement(ta,null),a.createElement(a.Fragment,null,a.createElement("button",{className:"paymentBtn",onClick:kn},"Pay"),a.createElement(wn,{open:J,onClose:Cn},F&&a.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},a.createElement(zn,{error:F,onClose:Cn})),Z&&a.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},a.createElement(zn,{error:Z,onClose:()=>{qe("")}})),G&&a.createElement(ca,{onClose:Cn,tranId:pe}),!F&&!Z&&!G&&a.createElement(a.Fragment,null,(t||I)&&a.createElement(dn,{loading:t||I}),a.createElement("div",{className:"frac-card-payment-page frac-form"},a.createElement("div",{className:"parent-pay-container"},a.createElement("span",{className:"request-payment-close-popup",onClick:Cn},a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},a.createElement("g",{clipPath:"url(#clip0_12425_52336)"},a.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"})),a.createElement("defs",null,a.createElement("clipPath",{id:"clip0_12425_52336"},a.createElement("rect",{width:"16",height:"16",fill:"white"}))))),a.createElement("div",{className:"pay-main-logo-res"},a.createElement("img",{src:k==null?void 0:k.logo,id:"pay-logos"})),a.createElement("div",{className:"pay-container"},a.createElement("div",{className:"pay-header pay-conatiner-one frac-pay-conatiner-one"},a.createElement("div",{className:"pay-conatiner-one-first"},a.createElement("div",{className:"pay-logo-container"},a.createElement("div",{className:"pay-main-logo"},a.createElement("img",{src:k==null?void 0:k.logo,id:"pay-logos"})),(g==null?void 0:g.length)>0&&v!=="cardList"&&a.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>de("cardList")}," ",a.createElement(Ba,null)," Back")),a.createElement("div",{className:"amt-pay-con"},a.createElement("div",{className:"pay-amount-conatiner"},a.createElement("small",{className:"pay-payment-amount"},"Select paymet type")),a.createElement("div",{className:"frac-card-bank-radio-main"},a.createElement(Ln,{label:"Card",amount:(ct=Number(e==null?void 0:e.amount))==null?void 0:ct.toFixed(2),value:"card",onChange:Sn,activetab:v}),(k==null?void 0:k.isSkyFiAccount)&&a.createElement(Ln,{label:"Bank",amount:(Lt=Number(D))==null?void 0:Lt.toFixed(2),value:"ach",onChange:Sn,activetab:v}),(e==null?void 0:e.isReader)&&(k==null?void 0:k.paymentDeviceList)&&((Ct=k==null?void 0:k.paymentDeviceList)==null?void 0:Ct.length)>0&&a.createElement(Ln,{label:"Reader",amount:(Qe=Number(e==null?void 0:e.amount))==null?void 0:Qe.toFixed(2),value:"reader",onChange:Sn,activetab:v})),!t&&(On(k==null?void 0:k.showSurcharge)?D&&D>0&&(e!=null&&e.pass_fee)?a.createElement("div",{className:"frac-cash-discount-fee"},a.createElement("small",null,v==="card"||v==="reader"?"Cash Discount":"Cash Discount Savings"," "),a.createElement("p",null,ge((Number(e.amount)-D).toFixed(2)))):null:D&&D>0&&(e!=null&&e.pass_fee)&&(v==="card"||v==="reader")?a.createElement("div",{className:"frac-cash-discount-fee"},a.createElement("small",null,v==="card"||v==="reader"?"Surcharge":null," "),a.createElement("p",null,ge((Number(e.amount)-D).toFixed(2)))):null))),a.createElement("div",{className:"pay-conatiner-one-last"},a.createElement("img",{src:B,alt:""}),a.createElement("img",{src:i,alt:""}),"Secure payments powered by Fractal")),a.createElement("div",{className:"pay-tab pay-conatiner-two"},!t&&a.createElement("div",{className:"col-md-12"},a.createElement("div",{id:"payment-form-div"},v!=="cardList"?a.createElement("div",{className:"frac-charge-payment-back-btn-wrap "},(g==null?void 0:g.length)>0&&a.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>de("cardList")}," ",a.createElement(Ba,null)," Back"),(k==null?void 0:k.isSkyFiAccount)&&a.createElement("div",{className:"tab"},a.createElement("button",{className:"tablinks",onClick:S=>{Sn("card")},style:{border:v==="card"?"1px solid":""}},a.createElement("i",{className:"fas fa-credit-card me-2",style:{marginRight:"8px",fontSize:"15px"}}),"Card"),a.createElement("button",{className:"tablinks",onClick:S=>{Sn("ach")},style:{border:v==="ach"?"1px solid":""}},a.createElement("i",{className:"fas fa-university me-2",style:{marginRight:"8px",fontSize:"15px"}}),"Bank")),a.createElement("div",{className:"res-pay-con"},a.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},a.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),a.createElement("strong",{className:"pay-amount"},"$",(qt=Number(e==null?void 0:e.amount))==null?void 0:qt.toFixed(2))),v!="ach"&&a.createElement("div",null,a.createElement("div",null,a.createElement("img",{src:it,alt:"",width:35,style:{paddingRight:"5px"}}),a.createElement("img",{src:Me,width:35,alt:""})),a.createElement("div",null,a.createElement("img",{src:Ft,alt:"",width:35,style:{paddingRight:"5px"}}),a.createElement("img",{src:Dt,width:35,alt:""}))))):a.createElement("div",null,a.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",k==null?void 0:k.customer_name),a.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," ",te==="card"?"Cards/Banks":"Readers"," "),a.createElement("div",{className:"res-pay-con"},a.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},a.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),a.createElement("strong",{className:"pay-amount"},"$",(Kt=Number(e==null?void 0:e.amount))==null?void 0:Kt.toFixed(2))),a.createElement("div",null,a.createElement("div",null,a.createElement("img",{src:it,alt:"",width:35,style:{paddingRight:"5px"}}),a.createElement("img",{src:Me,width:35,alt:""})),a.createElement("div",null,a.createElement("img",{src:Ft,alt:"",width:35,style:{paddingRight:"5px"}}),a.createElement("img",{src:Dt,width:35,alt:""}))))),a.createElement("div",{id:"card",style:{display:v==="card"?"block":"none"},className:"tabcontent"},a.createElement("div",{className:"frac-card-payment"},a.createElement("div",{className:"frac-heading-card-wrap"},a.createElement("div",{className:"frac-backarrow"},(g==null?void 0:g.length)>0&&C==="form"&&a.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>V("list")}," ",a.createElement(Ba,null))),a.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),v!="ach"&&a.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},a.createElement("img",{src:it,alt:"",width:33}),a.createElement("img",{src:Me,width:33,alt:""}),a.createElement("img",{src:Ft,alt:"",width:33}),a.createElement("img",{src:Dt,width:33,alt:""}))),C==="list"?a.createElement(a.Fragment,null,a.createElement(En,{listHeading:"Cards",paymentGateway:k==null?void 0:k.paymentGateway,ListItems:g,selectedCard:Oe,setSelectedCard:yt,handleDeleteCard:j,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{V("form")}}),a.createElement("div",{className:"form-group",style:{padding:"0"}},a.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",disabled:I,onClick:$},ge((Zt=Number(e==null?void 0:e.amount))==null?void 0:Zt.toFixed(2))))):(k==null?void 0:k.paymentGateway)===32?a.createElement("form",{id:"paymentForm",onSubmit:_n,onKeyDown:S=>{S.key==="Enter"&&I&&(S.preventDefault(),S.stopPropagation())}},a.createElement("div",{className:"ach-scrl",style:{minHeight:k!=null&&k.isSkyFiAccount&&(g==null?void 0:g.length)>0?"444px":k!=null&&k.isSkyFiAccount&&(g==null?void 0:g.length)==0?"456px":(g==null?void 0:g.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},a.createElement("div",{className:"form-group"},a.createElement("label",null,"NAME ON CARD"),a.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"John Doe",value:(s==null?void 0:s.cardName)||"",onChange:S=>{let p=S.target.value;/^[a-zA-Z\s]*$/.test(p)&&rn("cardName",p)}}),(T==null?void 0:T.cardName)&&a.createElement("span",{className:"error-span"},T==null?void 0:T.cardName)),a.createElement("div",{className:"form-group"},a.createElement("label",null,"CARD NUMBER"),a.createElement("div",{className:"toggle-num-wrapper"},J&&(k==null?void 0:k.paymentGateway)===32&&a.createElement(Jn,{fractalStyles:yn,tokenizerRef:ot}))),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Order ID / Description"),a.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"OID123456",disabled:!0,value:(Gt=e==null?void 0:e.orderID)!=null?Gt:"",style:{background:"#F6F6F7",color:"#727272"}})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"ZIP"),a.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(De=s==null?void 0:s.zipCode)!=null?De:"",onChange:S=>rn("zipCode",S.target.value)}),(T==null?void 0:T.zipCode)&&a.createElement("span",{className:"error-span"},T==null?void 0:T.zipCode)),(e==null?void 0:e.customerId)&&a.createElement("div",{className:"form-group"},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},a.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:Ne,onChange:S=>st(S.target.checked)}),a.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),a.createElement("label",{htmlFor:"save_card"},"Save card for future payments")))),a.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:"0"}},a.createElement("button",{type:"submit",style:{margin:0},className:"pay-button",disabled:I},ge((Xt=Number(e==null?void 0:e.amount))==null?void 0:Xt.toFixed(2))))):a.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:_n,onKeyDown:S=>{S.key==="Enter"&&I&&(S.preventDefault(),S.stopPropagation())}},a.createElement("div",{className:"ach-scrl",style:{minHeight:k!=null&&k.isSkyFiAccount&&(g==null?void 0:g.length)>0?"444px":k!=null&&k.isSkyFiAccount&&(g==null?void 0:g.length)==0?"456px":(g==null?void 0:g.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},a.createElement("div",{className:"form-group"},a.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),a.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"John Doe",value:(s==null?void 0:s.cardName)||"",onChange:S=>{let p=S.target.value;/^[a-zA-Z\s]*$/.test(p)&&rn("cardName",p)}}),(T==null?void 0:T.cardName)&&a.createElement("span",{className:"error-span"},T==null?void 0:T.cardName)),a.createElement("div",{className:"form-group"},a.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),a.createElement("div",{className:"toggle-num-wrapper"},a.createElement("input",{className:"form-control card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(s==null?void 0:s.cardNumber)||"",onChange:S=>na(S),"data-token":"card_number"}),a.createElement("div",{className:"card-crdi card-expiry-new"},a.createElement("div",{className:"exp-date-year-container"},a.createElement("div",{className:"exp-date form-group"},a.createElement("input",{"data-token":"exp_month",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(s==null?void 0:s.expiryMonth)||"",onChange:S=>rn("expiryMonth",S.target.value)})),a.createElement("div",{className:"exp-year form-group"},a.createElement("input",{"data-token":"exp_year",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(s==null?void 0:s.expiryYear)||"",onChange:S=>rn("expiryYear",S.target.value)})),a.createElement("div",{className:"security-digit form-group"},a.createElement("input",{"data-token":"cvv",className:"form-control card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(s==null?void 0:s.cvv)||"",onChange:S=>rn("cvv",S.target.value)})))),(T==null?void 0:T.cardNumber)&&a.createElement("span",{className:"error-span"},T==null?void 0:T.cardNumber),a.createElement("p",{style:{margin:"0"}},T!=null&&T.expiryMonth||T!=null&&T.expiryYear?a.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},T==null?void 0:T.expiryMonth):"",(T==null?void 0:T.cvv)&&a.createElement("span",{className:"error-span"},T==null?void 0:T.cvv)))),a.createElement("div",{className:"form-group"},a.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),a.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"OID123456",disabled:!0,value:(ln=e==null?void 0:e.orderID)!=null?ln:"",style:{background:"#F6F6F7",color:"#727272"}})),a.createElement("div",{className:"form-group"},a.createElement("label",{htmlFor:"zip"},"ZIP"),a.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(gn=s==null?void 0:s.zipCode)!=null?gn:"",onChange:S=>rn("zipCode",S.target.value)}),(T==null?void 0:T.zipCode)&&a.createElement("span",{className:"error-span"},T==null?void 0:T.zipCode)),(e==null?void 0:e.customerId)&&a.createElement("div",{className:"form-group"},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},a.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:Ne,onChange:S=>st(S.target.checked)}),a.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),a.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},a.createElement("g",{clipPath:"url(#clip0_12420_50192)"},a.createElement("rect",{width:"20",height:"20",fill:"white"}),a.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),a.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"})),a.createElement("defs",null,a.createElement("clipPath",{id:"clip0_12420_50192"},a.createElement("rect",{width:"20",height:"20",fill:"white"}))))))),a.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:"0"}},a.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ge((pn=Number(e==null?void 0:e.amount))==null?void 0:pn.toFixed(2)))))),a.createElement("div",{id:"ach",style:{display:v==="ach"?"block":"none"},className:"tabcontent"},a.createElement("div",{className:"frac-card-payment"},a.createElement("div",{className:"frac-heading-card-wrap"},a.createElement("div",{className:"frac-backarrow"},(dt==null?void 0:dt.length)>0&&h==="form"&&a.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>me("list")}," ",a.createElement(Ba,null))),a.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment"))),h==="list"?a.createElement(a.Fragment,null,a.createElement(En,{listHeading:"Banks",paymentGateway:k==null?void 0:k.paymentGateway,ListItems:dt,selectedCard:Oe,setSelectedCard:yt,handleDeleteCard:j,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{me("form")}}),a.createElement("div",{className:"form-group",style:{padding:"0"}},a.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:$},ge((fn=Number(D))==null?void 0:fn.toFixed(2))))):a.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:_n,autoComplete:"off",onKeyDown:S=>{S.key==="Enter"&&I&&(S.preventDefault(),S.stopPropagation())}},a.createElement("div",{className:"ach-scrl",style:{minHeight:k!=null&&k.isSkyFiAccount&&(g==null?void 0:g.length)>0?"444px":k!=null&&k.isSkyFiAccount&&(g==null?void 0:g.length)==0?"436px":(g==null?void 0:g.length)>0?"462px":"520px",maxHeight:k!=null&&k.isSkyFiAccount&&(g==null?void 0:g.length)>0?"444px":((g==null?void 0:g.length)>0,"380px")}},a.createElement("div",{className:"form-group mb-4"},a.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),a.createElement("input",{type:"text",id:"nameonaccount",className:"form-control",maxLength:100,placeholder:"John Doe",name:"name",value:(Tt=A==null?void 0:A.name)!=null?Tt:"",onChange:Nn}),(m==null?void 0:m.name)&&a.createElement("span",{className:"error-span"},m==null?void 0:m.name)),a.createElement("div",{className:"form-group mb-4"},a.createElement("label",{htmlFor:"routingnumber"},"Routing number"),a.createElement("input",{type:"text",id:"routingnumber",className:"form-control",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(Re=A==null?void 0:A.routingNumber)!=null?Re:"",onChange:Nn}),(m==null?void 0:m.routingNumber)&&a.createElement("span",{className:"error-span"},m==null?void 0:m.routingNumber)),a.createElement("div",{className:"form-group mb-4"},a.createElement("label",{htmlFor:"accountnumber"},"Account number"),a.createElement("input",{type:"text",id:"accountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(pt=A==null?void 0:A.accountNumber)!=null?pt:"",onChange:Nn}),(m==null?void 0:m.accountNumber)&&a.createElement("span",{className:"error-span"},m==null?void 0:m.accountNumber)),a.createElement("div",{className:"form-group mb-4"},a.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),a.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(Fe=A==null?void 0:A.confirmAccountNumber)!=null?Fe:"",onChange:Nn}),(m==null?void 0:m.confirmAccountNumber)&&a.createElement("span",{className:"error-span"},m==null?void 0:m.confirmAccountNumber)),a.createElement("div",{className:"form-group mb-4"},a.createElement("label",{htmlFor:"bankname"},"Bank name"),a.createElement("input",{type:"text",id:"bankname",className:"form-control",maxLength:100,placeholder:"My Bank",name:"bankName",value:(Ke=A==null?void 0:A.bankName)!=null?Ke:"",onChange:Nn}),(m==null?void 0:m.bankName)&&a.createElement("span",{className:"error-span"},m==null?void 0:m.bankName)),((A==null?void 0:A.accountType)==="business saving"||(A==null?void 0:A.accountType)==="business checking")&&a.createElement("div",{className:"form-group mb-4"},a.createElement("label",{htmlFor:"companyName"},"Company name"),a.createElement("input",{type:"text",id:"companyName",className:"form-control",maxLength:100,placeholder:"My Company",name:"companyName",value:(Rt=A==null?void 0:A.companyName)!=null?Rt:"",onChange:Nn}),(m==null?void 0:m.companyName)&&a.createElement("span",{className:"error-span"},m==null?void 0:m.companyName)),a.createElement("div",{className:"form-group mb-4"},a.createElement("label",{htmlFor:"accounttype"},"Select account type"),a.createElement("select",{name:"accountType",id:"accounttype",className:"form-control",value:(Ht=A==null?void 0:A.accountType)!=null?Ht:"",onChange:Nn},a.createElement("option",{value:""},"Select account"),fa.map(S=>a.createElement("option",{key:S.value,value:S.value},S.label)))),(e==null?void 0:e.customerId)&&a.createElement("div",{className:"form-group mb-4 save-ach-div",style:{paddingTop:"5px"}},a.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:He,onChange:S=>xt(S.target.checked)}),a.createElement("label",{htmlFor:"saveACH"},"Save ACH")),He&&a.createElement("div",{className:"form-group mb-4",style:{fontSize:"12px",color:"#727272"}},a.createElement("p",null,"If checked, I agree for ",a.createElement("b",null,"ecommerce")," to have my permission to charge this credit card for agreed upon purchases in the future."))),a.createElement("div",{className:"form-group "},a.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},ge((et=Number(D))==null?void 0:et.toFixed(2)))))),a.createElement("div",{id:"reader",style:{display:v==="reader"?"block":"none"},className:"tabcontent"},a.createElement("div",{className:"frac-card-payment"},a.createElement("div",{className:"frac-heading-card-wrap"},a.createElement("div",{className:"frac-backarrow"}),a.createElement("h6",{className:"frac-card-payment-heading"},"Reader Payment"))),a.createElement(Aa,{listHeading:"Reader",ListItems:k==null?void 0:k.paymentDeviceList,selectedPax:we,setSlectedPax:be}),a.createElement("button",{onClick:bn,className:"pay-button"},"$",(Xn=Number(e==null?void 0:e.amount))==null?void 0:Xn.toFixed(2)))))))))))))}import r,{useEffect as qa,useRef as po,useState as cn}from"react";import ka from"axios";import Za from"sweetalert2";import{IoArrowBack as fo}from"react-icons/io5";function ho(q){var I=q,{showButton:e=!0}=I,t=ra(I,["showButton"]);var kn,Sn,rn,na,Nn,Fn,aa,_n,un,Hn,bn;let[P,F]=cn(!1),[H,Z]=cn(!1),[qe,G]=cn(""),[z,J]=cn(!1),[ye,v]=cn(!1),[de,te]=cn("card"),[M,C]=cn(!1),[V,h]=cn("card"),[me,zt]=cn("form"),ve=t.merchantPublicKey,[Ne,st]=cn(void 0),He=po(null),xt={input:{"font-family":"'Inter', sans-serif","font-size":"16px",color:"#212529","background-color":"transparent",padding:"0px",appearance:"none",outline:"none",border:"none","box-shadow":"none"},":focus":{color:"#212529",outline:"none",border:"none"},"::placeholder":{color:"#212529"}};qa(()=>{t.onTriggerPay&&t.onTriggerPay(()=>{D()})},[t]);let ce=X+"widget/mc-img.svg",Me=X+"widget/visa-img.svg",it=X+"widget/ae-img.svg",Ft=X+"widget/discover-img.svg",Dt=X+"widget/card.svg",O=X+"widget/Trash.svg",Je=X+"widget/bank.svg",W=X+"widget/secure-img.png",B=X+"widget/pov-by.png",[i,x]=cn(),[s,N]=cn({}),[T,E]=cn([]),[A,o]=cn(),[m,b]=cn(void 0),[g,Ce]=cn(),[dt,ze]=cn(""),Oe=($,j)=>{let Xe=(parseFloat(j)||0)/100,_t=$/(1+Xe);return Math.round(_t*100)/100};qa(()=>{if(t!=null&&t.pass_fee){let $=Oe(t==null?void 0:t.amount,t==null?void 0:t.surcharge);b($)}},[t==null?void 0:t.pass_fee]);let yt=()=>F(!0),we=()=>F(!1),be=()=>{v(!1),te("card"),Z(!1),G(""),J(!1),ze(""),x({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),N({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),C(!1),o({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""})},D=()=>v(!0),ae=($,j)=>{let Xe=$;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(Xe)){(j===""||/^[0-9]+$/.test(j))&&(N(ct=>L(w({},ct),{[Xe]:""})),x(ct=>L(w({},ct),{[Xe]:j})));return}N(ct=>L(w({},ct),{[Xe]:""})),x(ct=>L(w({},ct),{[Xe]:j}))},k=$=>{var Lt;let j=$.target,Xe=j.value.replace(/\D/g,""),{formatted:_t,cursor:ct}=An(j.value,(Lt=j.selectionStart)!=null?Lt:0);N(Ct=>L(w({},Ct),{cardNumber:""})),x(Ct=>L(w({},Ct),{cardNumber:_t})),requestAnimationFrame(()=>{j.setSelectionRange(ct,ct)})},ue=()=>{var Xe,_t,ct,Lt,Ct,Qe;let $={},j=i;if((g==null?void 0:g.paymentGateway)!==32){let qt=parseInt((j==null?void 0:j.expiryMonth)||"",10),Kt=(j==null?void 0:j.expiryYear)||"";if((Xe=j==null?void 0:j.cardNumber)!=null&&Xe.trim()||($.cardNumber="Card number is required"),(!((_t=j==null?void 0:j.expiryMonth)!=null&&_t.trim())||!((ct=j==null?void 0:j.expiryYear)!=null&&ct.trim())||isNaN(qt)||qt<1||qt>12||Kt.length!==4)&&($.expiryMonth="Invalid Expiration Date."),(Lt=j==null?void 0:j.cvv)!=null&&Lt.trim()||($.cvv="CVV is required"),j!=null&&j.expiryMonth&&(j!=null&&j.expiryYear)&&j.expiryMonth.length<=2&&j.expiryYear.length===4){let Zt=parseInt(j.expiryMonth,10),Gt=parseInt(j.expiryYear,10),De=new Date,Xt=De.getMonth()+1,ln=De.getFullYear();(Gt<ln||Gt===ln&&Zt<Xt)&&($.expiryMonth="Card is expired")}}return(Ct=j==null?void 0:j.cardName)!=null&&Ct.trim()||($.cardName="Card name is required"),(Qe=j==null?void 0:j.zipCode)!=null&&Qe.trim()||($.zipCode="ZIP code is required"),N($),Object.keys($).length>0},pe=async $=>{var Xe,_t,ct,Lt,Ct,Qe,qt,Kt,Zt,Gt,De,Xt;$.preventDefault();let j=document.activeElement;if(j instanceof HTMLElement&&j.blur(),!H){debugger;if(de=="card"){if(ue())return;{let gn=!0,pn=!0,fn=!0;if((g==null?void 0:g.paymentGateway)!==32){let Tt=DatacapWebToken.validateCardNumber(i==null?void 0:i.cardNumber.replaceAll(" ","")),Re=DatacapWebToken.validateExpirationDate(i==null?void 0:i.expiryMonth,i==null?void 0:i.expiryYear),pt=DatacapWebToken.validateCVV(i==null?void 0:i.cvv),Fe={};Tt||(Fe.cardNumber="Invalid card Number"),Re||(Fe.expiryMonth="Invalid Expiration Date."),pt||(Fe.cvv="Invalid CVV"),N(Fe)}if(gn&&fn&&pn){Z(!0);try{let Tt=async function(Re){if(Re.Error)G(Re.Error),Z(!1);else{let pt=i==null?void 0:i.cardName,Fe=i==null?void 0:i.zipCode;Re.name=pt,Re.postal_code=Fe,Re.fractalpayPublicKey=t==null?void 0:t.merchantPublicKey,Re.amount=t==null?void 0:t.amount,Re.order_id=t==null?void 0:t.orderID,Re.preAuth_id=(t==null?void 0:t.preauthId)||"",Re.isCardSave=M,Re.customer_id=t==null?void 0:t.customerId,Re.link_token="",Re.gateway_id=g==null?void 0:g.paymentGateway,Re.discount=t==null?void 0:t.discount,Re.tax=t==null?void 0:t.tax,Re.surcharge=t==null?void 0:t.surcharge,Re.pass_fee=t==null?void 0:t.pass_fee,new Headers().append("Content-Type","application/json");let Rt={method:"POST",body:JSON.stringify(Re),redirect:"follow"};Et.emit("sendMessage",w(L(w({},Rt),{isChargePreauth:!0}),(t==null?void 0:t.sessionToken)&&{sessionToken:t.sessionToken})),Et.on("charge-preauth",Ht=>{var et;(Ht==null?void 0:Ht.status)=="Failed"?(Z(!1),G((Ht==null?void 0:Ht.message)||"Something went wrong. Please try again later.")):(J(!0),ze((et=Ht==null?void 0:Ht.data)==null?void 0:et.transaction_id),Z(!1),x({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}))})}};if((g==null?void 0:g.paymentGateway)===32){let Re={method:"POST",redirect:"follow"};try{let pt=await ka.post(`${Ve}api/v1/widget/generate-session`,Re);try{let Fe=await He.current.createToken({public_key_pem:((_t=(Xe=pt==null?void 0:pt.data)==null?void 0:Xe.data)==null?void 0:_t.publicKeyPem)||((Lt=(ct=pt==null?void 0:pt.data)==null?void 0:ct.data)==null?void 0:Lt.public_key_pem),session_key:(Qe=(Ct=pt==null?void 0:pt.data)==null?void 0:Ct.data)==null?void 0:Qe.session_key}),Ke=JSON.stringify(L(w({},Fe),{name:i==null?void 0:i.cardName,postal_code:i==null?void 0:i.zipCode,customer_id:t==null?void 0:t.customerId,amount:t==null?void 0:t.amount,Token:`${Fe==null?void 0:Fe.token}`,fractalpayPublicKey:ve,order_id:t==null?void 0:t.orderID,preAuth_id:(t==null?void 0:t.preauthId)||"",isCardSave:M,discount:t==null?void 0:t.discount,surcharge:t==null?void 0:t.surcharge,tax:t==null?void 0:t.tax,link_token:"",ExpirationYear:i==null?void 0:i.expiryYear,ExpirationMonth:i==null?void 0:i.expiryMonth,CVV:i==null?void 0:i.cvv,Last4:Fe==null?void 0:Fe.last4,Brand:Fe==null?void 0:Fe.brand,gateway_id:g==null?void 0:g.paymentGateway,pass_fee:t==null?void 0:t.pass_fee})),Ht={method:"POST",headers:{"Content-Type":"application/json"},body:Ke,redirect:"follow"};Et.emit("sendMessage",w(L(w({},Ht),{isFractalPreauth:!0}),(t==null?void 0:t.sessionToken)&&{sessionToken:t.sessionToken})),Et.on("fractal-charge-preauth",et=>{var Xn;(et==null?void 0:et.status)=="Failed"?(Z(!1),G((et==null?void 0:et.message)||"Something went wrong , Try again later")):(ze((Xn=et==null?void 0:et.data)==null?void 0:Xn.transaction_id),J(!0),Z(!1))})}catch(Fe){console.log(Fe),Z(!1),G(((Kt=(qt=Fe==null?void 0:Fe.response)==null?void 0:qt.data)==null?void 0:Kt.message)||(Fe==null?void 0:Fe.message)||"Something went wrong , Try again later")}}catch(pt){Z(!1),G(((Gt=(Zt=pt==null?void 0:pt.response)==null?void 0:Zt.data)==null?void 0:Gt.message)||(pt==null?void 0:pt.message)||"Something went wrong , Try again later")}}else DatacapWebToken.requestToken(g==null?void 0:g.dctoken,"PaymentForm",Tt)}catch(Tt){Z(!1),G(((Xt=(De=Tt==null?void 0:Tt.response)==null?void 0:De.data)==null?void 0:Xt.message)||(Tt==null?void 0:Tt.message)||"Something went wrong.")}}}}}},R=async()=>{var $,j,Xe,_t,ct,Lt,Ct,Qe,qt,Kt,Zt,Gt,De,Xt,ln,gn,pn,fn,Tt,Re,pt;yt();try{let Fe={fractalpayPublicKey:ve,customer_id:t==null?void 0:t.customerId,preauth:!0,isReader:!!(t!=null&&t.isReader)},Ke=await ka.post(`${lt}get-payment-details`,Fe);if(Ce(($=Ke==null?void 0:Ke.data)==null?void 0:$.data),(Xe=(j=Ke==null?void 0:Ke.data)==null?void 0:j.data)!=null&&Xe.paymentGateway||(be(),G("Something went wrong.")),(ct=(_t=Ke==null?void 0:Ke.data)==null?void 0:_t.data)!=null&&ct.card_list&&((Qe=(Ct=(Lt=Ke==null?void 0:Ke.data)==null?void 0:Lt.data)==null?void 0:Ct.card_list)==null?void 0:Qe.length)>0){te("card"),E((Kt=(qt=Ke==null?void 0:Ke.data)==null?void 0:qt.data)==null?void 0:Kt.card_list),((De=(Gt=(Zt=Ke==null?void 0:Ke.data)==null?void 0:Zt.data)==null?void 0:Gt.card_list)==null?void 0:De.length)>0&&zt("list");let Rt=(gn=(ln=(Xt=Ke==null?void 0:Ke.data)==null?void 0:Xt.data)==null?void 0:ln.card_list)==null?void 0:gn.filter(Ht=>(Ht==null?void 0:Ht.primary_card)==1);Rt!=null&&Rt[0]&&((pn=Rt==null?void 0:Rt[0])==null?void 0:pn.payment_method_type)==((Tt=(fn=Ke==null?void 0:Ke.data)==null?void 0:fn.data)==null?void 0:Tt.paymentGateway)&&o(Rt[0])}else te("card");we()}catch(Fe){console.log(Fe),we(),G(((pt=(Re=Fe==null?void 0:Fe.response)==null?void 0:Re.data)==null?void 0:pt.message)||(Fe==null?void 0:Fe.message)||"Something went wrong")}},ot=async $=>{var De,Xt,ln,gn,pn,fn,Tt;if($.currentTarget.blur(),H)return;let j=t==null?void 0:t.customerId,Xe=t==null?void 0:t.discount,_t=t==null?void 0:t.surcharge,ct=t==null?void 0:t.tax,Lt=t==null?void 0:t.merchantPublicKey,Ct=t==null?void 0:t.orderID,Qe=t==null?void 0:t.amount,qt=A==null?void 0:A.id,Kt=A==null?void 0:A.card_type,Zt=(t==null?void 0:t.preauthId)||"";if(Lt&&Ct&&Qe)if(j)if(qt){let Re={amount:Qe,order_id:Ct,customer_id:j,card_id:qt,fractalpayPublicKey:Lt,isCardSave:Kt!="Bank",discount:Xe,surcharge:_t,tax:ct,preAuth_id:Zt},Gt=Re,{isCardSave:pt}=Gt,Fe=ra(Gt,["isCardSave"]),Rt=lt+"authorize-by-card",Ht=w({"Content-Type":"application/json"},(t==null?void 0:t.sessionToken)&&{"X-Session-Token":t.sessionToken});Z(!0);try{let et=await ka.post(Rt,Kt=="Bank"?Fe:Re,{headers:Ht});(De=et==null?void 0:et.data)!=null&&De.result&&(ze((ln=(Xt=et==null?void 0:et.data)==null?void 0:Xt.data)==null?void 0:ln.transaction_id),J(!0),Z(!1))}catch(et){Z(!1),console.log(et),G(((pn=(gn=et==null?void 0:et.response)==null?void 0:gn.data)==null?void 0:pn.message)||((Tt=(fn=et==null?void 0:et.response)==null?void 0:fn.data)==null?void 0:Tt.status)||"Something went erong")}}else G("Please Select A Card/ACH");else G("Please Select Customer");else G("Something went wrong.")};qa(()=>{ye&&ve&&R()},[ve,ye]);let yn=async $=>{Za.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 j=>{if(j.isConfirmed){Z(!0);try{let Xe={card_id:$,customer_id:t==null?void 0:t.customerId,fractalpayPublicKey:t==null?void 0:t.merchantPublicKey},_t=await ka.post(`${lt}delete-customer-card`,Xe);Z(!1),R(),Za.fire({icon:"success",title:"Deleted!",text:"The card has been deleted.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}catch(Xe){Z(!1),Za.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}})},mt=$=>{switch($==null?void 0:$.toLowerCase()){case"visa":return Me;case"mastercard":case"mc":case"m/c":return ce;case"amex":case"american express":case"ae":return it;case"discover":case"dcvr":return Ft;case"bank":return Je;default:return $}},_=$=>{te($)},Qn=async $=>{var Lt,Ct,Qe,qt,Kt,Zt;if($.currentTarget.blur(),H)return;let j=t==null?void 0:t.merchantPublicKey,Xe=t==null?void 0:t.orderID,_t=String(t==null?void 0:t.amount),ct=t==null?void 0:t.customerId;if(!(Ne!=null&&Ne.device_id)){G("Please Select A Payment Device");return}if(j&&Xe&&_t){Z(!0);let Gt={amount:_t,fractalpayPublicKey:j,customer_order_id:Xe,device_id:Ne==null?void 0:Ne.device_id,customer_id:ct||"",is_auth:!0};try{let De=await ka.post(`${lt}charge-with-reader`,Gt);((Lt=De==null?void 0:De.data)==null?void 0:Lt.result)==!0?(ze((Qe=(Ct=De==null?void 0:De.data)==null?void 0:Ct.data)==null?void 0:Qe.transaction_id),J(!0),Z(!1)):(G(((qt=De==null?void 0:De.data)==null?void 0:qt.message)||"Something went wrong."),Z(!1))}catch(De){G(((Zt=(Kt=De==null?void 0:De.response)==null?void 0:Kt.data)==null?void 0:Zt.message)||"Something went wrong."),Z(!1)}}else G("Something went wrong.")},Cn=$=>{V==="card"?ot($):V==="reader"&&Qn($)};return qa(()=>{if(typeof FractalTokenizer=="undefined")return;let $=new FractalTokenizer({styles:{}})},[]),r.createElement(r.Fragment,null,r.createElement(Pn,null),r.createElement(Kn,null),r.createElement(ma,null),r.createElement(ta,null),r.createElement(r.Fragment,null,e&&r.createElement("button",{className:"paymentBtn",onClick:D},"PreAuth Payment"),r.createElement(wn,{open:ye,onClose:be},qe&&r.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},r.createElement(zn,{error:qe,onClose:be})),z&&r.createElement(ca,{onClose:be,tranId:dt}),!qe&&!z&&r.createElement(r.Fragment,null,(P||H)&&r.createElement(dn,{loading:P||H}),r.createElement("div",null,r.createElement("div",{className:"frac-card-payment-page frac-form"},r.createElement("div",{className:"parent-pay-container"},r.createElement("span",{className:"request-payment-close-popup",onClick:be},r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},r.createElement("g",{clipPath:"url(#clip0_12425_52336)"},r.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"})),r.createElement("defs",null,r.createElement("clipPath",{id:"clip0_12425_52336"},r.createElement("rect",{width:"16",height:"16",fill:"white"}))))),r.createElement("div",{className:"pay-container"},r.createElement("div",{className:"pay-header pay-conatiner-one"},r.createElement("div",{className:"pay-conatiner-one-first"},r.createElement("div",{className:"pay-logo-container"},r.createElement("div",{className:"pay-main-logo"},r.createElement("img",{src:g==null?void 0:g.logo,id:"pay-logos"}))),r.createElement("div",{className:"amt-pay-con"},r.createElement("div",{className:"pay-amount-conatiner"},r.createElement("small",{className:"pay-payment-amount"},"Select paymet type")),r.createElement("div",{className:"frac-card-bank-radio-main"},r.createElement(Ln,{label:"Card",amount:(kn=Number(t==null?void 0:t.amount))==null?void 0:kn.toFixed(2),value:"card",onChange:_,activetab:de}),(t==null?void 0:t.isReader)&&(g==null?void 0:g.paymentDeviceList)&&((Sn=g==null?void 0:g.paymentDeviceList)==null?void 0:Sn.length)>0&&r.createElement(Ln,{label:"Reader",amount:(rn=Number(t==null?void 0:t.amount))==null?void 0:rn.toFixed(2),value:"reader",onChange:_,activetab:de})))),r.createElement("div",{className:"pay-conatiner-one-last"},r.createElement("img",{src:W,alt:""}),r.createElement("img",{src:B,alt:""}),"Secure payments powered by Fractal"),r.createElement("div",null)),!P&&r.createElement("div",{className:"pay-tab pay-conatiner-two"},r.createElement("div",{className:"col-md-12"},r.createElement("div",{id:"payment-form-div"},de!=="cardList"?r.createElement("div",null,r.createElement("div",{className:""},r.createElement("div",{className:"res-pay-con"},r.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},r.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),r.createElement("strong",{className:"pay-amount"},ge((na=Number(t==null?void 0:t.amount))==null?void 0:na.toFixed(2)))),r.createElement("div",null,r.createElement("div",null,r.createElement("img",{src:Me,alt:"",width:35,style:{paddingRight:"5px"}}),r.createElement("img",{src:ce,width:35,alt:""})),r.createElement("div",null,r.createElement("img",{src:it,alt:"",width:35,style:{paddingRight:"5px"}}),r.createElement("img",{src:Ft,width:35,alt:""})))),m&&m>0&&r.createElement("div",{className:"res-pay-con frac-cash-discount"},r.createElement("div",{className:"frac-cashlabel"},On(g==null?void 0:g.showSurcharge)?"Surcharge":"Cash Discount"),r.createElement("div",null,ge(m.toFixed(2)))))):r.createElement("div",null,r.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",g==null?void 0:g.customer_name),r.createElement("div",{className:"res-pay-con"},r.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},r.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),r.createElement("strong",{className:"pay-amount"},ge((Nn=Number(t==null?void 0:t.amount))==null?void 0:Nn.toFixed(2)))),r.createElement("div",null,r.createElement("div",null,r.createElement("img",{src:Me,alt:"",width:35,style:{paddingRight:"5px"}}),r.createElement("img",{src:ce,width:35,alt:""})),r.createElement("div",null,r.createElement("img",{src:it,alt:"",width:35,style:{paddingRight:"5px"}}),r.createElement("img",{src:Ft,width:35,alt:""})))),r.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," Cards")),r.createElement("div",{id:"card",style:{display:de==="card"?"block":"none"},className:"tabcontent"},r.createElement("div",{className:"frac-card-payment"},r.createElement("div",{className:"frac-heading-card-wrap"},r.createElement("div",{className:"frac-backarrow"},(T==null?void 0:T.length)>0&&me==="form"&&r.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>zt("list")}," ",r.createElement(fo,null)),m&&m>0&&r.createElement("div",{className:"res-pay-con frac-cash-discount"},r.createElement("div",{className:"frac-cashlabel"},On(g==null?void 0:g.showSurcharge)?"Surcharge":"Cash Discount"),r.createElement("div",null,ge(m.toFixed(2))))),r.createElement("h6",{className:"frac-card-payment-heading"},"Card Authorization")),de!="ach"&&r.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},r.createElement("img",{src:Me,alt:"",width:33}),r.createElement("img",{src:ce,width:33,alt:""}),r.createElement("img",{src:it,alt:"",width:33}),r.createElement("img",{src:Ft,width:33,alt:""}))),me==="list"?r.createElement(r.Fragment,null,r.createElement(En,{listHeading:"Cards",paymentGateway:g==null?void 0:g.paymentGateway,ListItems:T,selectedCard:A,setSelectedCard:o,handleDeleteCard:yn,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{zt("form")}}),r.createElement("div",{className:"form-group",style:{padding:"0"}},r.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Cn},ge((Fn=Number(t==null?void 0:t.amount))==null?void 0:Fn.toFixed(2))))):r.createElement("div",{id:"card",style:{display:de==="card"?"block":"none"},className:"tabcontent"},(g==null?void 0:g.paymentGateway)===32?r.createElement("form",{id:"paymentForm",onSubmit:pe,onKeyDown:$=>{$.key==="Enter"&&H&&($.preventDefault(),$.stopPropagation())}},r.createElement("div",{className:"ach-scrl",style:{minHeight:(T==null?void 0:T.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"cardHolderName"},"Name on Card"),r.createElement("input",{type:"text",className:"form-control",placeholder:"John Doe",value:(i==null?void 0:i.cardName)||"",onChange:$=>{let j=$.target.value;/^[a-zA-Z\s]*$/.test(j)&&ae("cardName",j)}}),(s==null?void 0:s.cardName)&&r.createElement("span",{className:"error-span"},s==null?void 0:s.cardName)),r.createElement("div",{className:"form-group"},r.createElement("label",null,"CARD NUMBER"),r.createElement("div",{className:"toggle-num-wrapper"},ye&&(g==null?void 0:g.paymentGateway)===32&&r.createElement(Jn,{fractalStyles:xt,tokenizerRef:He}))),r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),r.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"Enter Order id",disabled:!0,value:t==null?void 0:t.orderID,onChange:$=>ae("orderId",$.target.value),style:{background:"#F6F6F7",color:"#727272"}})),r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"zip"},"ZIP"),r.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(aa=i==null?void 0:i.zipCode)!=null?aa:"",onChange:$=>ae("zipCode",$.target.value)}),(s==null?void 0:s.zipCode)&&r.createElement("span",{className:"error-span"},s==null?void 0:s.zipCode)),(t==null?void 0:t.customerId)&&r.createElement("div",{className:"form-group"},r.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},r.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:M,onChange:$=>C($.target.checked)}),r.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),r.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),r.createElement("div",{className:"frac-tooltip-wrapper"},r.createElement("div",{className:"frac-tooltip-icon"},r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},r.createElement("g",{clipPath:"url(#clip0_12420_50192)"},r.createElement("rect",{width:"20",height:"20",fill:"white"}),r.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),r.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"})),r.createElement("defs",null,r.createElement("clipPath",{id:"clip0_12420_50192"},r.createElement("rect",{width:"20",height:"20",fill:"white"}))))),r.createElement("div",{className:"frac-tooltip-text"},r.createElement("p",null,"If checked, I agree to give the ",r.createElement("b",null,(g==null?void 0:g.bname)||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),r.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:0}},r.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ge((_n=Number(t==null?void 0:t.amount))==null?void 0:_n.toFixed(2))))):r.createElement("form",{id:"PaymentForm",onSubmit:pe,onKeyDown:$=>{$.key==="Enter"&&H&&($.preventDefault(),$.stopPropagation())}},r.createElement("div",{className:"ach-scrl",style:{minHeight:(T==null?void 0:T.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"cardHolderName"},"Name on Card"),r.createElement("input",{type:"text",className:"form-control",placeholder:"John Doe",value:(i==null?void 0:i.cardName)||"",onChange:$=>{let j=$.target.value;/^[a-zA-Z\s]*$/.test(j)&&ae("cardName",j)}}),(s==null?void 0:s.cardName)&&r.createElement("span",{className:"error-span"},s==null?void 0:s.cardName)),r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"cardNumber"},"Card Number"),r.createElement("div",{className:"toggle-num-wrapper"},r.createElement("input",{className:"form-control card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(i==null?void 0:i.cardNumber)||"",onChange:$=>k($),"data-token":"card_number"}),r.createElement("div",{className:"card-crdi card-expiry-new"},r.createElement("div",{className:"exp-date-year-container"},r.createElement("div",{className:"exp-date form-group"},r.createElement("input",{"data-token":"exp_month",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(i==null?void 0:i.expiryMonth)||"",onChange:$=>ae("expiryMonth",$.target.value)})),r.createElement("div",{className:"exp-year form-group"},r.createElement("input",{"data-token":"exp_year",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(i==null?void 0:i.expiryYear)||"",onChange:$=>ae("expiryYear",$.target.value)})),r.createElement("div",{className:"security-digit form-group"},r.createElement("input",{"data-token":"cvv",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(i==null?void 0:i.cvv)||"",onChange:$=>ae("cvv",$.target.value)})))),(s==null?void 0:s.cardNumber)&&r.createElement("span",{className:"error-span"},s==null?void 0:s.cardNumber),r.createElement("p",{style:{margin:"0"}},s!=null&&s.expiryMonth||s!=null&&s.expiryYear?r.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},s==null?void 0:s.expiryMonth):"",(s==null?void 0:s.cvv)&&r.createElement("span",{className:"error-span"},s==null?void 0:s.cvv)))),r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),r.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"Enter Order id",disabled:!0,value:t==null?void 0:t.orderID,onChange:$=>ae("orderId",$.target.value),style:{background:"#F6F6F7",color:"#727272"}})),r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"zip"},"ZIP"),r.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(un=i==null?void 0:i.zipCode)!=null?un:"",onChange:$=>ae("zipCode",$.target.value)}),(s==null?void 0:s.zipCode)&&r.createElement("span",{className:"error-span"},s==null?void 0:s.zipCode)),(t==null?void 0:t.customerId)&&r.createElement("div",{className:"form-group"},r.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},r.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:M,onChange:$=>C($.target.checked)}),r.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),r.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),r.createElement("div",{className:"frac-tooltip-wrapper"},r.createElement("div",{className:"frac-tooltip-icon"},r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},r.createElement("g",{clipPath:"url(#clip0_12420_50192)"},r.createElement("rect",{width:"20",height:"20",fill:"white"}),r.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),r.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"})),r.createElement("defs",null,r.createElement("clipPath",{id:"clip0_12420_50192"},r.createElement("rect",{width:"20",height:"20",fill:"white"}))))),r.createElement("div",{className:"frac-tooltip-text"},r.createElement("p",null,"If checked, I agree to give the ",r.createElement("b",null,(g==null?void 0:g.bname)||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),r.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:0}},r.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ge((Hn=Number(t==null?void 0:t.amount))==null?void 0:Hn.toFixed(2))))))),r.createElement("div",{id:"reader",style:{display:de==="reader"?"block":"none"},className:"tabcontent"},r.createElement("div",{className:"frac-card-payment"},r.createElement("div",{className:"frac-heading-card-wrap"},r.createElement("div",{className:"frac-backarrow"},m&&m>0&&r.createElement("div",{className:"res-pay-con frac-cash-discount"},r.createElement("div",{className:"frac-cashlabel"},On(g==null?void 0:g.showSurcharge)?"Surcharge":"Cash Discount"),r.createElement("div",null,ge(m.toFixed(2))))),r.createElement("h6",{className:"frac-card-payment-heading"},"Reader Authorization"))),r.createElement(Aa,{listHeading:"Reader",ListItems:g==null?void 0:g.paymentDeviceList,selectedPax:Ne,setSlectedPax:st}),r.createElement("button",{onClick:Qn,className:"pay-button"},"$",(bn=Number(t==null?void 0:t.amount))==null?void 0:bn.toFixed(2))))))))))))))}import oe,{useEffect as vi,useRef as ha,useState as ua}from"react";import vo from"sweetalert2";import Ha from"axios";import yo from"react";function Ga(){let e="#000",t="#fff",q="#212529",I="#dee2e6";return yo.createElement("style",null,`
|
|
1760
|
-
.add-card {
|
|
1761
|
-
max-width:380px;
|
|
1762
|
-
padding: 0 20px
|
|
1763
|
-
}
|
|
1764
|
-
.add-card .form-group {
|
|
1765
|
-
margin-bottom: 5px;
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
.add-card .idle-green-btn {
|
|
1769
|
-
color: white;
|
|
1770
|
-
background-color: rgba(97, 198, 153, 1);
|
|
1771
|
-
border-radius: 100px;
|
|
1772
|
-
border: none !important;
|
|
1773
|
-
padding: 12px 24px 12px 24px;
|
|
1774
|
-
width: 100%;
|
|
1775
|
-
cursor:pointer
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
|
-
.add-card .idle-green-btn:hover {
|
|
1779
|
-
background-color: rgba(65, 164, 120, 1) !important;
|
|
1780
|
-
}
|
|
1781
|
-
|
|
1782
|
-
.add-card .idle-green-btn:focus {
|
|
1783
|
-
border: 2px solid rgba(90, 172, 136, 1) !important;
|
|
1784
|
-
background-color: rgba(97, 198, 153, 1) !important;
|
|
1785
|
-
padding: 10px 24px 10px 24px;
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
.add-card .container-creditcard {
|
|
1789
|
-
width: 426px;
|
|
1790
|
-
padding: 24px;
|
|
1791
|
-
background-color: #FFFFFF;
|
|
1792
|
-
border-radius: 24px;
|
|
1793
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
1794
|
-
}
|
|
1795
|
-
.add-card .container-creditcard .request-payment-close-popup{
|
|
1796
|
-
position:absolute;
|
|
1797
|
-
// background:red
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
.add-card h2 {
|
|
1801
|
-
font-size: 24px;
|
|
1802
|
-
line-height: 32px;
|
|
1803
|
-
font-weight: 500;
|
|
1804
|
-
color: #35254D;
|
|
1805
|
-
margin-bottom: 24px;
|
|
1806
|
-
text-align: center;
|
|
1807
|
-
}
|
|
1808
|
-
.add-card .form-group {
|
|
1809
|
-
margin-top: 20px;
|
|
1810
|
-
margin-bottom : 10px
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
.add-card .credit-card {
|
|
1814
|
-
display: flex;
|
|
1815
|
-
flex-direction: column;
|
|
1816
|
-
justify-content: space-between;
|
|
1817
|
-
align-items: flex-start;
|
|
1818
|
-
padding: 20px;
|
|
1819
|
-
background-color: #35254D;
|
|
1820
|
-
color: #FFFFFF;
|
|
1821
|
-
border-radius: 15px;
|
|
1822
|
-
margin-bottom: 20px;
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
.add-card .credit-card .chip {
|
|
1826
|
-
width: 50px;
|
|
1827
|
-
height: 30px;
|
|
1828
|
-
background-image: url('https://raw.githubusercontent.com/danieldasilvaa/creditcard-html-css/main/chip.png');
|
|
1829
|
-
background-size: cover;
|
|
1830
|
-
margin-bottom: 10px;
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
.add-card .credit-card .card-number {
|
|
1834
|
-
font-size: 18px;
|
|
1835
|
-
letter-spacing: 2px;
|
|
1836
|
-
margin-bottom: 10px;
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
.add-card .credit-card .card-info {
|
|
1840
|
-
font-size: 14px;
|
|
1841
|
-
margin-bottom: 5px;
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
.add-card label {
|
|
1845
|
-
font-size: 12px;
|
|
1846
|
-
font-family: 'IBM Plex Mono', monospace;
|
|
1847
|
-
font-weight: 400;
|
|
1848
|
-
text-transform: uppercase;
|
|
1849
|
-
color: #35254D;
|
|
1850
|
-
margin-bottom: 6px;
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
.add-card input[type="text"],
|
|
1854
|
-
.add-card input[type="number"],
|
|
1855
|
-
.add-card input[type="date"],
|
|
1856
|
-
.add-card input[type="email"],
|
|
1857
|
-
.add-card select {
|
|
1858
|
-
width: 100%;
|
|
1859
|
-
padding: 12px;
|
|
1860
|
-
font-size: 14px;
|
|
1861
|
-
font-weight: 500;
|
|
1862
|
-
color: #35254D;
|
|
1863
|
-
border: 1px solid #D4CDDF;
|
|
1864
|
-
border-radius: 6px;
|
|
1865
|
-
background-color: #FFFFFF;
|
|
1866
|
-
box-sizing: border-box;
|
|
1867
|
-
// margin-bottom: 20px;
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
.add-card input[type="text"]::placeholder {
|
|
1871
|
-
color: #867C94;
|
|
1872
|
-
}
|
|
1873
|
-
|
|
1874
|
-
// .add-card input[type="submit"] {
|
|
1875
|
-
// width: 100%;
|
|
1876
|
-
// padding: 12px;
|
|
1877
|
-
// background-color: #161616;
|
|
1878
|
-
// color: #FFFFFF;
|
|
1879
|
-
// font-size: 14px;
|
|
1880
|
-
// font-weight: 500;
|
|
1881
|
-
// border: none;
|
|
1882
|
-
// border-radius: 1000px;
|
|
1883
|
-
// cursor: pointer;
|
|
1884
|
-
// text-align: center;
|
|
1885
|
-
// }
|
|
1886
|
-
|
|
1887
|
-
.add-card input[type="submit"]:hover {
|
|
1888
|
-
background-color: #000000;
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
.add-card .error {
|
|
1892
|
-
font-size: 12px;
|
|
1893
|
-
color: red;
|
|
1894
|
-
margin-top: -15px;
|
|
1895
|
-
margin-bottom: 15px;
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
/* Tab Styling */
|
|
1899
|
-
.add-card .tabs {
|
|
1900
|
-
display: flex;
|
|
1901
|
-
gap: 4px;
|
|
1902
|
-
margin-bottom: 24px;
|
|
1903
|
-
justify-content: center;
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1906
|
-
.add-card .tab {
|
|
1907
|
-
display: flex;
|
|
1908
|
-
justify-content: center;
|
|
1909
|
-
align-items: center;
|
|
1910
|
-
padding: 6px 16px;
|
|
1911
|
-
font-size: 14px;
|
|
1912
|
-
font-weight: 500;
|
|
1913
|
-
border: 1px solid #D4CDDF;
|
|
1914
|
-
border-radius: 1000px;
|
|
1915
|
-
cursor: pointer;
|
|
1916
|
-
}
|
|
1917
|
-
|
|
1918
|
-
.add-card .tab.active {
|
|
1919
|
-
border-color: #35254D;
|
|
1920
|
-
color: #35254D;
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
.add-card .tab:hover {
|
|
1924
|
-
border-color: #867C94;
|
|
1925
|
-
}
|
|
1926
|
-
|
|
1927
|
-
/* Buttons */
|
|
1928
|
-
.add-card .button-close {
|
|
1929
|
-
display: inline-block;
|
|
1930
|
-
background-color: #161616;
|
|
1931
|
-
color: #FFFFFF;
|
|
1932
|
-
font-size: 14px;
|
|
1933
|
-
font-weight: 500;
|
|
1934
|
-
padding: 12px 32px;
|
|
1935
|
-
border-radius: 1000px;
|
|
1936
|
-
text-align: center;
|
|
1937
|
-
cursor: pointer;
|
|
1938
|
-
width: 48%;
|
|
1939
|
-
box-sizing: border-box;
|
|
1940
|
-
}
|
|
1941
|
-
|
|
1942
|
-
.add-card .button-close:hover {
|
|
1943
|
-
background-color: #000000;
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
.add-card .btn-add1 {
|
|
1947
|
-
display: inline-block;
|
|
1948
|
-
background-color: #61c699;
|
|
1949
|
-
color: #FFFFFF;
|
|
1950
|
-
font-size: 14px;
|
|
1951
|
-
font-weight: 500;
|
|
1952
|
-
padding: 12px 32px;
|
|
1953
|
-
border-radius: 1000px;
|
|
1954
|
-
text-align: center;
|
|
1955
|
-
cursor: pointer;
|
|
1956
|
-
width: 48%;
|
|
1957
|
-
box-sizing: border-box;
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
.add-card .btn-add1:hover {
|
|
1961
|
-
background-color: #B5E1CB;
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
/* Combined Expiration Date and CVC Row */
|
|
1965
|
-
.add-card .exp-cvc-container {
|
|
1966
|
-
display: flex;
|
|
1967
|
-
justify-content: space-between;
|
|
1968
|
-
gap: 16px;
|
|
1969
|
-
margin-bottom: 5px;
|
|
1970
|
-
}
|
|
1971
|
-
|
|
1972
|
-
.add-card .exp-cvc-container input {
|
|
1973
|
-
flex: 1;
|
|
1974
|
-
padding: 12px;
|
|
1975
|
-
font-size: 14px;
|
|
1976
|
-
font-weight: 500;
|
|
1977
|
-
color: #35254D;
|
|
1978
|
-
border: 1px solid #D4CDDF;
|
|
1979
|
-
border-radius: 6px;
|
|
1980
|
-
background-color: #FFFFFF;
|
|
1981
|
-
box-sizing: border-box;
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
|
-
.add-card .exp-cvc-container input::placeholder {
|
|
1985
|
-
color: #867C94;
|
|
1986
|
-
}
|
|
1987
|
-
|
|
1988
|
-
.card-scrl {
|
|
1989
|
-
overflow-y: auto;
|
|
1990
|
-
padding-right: 6px !important;
|
|
1991
|
-
}
|
|
1992
|
-
.card-scrl::-webkit-scrollbar {
|
|
1993
|
-
width: 3px;
|
|
1994
|
-
background-color: #F5F5F5;
|
|
1995
|
-
}
|
|
1996
|
-
.card-scrl::-webkit-scrollbar-thumb {
|
|
1997
|
-
background-color: #35254D;
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
.custom-z-index {
|
|
2001
|
-
z-index: 9999 !important;
|
|
2002
|
-
}
|
|
2003
|
-
#add-credit-card-panel{
|
|
2004
|
-
padding: auto 10px !important}
|
|
2005
|
-
/* Responsive Design */
|
|
2006
|
-
@media screen and (max-width: 768px) {
|
|
2007
|
-
.add-card .container-creditcard {
|
|
2008
|
-
width: 90%;
|
|
2009
|
-
padding: 20px;
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
.add-card input[type="submit"] {
|
|
2013
|
-
font-size: 12px;
|
|
2014
|
-
padding: 10px;
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
.exp-cvc-container-wrap div#exp_month, .exp-cvc-container-wrap div#exp_year, .exp-cvc-container-wrap div#cvv {
|
|
2018
|
-
border: 1px solid #dee2e6;
|
|
2019
|
-
height: 47px;
|
|
2020
|
-
border-radius: 0.375rem;
|
|
2021
|
-
padding: 0px 12px;
|
|
2022
|
-
|
|
2023
|
-
}
|
|
2024
|
-
div#card_number{
|
|
2025
|
-
border: 1px solid #dee2e6 !important;
|
|
2026
|
-
border-radius: 0.375rem !important;
|
|
2027
|
-
padding: 0px 12px;
|
|
2028
|
-
}
|
|
2029
|
-
input#cardholderName::placeholder {
|
|
2030
|
-
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
|
2031
|
-
color: #35254D;
|
|
2032
|
-
}
|
|
2033
|
-
`)}import Zn from"react";import bo from"react";function Wa(){return bo.createElement("style",null,`
|
|
2034
|
-
.card-success .logo-container {
|
|
2035
|
-
display: flex;
|
|
2036
|
-
justify-content: center;
|
|
2037
|
-
align-items: center;
|
|
2038
|
-
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
2039
|
-
z-index: 10;
|
|
2040
|
-
}
|
|
2041
|
-
|
|
2042
|
-
.card-success .client-logo {
|
|
2043
|
-
max-width: 100px;
|
|
2044
|
-
height: auto;
|
|
2045
|
-
object-fit: contain;
|
|
2046
|
-
display: block;
|
|
2047
|
-
}
|
|
2048
|
-
|
|
2049
|
-
.card-success .payment-success-container {
|
|
2050
|
-
display: flex;
|
|
2051
|
-
flex-direction: column;
|
|
2052
|
-
align-items: center;
|
|
2053
|
-
padding: 18px 20px 24px;
|
|
2054
|
-
width: 335px;
|
|
2055
|
-
height: 400px; /* Fixed height */
|
|
2056
|
-
background: #FFFFFF;
|
|
2057
|
-
border-radius: 12px;
|
|
2058
|
-
position: relative;
|
|
2059
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
2060
|
-
border: 1px solid #e3e3e3;
|
|
2061
|
-
justify-content: center;
|
|
2062
|
-
text-align: center;
|
|
2063
|
-
// margin-top: 50px; /* Adjust this to move the content down */
|
|
2064
|
-
margin: 50px auto 0 auto !important;
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
.card-success .success-icon {
|
|
2068
|
-
display: flex;
|
|
2069
|
-
flex-direction: column;
|
|
2070
|
-
align-items: center;
|
|
2071
|
-
gap: 12px;
|
|
2072
|
-
width: 227px;
|
|
2073
|
-
height: 116px;
|
|
2074
|
-
z-index: 2;
|
|
2075
|
-
}
|
|
2076
|
-
|
|
2077
|
-
.card-success .circle {
|
|
2078
|
-
width: 40px;
|
|
2079
|
-
height: 40px;
|
|
2080
|
-
border: 1px solid #49B182;
|
|
2081
|
-
border-radius: 50%;
|
|
2082
|
-
display: flex;
|
|
2083
|
-
justify-content: center;
|
|
2084
|
-
align-items: center;
|
|
2085
|
-
}
|
|
2086
|
-
|
|
2087
|
-
.card-success .circle .fa-check-circle {
|
|
2088
|
-
font-size: 20px;
|
|
2089
|
-
color: #49B182;
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
.card-success .success-text {
|
|
2093
|
-
display: flex;
|
|
2094
|
-
flex-direction: column;
|
|
2095
|
-
justify-content: center;
|
|
2096
|
-
align-items: center;
|
|
2097
|
-
gap: 4px;
|
|
2098
|
-
width: 227px;
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
.card-success .payment-success-text {
|
|
2102
|
-
font-family: 'Inter', sans-serif;
|
|
2103
|
-
font-weight: 500;
|
|
2104
|
-
font-size: 18px;
|
|
2105
|
-
line-height: 21px;
|
|
2106
|
-
text-align: center;
|
|
2107
|
-
letter-spacing: -0.02em;
|
|
2108
|
-
color: #161616;
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
|
-
.card-success .thank-you-text {
|
|
2112
|
-
font-family: 'Inter', sans-serif;
|
|
2113
|
-
font-weight: 500;
|
|
2114
|
-
font-size: 14px;
|
|
2115
|
-
line-height: 18px;
|
|
2116
|
-
text-align: center;
|
|
2117
|
-
letter-spacing: -0.02em;
|
|
2118
|
-
color: #161616;
|
|
2119
|
-
opacity: 0.5;
|
|
2120
|
-
}
|
|
2121
|
-
`)}var xo=({onClose:e})=>Zn.createElement(Zn.Fragment,null,Zn.createElement(Wa,null),Zn.createElement("div",{className:"card-success"},Zn.createElement("div",{className:"payment-success-container"},Zn.createElement("div",{className:"success-icon"},Zn.createElement("div",{className:"circle"},Zn.createElement("i",{className:"fa fa-check-circle","aria-hidden":"true"})),Zn.createElement("div",{className:"success-text"},Zn.createElement("div",{className:"payment-success-text"},"Your card was added successfully."),Zn.createElement("div",{className:"thank-you-text"},"Thank you ")))))),xi=xo;function Co(e){var Je,W;let[t,q]=ua(!1),[I,P]=ua(!1),[F,H]=ua(""),[Z,qe]=ua(!1),G=ha(null),z=ha(null),J=ha(null),ye=ha(null),v=ha(null),de=ha(null),te={input:{"font-family":"'Inter', sans-serif","font-size":"14px","font-weight":"500",color:"#35254D","background-color":"transparent",padding:"0px",appearance:"none",outline:"none",border:"none","box-shadow":"none"},":focus":{color:"#35254D",outline:"none",border:"none"},"::placeholder":{color:"#35254D"}},[M,C]=ua(),[V,h]=ua({}),[me,zt]=ua(),ve=()=>q(!0),Ne=()=>q(!1),st=B=>{vo.fire({icon:"error",text:B,customClass:{popup:"custom-z-index"}})},He=()=>{qe(!1),P(!1),H(""),C({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""})},xt=()=>qe(!0),ce=()=>{He()},Me=(B,i)=>{var N,T,E;let x=B,s=["expiryMonth","expiryYear","zipCode","cvv"];if(x==="expiryMonth"&&(i==null?void 0:i.length)===2&&((N=J==null?void 0:J.current)==null||N.focus()),x==="expiryYear"&&(i==null?void 0:i.length)===4&&((T=ye==null?void 0:ye.current)==null||T.focus()),x==="cvv"&&(i==null?void 0:i.length)===3&&((E=v==null?void 0:v.current)==null||E.focus()),s.includes(x)){(i===""||/^[0-9]+$/.test(i))&&(h(A=>L(w({},A),{[x]:""})),C(A=>L(w({},A),{[x]:i})));return}h(A=>L(w({},A),{[x]:""})),console.log(i,x),C(A=>L(w({},A),{[x]:i}))},it=B=>{var T,E;let i=B.target,x=i.value.replace(/\D/g,""),{formatted:s,cursor:N}=An(i.value,(T=i.selectionStart)!=null?T:0);h(A=>L(w({},A),{cardNumber:""})),C(A=>L(w({},A),{cardNumber:s})),console.log(x==null?void 0:x.length,"length"),(x==null?void 0:x.length)===16&&((E=z==null?void 0:z.current)==null||E.focus()),requestAnimationFrame(()=>{i.setSelectionRange(N,N)})},Ft=()=>{var x,s,N,T,E,A;let B={},i=M;if((me==null?void 0:me.paymentGateway)!==32){let o=parseInt((i==null?void 0:i.expiryMonth)||"",10),m=(i==null?void 0:i.expiryYear)||"";if((x=i==null?void 0:i.cardNumber)!=null&&x.trim()||(B.cardNumber="Card number is required"),(s=i==null?void 0:i.expiryMonth)!=null&&s.trim()?(Number(i==null?void 0:i.expiryMonth)>12||Number(i==null?void 0:i.expiryMonth)<1)&&(B.expiryMonth="Invalid Expiration Month."):B.expiryMonth="Expiration month is required",(N=i==null?void 0:i.expiryYear)!=null&&N.trim()?((T=i==null?void 0:i.expiryYear)==null?void 0:T.trim().length)!==4||Number(i==null?void 0:i.expiryYear)<2025?B.expiryYear="Invalid Expiration Year.":(isNaN(o)||o<1||o>12||m.length!==4)&&(B.expiryMonth="Invalid Expiration Date."):B.expiryYear="Expiration year is required",(E=i==null?void 0:i.cvv)!=null&&E.trim()||(B.cvv="CVC is required"),i!=null&&i.expiryMonth&&(i!=null&&i.expiryYear)&&i.expiryMonth.length<=2&&i.expiryYear.length===4){let b=parseInt(i.expiryMonth,10),g=parseInt(i.expiryYear,10),Ce=new Date,dt=Ce.getMonth()+1,ze=Ce.getFullYear();(g<ze||g===ze&&b<dt)&&(B.expiryMonth="Card is expired")}}return(A=i==null?void 0:i.cardName)!=null&&A.trim()||(B.cardName="Card name is required"),h(B),Object.keys(B).length>0},Dt=async()=>{var B,i,x;ve();try{let s={fractalpayPublicKey:e==null?void 0:e.merchantPublicKey,customer_id:e==null?void 0:e.customerId,addcard:!0},N=await Ha.post(`${lt}get-payment-details`,s);console.log(N),zt((B=N==null?void 0:N.data)==null?void 0:B.data),(x=(i=N==null?void 0:N.data)==null?void 0:i.data)!=null&&x.paymentGateway||(He(),H("Something went wrong.")),Ne()}catch(s){console.log(s),Ne(),He(),H("Something went wrong.")}};vi(()=>{e!=null&&e.merchantPublicKey&&Dt()},[e==null?void 0:e.merchantPublicKey]);let O=async B=>{var s,N,T,E,A,o,m,b,g,Ce,dt,ze,Oe,yt,we;B.preventDefault(),B.currentTarget.blur();let i=document.activeElement;if(i instanceof HTMLElement&&i.blur(),t)return;let x=Ft();if(console.log(M),!x){let be=!0,D=!0,ae=!0;if((me==null?void 0:me.paymentGateway)!==32){let k=DatacapWebToken.validateCardNumber(M==null?void 0:M.cardNumber.replaceAll(" ","")),ue=DatacapWebToken.validateExpirationDate(M==null?void 0:M.expiryMonth,M==null?void 0:M.expiryYear),pe=DatacapWebToken.validateCVV(M==null?void 0:M.cvv),R={};k||(R.cardNumber="Invalid card Number"),ue||(R.expiryMonth="Invalid Expiration Date."),pe||(R.cvv="Invalid CVV"),h(R)}if(be&&ae&&D){ve();try{let k=async function(ue){var pe,R,ot;if(console.log(ue),ue.Error)console.log(ue==null?void 0:ue.Error),H(ue.Error),Ne();else{let yn={userId:e==null?void 0:e.customerId,cardName:M==null?void 0:M.cardName,zip:M==null?void 0:M.zipCode,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey,token:ue};try{let mt=await Ha.post(`${lt}add-card`,yn);console.log(mt),(pe=mt==null?void 0:mt.data)!=null&&pe.result&&(P(!0),Ne(),C({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),oa(B,"close",""))}catch(mt){console.log(mt),Ne(),H(((ot=(R=mt==null?void 0:mt.response)==null?void 0:R.data)==null?void 0:ot.message)||(mt==null?void 0:mt.message)||"Something went wrong.")}}};if((me==null?void 0:me.paymentGateway)===32){let ue={method:"POST",redirect:"follow"};try{let pe=await Ha.post(`${Ve}api/v1/widget/generate-session`,ue);try{let R=await de.current.createToken({public_key_pem:((N=(s=pe==null?void 0:pe.data)==null?void 0:s.data)==null?void 0:N.publicKeyPem)||((E=(T=pe==null?void 0:pe.data)==null?void 0:T.data)==null?void 0:E.public_key_pem),session_key:(o=(A=pe==null?void 0:pe.data)==null?void 0:A.data)==null?void 0:o.session_key}),ot=JSON.stringify(L(w({},R),{cvv:M==null?void 0:M.cvv,cardName:M==null?void 0:M.cardName,zip:M==null?void 0:M.zipCode,userId:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey})),yn={"Content-Type":"application/json"};try{let mt=await Ha.post(`${lt}add-card`,ot,{headers:yn});console.log(mt),(m=mt==null?void 0:mt.data)!=null&&m.result&&(P(!0),Ne(),oa(B,"close",""))}catch(mt){Ne(),H(((g=(b=mt==null?void 0:mt.response)==null?void 0:b.data)==null?void 0:g.message)||(mt==null?void 0:mt.message)||"Something went wrong.")}}catch(R){Ne(),H(((dt=(Ce=R==null?void 0:R.response)==null?void 0:Ce.data)==null?void 0:dt.message)||(R==null?void 0:R.message)||"Something went wrong.")}}catch(pe){Ne(),H(((Oe=(ze=pe==null?void 0:pe.response)==null?void 0:ze.data)==null?void 0:Oe.message)||(pe==null?void 0:pe.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(me==null?void 0:me.dctoken,"creditCardForm",k)}catch(k){Ne(),H(((we=(yt=k==null?void 0:k.response)==null?void 0:yt.data)==null?void 0:we.message)||(k==null?void 0:k.message)||"Something went wrong.")}}}};return vi(()=>{if(typeof FractalTokenizer=="undefined")return;let B=new FractalTokenizer({styles:{}})},[]),oe.createElement(oe.Fragment,null,oe.createElement(Pn,null),oe.createElement(Kn,null),oe.createElement(Ga,null),oe.createElement(dn,{loading:t}),F&&oe.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},oe.createElement(zn,{error:F,onClose:He})),I&&oe.createElement(xi,{onClose:ce}),!F&&!I&&oe.createElement(oe.Fragment,null,oe.createElement("div",{className:"container-creditcard add-card modal-content",id:"add-credit-card-panel",style:{margin:"auto"}},(me==null?void 0:me.paymentGateway)===32?oe.createElement("form",{id:"paymentForm",onSubmit:O,onKeyDown:B=>{B.key==="Enter"&&t&&(B.preventDefault(),B.stopPropagation())}},oe.createElement("div",{style:{maxHeight:"350px",minHeight:"0"},className:"card-scrl"},oe.createElement("div",{className:"form-group",style:{marginTop:"0",marginBottom:"10px"}},oe.createElement("label",{htmlFor:"cardNumber"},"Card Number"),(me==null?void 0:me.paymentGateway)===32&&oe.createElement(Jn,{fractalStyles:te,tokenizerRef:de,isAddCard:!0})),oe.createElement("div",{className:"form-group",style:{marginTop:"0"}},oe.createElement("label",{htmlFor:"cardholderName"},"Name on card"),oe.createElement("input",{type:"text",id:"cardholderName",name:"cardholderName",placeholder:"Card Number Name on card required",value:(M==null?void 0:M.cardName)||"",onChange:B=>{let i=B.target.value;/^[a-zA-Z\s]*$/.test(i)&&Me("cardName",i)},ref:v}),(V==null?void 0:V.cardName)&&oe.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cardName)),oe.createElement("div",{className:"form-group",style:{marginTop:"0"}},oe.createElement("label",{htmlFor:"zipcode"},"Zip"),oe.createElement("input",{type:"text",id:"",name:"zipcode",placeholder:"Zip",value:(Je=M==null?void 0:M.zipCode)!=null?Je:"",onChange:B=>Me("zipCode",B.target.value)}),(V==null?void 0:V.zipCode)&&oe.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.zipCode)))):oe.createElement("form",{id:"creditCardForm",onSubmit:O,onKeyDown:B=>{B.key==="Enter"&&t&&(B.preventDefault(),B.stopPropagation())},style:{padding:"0 10px"}},oe.createElement("div",{style:{maxHeight:"350px",minHeight:"0"},className:"card-scrl"},oe.createElement("div",{className:"form-group",style:{marginTop:"0",marginBottom:"10px"}},oe.createElement("label",{htmlFor:"cardNumber"},"Card Number"),oe.createElement("input",{type:"text","data-token":"card_number",placeholder:"Enter card number",maxLength:19,inputMode:"numeric",value:(M==null?void 0:M.cardNumber)||"",onChange:B=>it(B),ref:G}),(V==null?void 0:V.cardNumber)&&oe.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cardNumber),oe.createElement("br",null)),oe.createElement("div",{className:"card-dtl"},oe.createElement("div",{className:"exp-cvc-container",style:{margin:"0"}},oe.createElement("div",{className:"form-group",style:{marginTop:"0"}},oe.createElement("label",{htmlFor:"expMonth"},"MM"),oe.createElement("input",{"data-token":"exp_month",className:"form-control required",type:"text",placeholder:"MM",maxLength:2,value:(M==null?void 0:M.expiryMonth)||"",onChange:B=>Me("expiryMonth",B.target.value),ref:z}),(V==null?void 0:V.expiryMonth)&&oe.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.expiryMonth)),oe.createElement("div",{className:"form-group",style:{marginTop:"0"}},oe.createElement("label",{htmlFor:"expYear"},"YYYY"),oe.createElement("input",{"data-token":"exp_year",className:"form-control required",type:"text",placeholder:"YYYY",maxLength:4,value:(M==null?void 0:M.expiryYear)||"",onChange:B=>Me("expiryYear",B.target.value),ref:J}),(V==null?void 0:V.expiryYear)&&oe.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.expiryYear)),oe.createElement("div",{className:"form-group",style:{marginTop:"0"}},oe.createElement("label",{htmlFor:"cvc"},"CVC"),oe.createElement("input",{"data-token":"cvv",className:"form-control required",type:"text",placeholder:"CVC",maxLength:4,value:(M==null?void 0:M.cvv)||"",onChange:B=>Me("cvv",B.target.value),ref:ye}),(V==null?void 0:V.cvv)&&oe.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cvv)))),oe.createElement("div",{className:"form-group",style:{marginTop:"0"}},oe.createElement("label",{htmlFor:"cardholderName"},"Name on card"),oe.createElement("input",{type:"text",id:"cardholderName",name:"cardholderName",placeholder:"Name on card required",value:(M==null?void 0:M.cardName)||"",onChange:B=>{let i=B.target.value;/^[a-zA-Z\s]*$/.test(i)&&Me("cardName",i)},ref:v}),(V==null?void 0:V.cardName)&&oe.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cardName)),oe.createElement("div",{className:"form-group",style:{marginTop:"0"}},oe.createElement("label",{htmlFor:"zipcode"},"Zip"),oe.createElement("input",{type:"text",id:"",name:"zipcode",placeholder:"Zip",value:(W=M==null?void 0:M.zipCode)!=null?W:"",onChange:B=>Me("zipCode",B.target.value)}),(V==null?void 0:V.zipCode)&&oe.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.zipCode))),oe.createElement("input",{type:"submit",className:"idle-green-btn w-100",defaultValue:"Submit",disabled:t})))))}import y,{useEffect as Ni,useRef as Fo,useState as ga}from"react";import Sa from"axios";var Ya={PROPAYKEY:"25",PAYARCKEY:"26",STRIPEKEYCC:"27",PAYRIXKEY:"28",SKYFIACHKEY:"29",JUSTIFIKEY:"30",INFINICEPTKEY:"31",FRACTALKEY:"32"};import No from"react";function Ua({}){return No.createElement("style",null,`
|
|
2122
|
-
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap");
|
|
2123
|
-
|
|
2124
|
-
.creditformbox {
|
|
2125
|
-
// max-width: 550px;
|
|
2126
|
-
margin: 0 auto;
|
|
2127
|
-
font-family: Poppins !important;
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
.name-row {
|
|
2131
|
-
display: grid;
|
|
2132
|
-
grid-gap: 10px;
|
|
2133
|
-
grid-template-columns:1fr 1fr;
|
|
2134
|
-
}
|
|
2135
|
-
|
|
2136
|
-
label {
|
|
2137
|
-
display: block;
|
|
2138
|
-
color: #383838;
|
|
2139
|
-
font-size: 16px;
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
.form-group span.text-danger{
|
|
2143
|
-
color:red;
|
|
2144
|
-
}
|
|
2145
|
-
.form-group small.error{
|
|
2146
|
-
color:red;
|
|
2147
|
-
font-size:11px;
|
|
2148
|
-
}
|
|
2149
|
-
.name-row .form-group {
|
|
2150
|
-
display: block;
|
|
2151
|
-
width: 100%;
|
|
2152
|
-
margin-bottom: 15px;
|
|
2153
|
-
}
|
|
2154
|
-
|
|
2155
|
-
.creditformbox input, .creditformbox select {
|
|
2156
|
-
border: 1.25px solid rgba(234, 236, 239, 1);
|
|
2157
|
-
color: rgba(94, 94, 94, 0.75);
|
|
2158
|
-
border-radius: 10px;
|
|
2159
|
-
width: -webkit-fill-available;
|
|
2160
|
-
padding: 10px 12px;
|
|
2161
|
-
font-size: .875rem;
|
|
2162
|
-
min-height: 20px;
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
.form-pay-row {
|
|
2166
|
-
display: block;
|
|
2167
|
-
width: 100%;
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
.form-pay-row .form-group {
|
|
2171
|
-
display: block;
|
|
2172
|
-
width: 100%;
|
|
2173
|
-
margin-bottom: 15px;
|
|
2174
|
-
}
|
|
2175
|
-
|
|
2176
|
-
.card-pay-row {
|
|
2177
|
-
display: flex;
|
|
2178
|
-
width: 100%;
|
|
2179
|
-
gap: 10px;
|
|
2180
|
-
flex-wrap: wrap;
|
|
2181
|
-
}
|
|
2182
|
-
|
|
2183
|
-
.card-pay-row .form-group {
|
|
2184
|
-
flex: 1;
|
|
2185
|
-
margin-bottom: 15px;
|
|
2186
|
-
min-width: 100px;
|
|
2187
|
-
}
|
|
2188
|
-
.card-pay-row #exp_month , .card-pay-row #exp_year, .card-pay-row #cvv , .form-pay-row #card_number{
|
|
2189
|
-
height: 20px;
|
|
2190
|
-
border: 1.25px solid rgba(234, 236, 239, 1);
|
|
2191
|
-
color: rgba(94, 94, 94, 0.75);
|
|
2192
|
-
border-radius: 10px;
|
|
2193
|
-
width: -webkit-fill-available;
|
|
2194
|
-
padding: 10px 12px;
|
|
2195
|
-
font-size: .875rem;
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
.creditformbox input:focus {
|
|
2199
|
-
color: #212529;
|
|
2200
|
-
background-color: #fff;
|
|
2201
|
-
border-color: #86b7fe;
|
|
2202
|
-
outline: 0;
|
|
2203
|
-
box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2206
|
-
.checks-row{
|
|
2207
|
-
display:flex;
|
|
2208
|
-
align-items:start;
|
|
2209
|
-
gap:10px
|
|
2210
|
-
}
|
|
2211
|
-
.checks-row input {
|
|
2212
|
-
border: 1.25px solid rgba(234, 236, 239, 1);
|
|
2213
|
-
color: rgba(94, 94, 94, 0.75);
|
|
2214
|
-
border-radius: 10px;
|
|
2215
|
-
min-width: 16px !important;
|
|
2216
|
-
width:16px !important;
|
|
2217
|
-
padding: 10px 12px;
|
|
2218
|
-
font-size: .875rem;
|
|
2219
|
-
max-height: 16px !important;
|
|
2220
|
-
height: 16px !important;
|
|
2221
|
-
}
|
|
2222
|
-
// .checks-row input.is-valid:checked{
|
|
2223
|
-
// background-color: #198754;
|
|
2224
|
-
// border-color: #198754;
|
|
2225
|
-
// 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);
|
|
2226
|
-
// }
|
|
2227
|
-
.check-error{
|
|
2228
|
-
color:red;
|
|
2229
|
-
font-size:11px;
|
|
2230
|
-
padding-left:25px
|
|
2231
|
-
}
|
|
2232
|
-
.button-row{
|
|
2233
|
-
display: flex;
|
|
2234
|
-
width: 100%;
|
|
2235
|
-
gap: 10px;
|
|
2236
|
-
flex-wrap: wrap;
|
|
2237
|
-
margin-top: 20px !important
|
|
2238
|
-
}
|
|
2239
|
-
.button-row .btn{
|
|
2240
|
-
flex: 1;
|
|
2241
|
-
margin-top:20px;
|
|
2242
|
-
}
|
|
2243
|
-
|
|
2244
|
-
.cancelbtn {
|
|
2245
|
-
font-size:15px;
|
|
2246
|
-
color: #000000 !important;
|
|
2247
|
-
background-color: transparent !important;
|
|
2248
|
-
background: transparent !important;
|
|
2249
|
-
border:1px solid #000000 !important;
|
|
2250
|
-
border-radius: 10px !important;
|
|
2251
|
-
padding: 10px 25px !important;
|
|
2252
|
-
cursor:pointer;
|
|
2253
|
-
font-size: 16px;
|
|
2254
|
-
}
|
|
2255
|
-
.cancelbtn:hover {
|
|
2256
|
-
background:#000000 !important;
|
|
2257
|
-
color:#ffffff !important;
|
|
2258
|
-
}
|
|
2259
|
-
|
|
2260
|
-
.savebtn {
|
|
2261
|
-
font-size:15px;
|
|
2262
|
-
color: #2979FF;
|
|
2263
|
-
background-color: transparent;
|
|
2264
|
-
background: transparent;
|
|
2265
|
-
border:1px solid #2979FF;
|
|
2266
|
-
border-radius: 10px;
|
|
2267
|
-
padding: 10px 25px;
|
|
2268
|
-
cursor:pointer;
|
|
2269
|
-
font-size: 16px;
|
|
2270
|
-
}
|
|
2271
|
-
.savebtn:hover {
|
|
2272
|
-
background:#2979FF;
|
|
2273
|
-
color:#ffffff;
|
|
2274
|
-
}
|
|
2275
|
-
|
|
2276
|
-
.toggle-label {
|
|
2277
|
-
position: relative;
|
|
2278
|
-
display: inline-block;
|
|
2279
|
-
width: 40px;
|
|
2280
|
-
height: 24px;
|
|
2281
|
-
background-color: #ccc;
|
|
2282
|
-
border-radius: 12px;
|
|
2283
|
-
cursor: pointer;
|
|
2284
|
-
transition: background-color 0.3s;
|
|
2285
|
-
}
|
|
2286
|
-
|
|
2287
|
-
.toggle-label::before {
|
|
2288
|
-
content: "";
|
|
2289
|
-
position: absolute;
|
|
2290
|
-
top: 2px;
|
|
2291
|
-
left: 2px;
|
|
2292
|
-
width: 20px;
|
|
2293
|
-
height: 20px;
|
|
2294
|
-
background: #ffffff;
|
|
2295
|
-
border-radius: 50%;
|
|
2296
|
-
transition: left 300ms linear;
|
|
2297
|
-
}
|
|
2298
|
-
|
|
2299
|
-
.toggle-checkbox {
|
|
2300
|
-
display: none;
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
.toggle-checkbox:checked + .toggle-label {
|
|
2304
|
-
background-color: #4caf50;
|
|
2305
|
-
}
|
|
2306
|
-
|
|
2307
|
-
.toggle-checkbox:checked + .toggle-label::before {
|
|
2308
|
-
left: 18px;
|
|
2309
|
-
}
|
|
2310
|
-
.pass-fee-toggle-div {
|
|
2311
|
-
display: flex;
|
|
2312
|
-
align-items: center;
|
|
2313
|
-
gap: 10px;
|
|
2314
|
-
padding-top: 10px;
|
|
2315
|
-
}
|
|
2316
|
-
`)}import{useEffect as wo,useRef as ko}from"react";var So=({fractalStyles:e,tokenizerRef:t,extraInputs:q})=>{let I=ko(null);return wo(()=>{if(!window.FractalTokenizer)return;let P=new window.FractalTokenizer({styles:e});return I.current=P,t.current=P,P.mountField("card_number","card_number"),P.mountField("exp_month","exp_month"),P.mountField("exp_year","exp_year"),P.mountField("cvv","cvv"),console.log("Fractal fields mounted"),()=>{var F;try{(F=P.destroy)==null||F.call(P)}catch(H){}t.current=null}},[]),React.createElement(React.Fragment,null,React.createElement("div",{className:"form-pay-row"},React.createElement("div",{className:"form-group"},React.createElement("label",null," Card Number ",React.createElement("span",{className:"text-danger"},"*")),React.createElement("div",{id:"card_number",className:"form-control card-number-new"}))),React.createElement("div",{className:"card-pay-row"},React.createElement("div",{className:"form-group"},React.createElement("label",null," Exp Month ",React.createElement("span",{className:"text-danger"},"*")),React.createElement("div",{id:"exp_month",className:"form-control required card-cvv-in"})),React.createElement("div",{className:"form-group"},React.createElement("label",null," Exp Year ",React.createElement("span",{className:"text-danger"},"*")),React.createElement("div",{id:"exp_year",className:"form-control required card-cvv-in"})),React.createElement("div",{className:"form-group"},React.createElement("label",null," CVV ",React.createElement("span",{className:"text-danger"},"*")),React.createElement("div",{id:"cvv",className:"form-control card-cvv-in required"})),q))},Ci=So;function _o({session_token:e,callback:t,isloading:q,onCancel:I,showChecks:P,merchantName:F,signCheckbox:H,checkedSignCheckbox:Z,onCheckSign:qe,cancelbtnClass:G,savebtnClass:z,inputClass:J,isDual:ye}){var E,A;let[v,de]=ga(!1),[te,M]=ga(!1),[C,V]=ga(),[h,me]=ga({}),[zt,ve]=ga(""),Ne=()=>de(!0),st=()=>de(!1),[He,xt]=ga(!1),[ce,Me]=ga(),it=Fo(null),Ft={input:{"font-family":"'Inter', sans-serif","font-size":"14px","font-weight":"500",color:"#35254D","background-color":"transparent",padding:"0px",appearance:"none",outline:"none",border:"none","box-shadow":"none"},":focus":{color:"#35254D",outline:"none",border:"none"},"::placeholder":{color:"#35254D"}},Dt=()=>{var b,g,Ce,dt,ze,Oe,yt,we;let o={},m=C;if(ce!=32){let be=parseInt((m==null?void 0:m.expiryMonth)||"",10),D=(m==null?void 0:m.expiryYear)||"";(b=m==null?void 0:m.cardNumber)!=null&&b.trim()||(o.cardNumber="Please enter a card number."),(g=m==null?void 0:m.expiryMonth)!=null&&g.trim()?(Number(m==null?void 0:m.expiryMonth)>12||Number(m==null?void 0:m.expiryMonth)<1)&&(o.expiryMonth="Invalid Expiration Month."):o.expiryMonth="Please enter an expiry month.",(Ce=m==null?void 0:m.expiryYear)!=null&&Ce.trim()?((dt=m==null?void 0:m.expiryYear)==null?void 0:dt.trim().length)!==4||Number(m==null?void 0:m.expiryYear)<2025?o.expiryYear="Invalid Expiration Year.":(isNaN(be)||be<1||be>12||D.length!==4)&&(o.expiryMonth="Invalid Expiration Date."):o.expiryYear="Please enter an expiry year.",(ze=m==null?void 0:m.cvv)!=null&&ze.trim()||(o.cvv="Please enter a CVV.")}return(Oe=m==null?void 0:m.firstName)!=null&&Oe.trim()||(o.firstName="Please enter a first name."),(yt=m==null?void 0:m.lastName)!=null&&yt.trim()||(o.lastName="Please enter a last name."),(we=m==null?void 0:m.zipCode)!=null&&we.trim()||(o.zipCode="Please enter a zip code."),H&&!Z&&(o.checkSign="You must authorize this before proceeding."),P&&!(m!=null&&m.authHold)&&(o.authHold="You must authorize this before proceeding."),P&&!(m!=null&&m.authorise)&&(o.authorise="Please confirm your authorization to continue."),me(o),Object.keys(o).length>0},O=o=>{var dt;let m=o.target,b=m.value.replace(/\D/g,""),{formatted:g,cursor:Ce}=An(m.value,(dt=m.selectionStart)!=null?dt:0);me(ze=>L(w({},ze),{cardNumber:""})),V(ze=>L(w({},ze),{cardNumber:g})),requestAnimationFrame(()=>{m.setSelectionRange(Ce,Ce)})},Je=(o,m)=>{let b=o;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(b)){(m===""||/^[0-9]+$/.test(m))&&(me(Ce=>L(w({},Ce),{[b]:""})),V(Ce=>L(w({},Ce),{[b]:m})));return}me(Ce=>L(w({},Ce),{[b]:""})),V(Ce=>L(w({},Ce),{[b]:m}))},W=()=>{let o=DatacapWebToken.validateCardNumber(C==null?void 0:C.cardNumber.replaceAll(" ","")),m=DatacapWebToken.validateExpirationDate(C==null?void 0:C.expiryMonth,C==null?void 0:C.expiryYear),b=DatacapWebToken.validateCVV(C==null?void 0:C.cvv),g={};return o||(g.cardNumber="Invalid card Number"),m||(g.expiryMonth="Invalid Expiration Date."),b||(g.cvv="Invalid CVV"),me(g),o&&b&&m},B=async o=>{var m,b;if(o.Error)ve(o.Error),st();else{let g={token:o.Token,resp:o},Ce=await Sa.post(`${Ve}api/v1/gateway/update/token/${e}`,g);if((Ce==null?void 0:Ce.status)==200){let dt=w(w({Token:(b=(m=Ce==null?void 0:Ce.data)==null?void 0:m.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:C==null?void 0:C.zipCode},P&&{authHold:C==null?void 0:C.authHold}),P&&{authorise:C==null?void 0:C.authorise});st(),t(dt)}}},i=async()=>{var o,m,b,g,Ce,dt,ze,Oe,yt,we,be;try{let D={method:"POST",redirect:"follow"},ae=await Sa.post(`${Ve}api/v1/widget/generate-session`,D),k=await it.current.createToken({public_key_pem:((m=(o=ae==null?void 0:ae.data)==null?void 0:o.data)==null?void 0:m.publicKeyPem)||((g=(b=ae==null?void 0:ae.data)==null?void 0:b.data)==null?void 0:g.public_key_pem),session_key:(dt=(Ce=ae==null?void 0:ae.data)==null?void 0:Ce.data)==null?void 0:dt.session_key});if(k!=null&&k.token){let ue=k==null?void 0:k.token;try{let pe=await Sa.post(`${Ve}api/v1/gateway/verify-and-save/${e}`,{token:ue});if((pe==null?void 0:pe.status)==200){let R=(ze=pe==null?void 0:pe.data)==null?void 0:ze.data,ot={Token:R.gateway_token,Brand:R.card_data.brand,ExpirationMonth:R.card_data.expire_mm,ExpirationYear:R.card_data.expire_yy,Last4:R.card_data.last4,Bin:R.card_data.bin,postalCode:C==null?void 0:C.zipCode};t(ot),st()}}catch(pe){console.log(pe,"error"),st()}}}catch(D){let ae="Something went wrong!";try{let k=((Oe=D==null?void 0:D.response)==null?void 0:Oe.data)||(D==null?void 0:D.message)||"",ue=typeof k=="string"?k:JSON.stringify(k),R=(((we=(yt=ue.split)==null?void 0:yt.call(ue,`
|
|
2317
|
-
`))==null?void 0:we.filter(Boolean))||[]).at(-1)||"",ot=(be=R.split)==null?void 0:be.call(R,": ");ae=(ot==null?void 0:ot.length)>1?ot.pop().trim():R.trim()||ae}catch(k){ae="Something went wrong!"}st(),ve(ae)}},x=async o=>{var Ce,dt,ze,Oe,yt,we,be;o.preventDefault();let m=document.activeElement;if(m instanceof HTMLElement&&m.blur(),v||Dt())return;let g=!0;if(ce!=32&&(g=W()),!!g){Ne();try{let D=await Sa.get(`${Ve}api/v1/gateway/token/${e}`,{params:{pass_fee:He}});if((D==null?void 0:D.status)==200){let ae=(dt=(Ce=D==null?void 0:D.data)==null?void 0:Ce.data)==null?void 0:dt.gateway_token;((Oe=(ze=D==null?void 0:D.data)==null?void 0:ze.data)==null?void 0:Oe.paymentGateway)==((yt=Ya)==null?void 0:yt.FRACTALKEY)?await i():DatacapWebToken.requestToken(ae,"creditCardForm",B)}}catch(D){st(),ve(((be=(we=D==null?void 0:D.response)==null?void 0:we.data)==null?void 0:be.message)||"Something went wrong!")}}},s=()=>{ve("")},N=()=>{ve(""),V({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:"",authHold:!1,authorise:!1,checkSign:!1}),I()};console.log(He,"aoapoaa");let T=async()=>{var o,m,b,g,Ce,dt,ze,Oe,yt;try{Ne();let we=await Sa.get(`${Ve}api/v1/gateway/get-payment-details/${e}`);(we==null?void 0:we.status)==200&&(Me((m=(o=we==null?void 0:we.data)==null?void 0:o.data)==null?void 0:m.paymentGateway),st())}catch(we){console.log((g=(b=we==null?void 0:we.response)==null?void 0:b.data)==null?void 0:g.result,"error while getting payment details"),t({error:((dt=(Ce=we==null?void 0:we.response)==null?void 0:Ce.data)==null?void 0:dt.message)||"Something went wrong!",result:(Oe=(ze=we==null?void 0:we.response)==null?void 0:ze.data)==null?void 0:Oe.result,statusCode:(yt=we==null?void 0:we.response)==null?void 0:yt.status}),st()}};return Ni(()=>{T()},[]),Ni(()=>{if(typeof FractalTokenizer=="undefined")return;let o=new FractalTokenizer({styles:{}})},[]),y.createElement(y.Fragment,null,y.createElement(Pn,null),y.createElement(Ua,null),y.createElement(dn,{loading:v||q}),zt&&y.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},y.createElement(zn,{error:zt,onClose:s})),!zt&&y.createElement("div",{className:"creditformbox"},ce==32?y.createElement("form",{id:"paymentForm",onSubmit:x,onKeyDown:o=>{o.key==="Enter"&&v&&(o.preventDefault(),o.stopPropagation())}},y.createElement("div",{className:"name-row"},y.createElement("div",{className:"form-group"},y.createElement("label",null," First Name ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(C==null?void 0:C.firstName)||"",onChange:o=>{let m=o.target.value;/^[a-zA-Z\s]*$/.test(m)&&Je("firstName",m)},className:J}),(h==null?void 0:h.firstName)&&y.createElement("small",{className:"error"},h==null?void 0:h.firstName)),y.createElement("div",{className:"form-group"},y.createElement("label",null," Last Name ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(C==null?void 0:C.lastName)||"",onChange:o=>{let m=o.target.value;/^[a-zA-Z\s]*$/.test(m)&&Je("lastName",m)},className:J}),(h==null?void 0:h.lastName)&&y.createElement("small",{className:"error"},h==null?void 0:h.lastName))),y.createElement(Ci,{fractalStyles:Ft,tokenizerRef:it,extraInputs:y.createElement("div",{className:"form-group"},y.createElement("label",null," Zip ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(E=C==null?void 0:C.zipCode)!=null?E:"",onChange:o=>Je("zipCode",o.target.value),className:J}),(h==null?void 0:h.zipCode)&&y.createElement("small",{className:"error"},h==null?void 0:h.zipCode))}),ye&&y.createElement("div",{className:"pass-fee-toggle-div"},y.createElement("input",{type:"checkbox",id:"pass_fee",className:"toggle-checkbox",checked:He,onChange:o=>{xt(o.target.checked)}}),y.createElement("label",{htmlFor:"pass_fee",className:"toggle-label"}),y.createElement("label",{htmlFor:"save_card"},"Cash Discount")),H&&y.createElement("div",{className:"checks-row"},y.createElement("input",{name:"discalosure",type:"checkbox",id:"disclosureCheck",checked:Z,onChange:o=>qe(o.target.checked)}),y.createElement("label",{htmlFor:"disclosureCheck",className:"form-check-label"},"Please agree to the following in order to add Payment method.")),H&&(h==null?void 0:h.checkSign)&&y.createElement("small",{className:"check-error"},h==null?void 0:h.checkSign),P&&y.createElement(y.Fragment,null,y.createElement("div",{className:"checks-row"},y.createElement("input",{name:"authHold",type:"checkbox",id:"authHold",checked:!!(C!=null&&C.authHold),onChange:o=>Je("authHold",o.target.checked)}),y.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.")),(h==null?void 0:h.authHold)&&y.createElement("small",{className:"check-error"},h==null?void 0:h.authHold),y.createElement("div",{className:"checks-row "},y.createElement("input",{name:"authorise",type:"checkbox",id:"authorise",checked:!!(C!=null&&C.authorise),onChange:o=>Je("authorise",o.target.checked)}),y.createElement("label",{htmlFor:"authorise",className:"form-check-label see-more"},te?y.createElement(y.Fragment,null,y.createElement("span",null,"By providing your payment information, you authorize"," ",y.createElement("strong",null,F),", 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"," ",y.createElement("strong",null,F),". You may request the removal of your stored payment information at any time by contacting"," ",y.createElement("strong",null,F)," directly. By signing or proceeding with this transaction, you acknowledge and agree to this card on file authorization.",y.createElement("a",{href:"#",onClick:o=>{o.preventDefault(),M(!1)}},"See less ..."))):y.createElement(y.Fragment,null,y.createElement("span",null,"By providing your payment information, you authorize ",F,", a Sky Systemz merchant, to securely store your card on file for future pay..."," "),y.createElement("a",{href:"#",onClick:o=>{o.preventDefault(),M(!0)}},"See more ...")))),(h==null?void 0:h.authorise)&&y.createElement("small",{className:"check-error"},h==null?void 0:h.authorise)),y.createElement("div",{className:"button-row"},y.createElement("button",{className:`cancelbtn ${G} `,type:"button",onClick:N},"Cancel"),y.createElement("button",{className:`savebtn ${z} `,disabled:v,type:"submit"},"Save"))):y.createElement("form",{id:"creditCardForm",onSubmit:x,onKeyDown:o=>{o.key==="Enter"&&v&&(o.preventDefault(),o.stopPropagation())}},y.createElement("div",{className:"name-row"},y.createElement("div",{className:"form-group"},y.createElement("label",null," First Name ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(C==null?void 0:C.firstName)||"",onChange:o=>{let m=o.target.value;/^[a-zA-Z\s]*$/.test(m)&&Je("firstName",m)},className:J}),(h==null?void 0:h.firstName)&&y.createElement("small",{className:"error"},h==null?void 0:h.firstName)),y.createElement("div",{className:"form-group"},y.createElement("label",null," Last Name ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(C==null?void 0:C.lastName)||"",onChange:o=>{let m=o.target.value;/^[a-zA-Z\s]*$/.test(m)&&Je("lastName",m)},className:J}),(h==null?void 0:h.lastName)&&y.createElement("small",{className:"error"},h==null?void 0:h.lastName))),y.createElement("div",{className:"form-pay-row"},y.createElement("div",{className:"form-group"},y.createElement("label",null," Card Number ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(C==null?void 0:C.cardNumber)||"",onChange:o=>O(o),className:J}),(h==null?void 0:h.cardNumber)&&y.createElement("small",{className:"error"},h==null?void 0:h.cardNumber))),y.createElement("div",{className:"card-pay-row"},y.createElement("div",{className:"form-group"},y.createElement("label",null," Exp Month ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(C==null?void 0:C.expiryMonth)||"",onChange:o=>Je("expiryMonth",o.target.value),className:J}),(h==null?void 0:h.expiryMonth)&&y.createElement("small",{className:"error"},h==null?void 0:h.expiryMonth)),y.createElement("div",{className:"form-group"},y.createElement("label",null," Exp Year ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(C==null?void 0:C.expiryYear)||"",onChange:o=>Je("expiryYear",o.target.value),className:J}),(h==null?void 0:h.expiryYear)&&y.createElement("small",{className:"error"},h==null?void 0:h.expiryYear)),y.createElement("div",{className:"form-group"},y.createElement("label",null," CVV ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(C==null?void 0:C.cvv)||"",onChange:o=>Je("cvv",o.target.value),className:J}),(h==null?void 0:h.cvv)&&y.createElement("small",{className:"error"},h==null?void 0:h.cvv)),y.createElement("div",{className:"form-group"},y.createElement("label",null," Zip ",y.createElement("span",{className:"text-danger"},"*")),y.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(A=C==null?void 0:C.zipCode)!=null?A:"",onChange:o=>Je("zipCode",o.target.value),className:J}),(h==null?void 0:h.zipCode)&&y.createElement("small",{className:"error"},h==null?void 0:h.zipCode))),ye&&y.createElement("div",{className:"pass-fee-toggle-div"},y.createElement("input",{type:"checkbox",id:"pass_fee",className:"toggle-checkbox",checked:He,onChange:o=>{xt(o.target.checked)}}),y.createElement("label",{htmlFor:"pass_fee",className:"toggle-label"}),y.createElement("label",{htmlFor:"save_card"},"Cash Discount")),H&&y.createElement("div",{className:"checks-row"},y.createElement("input",{name:"discalosure",type:"checkbox",id:"disclosureCheck",checked:Z,onChange:o=>qe(o.target.checked)}),y.createElement("label",{htmlFor:"disclosureCheck",className:"form-check-label"},"Please agree to the following in order to add Payment method.")),H&&(h==null?void 0:h.checkSign)&&y.createElement("small",{className:"check-error"},h==null?void 0:h.checkSign),P&&y.createElement(y.Fragment,null,y.createElement("div",{className:"checks-row"},y.createElement("input",{name:"authHold",type:"checkbox",id:"authHold",checked:!!(C!=null&&C.authHold),onChange:o=>Je("authHold",o.target.checked)}),y.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.")),(h==null?void 0:h.authHold)&&y.createElement("small",{className:"check-error"},h==null?void 0:h.authHold),y.createElement("div",{className:"checks-row "},y.createElement("input",{name:"authorise",type:"checkbox",id:"authorise",checked:!!(C!=null&&C.authorise),onChange:o=>Je("authorise",o.target.checked)}),y.createElement("label",{htmlFor:"authorise",className:"form-check-label see-more"},te?y.createElement(y.Fragment,null,y.createElement("span",null,"By providing your payment information, you authorize"," ",y.createElement("strong",null,F),", 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"," ",y.createElement("strong",null,F),". You may request the removal of your stored payment information at any time by contacting"," ",y.createElement("strong",null,F)," directly. By signing or proceeding with this transaction, you acknowledge and agree to this card on file authorization.",y.createElement("a",{href:"#",onClick:o=>{o.preventDefault(),M(!1)}},"See less ..."))):y.createElement(y.Fragment,null,y.createElement("span",null,"By providing your payment information, you authorize ",F,", a Sky Systemz merchant, to securely store your card on file for future pay..."," "),y.createElement("a",{href:"#",onClick:o=>{o.preventDefault(),M(!0)}},"See more ...")))),(h==null?void 0:h.authorise)&&y.createElement("small",{className:"check-error"},h==null?void 0:h.authorise)),y.createElement("div",{className:"button-row"},y.createElement("button",{className:`cancelbtn ${G} `,type:"button",onClick:N},"Cancel"),y.createElement("button",{className:`savebtn ${z} `,disabled:v,type:"submit"},"Save")))))}import n,{useEffect as Fa,useRef as wi,useState as Mt}from"react";import Va from"axios";import _a from"sweetalert2";import{IoArrowBack as $a}from"react-icons/io5";import{NumericFormat as Po}from"react-number-format";function Mo(e){var Gt,De,Xt,ln,gn,pn,fn,Tt,Re,pt,Fe,Ke,Rt,Ht,et,Xn,S,p,Le,ft,Pe,Nt,Ot,Wt,Yt,Ut,en;let t=wi(null);Fa(()=>{e.onTriggerPay&&e.onTriggerPay(()=>{aa()})},[e]);let q=X+"widget/mc-img.svg",I=X+"widget/visa-img.svg",P=X+"widget/ae-img.svg",F=X+"widget/discover-img.svg",H=X+"widget/card.svg",Z=X+"widget/Trash.svg",qe=X+"widget/bank.svg",G=X+"widget/secure-img.png",z=X+"widget/pov-by.png",J=X+"widget/pax.svg",[ye,v]=Mt(!1),[de,te]=Mt(!1),[M,C]=Mt(""),[V,h]=Mt(!1),[me,zt]=Mt(!1),[ve,Ne]=Mt("card"),[st,He]=Mt("card"),[xt,ce]=Mt("form"),[Me,it]=Mt("form"),[Ft,Dt]=Mt(!0),[O,Je]=Mt(!1),[W,B]=Mt(!1),i=e.merchantPublicKey,[x,s]=Mt(),[N,T]=Mt({}),[E,A]=Mt(),[o,m]=Mt({}),[b,g]=Mt([]),[Ce,dt]=Mt([]),[ze,Oe]=Mt(),[yt,we]=Mt(),[be,D]=Mt(Number(e==null?void 0:e.amount)),[ae,k]=Mt(Number(e==null?void 0:e.amount)),[ue,pe]=Mt(""),[R,ot]=Mt(""),yn=wi(null),mt={input:{"font-family":"'Inter', sans-serif","font-size":"16px",color:"#212529","background-color":"transparent",padding:"0px",appearance:"none",outline:"none",border:"none","box-shadow":"none"},":focus":{color:"#212529",outline:"none",border:"none"},"::placeholder":{color:"#212529"}},[_,Qn]=Mt(),[Cn,kn]=Mt(""),Sn=()=>v(!0),rn=()=>v(!1),na=(f,u)=>{let fe=(parseFloat(u)||0)/100;return f-f*fe},Nn=(f,u)=>{let fe=(Number(u)||0)/100;return+f+ +(f*fe)};Fa(()=>{me&&(e!=null&&e.pass_fee?(k(Number(e==null?void 0:e.amount)),D(Number(e==null?void 0:e.cashDiscount))):(k(Number(e==null?void 0:e.amount)),D(Number(e==null?void 0:e.amount))))},[me,e==null?void 0:e.pass_fee,e==null?void 0:e.amount,e==null?void 0:e.surcharge]);let Fn=()=>{zt(!1),Ne("card"),C(""),h(!1),kn(""),A({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),m({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),s({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),T({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),B(!1),Je(!1),Oe({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""}),we({}),D(0),He("card"),Dt(!0),it("form"),ce("form"),te(!1),v(!1),dt([]),g([]),pe(""),ot("")},aa=()=>zt(!0),_n=f=>{Ne(f)},un=(f,u)=>{let fe=f;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(fe)){(u===""||/^[0-9]+$/.test(u))&&(T(ne=>L(w({},ne),{[fe]:""})),s(ne=>L(w({},ne),{[fe]:u})));return}T(ne=>L(w({},ne),{[fe]:""})),s(ne=>L(w({},ne),{[fe]:u}))},Hn=f=>{var vt;let u=f.target,fe=u.value.replace(/\D/g,""),{formatted:Te,cursor:ne}=An(u.value,(vt=u.selectionStart)!=null?vt:0);T($e=>L(w({},$e),{cardNumber:""})),s($e=>L(w({},$e),{cardNumber:Te})),requestAnimationFrame(()=>{u.setSelectionRange(ne,ne)})},bn=f=>{let{name:u,value:fe}=f.target,Te=["routingNumber","accountNumber","confirmAccountNumber"];if(u=="name"){/^[a-zA-Z\s]*$/.test(fe)&&(m(ne=>L(w({},ne),{[u]:""})),A(ne=>L(w({},ne),{[u]:fe})));return}if(Te.includes(u)){(fe===""||/^[0-9]+$/.test(fe))&&(m(ne=>L(w({},ne),{[u]:""})),A(ne=>L(w({},ne),{[u]:fe})));return}m(ne=>L(w({},ne),{[u]:""})),A(ne=>L(w({},ne),{[u]:fe}))},$=()=>{var fe,Te,ne,vt,$e,ke;let f={},u=x;if((_==null?void 0:_.paymentGateway)!==32){(fe=u==null?void 0:u.cardNumber)!=null&&fe.trim()||(f.cardNumber="Card number is required");let Ye=parseInt((u==null?void 0:u.expiryMonth)||"",10),je=(u==null?void 0:u.expiryYear)||"";if((!((Te=u==null?void 0:u.expiryMonth)!=null&&Te.trim())||!((ne=u==null?void 0:u.expiryYear)!=null&&ne.trim())||isNaN(Ye)||Ye<1||Ye>12||je.length!==4)&&(f.expiryMonth="Invalid Expiration Date."),(vt=u==null?void 0:u.cvv)!=null&&vt.trim()||(f.cvv="CVV is required"),u!=null&&u.expiryMonth&&(u!=null&&u.expiryYear)&&u.expiryMonth.length<=2&&u.expiryYear.length===4){let tt=parseInt(u.expiryMonth,10),It=parseInt(u.expiryYear,10),re=new Date,ee=re.getMonth()+1,ht=re.getFullYear();(It<ht||It===ht&&tt<ee)&&(f.expiryMonth="Card is expired")}}return($e=u==null?void 0:u.cardName)!=null&&$e.trim()||(f.cardName="Card name is required"),(ke=u==null?void 0:u.zipCode)!=null&&ke.trim()||(f.zipCode="ZIP code is required"),T(f),Object.keys(f).length>0},j=()=>{var fe,Te,ne,vt,$e,ke,Ye,je;let f={},u=E;return(fe=u==null?void 0:u.name)!=null&&fe.trim()||(f.name="Name is required"),(Te=u==null?void 0:u.accountNumber)!=null&&Te.trim()||(f.accountNumber="Account number is required"),(ne=u==null?void 0:u.accountNumber)!=null&&ne.trim()&&((vt=u==null?void 0:u.accountNumber)==null?void 0:vt.trim())!==(($e=u==null?void 0:u.confirmAccountNumber)==null?void 0:$e.trim())&&(f.confirmAccountNumber="Account numbers must match"),(ke=u==null?void 0:u.bankName)!=null&&ke.trim()||(f.bankName="Bank name is required"),(Ye=u==null?void 0:u.routingNumber)!=null&&Ye.trim()||(f.routingNumber="Routing Number is required"),u!=null&&u.routingNumber&&((je=u==null?void 0:u.routingNumber)==null?void 0:je.length)!==9&&(f.routingNumber="Routing number must be 9 digits"),((u==null?void 0:u.accountType)==="business saving"||(u==null?void 0:u.accountType)==="business checking")&&(!(u!=null&&u.companyName)||(u==null?void 0:u.companyName)==="")&&(f.companyName="Company Name is required for business accounts"),m(f),Object.keys(f).length>0},Xe=async f=>{var fe,Te,ne,vt,$e,ke,Ye,je,tt,It,re,ee,ht;f.preventDefault();let u=document.activeElement;if(u instanceof HTMLElement&&u.blur(),!de&&!R)if(ve!=="ach"){if($())return;{let bt=!0,Vt=!0,Jt=!0;if((_==null?void 0:_.paymentGateway)!==32){let wt=DatacapWebToken.validateCardNumber(x==null?void 0:x.cardNumber.replaceAll(" ","")),Qt=DatacapWebToken.validateExpirationDate(x==null?void 0:x.expiryMonth,x==null?void 0:x.expiryYear),Ee=DatacapWebToken.validateCVV(x==null?void 0:x.cvv),At={};wt||(At.cardNumber="Invalid card Number"),Qt||(At.expiryMonth="Invalid Expiration Date."),Ee||(At.cvv="Invalid CVV"),T(At)}if(bt&&Jt&&Vt){te(!0);try{let wt=async function(Qt){var Ee,At;if(Qt.Error)C(Qt.Error),te(!1);else{let hn=x==null?void 0:x.cardName,nt=x==null?void 0:x.zipCode;Qt.name=hn,Qt.postal_code=nt,Qt.isCardSave=`${O}`,Qt.isCharge=!0,Qt.posSalesIdEncode=(Ee=_==null?void 0:_.orderDetails)==null?void 0:Ee.orderId,Qt.partial_amount=ue&&!R?ue:ae,Et.emit("sendMessage",Qt);let Yn=(At=_==null?void 0:_.orderDetails)==null?void 0:At.orderId;Et.on(Yn,xn=>{if(pa(xn==null?void 0:xn.data)){let kt=JSON.parse(xn.data);kt!=null&&kt.result?(s({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),Je(!1),kn(kt==null?void 0:kt.transactionId),h(!0),te(!1)):(te(!1),C((kt==null?void 0:kt.message)||"Something went wrong."))}else C("Something went wrong.")})}};if((_==null?void 0:_.paymentGateway)===32){let Qt={method:"POST",redirect:"follow"};try{let Ee=await Va.post(`${Ve}api/v1/widget/generate-session`,Qt);try{let At=await yn.current.createToken({public_key_pem:((Te=(fe=Ee==null?void 0:Ee.data)==null?void 0:fe.data)==null?void 0:Te.publicKeyPem)||((vt=(ne=Ee==null?void 0:Ee.data)==null?void 0:ne.data)==null?void 0:vt.public_key_pem),session_key:(ke=($e=Ee==null?void 0:Ee.data)==null?void 0:$e.data)==null?void 0:ke.session_key}),hn=JSON.stringify(L(w({},At),{isSaveCardChecked:O,name:x==null?void 0:x.cardName,postal_code:x==null?void 0:x.zipCode,customer_id:e==null?void 0:e.customerId,partial_amount:ue&&!R?ue:ae})),nt=JSON.stringify({pre_sales_id:`${(Ye=_==null?void 0:_.orderDetails)==null?void 0:Ye.orderId}`,token:`${At==null?void 0:At.token}`,json_response:`${hn}`}),xn={method:"POST",headers:JSON.stringify({"Content-Type":"application/json"}),body:nt,redirect:"follow",isChargeviafractal:!0};Et.emit("sendMessage",xn),Et.on("chargeviafractalgateway",kt=>{var xa;if(pa(kt==null?void 0:kt.data)){let Tn=JSON.parse(kt==null?void 0:kt.data);Tn!=null&&Tn.result?(kn((xa=Tn==null?void 0:Tn.data)==null?void 0:xa.transactionId),h(!0),te(!1)):(te(!1),C((Tn==null?void 0:Tn.message)||"Something went wrong."))}else C("Something went wrong.")})}catch(At){te(!1),C(((tt=(je=At==null?void 0:At.response)==null?void 0:je.data)==null?void 0:tt.message)||(At==null?void 0:At.message)||"Something went wrong.")}}catch(Ee){te(!1),C(((re=(It=Ee==null?void 0:Ee.response)==null?void 0:It.data)==null?void 0:re.message)||(Ee==null?void 0:Ee.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(_==null?void 0:_.dctoken,"PaymentForm",wt)}catch(wt){te(!1),C(((ht=(ee=wt==null?void 0:wt.response)==null?void 0:ee.data)==null?void 0:ht.message)||(wt==null?void 0:wt.message)||"Something went wrong.")}}}}else{if(j())return;{te(!0);let bt={fractalpayPublicKey:i,label:(E==null?void 0:E.name)||"John Doe",account_number:E==null?void 0:E.accountNumber,routing_number:E==null?void 0:E.routingNumber,bank_name:E==null?void 0:E.bankName,account_type:E==null?void 0:E.accountType,amount:ue&&!R?ue:String(be||0),isSaveAch:W,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:(E==null?void 0:E.companyName)||"",orderGuid:e==null?void 0:e.orderGuid};Et.emit("sendMessage",bt),Et.on("ach-incoming",Vt=>{var Jt;(Vt==null?void 0:Vt.status)=="Failed"?typeof(Vt==null?void 0:Vt.message)=="object"?Object.values(Vt==null?void 0:Vt.message).forEach(wt=>{C(wt||"Something went wrong")}):C((Vt==null?void 0:Vt.message)||"Something went wrong"):(kn((Jt=Vt==null?void 0:Vt.data)==null?void 0:Jt.transaction_id),h(!0),te(!1))})}}},_t=async()=>{var f,u,fe,Te,ne,vt,$e,ke,Ye,je,tt,It,re,ee,ht,an,bt,Vt,Jt,wt,Qt,Ee,At;Sn();try{let hn={fractalpayPublicKey:i,customer_id:e==null?void 0:e.customerId,pass_fee:e==null?void 0:e.pass_fee,orderGuid:e==null?void 0:e.orderGuid},nt=await Va.post(`${lt}get-payment-details`,hn);if(Qn((f=nt==null?void 0:nt.data)==null?void 0:f.data),(fe=(u=nt==null?void 0:nt.data)==null?void 0:u.data)!=null&&fe.paymentGateway||(Fn(),C("Something went wrong.")),(ne=(Te=nt==null?void 0:nt.data)==null?void 0:Te.data)!=null&&ne.card_list&&((ke=($e=(vt=nt==null?void 0:nt.data)==null?void 0:vt.data)==null?void 0:$e.card_list)==null?void 0:ke.length)>0){let Yn=(tt=(je=(Ye=nt==null?void 0:nt.data)==null?void 0:Ye.data)==null?void 0:je.card_list)==null?void 0:tt.filter(kt=>(kt==null?void 0:kt.card_type)=="Bank"),xn=(ee=(re=(It=nt==null?void 0:nt.data)==null?void 0:It.data)==null?void 0:re.card_list)==null?void 0:ee.filter(kt=>(kt==null?void 0:kt.card_type)!=="Bank");console.log(Yn,"hohgohoo",xn),(xn==null?void 0:xn.length)>0&&ce("list"),(Yn==null?void 0:Yn.length)>0&&it("list"),g(xn),dt(Yn)}else Ne("card");(an=(ht=nt==null?void 0:nt.data)==null?void 0:ht.data)!=null&&an.paymentDeviceList&&((Jt=(Vt=(bt=nt==null?void 0:nt.data)==null?void 0:bt.data)==null?void 0:Vt.paymentDeviceList)==null?void 0:Jt.length)>0&&we((Qt=(wt=nt==null?void 0:nt.data)==null?void 0:wt.data)==null?void 0:Qt.paymentDeviceList[0]),rn()}catch(hn){console.log(hn),rn(),C(((At=(Ee=hn==null?void 0:hn.response)==null?void 0:Ee.data)==null?void 0:At.message)||(hn==null?void 0:hn.message)||"Something went wrong")}},ct=async f=>{if(f.currentTarget.blur(),de)return;let u=e==null?void 0:e.customerId,fe=String(e==null?void 0:e.discount),Te=String(e==null?void 0:e.surcharge),ne=String(e==null?void 0:e.tax),vt=e==null?void 0:e.merchantPublicKey,$e=e==null?void 0:e.orderID,ke=ue&&!R?ue:String(ae),Ye=ze==null?void 0:ze.id,je=ze==null?void 0:ze.card_type;if(!R)if(vt&&$e&&ke&&be)if(u)if(Ye){let It;ue&&!R?It=ue:je==="Bank"?It=be:It=ae;let re={amount:It,order_id:$e,customer_id:u,card_id:Ye,fractalpayPublicKey:vt,isCardSave:O,discount:fe,surcharge:Te,tax:ne,orderGuid:e==null?void 0:e.orderGuid,pass_fee:e==null?void 0:e.pass_fee,require3ds:!1};ue&&!R&&je!=="Bank"&&(re.ispartialPayment=!0);let tt=re,{isCardSave:ee}=tt,ht=ra(tt,["isCardSave"]),bt=lt+(je==="Bank"?"charge-ach":"charge-by-card"),Vt={"Content-Type":"application/json"};te(!0),Et.emit("sendMessage",{url:bt,body:je=="Bank"?ht:re,isChargebycard:!0}),Et.on("charge-by-card",Jt=>{var wt;(Jt==null?void 0:Jt.result)==!0||(Jt==null?void 0:Jt.status)==!0?(kn((wt=Jt.data)==null?void 0:wt.transaction_id),h(!0),te(!1)):C((Jt==null?void 0:Jt.message)||"Something went wrong.")})}else C("Please Select A Card/ACH");else C("Please Select Customer");else C("Something went wrong.")},Lt=async f=>{var vt,$e,ke,Ye,je,tt;if(f.currentTarget.blur(),de)return;let u=e==null?void 0:e.merchantPublicKey,fe=e==null?void 0:e.orderID,Te=ue&&!R?ue:String(ae),ne=e==null?void 0:e.customerId;if(!(yt!=null&&yt.device_id)){C("Please Select A Payment Device");return}if(u&&fe&&Te){te(!0);let It={amount:Te,fractalpayPublicKey:u,customer_order_id:fe,device_id:yt==null?void 0:yt.device_id,customer_id:ne||""};try{let re=await Va.post(`${lt}charge-with-reader`,It);((vt=re==null?void 0:re.data)==null?void 0:vt.result)==!0?(kn((ke=($e=re==null?void 0:re.data)==null?void 0:$e.data)==null?void 0:ke.transaction_id),h(!0),te(!1)):(C(((Ye=re==null?void 0:re.data)==null?void 0:Ye.message)||"Something went wrong."),te(!1))}catch(re){C(((tt=(je=re==null?void 0:re.response)==null?void 0:je.data)==null?void 0:tt.message)||"Something went wrong."),te(!1)}}else C("Something went wrong.")},Ct=f=>{st==="card"?ct(f):st==="reader"&&Lt(f)};Fa(()=>{me&&i&&_t()},[i,me]);let Qe=async f=>{_a.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 u=>{if(u.isConfirmed){te(!0);try{let fe={card_id:f,customer_id:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey},Te=await Va.post(`${lt}delete-customer-card`,fe);te(!1),_t(),_a.fire({icon:"success",title:"Deleted!",text:"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})}catch(fe){te(!1),_a.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else u.dismiss===_a.DismissReason.cancel&&_a.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},qt=f=>{switch(f==null?void 0:f.toLowerCase()){case"visa":return I;case"mastercard":case"mc":case"m/c":return q;case"amex":case"american express":case"ae":return P;case"discover":case"dcvr":return F;case"bank":return qe;default:return f}},Kt=()=>{let f=be||0;return(Number(ae)-f).toFixed(0)};console.log(xt,"activeinCard","activeinBank",Me);let Zt=f=>{var u,fe,Te,ne;console.log(f,"values"),ve==="ach"?((u=Number(be))==null?void 0:u.toFixed(2))<(f==null?void 0:f.floatValue)||(f==null?void 0:f.floatValue)<=0?(pe(f==null?void 0:f.value),ot(`Partial amount cannot exceed ${ge((fe=Number(be))==null?void 0:fe.toFixed(2))}`)):(pe(f==null?void 0:f.value),ot("")):((Te=Number(ae))==null?void 0:Te.toFixed(2))<(f==null?void 0:f.floatValue)||(f==null?void 0:f.floatValue)<=0?(pe(f==null?void 0:f.value),ot(`Partial amount cannot exceed ${ge((ne=Number(ae))==null?void 0:ne.toFixed(2))}`)):(pe(f==null?void 0:f.value),ot(""))};return Fa(()=>{let f=Number(ve==="ach"?be:ae),u=Number(ue);ue&&(u<=0||u>f)?ot(`Partial amount cannot exceed ${ge(f.toFixed(2))}`):ot("")},[ve,ue,be,ae]),console.log(ve,"activetab"),Fa(()=>{if(typeof FractalTokenizer=="undefined")return;let f=new FractalTokenizer({styles:{}})},[]),n.createElement(n.Fragment,null,n.createElement(Pn,null),n.createElement(ma,null),n.createElement(ta,null),n.createElement(Kn,null),n.createElement(n.Fragment,null,n.createElement("button",{ref:t,style:{display:"none"},className:"paymentBtn",onClick:aa},"Pay"),n.createElement(wn,{open:me,onClose:Fn},M&&n.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},n.createElement(zn,{error:M,onClose:Fn})),V&&n.createElement(ca,{onClose:Fn,tranId:Cn}),!M&&!V&&n.createElement(n.Fragment,null,(ye||de)&&n.createElement(dn,{loading:ye||de}),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:Fn},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:_==null?void 0:_.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:_==null?void 0:_.logo,id:"pay-logos"})),(b==null?void 0:b.length)>0&&ve!=="cardList"&&n.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>Ne("cardList")}," ",n.createElement($a,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(Ln,{label:"Card",amount:(Gt=Number(ae))==null?void 0:Gt.toFixed(2),value:"card",onChange:_n,activetab:ve}),(_==null?void 0:_.isSkyFiAccount)&&n.createElement(Ln,{label:"Bank",amount:(De=Number(be))==null?void 0:De.toFixed(2),value:"ach",onChange:_n,activetab:ve})),On(_==null?void 0:_.showSurcharge)?be&&be>0&&(e!=null&&e.pass_fee)?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,ve==="card"?"Cash Discount":"Cash Discount Savings"," "),n.createElement("p",null,ge((Number(ae)-be).toFixed(2)))):null:be&&be>0&&(e!=null&&e.pass_fee)&&ve==="card"?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,ve==="card"?"Surcharge":null," "),n.createElement("p",null,ge((Number(ae)-be).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(Po,{prefix:"$",className:"form-control",value:ue,onValueChange:f=>{Zt(f)},thousandSeparator:!0,placeholder:"Enter partial amount",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0}),R&&n.createElement("span",{className:"error-span"},R)))),n.createElement("div",{className:"pay-conatiner-one-last"},n.createElement("img",{src:G,alt:""}),n.createElement("img",{src:z,alt:""}),"Secure payments powered by Fractal")),n.createElement("div",{className:"pay-tab pay-conatiner-two"},!ye&&n.createElement("div",{className:"col-md-12"},n.createElement("div",{id:"payment-form-div"},ve!=="cardList"?n.createElement("div",{className:"frac-charge-payment-back-btn-wrap "},(b==null?void 0:b.length)>0&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Ne("cardList")}," ",n.createElement($a,null)," Back"),(_==null?void 0:_.isSkyFiAccount)&&n.createElement("div",{className:"tab"},n.createElement("button",{className:"tablinks",onClick:f=>{_n("card")},style:{border:ve==="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:f=>{_n("ach")},style:{border:ve==="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"},"$",(Xt=Number(ae))==null?void 0:Xt.toFixed(2))),ve!="ach"&&n.createElement("div",null,n.createElement("div",null,n.createElement("img",{src:I,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:q,width:35,alt:""})),n.createElement("div",null,n.createElement("img",{src:P,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:F,width:35,alt:""})))),!ye&&On(_==null?void 0:_.showSurcharge)?be&&be>0&&(e!=null&&e.pass_fee)?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,ve==="card"?"Cash Discount":"Cash Discount Savings"," "),n.createElement("p",null,ge((Number(ae)-be).toFixed(2)))):null:be&&be>0&&(e!=null&&e.pass_fee)&&ve==="card"?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,ve==="card"?"Surcharge":null," "),n.createElement("p",null,ge((Number(ae)-be).toFixed(2)))):null):n.createElement("div",null,n.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",_==null?void 0:_.customer_name),n.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," ",st==="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"},"$",(ln=Number(ae))==null?void 0:ln.toFixed(2))),n.createElement("div",null,n.createElement("div",null,n.createElement("img",{src:I,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:q,width:35,alt:""})),n.createElement("div",null,n.createElement("img",{src:P,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:F,width:35,alt:""}))))),n.createElement("div",{id:"card",style:{display:ve==="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"},(b==null?void 0:b.length)>0&&xt==="form"&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>ce("list")}," ",n.createElement($a,null))),n.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),ve!="ach"&&n.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},n.createElement("img",{src:I,alt:"",width:33}),n.createElement("img",{src:q,width:33,alt:""}),n.createElement("img",{src:P,alt:"",width:33}),n.createElement("img",{src:F,width:33,alt:""}))),xt==="list"?n.createElement(n.Fragment,null,n.createElement(En,{listHeading:"Cards",paymentGateway:_==null?void 0:_.paymentGateway,ListItems:b,selectedCard:ze,setSelectedCard:Oe,handleDeleteCard:Qe,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{ce("form")}}),n.createElement("div",{className:"form-group",style:{padding:"0"}},n.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Ct},ue&&!R?ge((gn=Number(ue))==null?void 0:gn.toFixed(2)):ge((pn=Number(ae))==null?void 0:pn.toFixed(2))))):(_==null?void 0:_.paymentGateway)===32?n.createElement("form",{id:"paymentForm",onSubmit:Xe,onKeyDown:f=>{f.key==="Enter"&&de&&(f.preventDefault(),f.stopPropagation())}},n.createElement("div",{className:"ach-scrl",style:{minHeight:_!=null&&_.isSkyFiAccount&&(b==null?void 0:b.length)>0?"444px":_!=null&&_.isSkyFiAccount&&(b==null?void 0:b.length)==0?"456px":(b==null?void 0:b.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:(x==null?void 0:x.cardName)||"",onChange:f=>{let u=f.target.value;/^[a-zA-Z\s]*$/.test(u)&&un("cardName",u)}}),(N==null?void 0:N.cardName)&&n.createElement("span",{className:"error-span"},N==null?void 0:N.cardName)),n.createElement("div",{className:"form-group"},n.createElement("label",null,"CARD NUMBER"),n.createElement("div",{className:"toggle-num-wrapper"},me&&(_==null?void 0:_.paymentGateway)===32&&n.createElement(Jn,{fractalStyles:mt,tokenizerRef:yn}))),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:(fn=e==null?void 0:e.orderID)!=null?fn:"",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:(Tt=x==null?void 0:x.zipCode)!=null?Tt:"",onChange:f=>un("zipCode",f.target.value)}),(N==null?void 0:N.zipCode)&&n.createElement("span",{className:"error-span"},N==null?void 0:N.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:O,onChange:f=>Je(f.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"}},(_==null?void 0:_.paymentDeviceList)&&((Re=_==null?void 0:_.paymentDeviceList)==null?void 0:Re.length)>0&&n.createElement("button",{type:"button",style:{marginBottom:"10px"},className:"pay-button",onClick:()=>Dt(!Ft)},Ft?"Pay With Reader":"Pay With Card"),n.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ue&&!R?ge((pt=Number(ue))==null?void 0:pt.toFixed(2)):ge((Fe=Number(ae))==null?void 0:Fe.toFixed(2))))):n.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:Xe,onKeyDown:f=>{f.key==="Enter"&&de&&(f.preventDefault(),f.stopPropagation())}},n.createElement("div",{className:"ach-scrl",style:{minHeight:_!=null&&_.isSkyFiAccount&&(b==null?void 0:b.length)>0?"444px":_!=null&&_.isSkyFiAccount&&(b==null?void 0:b.length)==0?"456px":(b==null?void 0:b.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:(x==null?void 0:x.cardName)||"",onChange:f=>{let u=f.target.value;/^[a-zA-Z\s]*$/.test(u)&&un("cardName",u)}}),(N==null?void 0:N.cardName)&&n.createElement("span",{className:"error-span"},N==null?void 0:N.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:(x==null?void 0:x.cardNumber)||"",onChange:f=>Hn(f),"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:(x==null?void 0:x.expiryMonth)||"",onChange:f=>un("expiryMonth",f.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:(x==null?void 0:x.expiryYear)||"",onChange:f=>un("expiryYear",f.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:(x==null?void 0:x.cvv)||"",onChange:f=>un("cvv",f.target.value)})))),(N==null?void 0:N.cardNumber)&&n.createElement("span",{className:"error-span"},N==null?void 0:N.cardNumber),n.createElement("p",{style:{margin:"0"}},N!=null&&N.expiryMonth||N!=null&&N.expiryYear?n.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},N==null?void 0:N.expiryMonth):"",(N==null?void 0:N.cvv)&&n.createElement("span",{className:"error-span"},N==null?void 0:N.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:(Ke=e==null?void 0:e.orderID)!=null?Ke:"",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:(Rt=x==null?void 0:x.zipCode)!=null?Rt:"",onChange:f=>un("zipCode",f.target.value)}),(N==null?void 0:N.zipCode)&&n.createElement("span",{className:"error-span"},N==null?void 0:N.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:O,onChange:f=>Je(f.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"}},(_==null?void 0:_.paymentDeviceList)&&((Ht=_==null?void 0:_.paymentDeviceList)==null?void 0:Ht.length)>0&&n.createElement("button",{type:"button",style:{marginBottom:"10px"},className:"pay-button",onClick:()=>Dt(!Ft)},Ft?"Pay With Reader":"Pay With Card"),n.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ue&&!R?ge((et=Number(ue))==null?void 0:et.toFixed(2)):ge((Xn=Number(ae))==null?void 0:Xn.toFixed(2)))))),n.createElement("div",{id:"ach",style:{display:ve==="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"},(Ce==null?void 0:Ce.length)>0&&Me==="form"&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>it("list")}," ",n.createElement($a,null))),n.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment"))),Me==="list"?n.createElement(n.Fragment,null,n.createElement(En,{listHeading:"Banks",paymentGateway:_==null?void 0:_.paymentGateway,ListItems:Ce,selectedCard:ze,setSelectedCard:Oe,handleDeleteCard:Qe,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{it("form")}}),n.createElement("div",{className:"form-group",style:{padding:"0"}},n.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Ct},ue&&!R?ge((S=Number(ue))==null?void 0:S.toFixed(2)):ge((p=Number(be))==null?void 0:p.toFixed(2))))):n.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:Xe,autoComplete:"off",onKeyDown:f=>{f.key==="Enter"&&de&&(f.preventDefault(),f.stopPropagation())}},n.createElement("div",{className:"ach-scrl",style:{minHeight:_!=null&&_.isSkyFiAccount&&(b==null?void 0:b.length)>0?"444px":_!=null&&_.isSkyFiAccount&&(b==null?void 0:b.length)==0?"436px":(b==null?void 0:b.length)>0?"462px":"520px",maxHeight:_!=null&&_.isSkyFiAccount&&(b==null?void 0:b.length)>0?"444px":((b==null?void 0:b.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:(Le=E==null?void 0:E.name)!=null?Le:"",onChange:bn}),(o==null?void 0:o.name)&&n.createElement("span",{className:"error-span"},o==null?void 0:o.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:(ft=E==null?void 0:E.routingNumber)!=null?ft:"",onChange:bn}),(o==null?void 0:o.routingNumber)&&n.createElement("span",{className:"error-span"},o==null?void 0:o.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:(Pe=E==null?void 0:E.accountNumber)!=null?Pe:"",onChange:bn}),(o==null?void 0:o.accountNumber)&&n.createElement("span",{className:"error-span"},o==null?void 0:o.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:(Nt=E==null?void 0:E.confirmAccountNumber)!=null?Nt:"",onChange:bn}),(o==null?void 0:o.confirmAccountNumber)&&n.createElement("span",{className:"error-span"},o==null?void 0:o.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:(Ot=E==null?void 0:E.bankName)!=null?Ot:"",onChange:bn}),(o==null?void 0:o.bankName)&&n.createElement("span",{className:"error-span"},o==null?void 0:o.bankName)),((E==null?void 0:E.accountType)==="business saving"||(E==null?void 0:E.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:(Wt=E==null?void 0:E.companyName)!=null?Wt:"",onChange:bn}),(o==null?void 0:o.companyName)&&n.createElement("span",{className:"error-span"},o==null?void 0:o.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:(Yt=E==null?void 0:E.accountType)!=null?Yt:"",onChange:bn},n.createElement("option",{value:""},"Select account"),fa.map(f=>n.createElement("option",{key:f.value,value:f.value},f.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:W,onChange:f=>B(f.target.checked)}),n.createElement("label",{htmlFor:"saveACH"},"Save ACH")),W&&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"},ue&&!R?ge((Ut=Number(ue))==null?void 0:Ut.toFixed(2)):ge((en=Number(be))==null?void 0:en.toFixed(2))))))))))))))))}import qn,{useEffect as Pi,useState as ba,useMemo as Oo}from"react";import zo from"react";function Ja(){let e="#000",t="#fff",q="#212529",I="#dee2e6";return zo.createElement("style",null,`
|
|
2318
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
2319
|
-
body
|
|
2320
|
-
{
|
|
2321
|
-
font-family: 'Inter', sans-serif;
|
|
2322
|
-
}
|
|
2323
|
-
input
|
|
2324
|
-
{
|
|
2325
|
-
font-family: 'Inter', sans-serif !important;
|
|
2326
|
-
}
|
|
2327
|
-
.frac-form .form-group-frac{
|
|
2328
|
-
margin:0 !important;
|
|
2329
|
-
padding: 5px 0;
|
|
2330
|
-
}
|
|
2331
|
-
.frac-form .mb-4{
|
|
2332
|
-
margin-bottom : 10px !important
|
|
2333
|
-
}
|
|
2334
|
-
.frac-form .save-ach-div{
|
|
2335
|
-
display:flex !important;
|
|
2336
|
-
gap:5px !important;
|
|
2337
|
-
align-items:center
|
|
2338
|
-
}
|
|
2339
|
-
|
|
2340
|
-
.frac-form .card-cvv-in{
|
|
2341
|
-
height : 36px !importantt;
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
.frac-form .pay-payment-amount{
|
|
2345
|
-
text-align:start !important
|
|
2346
|
-
}
|
|
2347
|
-
.frac-form .pay-amount{
|
|
2348
|
-
text-align:start !important
|
|
2349
|
-
}
|
|
2350
|
-
.frac-form .pay-main-logo{
|
|
2351
|
-
text-align:start !important
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
.paymentBtn {
|
|
2357
|
-
background-color: black;
|
|
2358
|
-
border: none;
|
|
2359
|
-
color: white;
|
|
2360
|
-
padding: 15px 32px;
|
|
2361
|
-
text-align: center;
|
|
2362
|
-
text-decoration: none;
|
|
2363
|
-
display: inline-block;
|
|
2364
|
-
font-size: 16px;
|
|
2365
|
-
margin: 4px 2px;
|
|
2366
|
-
cursor: pointer;
|
|
2367
|
-
border-radius: 180px;
|
|
2368
|
-
/* width: auto; */
|
|
2369
|
-
}
|
|
2370
|
-
|
|
2371
|
-
.main-logo {
|
|
2372
|
-
text-align: center;
|
|
2373
|
-
margin-bottom: 20px;
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
.main-logo img {
|
|
2377
|
-
max-width: 180px;
|
|
2378
|
-
}
|
|
2379
|
-
|
|
2380
|
-
.pay-main-box {
|
|
2381
|
-
width: 365px !important;
|
|
2382
|
-
height: 93%;
|
|
2383
|
-
background: 0 0 #ffffff;
|
|
2384
|
-
border-radius: 12px;
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
border: 1px solid #E0DFE2;
|
|
2388
|
-
margin: 0 auto;
|
|
2389
|
-
display: block;
|
|
2390
|
-
padding: 0px 26px !important
|
|
2391
|
-
}
|
|
2392
|
-
.pay-main-box .pay-header {
|
|
2393
|
-
display: flex;
|
|
2394
|
-
justify-content: center;
|
|
2395
|
-
align-items: center;
|
|
2396
|
-
text-align: center;
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
.pay-main-box .pay-header button {
|
|
2400
|
-
border: 0;
|
|
2401
|
-
background: none;
|
|
2402
|
-
padding: 0;
|
|
2403
|
-
box-shadow: 0;
|
|
2404
|
-
outline: inherit;
|
|
2405
|
-
}
|
|
2406
|
-
|
|
2407
|
-
.pay-main-box h1 {
|
|
2408
|
-
margin: 0;
|
|
2409
|
-
flex: 1;
|
|
2410
|
-
padding: 10px 0;
|
|
2411
|
-
font-size: 23px;
|
|
2412
|
-
font-weight: 500;
|
|
2413
|
-
color: #35254D;
|
|
2414
|
-
align-items: start;
|
|
2415
|
-
display: flex;
|
|
2416
|
-
}
|
|
2417
|
-
.tab {
|
|
2418
|
-
overflow: hidden;
|
|
2419
|
-
padding: 5px;
|
|
2420
|
-
border-radius: 8px;
|
|
2421
|
-
display: flex;
|
|
2422
|
-
justify-content: space-around;
|
|
2423
|
-
margin-bottom:12px
|
|
2424
|
-
}
|
|
2425
|
-
|
|
2426
|
-
/* Style the buttons inside the tab */
|
|
2427
|
-
.tab button {
|
|
2428
|
-
float: left;
|
|
2429
|
-
border: none;
|
|
2430
|
-
outline: none;
|
|
2431
|
-
cursor: pointer;
|
|
2432
|
-
background:white;
|
|
2433
|
-
padding: 11px 16px;
|
|
2434
|
-
transition: 0.3s;
|
|
2435
|
-
font-size: 16px;
|
|
2436
|
-
width: 143px;
|
|
2437
|
-
border-radius: 5px;
|
|
2438
|
-
box-shadow: inherit;
|
|
2439
|
-
outline: none;
|
|
2440
|
-
color: ${e};
|
|
2441
|
-
}
|
|
2442
|
-
|
|
2443
|
-
/* Change background color of buttons on hover */
|
|
2444
|
-
.tab button:hover {
|
|
2445
|
-
background-color: #f0f0f0;
|
|
2446
|
-
}
|
|
2447
|
-
|
|
2448
|
-
/* Create an active/current tablink class */
|
|
2449
|
-
// .tab button.active {
|
|
2450
|
-
// background-color: #ccc;
|
|
2451
|
-
// }
|
|
2452
|
-
|
|
2453
|
-
/* Style the tab content */
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
.parent-pay-container{
|
|
2457
|
-
padding: 24px;
|
|
2458
|
-
}
|
|
2459
|
-
.pay-container{
|
|
2460
|
-
display: grid;
|
|
2461
|
-
grid-template-columns: 2fr 3fr;
|
|
2462
|
-
|
|
2463
|
-
}
|
|
2464
|
-
.pay-main{
|
|
2465
|
-
padding-y: 20px}
|
|
2466
|
-
|
|
2467
|
-
.request-payment-close-popup {
|
|
2468
|
-
position: absolute;
|
|
2469
|
-
right: 20px;
|
|
2470
|
-
top: 20px;
|
|
2471
|
-
cursor: pointer;
|
|
2472
|
-
}
|
|
2473
|
-
.pay-conatiner-one{
|
|
2474
|
-
border-right: 1px solid #E0DFE2;
|
|
2475
|
-
display: flex;
|
|
2476
|
-
flex-direction: column;
|
|
2477
|
-
justify-content: space-between;
|
|
2478
|
-
}
|
|
2479
|
-
.pay-conatiner-one-first{
|
|
2480
|
-
|
|
2481
|
-
min-height:inherit !important;
|
|
2482
|
-
}
|
|
2483
|
-
.pay-conatiner-one-last{
|
|
2484
|
-
display:flex;
|
|
2485
|
-
font-size:12px;
|
|
2486
|
-
gap:5px;
|
|
2487
|
-
max-width:250px;
|
|
2488
|
-
align-items:center;
|
|
2489
|
-
color:black !important
|
|
2490
|
-
}
|
|
2491
|
-
.pay-conatiner-one-last img{
|
|
2492
|
-
width : 17px;
|
|
2493
|
-
height:17px
|
|
2494
|
-
}
|
|
2495
|
-
.pay-conatiner-two{
|
|
2496
|
-
padding: 0 5% 0;
|
|
2497
|
-
}
|
|
2498
|
-
.pay-logo-container{
|
|
2499
|
-
border-bottom: 1px solid #E0DFE2
|
|
2500
|
-
}
|
|
2501
|
-
.pay-heading{
|
|
2502
|
-
margin: 0;
|
|
2503
|
-
flex: 1;
|
|
2504
|
-
padding: 10px 0;
|
|
2505
|
-
font-size: 23px;
|
|
2506
|
-
font-weight: 500;
|
|
2507
|
-
color: #35254D;
|
|
2508
|
-
align-items: start;
|
|
2509
|
-
display: flex;
|
|
2510
|
-
}
|
|
2511
|
-
.pay-main-logo > img{
|
|
2512
|
-
width: 50%;
|
|
2513
|
-
}
|
|
2514
|
-
.pay-main-logo-res > img{
|
|
2515
|
-
width: 50%;
|
|
2516
|
-
display : none
|
|
2517
|
-
}
|
|
2518
|
-
|
|
2519
|
-
.pay-payment-amount{
|
|
2520
|
-
display: block;
|
|
2521
|
-
font-size: 12px;
|
|
2522
|
-
color: #727272;
|
|
2523
|
-
margin-bottom: 8px;
|
|
2524
|
-
}
|
|
2525
|
-
.pay-amount-conatiner{
|
|
2526
|
-
margin-top: 6%;
|
|
2527
|
-
}
|
|
2528
|
-
.pay-amount{
|
|
2529
|
-
color: #000000;
|
|
2530
|
-
font-size: 38px;
|
|
2531
|
-
display: block;
|
|
2532
|
-
line-height: 110%;
|
|
2533
|
-
letter-spacing: -1px;
|
|
2534
|
-
}
|
|
2535
|
-
.frac-form label{
|
|
2536
|
-
font-family: 'IBM Plex Mono', monospace !important;
|
|
2537
|
-
color: #727272 !important;
|
|
2538
|
-
margin-bottom: 2px !important;
|
|
2539
|
-
font-weight: 600 !important;
|
|
2540
|
-
font-size: 12px !important;
|
|
2541
|
-
display:block !important;
|
|
2542
|
-
text-align : left !important
|
|
2543
|
-
}
|
|
2544
|
-
.form-control-frac{
|
|
2545
|
-
display: block;
|
|
2546
|
-
width: 100%;
|
|
2547
|
-
padding: .375rem .75rem;
|
|
2548
|
-
font-size: 1rem;
|
|
2549
|
-
font-weight: 400;
|
|
2550
|
-
line-height: 1.5;
|
|
2551
|
-
color: ${q};
|
|
2552
|
-
-webkit-appearance: none;
|
|
2553
|
-
-moz-appearance: none;
|
|
2554
|
-
appearance: none;
|
|
2555
|
-
background-color: ${t};
|
|
2556
|
-
background-clip: padding-box;
|
|
2557
|
-
border: 1px solid ${I};
|
|
2558
|
-
border-radius: 0.375rem;
|
|
2559
|
-
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
|
2560
|
-
}
|
|
2561
|
-
.form-control-frac:focus{
|
|
2562
|
-
border-color: #86b7fe;
|
|
2563
|
-
outline: 0;
|
|
2564
|
-
}
|
|
2565
|
-
.toggle-num-wrapper {
|
|
2566
|
-
position: relative;
|
|
2567
|
-
}
|
|
2568
|
-
.card-number-new{
|
|
2569
|
-
border: 1px solid #dee2e6;
|
|
2570
|
-
border-radius: 0.375rem;
|
|
2571
|
-
border-bottom: none;
|
|
2572
|
-
border-bottom-left-radius: 0px;
|
|
2573
|
-
border-bottom-right-radius: 0px;
|
|
2574
|
-
padding-left: .75rem;
|
|
2575
|
-
}
|
|
2576
|
-
.exp-date-year-container .form-group {
|
|
2577
|
-
flex: 1;
|
|
2578
|
-
padding-left:.75rem;
|
|
2579
|
-
}
|
|
2580
|
-
.card-crdi {
|
|
2581
|
-
display: flex;
|
|
2582
|
-
border: 1px solid ${I};
|
|
2583
|
-
border-radius: 0.375rem;
|
|
2584
|
-
}
|
|
2585
|
-
.card-expiry-new{
|
|
2586
|
-
border-top-left-radius: 0px;
|
|
2587
|
-
border-top-right-radius: 0px;
|
|
2588
|
-
}
|
|
2589
|
-
.exp-date-year-container{
|
|
2590
|
-
display: flex;
|
|
2591
|
-
flex-wrap: wrap;
|
|
2592
|
-
}
|
|
2593
|
-
.exp-date-year-container .form-group-frac{
|
|
2594
|
-
flex:1;
|
|
2595
|
-
padding: 0px !important
|
|
2596
|
-
|
|
2597
|
-
}
|
|
2598
|
-
|
|
2599
|
-
.exp-date {
|
|
2600
|
-
float: left;
|
|
2601
|
-
// width: 30%
|
|
2602
|
-
}
|
|
2603
|
-
|
|
2604
|
-
.exp-date input {
|
|
2605
|
-
width: calc(100% + 1px);
|
|
2606
|
-
border-top-right-radius: 0;
|
|
2607
|
-
border-bottom-right-radius: 0;
|
|
2608
|
-
border: 0;
|
|
2609
|
-
border-right: 1px solid ${I};
|
|
2610
|
-
}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
.exp-year {
|
|
2614
|
-
float: left;
|
|
2615
|
-
// width: 30%
|
|
2616
|
-
}
|
|
2617
|
-
|
|
2618
|
-
.exp-year input {
|
|
2619
|
-
width: calc(100% + 1px);
|
|
2620
|
-
border-radius: 0;
|
|
2621
|
-
border-top: 0;
|
|
2622
|
-
border-bottom: 0;
|
|
2623
|
-
border-right: 1px solid ${I};
|
|
2624
|
-
}
|
|
2625
|
-
|
|
2626
|
-
.exp-date input:focus {
|
|
2627
|
-
position: relative;
|
|
2628
|
-
z-index: 10;
|
|
2629
|
-
}
|
|
2630
|
-
|
|
2631
|
-
.security-digit {
|
|
2632
|
-
float: right;
|
|
2633
|
-
// width: 40%;
|
|
2634
|
-
position: relative;
|
|
2635
|
-
}
|
|
2636
|
-
|
|
2637
|
-
.security-digit input {
|
|
2638
|
-
border-top-left-radius: 0;
|
|
2639
|
-
border-bottom-left-radius: 0;
|
|
2640
|
-
border-top: 0;
|
|
2641
|
-
border-bottom: 0;
|
|
2642
|
-
border-right:0;
|
|
2643
|
-
}
|
|
2644
|
-
.card-expiry-new{
|
|
2645
|
-
border-top-left-radius: 0px;
|
|
2646
|
-
border-top-right-radius: 0px;
|
|
2647
|
-
}
|
|
2648
|
-
.form-control-frac{box-sizing: border-box ;}
|
|
2649
|
-
#PaymentForm .form-group-frac{
|
|
2650
|
-
padding:5px 0 ;
|
|
2651
|
-
matgin: 0 !important
|
|
2652
|
-
}
|
|
2653
|
-
|
|
2654
|
-
.toggle-label {
|
|
2655
|
-
position: relative;
|
|
2656
|
-
display: inline-block;
|
|
2657
|
-
width: 40px;
|
|
2658
|
-
height: 24px;
|
|
2659
|
-
background-color: #ccc;
|
|
2660
|
-
border-radius: 12px;
|
|
2661
|
-
cursor: pointer;
|
|
2662
|
-
transition: background-color 0.3s;
|
|
2663
|
-
}
|
|
2664
|
-
|
|
2665
|
-
.toggle-label::before {
|
|
2666
|
-
content: "";
|
|
2667
|
-
position: absolute;
|
|
2668
|
-
top: 2px;
|
|
2669
|
-
left: 2px;
|
|
2670
|
-
width: 20px;
|
|
2671
|
-
height: 20px;
|
|
2672
|
-
background: #ffffff;
|
|
2673
|
-
border-radius: 50%;
|
|
2674
|
-
transition: left 300ms linear;
|
|
2675
|
-
}
|
|
2676
|
-
|
|
2677
|
-
.toggle-checkbox {
|
|
2678
|
-
display: none;
|
|
2679
|
-
}
|
|
2680
|
-
|
|
2681
|
-
.toggle-checkbox:checked + .toggle-label {
|
|
2682
|
-
background-color: #4caf50;
|
|
2683
|
-
}
|
|
2684
|
-
|
|
2685
|
-
.toggle-checkbox:checked + .toggle-label::before {
|
|
2686
|
-
left: 18px;
|
|
2687
|
-
}
|
|
2688
|
-
.ach-scrl {
|
|
2689
|
-
max-height: 380px;
|
|
2690
|
-
min-height: 380px;
|
|
2691
|
-
overflow-y: auto;
|
|
2692
|
-
padding-right: 6px;
|
|
2693
|
-
}
|
|
2694
|
-
.mb-4{
|
|
2695
|
-
margin-bottom:4px
|
|
2696
|
-
}
|
|
2697
|
-
.ach-scrl::-webkit-scrollbar {
|
|
2698
|
-
width: 3px;
|
|
2699
|
-
background-color: #F5F5F5;
|
|
2700
|
-
}
|
|
2701
|
-
.ach-scrl::-webkit-scrollbar-thumb {
|
|
2702
|
-
background-color: #35254D;
|
|
2703
|
-
}
|
|
2704
|
-
|
|
2705
|
-
.error-span{
|
|
2706
|
-
color:red !important;
|
|
2707
|
-
font-size:12px !important;
|
|
2708
|
-
text-align: left !important;
|
|
2709
|
-
width: 100% !important;
|
|
2710
|
-
display: block;
|
|
2711
|
-
}
|
|
2712
|
-
|
|
2713
|
-
.charge-customer-name-frac{
|
|
2714
|
-
color: #161616;
|
|
2715
|
-
font-family: Inter;
|
|
2716
|
-
font-size: 24px;
|
|
2717
|
-
font-style: normal;
|
|
2718
|
-
font-weight: 600;
|
|
2719
|
-
line-height: 32px;
|
|
2720
|
-
letter-spacing: -0.48px;
|
|
2721
|
-
text-transform: capitalize;
|
|
2722
|
-
margin-top:0;
|
|
2723
|
-
margin-bottom:16px !important;
|
|
2724
|
-
text-align:left !important
|
|
2725
|
-
}
|
|
2726
|
-
.card-ach-heading-frac {
|
|
2727
|
-
color: #727272;
|
|
2728
|
-
font-family: Inter;
|
|
2729
|
-
font-size: 12px;
|
|
2730
|
-
font-style: normal;
|
|
2731
|
-
font-weight: 500;
|
|
2732
|
-
line-height: 18px;
|
|
2733
|
-
letter-spacing: -0.24px;
|
|
2734
|
-
margin : 0 0 10px !important;
|
|
2735
|
-
text-align : left
|
|
2736
|
-
}
|
|
2737
|
-
.card-list-div{
|
|
2738
|
-
max-height : 190px;
|
|
2739
|
-
overflow-y : auto;
|
|
2740
|
-
border:1px solid #E0DFE2;
|
|
2741
|
-
border-radius : 8px
|
|
2742
|
-
}
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
.card-list-div::-webkit-scrollbar{
|
|
2746
|
-
width:2px;
|
|
2747
|
-
background-color:#F5F5F5
|
|
2748
|
-
}
|
|
2749
|
-
.card-list-div::-webkit-scrollbar-thumb{
|
|
2750
|
-
background-color:#35254D
|
|
2751
|
-
}
|
|
2752
|
-
|
|
2753
|
-
.card-list-single-div{
|
|
2754
|
-
border-bottom: 1px solid #E0DFE2;
|
|
2755
|
-
padding : 8px 11px;
|
|
2756
|
-
display : flex ;
|
|
2757
|
-
align-items:center;
|
|
2758
|
-
justify-content : space-between;
|
|
2759
|
-
gap:12px
|
|
2760
|
-
}
|
|
2761
|
-
.card-list-single-div:last-child {
|
|
2762
|
-
border-bottom: none;
|
|
2763
|
-
}
|
|
2764
|
-
.card-lint-div-in{
|
|
2765
|
-
min-height:444px}
|
|
2766
|
-
.card-number-radio{
|
|
2767
|
-
display:flex;
|
|
2768
|
-
gap:12px;
|
|
2769
|
-
}
|
|
2770
|
-
.card-number-radio .card-number-last-four{
|
|
2771
|
-
color:#161616 !important;
|
|
2772
|
-
font-family:Inter !important;
|
|
2773
|
-
font-size:14px !important;
|
|
2774
|
-
font-weight:500 !important;
|
|
2775
|
-
font-style:normal !important;
|
|
2776
|
-
line-height : 18px !important;
|
|
2777
|
-
latter-spacing:-0.18px !important
|
|
2778
|
-
}
|
|
2779
|
-
.card-expiry-date{
|
|
2780
|
-
margin:0;
|
|
2781
|
-
color:#00000080;
|
|
2782
|
-
font-family:Inter;
|
|
2783
|
-
font-size:14px;
|
|
2784
|
-
font-weight:500;
|
|
2785
|
-
font-style"normal;
|
|
2786
|
-
line-height : 18px;
|
|
2787
|
-
latter-spacing:-0.18px
|
|
2788
|
-
}
|
|
2789
|
-
.pay-with-other-card {
|
|
2790
|
-
margin-top : 12px;
|
|
2791
|
-
padding:12px 32px;
|
|
2792
|
-
border :1px solid #E0DFE2;
|
|
2793
|
-
border-radius : 1000px;
|
|
2794
|
-
display: flex;
|
|
2795
|
-
justify-content : center;
|
|
2796
|
-
align-items:center;
|
|
2797
|
-
gap:10px;
|
|
2798
|
-
// width:100%;
|
|
2799
|
-
background:white;
|
|
2800
|
-
cursor:pointer;
|
|
2801
|
-
color:#161616;
|
|
2802
|
-
text-align:center
|
|
2803
|
-
font-family: Inter;
|
|
2804
|
-
font-size: 14px;
|
|
2805
|
-
font-style: normal;
|
|
2806
|
-
font-weight: 500;
|
|
2807
|
-
line-height: 24px;
|
|
2808
|
-
letter-spacing: -0.28px;
|
|
2809
|
-
// margin-bottom: 50px;
|
|
2810
|
-
}
|
|
2811
|
-
.charge-payment-back-btn {
|
|
2812
|
-
display: flex;
|
|
2813
|
-
padding: 6px 12px !important ;
|
|
2814
|
-
align-items: center;
|
|
2815
|
-
gap: 6px;
|
|
2816
|
-
border-radius: 1000px;
|
|
2817
|
-
border: 1px solid #E0DFE2;
|
|
2818
|
-
background: #FFF;
|
|
2819
|
-
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
2820
|
-
font-size:16px;
|
|
2821
|
-
curso:pointer;
|
|
2822
|
-
color:black
|
|
2823
|
-
}
|
|
2824
|
-
.res-charge-payment-back-btn{
|
|
2825
|
-
padding: 9px 16px;
|
|
2826
|
-
align-items: center;
|
|
2827
|
-
gap: 6px;
|
|
2828
|
-
margin-bottom: 20px;
|
|
2829
|
-
border-radius: 1000px;
|
|
2830
|
-
border: 1px solid #E0DFE2;
|
|
2831
|
-
background: #FFF;
|
|
2832
|
-
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
2833
|
-
font-size:16px;
|
|
2834
|
-
curso:pointer;
|
|
2835
|
-
color:black;
|
|
2836
|
-
display:none
|
|
2837
|
-
}
|
|
2838
|
-
.btn {
|
|
2839
|
-
padding: 11px 23px;
|
|
2840
|
-
background-color: black;
|
|
2841
|
-
color: white;
|
|
2842
|
-
border: none;
|
|
2843
|
-
border-radius: 6px;
|
|
2844
|
-
font-weight: bold;
|
|
2845
|
-
margin: 0 10px;
|
|
2846
|
-
cursor: pointer;
|
|
2847
|
-
}
|
|
2848
|
-
|
|
2849
|
-
.custom-swal-icon {
|
|
2850
|
-
margin: 20px auto;
|
|
2851
|
-
}
|
|
2852
|
-
|
|
2853
|
-
.custom-swal-popup {
|
|
2854
|
-
font-size: 16px;
|
|
2855
|
-
text-align: center;
|
|
2856
|
-
}
|
|
2857
|
-
|
|
2858
|
-
.frac-form .res-pay-con{
|
|
2859
|
-
display:none
|
|
2860
|
-
}
|
|
2861
|
-
|
|
2862
|
-
.saveachtext p, .saveachtext b {
|
|
2863
|
-
font-size: 12px !important;
|
|
2864
|
-
color: #727272 !important;
|
|
2865
|
-
}
|
|
2866
|
-
|
|
2867
|
-
.cardicon-img img {
|
|
2868
|
-
margin-top: -2px !important;
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
|
-
.bankicon-img img {
|
|
2872
|
-
margin-top: -4px !important;
|
|
2873
|
-
}
|
|
2874
|
-
|
|
2875
|
-
.cardicon {
|
|
2876
|
-
margin-right : 8px !important;
|
|
2877
|
-
width : 18px !important;
|
|
2878
|
-
}
|
|
2879
|
-
|
|
2880
|
-
.bankicon {
|
|
2881
|
-
margin-right : 8px !important;
|
|
2882
|
-
width : 18px !important;
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
.frac-tooltip-wrapper {
|
|
2887
|
-
position: absolute;
|
|
2888
|
-
right:0;
|
|
2889
|
-
}
|
|
2890
|
-
|
|
2891
|
-
.frac-tooltip-icon {
|
|
2892
|
-
cursor: pointer;
|
|
2893
|
-
}
|
|
2894
|
-
.frac-tooltip-mn{
|
|
2895
|
-
position:relative;
|
|
2896
|
-
}
|
|
2897
|
-
.frac-tooltip-text {
|
|
2898
|
-
display: none;
|
|
2899
|
-
position: absolute;
|
|
2900
|
-
top:-15px;
|
|
2901
|
-
right: 22px;
|
|
2902
|
-
background: #161616;
|
|
2903
|
-
color: white;
|
|
2904
|
-
padding: 15px;
|
|
2905
|
-
border-radius: 10px;
|
|
2906
|
-
width: 200px;
|
|
2907
|
-
font-size:12px;
|
|
2908
|
-
word-break: break-word;
|
|
2909
|
-
white-space: normal;
|
|
2910
|
-
z-index: 999;
|
|
2911
|
-
}
|
|
2912
|
-
|
|
2913
|
-
.frac-tooltip-wrapper:hover .frac-tooltip-text {
|
|
2914
|
-
display: block;
|
|
2915
|
-
}
|
|
2916
|
-
|
|
2917
|
-
.frac-tooltip-text p,.frac-tooltip-text b {
|
|
2918
|
-
font-size : 12px !important;
|
|
2919
|
-
line-height : 1.5 !important;
|
|
2920
|
-
margin-bottom : 10px !important;
|
|
2921
|
-
}
|
|
2922
|
-
|
|
2923
|
-
.amt-pay-con {
|
|
2924
|
-
padding-right: 24px;
|
|
2925
|
-
}
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
@media (max-width: 768px) {
|
|
2930
|
-
.card-lint-div-in {
|
|
2931
|
-
min-height: auto;
|
|
2932
|
-
margin-bottom: 10px;
|
|
2933
|
-
}
|
|
2934
|
-
.ach-scrl {
|
|
2935
|
-
min-height: auto !important;
|
|
2936
|
-
margin-bottom: 10px;
|
|
2937
|
-
}
|
|
2938
|
-
.request-payment-close-popup {
|
|
2939
|
-
right: 12px !important;
|
|
2940
|
-
top: 12px !important;
|
|
2941
|
-
}
|
|
2942
|
-
|
|
2943
|
-
.parent-pay-container{
|
|
2944
|
-
padding:24px;
|
|
2945
|
-
}
|
|
2946
|
-
.pay-container {
|
|
2947
|
-
grid-template-columns: 1fr;
|
|
2948
|
-
padding: 10px 5%;
|
|
2949
|
-
border:1px solid #E0DFE2;
|
|
2950
|
-
border-radius : 12px
|
|
2951
|
-
}
|
|
2952
|
-
.pay-conatiner-one{
|
|
2953
|
-
border-right: none;
|
|
2954
|
-
}
|
|
2955
|
-
.pay-conatiner-one-first{
|
|
2956
|
-
min-height:0
|
|
2957
|
-
}
|
|
2958
|
-
.pay-main-logo > img{
|
|
2959
|
-
display: none;
|
|
2960
|
-
}
|
|
2961
|
-
.pay-main-logo-res > img {
|
|
2962
|
-
display:block;
|
|
2963
|
-
margin:auto
|
|
2964
|
-
}
|
|
2965
|
-
|
|
2966
|
-
.pay-logo-container{
|
|
2967
|
-
border :none
|
|
2968
|
-
}
|
|
2969
|
-
// .res-charge-payment-back-btn {
|
|
2970
|
-
// display:flex !important
|
|
2971
|
-
// }
|
|
2972
|
-
// .charge-payment-back-btn{
|
|
2973
|
-
// display:none !important
|
|
2974
|
-
// }
|
|
2975
|
-
|
|
2976
|
-
.frac-new-form .pay-amount-conatiner {
|
|
2977
|
-
margin-top: 0px;
|
|
2978
|
-
margin-bottom: 24px;
|
|
2979
|
-
}
|
|
2980
|
-
.frac-form .res-pay-con{
|
|
2981
|
-
display:flex;
|
|
2982
|
-
justify-content :space-between;
|
|
2983
|
-
align-items:center;
|
|
2984
|
-
padding-bottom : 10px
|
|
2985
|
-
}
|
|
2986
|
-
.amt-pay-con {
|
|
2987
|
-
padding-right: 0px;
|
|
2988
|
-
}
|
|
2989
|
-
.pay-conatiner-one-last{
|
|
2990
|
-
display:none}
|
|
2991
|
-
.pay-conatiner-two{
|
|
2992
|
-
padding:0
|
|
2993
|
-
}
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
}
|
|
2997
|
-
@media (max-width : 512px){
|
|
2998
|
-
.tab button {
|
|
2999
|
-
padding: 6px 16px;
|
|
3000
|
-
}
|
|
3001
|
-
|
|
3002
|
-
}
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
.frac-cash-discount-fee {
|
|
3006
|
-
display: flex;
|
|
3007
|
-
padding: 11px;
|
|
3008
|
-
justify-content: space-between;
|
|
3009
|
-
align-items: center;
|
|
3010
|
-
align-self: stretch;
|
|
3011
|
-
border-radius: 8px;
|
|
3012
|
-
border: 1px solid #E0DFE2;
|
|
3013
|
-
background: #F6F6F7;
|
|
3014
|
-
margin-top: 24px;
|
|
3015
|
-
}
|
|
3016
|
-
.frac-cash-discount-fee small {
|
|
3017
|
-
color:#727272;
|
|
3018
|
-
font-size: 12px;
|
|
3019
|
-
font-weight: 500;
|
|
3020
|
-
}
|
|
3021
|
-
.frac-cash-discount-fee p{
|
|
3022
|
-
margin:0px;
|
|
3023
|
-
font-size: 14px;
|
|
3024
|
-
font-weight: 500;
|
|
3025
|
-
}
|
|
3026
|
-
.frac-card-payment-heading {
|
|
3027
|
-
font-size: 24px;
|
|
3028
|
-
font-style: normal;
|
|
3029
|
-
font-weight: 600;
|
|
3030
|
-
margin:0px;
|
|
3031
|
-
}
|
|
3032
|
-
|
|
3033
|
-
.frac-heading-card-wrap {
|
|
3034
|
-
display: flex;
|
|
3035
|
-
align-items: center;
|
|
3036
|
-
margin-bottom:12px;
|
|
3037
|
-
}
|
|
3038
|
-
.frac-backarrow {
|
|
3039
|
-
margin-right: 10px;
|
|
3040
|
-
}
|
|
3041
|
-
.frac-charge-payment-back-btn-wrap , .frac-tab-2{
|
|
3042
|
-
display: none;
|
|
3043
|
-
}
|
|
3044
|
-
.frac-pay-conatiner-one{
|
|
3045
|
-
display: flex;
|
|
3046
|
-
flex-direction: column;
|
|
3047
|
-
justify-content: space-between;
|
|
3048
|
-
min-height: auto;
|
|
3049
|
-
}
|
|
3050
|
-
|
|
3051
|
-
.frac-form .saveachlabel {
|
|
3052
|
-
margin-bottom : 0px !important;
|
|
3053
|
-
}
|
|
3054
|
-
|
|
3055
|
-
.frac-partial-payment-input{
|
|
3056
|
-
margin-top: 12px !important;
|
|
3057
|
-
}
|
|
3058
|
-
|
|
3059
|
-
.challengeUrlclass-frac{
|
|
3060
|
-
height : 90vh;
|
|
3061
|
-
width : 100%;
|
|
3062
|
-
border-radius : 8px;
|
|
3063
|
-
border : none;
|
|
3064
|
-
}
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
div#cvv {
|
|
3068
|
-
border-top-left-radius: 0;
|
|
3069
|
-
border-bottom-left-radius: 0;
|
|
3070
|
-
border-top: 0;
|
|
3071
|
-
border-bottom: 0;
|
|
3072
|
-
border-right: 0;
|
|
3073
|
-
}
|
|
3074
|
-
div#exp_year {
|
|
3075
|
-
height: 36px;
|
|
3076
|
-
width: calc(100% + 1px);
|
|
3077
|
-
border-radius: 0;
|
|
3078
|
-
border-top: 0;
|
|
3079
|
-
border-bottom: 0;
|
|
3080
|
-
border-right: 1px solid #dee2e6;
|
|
3081
|
-
}
|
|
3082
|
-
div#exp_month {
|
|
3083
|
-
width: calc(100% + 1px);
|
|
3084
|
-
border-top-right-radius: 0;
|
|
3085
|
-
border-bottom-right-radius: 0;
|
|
3086
|
-
border: 0;
|
|
3087
|
-
border-right: 1px solid #dee2e6;
|
|
3088
|
-
}
|
|
3089
|
-
.exp-date-year-container .form-group {
|
|
3090
|
-
flex: 1;
|
|
3091
|
-
}
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
`)}import l,{useCallback as Vo,useEffect as Pa,useRef as ja,useState as gt}from"react";import vn from"axios";import ya from"sweetalert2";import{useEffect as Lo,useRef as To}from"react";function ki({challengeUrl:e,fractalToken:t,stripeIntentId:q,onSuccess:I,onError:P,containerRef:F}){let H=To(null);return Lo(()=>{if(!e||typeof window=="undefined")return;let Z=F.current;if(!Z)return;H.current&&Z.contains(H.current)&&Z.removeChild(H.current);let qe=document.createElement("iframe");qe.className="challengeUrlclass-frac",qe.src=e,H.current=qe,Z.appendChild(qe);let G=z=>{var J;((J=z.data)==null?void 0:J.type)==="3ds-authentication-challenge-complete"&&(Z.innerHTML="",z.data.status==="succeeded"?I(t,q):P(z.data.status))};return window.addEventListener("message",G),()=>{window.removeEventListener("message",G),H.current&&Z.contains(H.current)&&Z.removeChild(H.current)}},[e,F,t,q,I,P]),null}import{Elements as qo}from"@stripe/react-stripe-js";import{loadStripe as Ho}from"@stripe/stripe-js";import{PaymentElement as Si,useElements as Io,useStripe as Ao}from"@stripe/react-stripe-js";import Bo from"axios";import{useState as Fi}from"react";var _i=({onSuccess:e,showLoader:t,setError:q,session_token:I,callback:P,hideLoader:F,handleClose:H,amount:Z,isPreAuth:qe})=>{var M;let G=Ao(),z=Io(),[J,ye]=Fi(!1),[v,de]=Fi(null);return React.createElement("form",{onSubmit:async C=>{var V,h,me,zt,ve,Ne,st;if(C.preventDefault(),!G||!z){console.warn("stripe nopt loaded");return}console.log("Stripe:",G),console.log("Elements:",z),console.log("PaymentElement:",z.getElement(Si)),t(),ye(!0);try{let{error:He,paymentIntent:xt}=await G.confirmPayment({elements:z,confirmParams:{},redirect:"if_required"});if(ye(!1),He)console.log(He,"paymentIntent error"),q(He.message||"Payment failed.");else if((xt==null?void 0:xt.status)==="succeeded"){if(de("\u2705 Payment successful!"),e){console.log(xt,"paymentIntent");try{let ce=await Bo.post(`${Ve}api/v1/gateway/secure-charge/${I}`,{stripe_id:xt==null?void 0:xt.id});if(console.log(ce,"chargeDetails"),(V=ce==null?void 0:ce.data)!=null&&V.result){let Me=(h=ce==null?void 0:ce.data)==null?void 0:h.data;console.log(Me,"callbackdata"),P(L(w({},Me),{isPreAuth:qe})),H(),F()}console.log((me=ce==null?void 0:ce.data)==null?void 0:me.data,"chargeDetails")}catch(ce){console.log(ce==null?void 0:ce.response,"error"),q(((ve=(zt=ce==null?void 0:ce.response)==null?void 0:zt.data)==null?void 0:ve.message)||"Something went wrong"),F()}}setTimeout(()=>window.close(),1500)}else de("Processing payment...")}catch(He){console.log(He==null?void 0:He.response,"error"),q(((st=(Ne=He==null?void 0:He.response)==null?void 0:Ne.data)==null?void 0:st.message)||"Something went wrong"),F()}}},React.createElement(Si,null),React.createElement("button",{className:"pay-button",disabled:J||!G},J?"Processing...":`${ge((M=Number(Z))==null?void 0:M.toFixed(2))}`))};var Yo=Ho(da);function Qa({clientSecret:e,onSuccess:t,showLoader:q,setError:I,session_token:P,callback:F,hideLoader:H,handleClose:Z,amount:qe,isPreAuth:G}){return e?React.createElement(qo,{stripe:Yo,options:{clientSecret:e}},React.createElement(_i,{onSuccess:t,showLoader:q,hideLoader:H,setError:I,session_token:P,callback:F,handleClose:Z,amount:qe,isPreAuth:G})):null}import{IoArrowBack as Xa}from"react-icons/io5";import{NumericFormat as $o}from"react-number-format";var jo=({amount:e,bankAmount:t,submitBtnText:q="Pay",session_token:I,customerId:P,callback:F,merchantName:H="merchant",isPreAuth:Z,surcharge:qe="0",submitBtnClass:G,submitBtnIcon:z,isRequest:J,pass_fee:ye,pass_fee_amount:v,require3ds:de=!1,autoTrigger:te=!1,show:M,setShow:C,setHandleCloseRef:V,isPartial:h,bankSurcharge:me,partialRef:zt,loadingPrev:ve=!1,orderGuid:Ne,remainingAmount:st})=>{var Qt,Ee,At,hn,nt,Yn,xn,kt,xa,Tn,Ra,ei,ti,ni,ai,ii,oi,ri,li;let He=ja(!1),xt=ja(!1),ce=ja(null),[Me,it]=gt("card"),[Ft,Dt]=gt("card"),[O,Je]=gt(),[W,B]=gt({}),[i,x]=gt(),[s,N]=gt({}),[T,E]=gt(!1),[A,o]=gt(!1),[m,b]=gt(""),[g,Ce]=gt(!1),[dt,ze]=gt(""),[Oe,yt]=gt(!1),[we,be]=gt(!1),[D,ae]=gt([]),[k,ue]=gt([]),[pe,R]=gt(),[ot,yn]=gt(Number(e)),[mt,_]=gt("form"),[Qn,Cn]=gt("form"),[kn,Sn]=gt(!1),[rn,na]=gt(0),[Nn,Fn]=gt(""),[aa,_n]=gt(null),[un,Hn]=gt(!1),[bn,$]=gt(!1),[j,Xe]=gt(null),[_t,ct]=gt(!1),[Lt,Ct]=gt(Ne||null),[Qe,qt]=gt(""),[Kt,Zt]=gt(""),[Gt,De]=gt(""),[Xt,ln]=gt(),gn=X+"widget/mc-img.svg",pn=X+"widget/visa-img.svg",fn=X+"widget/ae-img.svg",Tt=X+"widget/discover-img.svg",Re=X+"widget/card.svg",pt=X+"widget/Trash.svg",Fe=X+"widget/bank.svg",Ke=X+"widget/secure-img.png",Rt=X+"widget/pov-by.png",Ht=X+"widget/pax.svg",et=X+"widget/cardicon.svg",Xn=X+"widget/bankicon.svg",S=()=>yt(!0),p=()=>yt(!1),Le=(d,c)=>{let U=(parseFloat(c)||0)/100,he=d/(1+U);return Math.round(he*100)/100},ft=ja(null),Pe={input:{"font-family":"'Inter', sans-serif","font-size":"16px",color:"#212529","background-color":"transparent",padding:"0px",appearance:"none",outline:"none",border:"none","box-shadow":"none"},":focus":{color:"#212529",outline:"none",border:"none"},"::placeholder":{color:"#212529"}},Nt=async d=>{var c,U,he,Q,le,Ze,ut,rt,Se,Ie,ie,Ge,se,$t,In,at,Vn,$n;try{let We={pass_fee_amount:Number(e)-ot,pass_fee:ye,Token:d==null?void 0:d.Token,amount:Qe||e,postal_code:d==null?void 0:d.postalCode,require3ds:de,isPartial:h,orderGuid:Lt||Ne};de&&(d!=null&&d.stripe_3ds_auth_id)&&(We.stripe_3ds_auth_id=d==null?void 0:d.stripe_3ds_auth_id);let nn=await vn.post(`${Ve}api/v1/gateway/charge/${I}`,We);if((c=nn==null?void 0:nn.data)!=null&&c.result){let Bt;if(A&&P)try{let xe={postal_code:O==null?void 0:O.zipCode,customer_id:P,gateway_token:(d==null?void 0:d.gateway_token)||(d==null?void 0:d.Token)};Bt=await vn.post(`${Ve}api/v1/gateway/add-card/${I}`,xe),(U=Bt==null?void 0:Bt.data)!=null&&U.result&&(Bt=(he=Bt==null?void 0:Bt.data)==null?void 0:he.data)}catch(xe){console.log(xe,"error"),p(),F({error:((le=(Q=xe==null?void 0:xe.response)==null?void 0:Q.data)==null?void 0:le.message)||"Something went wrong!",result:(ut=(Ze=xe==null?void 0:xe.response)==null?void 0:Ze.data)==null?void 0:ut.result,statusCode:(rt=xe==null?void 0:xe.response)==null?void 0:rt.status}),b(((Ie=(Se=xe==null?void 0:xe.response)==null?void 0:Se.data)==null?void 0:Ie.message)||"Something went wrong!")}let jn={cardDetails:w(w({},Bt),d),callback:L(w({},(ie=nn==null?void 0:nn.data)==null?void 0:ie.data),{name:O==null?void 0:O.cardName,isPreAuth:Z})};A||delete jn.cardDetails,F(jn),p(),ke()}}catch(We){b(((se=(Ge=We==null?void 0:We.response)==null?void 0:Ge.data)==null?void 0:se.message)||"Something went wrong!"),F({error:((In=($t=We==null?void 0:We.response)==null?void 0:$t.data)==null?void 0:In.message)||"Something went wrong!",result:(Vn=(at=We==null?void 0:We.response)==null?void 0:at.data)==null?void 0:Vn.result,statusCode:($n=We==null?void 0:We.response)==null?void 0:$n.status}),p()}},Ot=async d=>{var c,U,he,Q,le,Ze,ut,rt,Se,Ie,ie,Ge,se,$t,In,at,Vn,$n;try{let We={Token:d==null?void 0:d.Token,amount:e,postal_code:d==null?void 0:d.postalCode},nn=await vn.post(`${Ve}api/v1/gateway/preauth/${I}`,We);if((c=nn==null?void 0:nn.data)!=null&&c.result){let Bt;if(A&&P)try{let xe={postal_code:O==null?void 0:O.zipCode,customer_id:P,gateway_token:(d==null?void 0:d.Token)||(d==null?void 0:d.gateway_token)};Bt=await vn.post(`${Ve}api/v1/gateway/add-card/${I}`,xe),(U=Bt==null?void 0:Bt.data)!=null&&U.result&&(Bt=(he=Bt==null?void 0:Bt.data)==null?void 0:he.data)}catch(xe){console.log(xe,"error"),p(),b(((le=(Q=xe==null?void 0:xe.response)==null?void 0:Q.data)==null?void 0:le.message)||"Something went wrong!"),F({error:((ut=(Ze=xe==null?void 0:xe.response)==null?void 0:Ze.data)==null?void 0:ut.message)||"Something went wrong!",result:(Se=(rt=xe==null?void 0:xe.response)==null?void 0:rt.data)==null?void 0:Se.result,statusCode:(Ie=xe==null?void 0:xe.response)==null?void 0:Ie.status})}let jn={cardDetails:w(w({},Bt),d),callback:L(w({},(ie=nn==null?void 0:nn.data)==null?void 0:ie.data),{name:O==null?void 0:O.cardName,isPreAuth:Z})};A||delete jn.cardDetails,F(jn),p(),ke()}}catch(We){b(((se=(Ge=We==null?void 0:We.response)==null?void 0:Ge.data)==null?void 0:se.message)||"Something went wrong!"),F({error:((In=($t=We==null?void 0:We.response)==null?void 0:$t.data)==null?void 0:In.message)||"Something went wrong!",result:(Vn=(at=We==null?void 0:We.response)==null?void 0:at.data)==null?void 0:Vn.result,statusCode:($n=We==null?void 0:We.response)==null?void 0:$n.status}),p()}},Wt=async d=>{var c,U,he,Q,le,Ze,ut,rt,Se;if(d.Error)b(d.Error),F({error:d.Error||"Something went wrong!"}),p();else{let Ie={token:d.Token,resp:d};try{let ie=await vn.post(`${Ve}api/v1/gateway/update/token/${I}`,Ie);if((ie==null?void 0:ie.status)==200){let Ge={Token:(U=(c=ie==null?void 0:ie.data)==null?void 0:c.data)==null?void 0:U.gateway_token,Brand:d.Brand,ExpirationMonth:d.ExpirationMonth,ExpirationYear:d.ExpirationYear,Last4:d.Last4,Bin:d.Bin,CVV:d.CVV,postalCode:O==null?void 0:O.zipCode},se;Z?Ot(Ge):Nt(Ge)}}catch(ie){console.log(ie,"error"),p(),b(((Q=(he=ie==null?void 0:ie.response)==null?void 0:he.data)==null?void 0:Q.message)||"Something went wrong!"),F({error:((Ze=(le=ie==null?void 0:ie.response)==null?void 0:le.data)==null?void 0:Ze.message)||"Something went wrong!",result:(rt=(ut=ie==null?void 0:ie.response)==null?void 0:ut.data)==null?void 0:rt.result,statusCode:(Se=ie==null?void 0:ie.response)==null?void 0:Se.status})}}},Yt=d=>{it(d)},Ut=()=>{var U,he,Q,le,Ze,ut,rt,Se;let d={},c=i;return(U=c==null?void 0:c.name)!=null&&U.trim()||(d.name="Name is required"),(he=c==null?void 0:c.accountNumber)!=null&&he.trim()||(d.accountNumber="Account number is required"),(Q=c==null?void 0:c.accountNumber)!=null&&Q.trim()&&((le=c==null?void 0:c.accountNumber)==null?void 0:le.trim())!==((Ze=c==null?void 0:c.confirmAccountNumber)==null?void 0:Ze.trim())&&(d.confirmAccountNumber="Account numbers must match"),(ut=c==null?void 0:c.bankName)!=null&&ut.trim()||(d.bankName="Bank name is required"),(rt=c==null?void 0:c.routingNumber)!=null&&rt.trim()||(d.routingNumber="Routing Number is required"),c!=null&&c.routingNumber&&((Se=c==null?void 0:c.routingNumber)==null?void 0:Se.length)!==9&&(d.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)==="")&&(d.companyName="Company Name is required for business accounts"),N(d),Object.keys(d).length>0},en=async(d,c)=>{var U,he,Q,le,Ze,ut,rt,Se;try{let Ie=d,ie=await vn.post(`${Ve}api/v1/gateway/verify-and-save/${I}`,{token:Ie,require3ds:de,pass_fee:ye});if((ie==null?void 0:ie.status)==200){let Ge=(U=ie==null?void 0:ie.data)==null?void 0:U.data,se={Token:Ge.gateway_token,Brand:Ge.card_data.brand,ExpirationMonth:Ge.card_data.expire_mm,ExpirationYear:Ge.card_data.expire_yy,Last4:Ge.card_data.last4,Bin:Ge.card_data.bin,postalCode:O==null?void 0:O.zipCode,stripe_3ds_auth_id:c};Z?Ot(se):Nt(se)}}catch(Ie){console.log(Ie,"error"),b(((Q=(he=Ie==null?void 0:Ie.response)==null?void 0:he.data)==null?void 0:Q.message)||"Something went wrong!"),F({error:((Ze=(le=Ie==null?void 0:Ie.response)==null?void 0:le.data)==null?void 0:Ze.message)||"Something went wrong!",result:(rt=(ut=Ie==null?void 0:Ie.response)==null?void 0:ut.data)==null?void 0:rt.result,statusCode:(Se=Ie==null?void 0:Ie.response)==null?void 0:Se.status}),p()}},f=async()=>{var d,c,U,he,Q,le,Ze,ut,rt,Se,Ie,ie,Ge,se,$t,In,at,Vn,$n,We,nn,Bt,jn;try{let xe={method:"POST",redirect:"follow"},on=await vn.post(`${Ve}api/v1/widget/generate-session`,xe),Gn={public_key_pem:((c=(d=on==null?void 0:on.data)==null?void 0:d.data)==null?void 0:c.publicKeyPem)||((he=(U=on==null?void 0:on.data)==null?void 0:U.data)==null?void 0:he.public_key_pem),session_key:(le=(Q=on==null?void 0:on.data)==null?void 0:Q.data)==null?void 0:le.session_key};if(de&&typeof window!="undefined"&&typeof navigator!="undefined"){let Pt=(Ze=navigator.languages)!=null?Ze:[navigator.language],Dn=Array.isArray(Pt)?Pt[0]:Pt;Gn.three_ds_data={amount:Math.round(Qe?parseFloat(Qe)*100:parseFloat(e)*100),currency:"usd",channel:{type:"browser",browser:{language:typeof Dn=="string"?Dn:null,color_depth:(rt=(ut=window.screen)==null?void 0:ut.colorDepth)!=null?rt:null,java_enabled:typeof navigator.javaEnabled=="function"?navigator.javaEnabled():!1,screen_height:(Ie=(Se=window.screen)==null?void 0:Se.height)!=null?Ie:null,screen_width:(Ge=(ie=window.screen)==null?void 0:ie.width)!=null?Ge:null,timezoneOffset:new Date().getTimezoneOffset()}}}}let _e=await ft.current.createToken(Gn);if(_e!=null&&_e.token){let Pt=_e==null?void 0:_e.stripe_three_ds_response;de&&!Pt&&(Pt==null?void 0:Pt.status)==="200 OK"&&((se=Pt==null?void 0:Pt.data)!=null&&se.challenge_url)&&b("Something went wrong. Please try again later."),de?($t=Pt==null?void 0:Pt.data)!=null&&$t.challenge_url?(p(),Xe(L(w({},Pt==null?void 0:Pt.data),{fractalToken:_e==null?void 0:_e.token}))):en(_e==null?void 0:_e.token,(In=Pt==null?void 0:Pt.data)==null?void 0:In.id):en(_e==null?void 0:_e.token,null)}}catch(xe){p(),console.log(xe,"error");let on="Something went wrong!";try{let Gn=((at=xe==null?void 0:xe.response)==null?void 0:at.data)||(xe==null?void 0:xe.message)||"",_e=typeof Gn=="string"?Gn:JSON.stringify(Gn),Dn=((($n=(Vn=_e.split)==null?void 0:Vn.call(_e,`
|
|
3097
|
-
`))==null?void 0:$n.filter(Boolean))||[]).at(-1)||"",Rn=(We=Dn.split)==null?void 0:We.call(Dn,": ");on=(Rn==null?void 0:Rn.length)>1?Rn.pop().trim():Dn.trim()||on}catch(Gn){on="Something went wrong!"}b(on),F({error:on,result:(Bt=(nn=xe==null?void 0:xe.response)==null?void 0:nn.data)==null?void 0:Bt.result,statusCode:(jn=xe==null?void 0:xe.response)==null?void 0:jn.status})}},u=()=>{var U,he,Q,le,Ze,ut;let d={},c=O;if(Xt!==32){let rt=parseInt((c==null?void 0:c.expiryMonth)||"",10),Se=(c==null?void 0:c.expiryYear)||"";if((U=c==null?void 0:c.cardNumber)!=null&&U.trim()||(d.cardNumber="Card number is required"),(!((he=c==null?void 0:c.expiryMonth)!=null&&he.trim())||!((Q=c==null?void 0:c.expiryYear)!=null&&Q.trim())||isNaN(rt)||rt<1||rt>12||Se.length!==4)&&(d.expiryMonth="Invalid Expiration Date."),(le=c==null?void 0:c.cvv)!=null&&le.trim()||(d.cvv="CVV is required"),c!=null&&c.expiryMonth&&(c!=null&&c.expiryYear)&&c.expiryMonth.length<=2&&c.expiryYear.length===4){let Ie=parseInt(c.expiryMonth,10),ie=parseInt(c.expiryYear,10),Ge=new Date,se=Ge.getMonth()+1,$t=Ge.getFullYear();(ie<$t||ie===$t&&Ie<se)&&(d.expiryMonth="Card is expired")}}return(Ze=c==null?void 0:c.cardName)!=null&&Ze.trim()||(d.cardName="Card name is required"),(ut=c==null?void 0:c.zipCode)!=null&&ut.trim()||(d.zipCode="ZIP code is required"),B(d),Object.keys(d).length>0},fe=()=>{let d=DatacapWebToken.validateCardNumber(O==null?void 0:O.cardNumber.replaceAll(" ","")),c=DatacapWebToken.validateExpirationDate(O==null?void 0:O.expiryMonth,O==null?void 0:O.expiryYear),U=DatacapWebToken.validateCVV(O==null?void 0:O.cvv),he={};return d||(he.cardNumber="Invalid card Number"),c||(he.expiryMonth="Invalid Expiration Date."),U||(he.cvv="Invalid CVV"),B(he),d&&U&&c},Te=async d=>{var U,he,Q,le,Ze,ut,rt,Se,Ie,ie,Ge,se,$t,In,at,Vn,$n,We,nn,Bt,jn,xe,on,Gn;d.preventDefault();let c=document.activeElement;if(c instanceof HTMLElement&&c.blur(),!Oe&&!Kt){if(Me!=="ach"){if(u())return;let Pt=!0;if(Xt!==32&&(Pt=fe()),!Pt)return}else if(Ut())return;try{S();let _e=await vn.get(`${Ve}api/v1/gateway/token/${I}`,{params:{require3ds:de,pass_fee:ye}});if((_e==null?void 0:_e.status)==200){let Pt=(he=(U=_e==null?void 0:_e.data)==null?void 0:U.data)==null?void 0:he.gateway_token,Dn=(le=(Q=_e==null?void 0:_e.data)==null?void 0:Q.data)==null?void 0:le.paymentGateway;if(Me!=="ach")Dn==((Ze=Ya)==null?void 0:Ze.FRACTALKEY)?await f():DatacapWebToken.requestToken(Pt,"PaymentForm",Wt);else{let Rn;try{let sn=await vn.post(`${Ve}api/v1/gateway/bank-charge/${I}`,{label:i==null?void 0:i.name,account_number:i==null?void 0:i.accountNumber,routing_number:i==null?void 0:i.routingNumber,bank_name:i==null?void 0:i.bankName,account_type:i==null?void 0:i.accountType,amount:`${t}`,customer_id:null,isSaveAch:!1,tax:"0.00",discount:"0.00",surcharge:"0.00",order_id:"",company_name:(i==null?void 0:i.companyName)||""});if((ut=sn==null?void 0:sn.data)!=null&&ut.result){if(T&&P)try{let Ue=await vn.post(`${Ve}api/v1/gateway/add-bank/${I}`,{name:i==null?void 0:i.name,account_number:i==null?void 0:i.accountNumber,routing_number:i==null?void 0:i.routingNumber,bank_name:i==null?void 0:i.bankName,account_type:i==null?void 0:i.accountType,customer_id:P||"",company_name:(i==null?void 0:i.companyName)||""});Ue.data.result&&(Rn={bankDetails:L(w({},(rt=Ue==null?void 0:Ue.data)==null?void 0:rt.data),{account_type:i==null?void 0:i.accountType})})}catch(Ue){p(),b(((Ie=(Se=Ue==null?void 0:Ue.response)==null?void 0:Se.data)==null?void 0:Ie.message)||"Something went wrong!"),F({error:((Ge=(ie=Ue==null?void 0:Ue.response)==null?void 0:ie.data)==null?void 0:Ge.message)||"Something went wrong!",result:($t=(se=Ue==null?void 0:Ue.response)==null?void 0:se.data)==null?void 0:$t.result,statusCode:(In=Ue==null?void 0:Ue.response)==null?void 0:In.status})}Rn=L(w({},Rn),{callback:L(w({},(at=sn==null?void 0:sn.data)==null?void 0:at.data),{name:i==null?void 0:i.name,isPreAuth:Z})}),F(Rn),ke(),p()}}catch(sn){console.log(sn,"errororor");let Ue=(Vn=sn==null?void 0:sn.response)==null?void 0:Vn.data;typeof(Ue==null?void 0:Ue.message)=="object"?Object.values(Ue==null?void 0:Ue.message).forEach(si=>{var di;b(si||"Something went wrong"),F({error:si||"Something went wrong!",result:(Ue==null?void 0:Ue.result)||!1,statusCode:(di=sn==null?void 0:sn.response)==null?void 0:di.status})}):(b((Ue==null?void 0:Ue.message)||"Something went wrong"),F({error:(Ue==null?void 0:Ue.message)||"Something went wrong!",result:(Ue==null?void 0:Ue.result)||!1,statusCode:($n=sn==null?void 0:sn.response)==null?void 0:$n.status})),p()}}}}catch(_e){p(),F({error:((nn=(We=_e==null?void 0:_e.response)==null?void 0:We.data)==null?void 0:nn.message)||"Something went wrong!",result:(jn=(Bt=_e==null?void 0:_e.response)==null?void 0:Bt.data)==null?void 0:jn.result,statusCode:(xe=_e==null?void 0:_e.response)==null?void 0:xe.status}),b(((Gn=(on=_e==null?void 0:_e.response)==null?void 0:on.data)==null?void 0:Gn.message)||"Something went wrong!")}}},ne=(d,c)=>{let U=d;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(U)){(c===""||/^[0-9]+$/.test(c))&&(B(Q=>L(w({},Q),{[U]:""})),Je(Q=>L(w({},Q),{[U]:c})));return}B(Q=>L(w({},Q),{[U]:""})),Je(Q=>L(w({},Q),{[U]:c}))},vt=d=>{var le;let c=d.target,U=c.value.replace(/\D/g,""),{formatted:he,cursor:Q}=An(c.value,(le=c.selectionStart)!=null?le:0);B(Ze=>L(w({},Ze),{cardNumber:""})),Je(Ze=>L(w({},Ze),{cardNumber:he})),requestAnimationFrame(()=>{c.setSelectionRange(Q,Q)})},$e=d=>{let{name:c,value:U}=d.target,he=["routingNumber","accountNumber","confirmAccountNumber"];if(c=="name"){/^[a-zA-Z\s]*$/.test(U)&&(N(Q=>L(w({},Q),{[c]:""})),x(Q=>L(w({},Q),{[c]:U})));return}if(he.includes(c)){(U===""||/^[0-9]+$/.test(U))&&(N(Q=>L(w({},Q),{[c]:""})),x(Q=>L(w({},Q),{[c]:U})));return}N(Q=>L(w({},Q),{[c]:""})),x(Q=>L(w({},Q),{[c]:U}))},ke=()=>{C(!1),it("card"),b(""),Ce(!1),ze(""),x({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),N({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),Je({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),B({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),E(!1),o(!1),Cn("form"),_("form"),Sn(!1),na(0),yn(0),ae([]),_n(null),Fn(null),Hn(!1),$(!1),Xe(null),Ct(null),qt(""),Zt(""),De("")},Ye=async()=>{var d,c,U,he,Q,le,Ze,ut,rt;S();try{let Se={isPreAuth:Z,customerId:P},Ie=await vn.post(`${Ve}api/v1/gateway/card-list/${I}`,Se),ie=((c=(d=Ie==null?void 0:Ie.data)==null?void 0:d.data)==null?void 0:c.cardList)||[],Ge=ie==null?void 0:ie.filter($t=>($t==null?void 0:$t.card_type)=="Bank"),se=ie==null?void 0:ie.filter($t=>($t==null?void 0:$t.card_type)!=="Bank");se&&(se==null?void 0:se.length)>0?(it("card"),_("list"),ae(se)):(it("card"),ae([])),Ge&&(Ge==null?void 0:Ge.length)>0?(Cn("list"),ue(Ge)):ue([]),p()}catch(Se){console.log(Se),p(),F({error:((he=(U=Se==null?void 0:Se.response)==null?void 0:U.data)==null?void 0:he.message)||"Something went wrong!",result:(le=(Q=Se==null?void 0:Se.response)==null?void 0:Q.data)==null?void 0:le.result,statusCode:(Ze=Se==null?void 0:Se.response)==null?void 0:Ze.status}),b(((rt=(ut=Se==null?void 0:Se.response)==null?void 0:ut.data)==null?void 0:rt.message)||(Se==null?void 0:Se.message)||"Something went wrong")}},je=d=>{switch(d==null?void 0:d.toLowerCase()){case"visa":return pn;case"mastercard":case"mc":case"m/c":return gn;case"amex":case"american express":case"ae":return fn;case"discover":case"dcvr":return Tt;case"bank":return Fe;default:return d}},tt=async d=>{ya.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=>{var U,he;if(c.isConfirmed){be(!0);try{let Q={card_id:d,customer_id:P},le=await vn.patch(`${Ve}api/v1/gateway/delete-card/${I}`,Q);(U=le==null?void 0:le.data)!=null&&U.result?(be(!1),Ye(),ya.fire({icon:"success",title:"Deleted!",text:((he=le==null?void 0:le.data)==null?void 0:he.message)||"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})):(be(!1),ya.fire({icon:"error",title:"Failure!",text:"Card not deleted.",timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}}))}catch(Q){be(!1),ya.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else c.dismiss===ya.DismissReason.cancel&&ya.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},It=async d=>{var Q,le,Ze,ut,rt,Se,Ie,ie,Ge;if(d.currentTarget.blur(),Oe)return;let c=P,U=pe==null?void 0:pe.id,he=pe==null?void 0:pe.card_type;if(!Kt)if(e)if(c)if(U){let se={amount:(he==null?void 0:he.toLowerCase())==="bank"?`${t}`:Qe||e,customer_id:c,card_id:U,pass_fee:ye,pass_fee_amount:Number(e)-ot};h&&(se.orderGuid=Lt||Ne,Qe&&(se.ispartialPayment=!0)),Z&&(se.isPreauth=!0);let $t=Ve+"api/v1/gateway/charge-by-saved-details/"+I,In={"Content-Type":"application/json"};try{S();let at=await vn.post($t,se);(Q=at==null?void 0:at.data)!=null&&Q.result&&(F({callback:L(w({},(le=at==null?void 0:at.data)==null?void 0:le.data),{isPreAuth:Z})}),p(),ke())}catch(at){console.log(at==null?void 0:at.response,"error by saved details"),F({error:((ut=(Ze=at==null?void 0:at.response)==null?void 0:Ze.data)==null?void 0:ut.message)||"Something went wrong!",result:(Se=(rt=at==null?void 0:at.response)==null?void 0:rt.data)==null?void 0:Se.result,statusCode:(Ie=at==null?void 0:at.response)==null?void 0:Ie.status}),p(),b(((Ge=(ie=at==null?void 0:at.response)==null?void 0:ie.data)==null?void 0:Ge.message)||"Something went wrong!")}}else b("Please Select A Card/Bank"),F({error:"Please Select A Card/Bank"});else b("Please Select Customer"),F({error:"Please Select Customer"});else b("Something went wrong."),F({error:"Something went wrong."})},re=async()=>{var d,c,U,he,Q,le,Ze,ut,rt,Se,Ie,ie,Ge;try{S();let se=await vn.get(`${Ve}api/v1/gateway/get-payment-details/${I}`);(se==null?void 0:se.status)==200&&(Sn((c=(d=se==null?void 0:se.data)==null?void 0:d.data)==null?void 0:c.isBankActive),na(Number((he=(U=se==null?void 0:se.data)==null?void 0:U.data)==null?void 0:he.fee)||0),ln((le=(Q=se==null?void 0:se.data)==null?void 0:Q.data)==null?void 0:le.paymentGateway),p())}catch(se){console.log((ut=(Ze=se==null?void 0:se.response)==null?void 0:Ze.data)==null?void 0:ut.result,"error while getting payment details"),F({error:((Se=(rt=se==null?void 0:se.response)==null?void 0:rt.data)==null?void 0:Se.message)||"Something went wrong!",result:(ie=(Ie=se==null?void 0:se.response)==null?void 0:Ie.data)==null?void 0:ie.result,statusCode:(Ge=se==null?void 0:se.response)==null?void 0:Ge.status}),p()}},ee=async()=>{var d,c,U,he,Q;if(!_t){ct(!0);try{let le=await vn.post(`${Ve}api/v1/gateway/create-pay-order/${I}`,{amount:e,cashDiscount:ot,bankAmount:t,bankSurcharge:me,customerId:P,passFee:ye,passFeeAmount:v||Number(e)-ot,require3ds:de,isPartial:h});(d=le==null?void 0:le.data)!=null&&d.result&&(ct(!1),Ct((U=(c=le==null?void 0:le.data)==null?void 0:c.data)==null?void 0:U.orderGuid),De((Q=(he=le==null?void 0:le.data)==null?void 0:he.data)==null?void 0:Q.remainingAmount),He.current=!0)}catch(le){console.log("error in creating order",le),ct(!1)}}};Pa(()=>{!M&&!te&&(He.current=!1,xt.current=!1)},[M,te]),Pa(()=>{!He.current&&(M||te)&&(re(),h&&!zt&&ee())},[M,te,h]),Pa(()=>{if((M||te)&&v){let d=Number(e)-Number(v);d&&!isNaN(d)&&yn(d)}else if((M||te)&&ye&&rn){let d=Le(e,rn);d&&!isNaN(d)&&yn(d)}else yn(Number(e));!xt.current&&P&&(M||te)&&!J&&(xt.current=!0,Ye())},[P,M,e,rn,te]);let ht=()=>Z?"Cards":"Cards/Bank",an=Vo(async()=>{try{Hn(!0);let c=await(await fetch(`${Ve}api/v1/gateway/create-payment-intent/${I}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:e,require3ds:de,pass_fee:ye})})).json();c.is3dEnable?(Hn(!1),Fn(c.clientSecret),$(c.is3dEnable)):(Hn(!1),$(c.is3dEnable)),c.result||b(c.error||(c==null?void 0:c.message)||"Failed to get client secret")}catch(d){console.log(d.response,"err.response"),b(d.message)}},[e]),bt=()=>{},Vt=(d,c)=>{S(),en(d,c),Xe(null)},Jt=d=>{console.error("3DS Auth failed \u274C",d),b(`3DS Authentication ${d}`)};Pa(()=>{V&&V(()=>ke)},[]);let wt=d=>{var c,U;((c=Number(Gt||st))==null?void 0:c.toFixed(2))<(d==null?void 0:d.floatValue)||(d==null?void 0:d.floatValue)<0?(qt(d==null?void 0:d.value),Zt(`Partial amount cannot exceed ${ge((U=Number(Gt||st))==null?void 0:U.toFixed(2))}`)):(d==null?void 0:d.floatValue)==0?(qt(d==null?void 0:d.value),Zt("Partial amount must be greater than 0")):(qt(d==null?void 0:d.value),Zt(""))};return Pa(()=>{if(typeof FractalTokenizer=="undefined")return;let d=new FractalTokenizer({styles:{}})},[]),l.createElement(l.Fragment,null,un&&l.createElement(dn,{loading:un}),m&&l.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},l.createElement(zn,{error:m,onClose:ke})),!m&&l.createElement(l.Fragment,null,(Oe||we)&&l.createElement(dn,{loading:Oe||we||ve||_t}),l.createElement("div",{className:"frac-card-payment-page frac-form frac-new-form"},l.createElement("div",{ref:ce,style:{width:"100%",height:"100%"}}),j!=null&&j.challenge_url?l.createElement(ki,{containerRef:ce,challengeUrl:j.challenge_url,fractalToken:j.fractalToken,stripeIntentId:j.id,onSuccess:Vt,onError:Jt}):l.createElement("div",{className:"parent-pay-container"},l.createElement("span",{style:{display:te?"none":"block"},className:"request-payment-close-popup",onClick:ke},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("g",{clipPath:"url(#clip0_12425_52336)"},l.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"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_12425_52336"},l.createElement("rect",{width:"16",height:"16",fill:"white"}))))),l.createElement("div",{className:"pay-main-logo-res"}),l.createElement("div",{className:"pay-container"},l.createElement("div",{className:"pay-header pay-conatiner-one"},l.createElement("div",{className:"pay-conatiner-one-first"},l.createElement("div",{className:"pay-logo-container"},l.createElement("div",{className:"pay-main-logo"}),l.createElement("h1",{className:"pay-heading"},"Pay"),(D==null?void 0:D.length)>0&&Me!=="cardList"&&l.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>it("cardList")}," ",l.createElement(Xa,null)," Back")),l.createElement("div",{className:"amt-pay-con"},l.createElement("div",{className:"pay-amount-conatiner"},l.createElement("small",{className:"pay-payment-amount"},"Select payment type"),l.createElement("div",{className:"frac-card-bank-radio-main"},l.createElement(Ln,{label:"Card",amount:(Qt=Number(e))==null?void 0:Qt.toFixed(2),value:"card",onChange:Yt,activetab:Me}),!Z&&kn&&!h&&l.createElement(Ln,{label:"Bank",amount:(Ee=Number(t))==null?void 0:Ee.toFixed(2),value:"ach",onChange:Yt,activetab:Me})),ye&&Me==="card"&&ot&&Number(e)-Number(ot)>0?l.createElement("div",{className:"frac-cash-discount-fee"},l.createElement("small",null,Me==="card"?"Cash Discount":"Cash Discount Savings"," "),l.createElement("p",null,ge((Number(e)-Number(ot)).toFixed(2)))):null,h&&l.createElement("div",{className:"frac-partial-payment-input"},l.createElement("label",{htmlFor:"partialpayment"},"Partial Payment"),l.createElement($o,{prefix:"$",className:"form-control-frac",value:Qe,onValueChange:d=>{wt(d)},thousandSeparator:!0,placeholder:"Enter partial amount",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,isAllowed:d=>{let{floatValue:c=0,value:U}=d;return U===""||U==="0"||U.startsWith("0.")?!0:c===0?!1:c>0}}),Kt&&l.createElement("span",{className:"error-span"},Kt))))),l.createElement("div",{className:"pay-conatiner-one-last"},l.createElement("img",{src:Ke,alt:""}),l.createElement("img",{src:Rt,alt:""}),"Secure payments powered by Fractal")),l.createElement("div",{className:"pay-tab pay-conatiner-two"},l.createElement("div",{className:"col-md-12"},l.createElement("div",{id:"payment-form-div"},bn?Nn&&l.createElement(Qa,{onSuccess:bt,clientSecret:Nn,amount:e,showLoader:S,hideLoader:p,callback:F,session_token:I,handleClose:ke,setError:b,isPreAuth:Z}):l.createElement(l.Fragment,null,l.createElement("div",{id:"ach",style:{display:Me==="card"?"block":"none"},className:"tabcontent"},l.createElement("div",{className:"frac-heading-card-wrap"},l.createElement("div",{className:"frac-backarrow"},(D==null?void 0:D.length)>0&&mt==="form"&&l.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>_("list")}," ",l.createElement(Xa,null))),l.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),l.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},l.createElement("img",{src:pn,alt:"",width:33}),l.createElement("img",{src:gn,width:33,alt:""}),l.createElement("img",{src:fn,alt:"",width:33}),l.createElement("img",{src:Tt,width:33,alt:""})),mt==="list"&&(D==null?void 0:D.length)>0?l.createElement(l.Fragment,null,l.createElement(En,{headingClass:"card-ach-heading-frac",listHeading:"Card",ListItems:D,selectedCard:pe,setSelectedCard:R,handleDeleteCard:tt,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{_("form")}}),l.createElement("div",{className:"form-group-frac",style:{padding:"0"}},l.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:It},Qe?ge((At=Number(Qe))==null?void 0:At.toFixed(2)):ge((hn=Number(e))==null?void 0:hn.toFixed(2))))):Xt==32?l.createElement("form",{id:"paymentForm",style:{textAlign:"start"},onSubmit:Te,onKeyDown:d=>{d.key==="Enter"&&Oe&&(d.preventDefault(),d.stopPropagation())}},l.createElement("div",{className:"ach-scrl",style:{minHeight:"398px",maxHeight:"398px",overflow:"auto",marginRight:"5px"}},l.createElement("div",{className:"form-group-frac"},l.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),l.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"John Doe",value:(O==null?void 0:O.cardName)||"",onChange:d=>{let c=d.target.value;/^[a-zA-Z\s]*$/.test(c)&&ne("cardName",c)}}),(W==null?void 0:W.cardName)&&l.createElement("span",{className:"error-span"},W==null?void 0:W.cardName)),l.createElement("div",{className:"form-group-frac"},l.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),l.createElement("div",{className:"toggle-num-wrapper"},M&&Xt===32&&l.createElement(Jn,{fractalStyles:Pe,tokenizerRef:ft,isSky:!0}))),l.createElement("div",{className:"form-group-frac"},l.createElement("label",{htmlFor:"zip"},"ZIP"),l.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"000000",value:(nt=O==null?void 0:O.zipCode)!=null?nt:"",onChange:d=>ne("zipCode",d.target.value)}),(W==null?void 0:W.zipCode)&&l.createElement("span",{className:"error-span"},W==null?void 0:W.zipCode)),P&&l.createElement("div",{className:"form-group-frac"},l.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},l.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:A,onChange:d=>o(d.target.checked)}),l.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),l.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),l.createElement("div",{className:"frac-tooltip-wrapper"},l.createElement("div",{className:"frac-tooltip-icon"},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},l.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),l.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"}))),l.createElement("div",{className:"frac-tooltip-text"},l.createElement("p",null,"If checked, I agree to give the ",l.createElement("b",null,H||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),l.createElement("div",{className:"form-group-frac",style:{marginTop:"20px",padding:"0"}},l.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},Qe?ge((Yn=Number(Qe))==null?void 0:Yn.toFixed(2)):ge((xn=Number(e))==null?void 0:xn.toFixed(2))))):l.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:Te,onKeyDown:d=>{d.key==="Enter"&&Oe&&(d.preventDefault(),d.stopPropagation())}},l.createElement("div",{className:"ach-scrl",style:{minHeight:"398px",maxHeight:"398px",overflow:"auto",marginRight:"5px"}},l.createElement("div",{className:"form-group-frac"},l.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),l.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"John Doe",value:(O==null?void 0:O.cardName)||"",onChange:d=>{let c=d.target.value;/^[a-zA-Z\s]*$/.test(c)&&ne("cardName",c)}}),(W==null?void 0:W.cardName)&&l.createElement("span",{className:"error-span"},W==null?void 0:W.cardName)),l.createElement("div",{className:"form-group-frac"},l.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),l.createElement("div",{className:"toggle-num-wrapper"},l.createElement("input",{className:"form-control-frac card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(O==null?void 0:O.cardNumber)||"",onChange:d=>vt(d),"data-token":"card_number"}),l.createElement("div",{className:"card-crdi card-expiry-new"},l.createElement("div",{className:"exp-date-year-container"},l.createElement("div",{className:"exp-date form-group-frac"},l.createElement("input",{"data-token":"exp_month",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(O==null?void 0:O.expiryMonth)||"",onChange:d=>ne("expiryMonth",d.target.value)})),l.createElement("div",{className:"exp-year form-group-frac"},l.createElement("input",{"data-token":"exp_year",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(O==null?void 0:O.expiryYear)||"",onChange:d=>ne("expiryYear",d.target.value)})),l.createElement("div",{className:"security-digit form-group-frac"},l.createElement("input",{"data-token":"cvv",className:"form-control-frac card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(O==null?void 0:O.cvv)||"",onChange:d=>ne("cvv",d.target.value)})))),(W==null?void 0:W.cardNumber)&&l.createElement("span",{className:"error-span"},W==null?void 0:W.cardNumber),l.createElement("p",{style:{margin:"0"}},W!=null&&W.expiryMonth||W!=null&&W.expiryYear?l.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},W==null?void 0:W.expiryMonth):"",(W==null?void 0:W.cvv)&&l.createElement("span",{className:"error-span"},W==null?void 0:W.cvv)))),l.createElement("div",{className:"form-group-frac"},l.createElement("label",{htmlFor:"zip"},"ZIP"),l.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"000000",value:(kt=O==null?void 0:O.zipCode)!=null?kt:"",onChange:d=>ne("zipCode",d.target.value)}),(W==null?void 0:W.zipCode)&&l.createElement("span",{className:"error-span"},W==null?void 0:W.zipCode)),P&&l.createElement("div",{className:"form-group-frac"},l.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},l.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:A,onChange:d=>o(d.target.checked)}),l.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),l.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),l.createElement("div",{className:"frac-tooltip-wrapper"},l.createElement("div",{className:"frac-tooltip-icon"},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},l.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),l.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"}))),l.createElement("div",{className:"frac-tooltip-text"},l.createElement("p",null,"If checked, I agree to give the ",l.createElement("b",null,H||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),l.createElement("div",{className:"form-group-frac",style:{marginTop:"20px",padding:"0"}},l.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},Qe?ge((xa=Number(Qe))==null?void 0:xa.toFixed(2)):ge((Tn=Number(e))==null?void 0:Tn.toFixed(2)))))),l.createElement("div",{id:"ach",style:{display:Me==="ach"?"block":"none"},className:"tabcontent"},l.createElement(l.Fragment,null,l.createElement("div",{className:"frac-heading-card-wrap"},l.createElement("div",{className:"frac-backarrow"},(k==null?void 0:k.length)>0&&Qn==="form"&&l.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Cn("list")}," ",l.createElement(Xa,null))),l.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment")),Qn==="list"&&(k==null?void 0:k.length)>0?l.createElement(l.Fragment,null,l.createElement(En,{headingClass:"card-ach-heading-frac",listHeading:"Banks",ListItems:k,selectedCard:pe,setSelectedCard:R,handleDeleteCard:tt,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{Cn("form")}}),l.createElement("div",{className:"form-group-frac",style:{padding:"0"}},l.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:It},ge((Ra=Number(t))==null?void 0:Ra.toFixed(2))))):l.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:Te,autoComplete:"off",onKeyDown:d=>{d.key==="Enter"&&Oe&&(d.preventDefault(),d.stopPropagation())}},l.createElement("div",{className:"ach-scrl",style:{minHeight:"444px",maxHeight:"444px"}},l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),l.createElement("input",{type:"text",id:"nameonaccount",className:"form-control-frac",maxLength:100,placeholder:"John Doe",name:"name",value:(ei=i==null?void 0:i.name)!=null?ei:"",onChange:$e}),(s==null?void 0:s.name)&&l.createElement("span",{className:"error-span"},s==null?void 0:s.name)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"routingnumber"},"Routing number"),l.createElement("input",{type:"text",id:"routingnumber",className:"form-control-frac",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(ti=i==null?void 0:i.routingNumber)!=null?ti:"",onChange:$e}),(s==null?void 0:s.routingNumber)&&l.createElement("span",{className:"error-span"},s==null?void 0:s.routingNumber)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"accountnumber"},"Account number"),l.createElement("input",{type:"text",id:"accountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(ni=i==null?void 0:i.accountNumber)!=null?ni:"",onChange:$e}),(s==null?void 0:s.accountNumber)&&l.createElement("span",{className:"error-span"},s==null?void 0:s.accountNumber)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),l.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(ai=i==null?void 0:i.confirmAccountNumber)!=null?ai:"",onChange:$e}),(s==null?void 0:s.confirmAccountNumber)&&l.createElement("span",{className:"error-span"},s==null?void 0:s.confirmAccountNumber)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"bankname"},"Bank name"),l.createElement("input",{type:"text",id:"bankname",className:"form-control-frac",maxLength:100,placeholder:"My Bank",name:"bankName",value:(ii=i==null?void 0:i.bankName)!=null?ii:"",onChange:$e}),(s==null?void 0:s.bankName)&&l.createElement("span",{className:"error-span"},s==null?void 0:s.bankName)),((i==null?void 0:i.accountType)==="business saving"||(i==null?void 0:i.accountType)==="business checking")&&l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"companyName"},"Company name"),l.createElement("input",{type:"text",id:"companyName",className:"form-control-frac",maxLength:100,placeholder:"My Company",name:"companyName",value:(oi=i==null?void 0:i.companyName)!=null?oi:"",onChange:$e}),(s==null?void 0:s.companyName)&&l.createElement("span",{className:"error-span"},s==null?void 0:s.companyName)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"accounttype"},"Select account type"),l.createElement("select",{name:"accountType",id:"accounttype",className:"form-control-frac",value:(ri=i==null?void 0:i.accountType)!=null?ri:"",onChange:$e},l.createElement("option",{value:""},"Select account"),fa.map(d=>l.createElement("option",{key:d.value,value:d.value},d.label)))),P&&l.createElement("div",{className:"form-group-frac mb-4 save-ach-div",style:{paddingTop:"5px"}},l.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:T,onChange:d=>E(d.target.checked)}),l.createElement("label",{className:"saveachlabel",htmlFor:"saveACH"},"Save ACH")),T&&l.createElement("div",{className:"form-group-frac mb-4 saveachtext"},l.createElement("p",null,"If checked, I agree to give the ",l.createElement("b",null,H||"merchant")," permission to charge this bank account for agreed-upon purchases in the future."))),l.createElement("div",{className:"form-group-frac "},l.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},ge((li=Number(t))==null?void 0:li.toFixed(2))))))))))))))))},Da=jo;import Eo from"axios";var Ko=({amount:e,bankAmount:t,submitBtnText:q="Pay",session_token:I,customerId:P,callback:F,merchantName:H="merchant",isPreAuth:Z,surcharge:qe="0",submitBtnClass:G,submitBtnIcon:z,isRequest:J,pass_fee:ye,pass_fee_amount:v,require3ds:de=!1,autoTrigger:te=!1,isPartial:M,bankSurcharge:C,partialRef:V})=>{let[h,me]=ba(!1),[zt,ve]=ba(!1),[Ne,st]=ba(()=>()=>{}),[He,xt]=ba(null),[ce,Me]=ba(null),it=Oo(()=>({amount:e,bankAmount:t,submitBtnText:q,session_token:I,customerId:P,callback:F,merchantName:H,isPreAuth:Z,surcharge:qe,submitBtnClass:G,submitBtnIcon:z,isRequest:J,pass_fee:ye,pass_fee_amount:v,require3ds:de,autoTrigger:te,setShow:me,setHandleCloseRef:st,isPartial:M,bankSurcharge:C,partialRef:V}),[e,t,q,I,P,F,H,Z,qe,G,z,J,ye,v,de,te,M,C,V]),[Ft,Dt]=ba(it);Pi(()=>{h&&Dt(it)},[h,it]);let O=async()=>{var Je;ve(!0);try{let W=await Eo.get(`${Ve}api/v1/gateway/get-order-details/${I}`,{params:{isPartial:M,partialRef:V}});if((Je=W==null?void 0:W.data)!=null&&Je.result){let B=W.data.data;B!=null&&B.orderGuid&&(xt(B==null?void 0:B.orderGuid),Me(B==null?void 0:B.remainingAmount)),Dt(i=>L(w({},i),{amount:B.amount,pass_fee_amount:B.pass_fee_amount,pass_fee:B.pass_fee}))}}catch(W){console.log("error while getting skyosorderdeatils",W)}finally{ve(!1)}};return Pi(()=>{h&&M&&V&&O()},[h,M,V]),qn.createElement(qn.Fragment,null,qn.createElement("link",{href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"}),qn.createElement(Pn,null),qn.createElement(Kn,null),qn.createElement(Ja,null),qn.createElement(ta,null),qn.createElement(La,null),!te&&qn.createElement("button",{className:G||"paymentBtn",onClick:()=>me(!0)},q,z),te?qn.createElement(Da,L(w({show:h,loadingPrev:zt},Ft),{orderGuid:He,remainingAmount:ce})):qn.createElement(wn,{open:h,onClose:Ne},qn.createElement(Da,L(w({show:h,loadingPrev:zt},Ft),{orderGuid:He,remainingAmount:ce}))))};export{Co as AddCard,_o as CardOnFile,go as GetPaymentPage,Mo as PartialPayment,Ko as PaymentWidget,ho as PreAuthPayment,Ji as RequestPayment,Ri as RequestPreAuthPayment};
|