@fractalpay/fractalpay-next-dev 0.0.210 → 0.0.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -2
- package/dist/index.js +8406 -38
- package/dist/index.js.map +1 -0
- package/package.json +12 -15
- package/types/fractal.d.ts +11 -0
- package/dist/index.d.mts +0 -138
- package/dist/index.mjs +0 -3013
package/dist/index.mjs
DELETED
|
@@ -1,3013 +0,0 @@
|
|
|
1
|
-
var Fa=Object.defineProperty,Ma=Object.defineProperties;var La=Object.getOwnPropertyDescriptors;var Li=Object.getOwnPropertySymbols;var ca=Object.prototype.hasOwnProperty,ua=Object.prototype.propertyIsEnumerable;var ma=(e,t,H)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:H}):e[t]=H,v=(e,t)=>{for(var H in t||(t={}))ca.call(t,H)&&ma(e,H,t[H]);if(Li)for(var H of Li(t))ua.call(t,H)&&ma(e,H,t[H]);return e},F=(e,t)=>Ma(e,La(t));var Un=(e,t)=>{var H={};for(var T in e)ca.call(e,T)&&t.indexOf(T)<0&&(H[T]=e[T]);if(e!=null&&Li)for(var T of Li(e))t.indexOf(T)<0&&ua.call(e,T)&&(H[T]=e[T]);return H};var Aa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var pa=Aa((Or,Ba)=>{Ba.exports={name:"@fractalpay/fractalpay-next-dev",version:"0.0.210",private:!1,scripts:{dev:"next dev -p 4001",build:"next build",start:"next start",lint:"next lint",bundle:"tsup src/app/index.ts"},dependencies:{"@stripe/react-stripe-js":"^5.3.0","@stripe/stripe-js":"^8.3.0","@types/yup":"^0.29.14",axios:"^1.8.1",bootstrap:"^5.3.3","credit-card-type":"^10.0.1",formik:"^2.4.6","node-forge":"^1.3.1","react-bootstrap":"^2.10.5","react-bs-datatable":"^3.15.0","react-datepicker":"^7.5.0","react-icons":"^5.5.0","react-number-format":"^5.4.3","react-toastify":"^10.0.6","socket.io-client":"^4.8.1","styled-components":"^6.1.15",sweetalert2:"^11.22.0",yup:"^1.6.1"},peerdependencies:{next:"15.0.5",react:">=18.0.0 <20.0.0","react-dom":">=18.0.0 <20.0.0"},devDependencies:{"@types/estree":"^1.0.8","@types/node":"^20","@types/node-forge":"^1.3.11","@types/react":"^18","@types/react-dom":"^18",autoprefixer:"^10.4.20","credit-card-type":"^10.0.1",eslint:"^8","eslint-config-next":"15.0.3",next:"^15.0.5",react:"^18.3.1","react-bs-datatable":"^3.15.0","react-datepicker":"^7.5.0","react-dom":"^18.3.1","react-toastify":"^10.0.6",tsup:"^8.4.0",typescript:"^5"},author:"Mukul",license:"MIT",keywords:["nextjs","next","typescript","tailwindcss"],main:"dist/index.js",publishConfig:{access:"public"}}});import"bootstrap/dist/js/bootstrap.bundle.min.js";import I,{useState as $n,useEffect as ya}from"react";import On from"react";import Ta from"react";var za=e=>Ta.createElement("style",null,`
|
|
2
|
-
|
|
3
|
-
.loader {
|
|
4
|
-
position: fixed; /* Fixed position to cover the viewport */
|
|
5
|
-
top: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100%;
|
|
9
|
-
display: flex;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
/* background: rgba(255, 255, 0, 0.01); Adjust the blur effect */
|
|
13
|
-
background-color: rgba(31, 29, 29, 0.52); /* Semi-transparent black background */
|
|
14
|
-
|
|
15
|
-
backdrop-filter: blur(.5px); /* Blur effect */
|
|
16
|
-
z-index: 999999999999 !important; /* Ensure it's on top of other elements */
|
|
17
|
-
transform: translate(0%, 0%) !important
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.lds-ellipsis {
|
|
21
|
-
display: inline-block;
|
|
22
|
-
position: relative;
|
|
23
|
-
width: 80px;
|
|
24
|
-
height: 80px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.lds-ellipsis div {
|
|
28
|
-
position: absolute;
|
|
29
|
-
top: 33px;
|
|
30
|
-
width: 13px;
|
|
31
|
-
height: 13px;
|
|
32
|
-
border-radius: 50%;
|
|
33
|
-
background: #000;
|
|
34
|
-
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.lds-ellipsis div:nth-child(1) {
|
|
38
|
-
left: 8px;
|
|
39
|
-
animation: lds-ellipsis1 0.6s infinite;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.lds-ellipsis div:nth-child(2) {
|
|
43
|
-
left: 8px;
|
|
44
|
-
animation: lds-ellipsis2 0.6s infinite;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.lds-ellipsis div:nth-child(3) {
|
|
48
|
-
left: 32px;
|
|
49
|
-
animation: lds-ellipsis2 0.6s infinite;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.lds-ellipsis div:nth-child(4) {
|
|
53
|
-
left: 56px;
|
|
54
|
-
animation: lds-ellipsis3 0.6s infinite;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@keyframes lds-ellipsis1 {
|
|
58
|
-
0% {
|
|
59
|
-
transform: scale(0);
|
|
60
|
-
}
|
|
61
|
-
100% {
|
|
62
|
-
transform: scale(1);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@keyframes lds-ellipsis2 {
|
|
67
|
-
0% {
|
|
68
|
-
transform: translate(0, 0);
|
|
69
|
-
}
|
|
70
|
-
100% {
|
|
71
|
-
transform: translate(24px, 0);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@keyframes lds-ellipsis3 {
|
|
76
|
-
0% {
|
|
77
|
-
transform: scale(1);
|
|
78
|
-
}
|
|
79
|
-
100% {
|
|
80
|
-
transform: scale(0);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
`),ga=za;var Ia=e=>On.createElement(On.Fragment,null,On.createElement(ga,null),(e==null?void 0:e.loading)&&On.createElement("div",{className:"loader"},On.createElement("div",{className:"lds-ellipsis"},On.createElement("div",null),On.createElement("div",null),On.createElement("div",null),On.createElement("div",null)))),an=Ia;var{name:Ai}=pa(),ne="https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/";Ai==="@fractalpay/fractalpay-next-dev"?(je="https://dev-sky-node.fractalpay.com/",Xe="https://dev-widget.fractalpay.com/",rn="https://api-dev.merchant-trends.com/",Jn="https://token-cert.dcap.com/v1/client",Qn="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw"):Ai==="@fractalpay/fractalpay-next-test"?(je="https://testapi.fractalpay.com/",Xe="https://staging-widget.fractalpay.com/",rn="https://api-dev.merchant-trends.com/",Jn="https://token-cert.dcap.com/v1/client",Qn="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw"):Ai==="@fractalpay/fractalpay-next-testprod"?(je="https://sky-node-prod.fractalpay.com/",Xe="https://widget-prod.fractalpay.com/",rn="https://api.merchant-trends.com/",Jn="https://token.dcap.com/v1/client",Qn="pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB"):Ai==="@fractalpay/fractalpay-next"?(je="https://api.fractalpay.com/",Xe="https://widget.fractalpay.com/",rn="https://api.merchant-trends.com/",Jn="https://token.dcap.com/v1/client",Qn="pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB"):(Xe="http://localhost:8082/",je="http://localhost:8081/",rn="https://api-dev.merchant-trends.com/",Jn="https://token-cert.dcap.com/v1/client",Qn="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw");var je,Xe,rn,Jn,Qn;var Zt={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 yi from"react";import qa from"react";var Ha=e=>qa.createElement("style",null,`
|
|
85
|
-
.fractal-input::placeholder {
|
|
86
|
-
color: #35254D;
|
|
87
|
-
opacity: 1;
|
|
88
|
-
font-size: 15px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.fractal-input::-ms-input-placeholder {
|
|
92
|
-
color: #35254D;
|
|
93
|
-
font-size: 15px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.trigger{
|
|
97
|
-
text-align: center;
|
|
98
|
-
padding: 7px 13px;
|
|
99
|
-
background: #3e3e3e;
|
|
100
|
-
color: #fff;
|
|
101
|
-
font-size: 15px;
|
|
102
|
-
outline: none;
|
|
103
|
-
border: none;
|
|
104
|
-
border-radius: 5px;
|
|
105
|
-
font-family: cursive;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// .fractal-popup {
|
|
109
|
-
// position: fixed;
|
|
110
|
-
// z-index: 9999;
|
|
111
|
-
// top: 0;
|
|
112
|
-
// right: 0;
|
|
113
|
-
// bottom: 0;
|
|
114
|
-
// left: 0;
|
|
115
|
-
// width: 100%;
|
|
116
|
-
// // max-width:810px;
|
|
117
|
-
// height: 100%;
|
|
118
|
-
// background-color: rgba(0, 0, 0, 0.5);
|
|
119
|
-
// transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
|
|
120
|
-
// display: flex;
|
|
121
|
-
// justify-content: center;
|
|
122
|
-
// align-items: center;
|
|
123
|
-
// overflow:auto;
|
|
124
|
-
// }
|
|
125
|
-
|
|
126
|
-
.fractal-popup {
|
|
127
|
-
position: fixed;
|
|
128
|
-
z-index: 1050;
|
|
129
|
-
left: 0;
|
|
130
|
-
top: 0;
|
|
131
|
-
width: 100%;
|
|
132
|
-
height: 100%;
|
|
133
|
-
overflow: auto;
|
|
134
|
-
background-color: rgba(0, 0, 0, 0.8);
|
|
135
|
-
// padding:20px
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.fractal-popup-content {
|
|
139
|
-
margin:20px auto !important;
|
|
140
|
-
transform :none;
|
|
141
|
-
background-color: white;
|
|
142
|
-
padding:20px;
|
|
143
|
-
border-radius: 0.5rem;
|
|
144
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
145
|
-
box-sizing: border-box;
|
|
146
|
-
position: relative;
|
|
147
|
-
// min-height : 585px;
|
|
148
|
-
max-width:810px;
|
|
149
|
-
width:90vw
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
// @media only screen and (min-width: 600px){
|
|
155
|
-
// .fractal-popup-content {
|
|
156
|
-
// max-width:810px;
|
|
157
|
-
// }
|
|
158
|
-
// }
|
|
159
|
-
// @media only screen and (max-width: 600px){
|
|
160
|
-
// .fractal-popup-content {
|
|
161
|
-
// width: 350px;
|
|
162
|
-
// }
|
|
163
|
-
// }
|
|
164
|
-
// @media only screen and (max-width: 450px){
|
|
165
|
-
// .fractal-popup-content {
|
|
166
|
-
// width: 300px;
|
|
167
|
-
// }
|
|
168
|
-
// }
|
|
169
|
-
.close-popup {
|
|
170
|
-
max-height:25px;
|
|
171
|
-
width:25px;
|
|
172
|
-
height: 25px;
|
|
173
|
-
color: #999;
|
|
174
|
-
position: absolute;
|
|
175
|
-
top: 2px;
|
|
176
|
-
right: 4px;
|
|
177
|
-
z-index: 7;
|
|
178
|
-
text-align: center;
|
|
179
|
-
cursor: pointer;
|
|
180
|
-
border-radius: 0.25rem;
|
|
181
|
-
font-size: 30px;
|
|
182
|
-
line-height: 30px;
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
justify-content: center;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.close-popup:hover {
|
|
189
|
-
color: #000;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.fractal-inpt-list {
|
|
193
|
-
margin-bottom: 15px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.fractal-label {
|
|
197
|
-
color: #727272;
|
|
198
|
-
margin-bottom: 3px;
|
|
199
|
-
font-family: "Inter", sans-serif;
|
|
200
|
-
font-weight: 500;
|
|
201
|
-
font-size: 12px;
|
|
202
|
-
display: block;
|
|
203
|
-
text-align: left;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.fractal-input {
|
|
207
|
-
display: block;
|
|
208
|
-
width: 100%;
|
|
209
|
-
padding: .320rem .75rem;
|
|
210
|
-
font-size: 1rem;
|
|
211
|
-
font-weight: 400;
|
|
212
|
-
line-height: 1.5;
|
|
213
|
-
color: #35254D;
|
|
214
|
-
appearance: none;
|
|
215
|
-
background-color:#ffffff;
|
|
216
|
-
background-clip: padding-box;
|
|
217
|
-
border:1px solid #dee2e6;
|
|
218
|
-
border-radius: 0.375rem;
|
|
219
|
-
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.fractal-input:focus {border:#86b7fe 1px solid; outline: none;}
|
|
223
|
-
|
|
224
|
-
.fractal-group {
|
|
225
|
-
position: relative;
|
|
226
|
-
display: flex;
|
|
227
|
-
align-items: stretch;
|
|
228
|
-
width: 100%;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.fractal-group-icons {
|
|
232
|
-
display: flex;
|
|
233
|
-
align-items: center;
|
|
234
|
-
padding: 0.375rem 0.75rem;
|
|
235
|
-
font-size: 1rem;
|
|
236
|
-
font-weight: 400;
|
|
237
|
-
line-height: 1.5;
|
|
238
|
-
color: #212529;
|
|
239
|
-
text-align: center;
|
|
240
|
-
white-space: nowrap;
|
|
241
|
-
background-color: #f8f9fa;
|
|
242
|
-
border:#dee2e6 1px solid;
|
|
243
|
-
border-radius: 0.375rem 0 0 0.375rem ;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.fractal-group .fractal-input{
|
|
247
|
-
border-radius:0 0.375rem 0.375rem 0;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
.pay-button {
|
|
252
|
-
outline: 0;
|
|
253
|
-
height: 46px;
|
|
254
|
-
font-size: 16px;
|
|
255
|
-
background: #727272;
|
|
256
|
-
border: none;
|
|
257
|
-
display: block;
|
|
258
|
-
color: #fff;
|
|
259
|
-
width: 100%;
|
|
260
|
-
border-radius: 180px;
|
|
261
|
-
margin: 10px 0;
|
|
262
|
-
text-decoration: none;
|
|
263
|
-
cursor:pointer,
|
|
264
|
-
font-family:
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.pay-button:hover, .pay-button:focus {background: #222; color: #fff; cursor:pointer}
|
|
268
|
-
|
|
269
|
-
.fractal-powerd-by {
|
|
270
|
-
display: flex;
|
|
271
|
-
font-size: 12px;
|
|
272
|
-
text-align: center;
|
|
273
|
-
align-items: center;
|
|
274
|
-
justify-content: center;
|
|
275
|
-
margin: 5px 0 20px 0;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
/* ................................................................ */
|
|
285
|
-
|
|
286
|
-
.fractal-pay-popup {
|
|
287
|
-
position: fixed;
|
|
288
|
-
z-index: 9999;
|
|
289
|
-
top: 0;
|
|
290
|
-
right: 0;
|
|
291
|
-
bottom: 0;
|
|
292
|
-
left: 0;
|
|
293
|
-
width: 100%;
|
|
294
|
-
height: 100%;
|
|
295
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
296
|
-
transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
|
|
297
|
-
display: flex;
|
|
298
|
-
justify-content: center;
|
|
299
|
-
align-items: center;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.fractal-pay-popup-content {
|
|
303
|
-
background-color: white;
|
|
304
|
-
padding:0px;
|
|
305
|
-
border-radius: 0.5rem;
|
|
306
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
307
|
-
box-sizing: border-box;
|
|
308
|
-
position: relative;
|
|
309
|
-
height: 100%;
|
|
310
|
-
max-height:90%;
|
|
311
|
-
overflow: hidden;
|
|
312
|
-
}
|
|
313
|
-
.fractal-pay-popup-content iframe{height: 100% !important; }
|
|
314
|
-
.fractal-pay-popup-content iframe body{overflow: hidden;}
|
|
315
|
-
@media only screen and (min-width: 768px){
|
|
316
|
-
.fractal-pay-popup-content iframe{width: 768px;}
|
|
317
|
-
.fractal-pay-popup-content {
|
|
318
|
-
width: 750px;
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
@media only screen and (max-width: 600px){
|
|
323
|
-
.fractal-pay-popup-content {
|
|
324
|
-
width: 350px;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
@media only screen and (max-width: 450px){
|
|
328
|
-
.fractal-pay-popup-content {
|
|
329
|
-
width: 300px;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.request-payment-popup-container {
|
|
334
|
-
padding: 0px !important;
|
|
335
|
-
border-radius: 12px !important;
|
|
336
|
-
}
|
|
337
|
-
`),Ti=Ha;var Ya=({open:e,onClose:t,children:H,maxWidth:T})=>e?yi.createElement(yi.Fragment,null,yi.createElement(Ti,null),yi.createElement("div",{className:"fractal-popup"},yi.createElement("div",{className:"fractal-popup-content request-payment-popup-container",style:{maxWidth:`${T!=null?T:"auto"}`}},H))):null,yn=Ya;import Wa from"axios";import{PatternFormat as Ga}from"react-number-format";import Ea from"react";var $a=e=>Ea.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
|
-
`),zi=$a;var ri=e=>{try{let t=JSON.parse(e);return typeof t=="object"&&t!==null}catch(t){return!1}},oi=[{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 be(e){let t=Number(e);return isNaN(t)?`$${e}`:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}var ja=ne+"widget/mc-img.svg",Va=ne+"widget/visa-img.svg",Oa=ne+"widget/ae-img.svg",Ka=ne+"widget/discover-img.svg",bi=ne+"widget/card.svg",Za=ne+"widget/bank.svg",ro=ne+"widget/Trash.svg",oo=ne+"widget/secure-img.png",so=ne+"widget/pov-by.png",Ii=ne+"widget/pax.svg",fa=ne+"widget/Bank _New.svg",ha=e=>{switch(e==null?void 0:e.toLowerCase()){case"visa":return Va;case"mastercard":case"mc":case"m/c":return ja;case"amex":case"american express":case"ae":return Oa;case"discover":case"dcvr":return Ka;case"bank":return Za;default:return bi}},Pn=(e,t)=>{let H=e.replace(/\D/g,""),T=e.slice(0,t).replace(/\D/g,"").length,B="",Y="";if(/^3[47]/.test(H)?(B=H.slice(0,15),Y=B.replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(Z,A,G,oe)=>[A,G,oe].filter(Boolean).join(" "))):(B=H.slice(0,16),Y=B.replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(Z,A,G,oe,w)=>[A,G,oe,w].filter(Boolean).join(" "))),T===0)return{formatted:Y,cursor:0};let U=Y.length,ve=0;for(let Z=0;Z<Y.length;Z++)if(/\d/.test(Y[Z])&&ve++,ve===T){U=Z+1;break}return{formatted:Y,cursor:U}},In=e=>e==1?!1:(e==0,!0);function Ua(e){let t=e.merchantPublicKey,H=e==null?void 0:e.discount,T=e==null?void 0:e.tax,B=e==null?void 0:e.surcharge,[Y,K]=$n(!1),[U,ve]=$n(!1),[Z,A]=$n({}),[G,oe]=$n(null),[w,C]=$n({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),[ee,V]=$n(!1),[y,_e]=$n(void 0),[M,Te]=$n(""),[Pe,me]=$n(!1),[ke,ut]=$n(null),Fe=x=>/^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(x),Me=/[+-]?([0-9]*[.])?[0-9]+/,ce=x=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x),Ye=x=>/^[A-Za-z\s]*$/.test(x),Je=(x,f)=>{let N=(parseFloat(f)||0)/100,$e=x/(1+N);return Math.round($e*100)/100};ya(()=>{if(e!=null&&e.pass_fee){let x=Je(e==null?void 0:e.amount,e==null?void 0:e.surcharge);_e(x)}},[e==null?void 0:e.pass_fee]);let ln=()=>{K(!1),A({})},Ut=()=>K(!0),h=()=>{console.log(ke,"apiresponse"),u(ke),me(!1)};function L(){C({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),Te("")}function u(x){let f={type:"preview.compiledcheck",other:F(v({},x),{status:!0})};window.parent.postMessage(f,"*")}let Ce=async x=>{if(x.currentTarget.blur(),!U&&!(Object.keys(Z).length>0)){if(A({}),!(w!=null&&w.email)&&G&&!Fe(G)){A(f=>F(v({},f),{phone:Zt.phonenumbervalid}));return}if(b())try{ve(!0);let f={fractalpayPublicKey:t,amount:M,phone_number:G,order_id:w.order_id,action:"request",name:w.name,email:w.email,customer_id:e!=null&&e.customerId?e==null?void 0:e.customerId:"",discount:H,surcharge:B,tax:T,require_3ds:e==null?void 0:e.require_3ds,pass_fee:e==null?void 0:e.pass_fee,allow_partial:ee},N=await Wa.post(`${Xe}create-widget-order`,f,{headers:v({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})});(N==null?void 0:N.status)===200&&(me(!0),K(!1),L(),ut(N==null?void 0:N.data)),ve(!1)}catch(f){console.log(f),ve(!1)}}},a=Xe+"images/logo-img.png",o=x=>{let{value:f}=x.target,N=x.target.dataset.token;if(C(F(v({},w),{[N]:f})),N==="name"&&!Ye(f)){A(dt=>F(v({},dt),{[N]:Zt.onlylettersallowed}));return}let $e=Z;N==="email"&&!G&&(delete $e.phone,A($e)),f&&(delete $e[N],A($e)),N==="email"&&!f&&(delete $e[N],A($e))},r=x=>{let{value:f}=x;if(Number(f)>0){let N=Z;delete N.amount,A(N)}Te(f)},b=()=>{let x={};return M||(x.amount=Zt.amountrequired),w.email&&!ce(w==null?void 0:w.email)&&(x.email=Zt.invalidemail),!G&&!(w!=null&&w.email)&&(x.phone=Zt.phoneoremailrequired),!G&&!(w!=null&&w.email)&&(x.email=Zt.phoneoremailrequired),!G&&w.email&&!ce(w==null?void 0:w.email)&&(x.email=Zt.invalidemail),e.from==="merchant"&&!w.order_id&&(x.order_id=Zt.orderidrequired),A(x),Object.keys(x).length===0};ya(()=>{e&&(C(x=>F(v({},x),{order_id:e.orderID?e.orderID:"",name:e!=null&&e.name?e==null?void 0:e.name:"",email:e!=null&&e.email?e==null?void 0:e.email:""})),Te(e.amount?e.amount:""),oe(e.phone?`${e.phone}`:null))},[e]);let k=x=>{let f=x==null?void 0:x.value;if(f&&(f==null?void 0:f.length)>0&&(f==null?void 0:f.length)!==10){A($e=>F(v({},$e),{phone:Zt.phonenumberlength})),oe(f);return}else oe(f);let N=Z;delete N.phone,f&&!(w!=null&&w.email)&&delete N.email,A(N)};function P(x){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(x))}let O=x=>{let f=x.target.checked;V(f)};return I.createElement(I.Fragment,null,I.createElement(zi,null),I.createElement(an,{loading:U}),I.createElement(I.Fragment,null,I.createElement("button",{className:"paymentBtn",onClick:Ut},"Request Payment"),I.createElement(yn,{open:Y,onClose:()=>K(!1),maxWidth:"500px"},I.createElement("div",{style:{maxWidth:"500px"}},I.createElement("div",{className:"request-payment-amount-detail frac-form"},I.createElement("p",{className:"request-payment-merchantname"},"Pay ",e==null?void 0:e.webname),I.createElement("p",{className:"request-payment-amount"},P(e==null?void 0:e.amount)),y&&y>0&&I.createElement("div",{className:"frac-req-cash-discount"},I.createElement("div",{className:"frac-cashlabel"},In(e==null?void 0:e.showSurcharge)?"Surcharge":"Cash Discount"," :"),I.createElement("div",null,be((Number(e.amount)-y).toFixed(2)))),(e==null?void 0:e.from)==="merchant"&&I.createElement("p",{className:"request-payment-orderid"},w==null?void 0:w.order_id),I.createElement("span",{className:"request-payment-close-popup",onClick:ln},I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},I.createElement("g",{clipPath:"url(#clip0_12425_52336)"},I.createElement("path",{d:"M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z",fill:"#727272"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_12425_52336"},I.createElement("rect",{width:"16",height:"16",fill:"white"})))))),I.createElement("form",{className:"request-payment-input-form"},I.createElement("div",{className:"request-payment-list-div"},I.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"FULL NAME"),I.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Full Name","data-token":"name",onChange:o,value:w==null?void 0:w.name}),Z.name&&I.createElement("small",{className:"request-payment-error-msg"},Z.name)),I.createElement("div",{className:"request-payment-list-div"},I.createElement("label",{htmlFor:"requestPhoneNumber",className:"request-payment-input-label"},"Phone Number"),I.createElement(Ga,{className:"request-payment-input-box",placeholder:"Mobile number",format:"+1 (###) ###-####",value:G,onValueChange:x=>{k(x)}}),Z.phone&&I.createElement("small",{className:"request-payment-error-msg"},Z.phone)),I.createElement("div",{className:"request-payment-list-div"},I.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"EMAIL"),I.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Email",onChange:o,"data-token":"email",value:w==null?void 0:w.email}),Z.email&&I.createElement("small",{className:"request-payment-error-msg"},Z.email)),I.createElement("div",{className:"partial-toggle-div"},I.createElement("input",{className:"partial-input",type:"checkbox",role:"switch",style:{cursor:"pointer"},checked:ee,onChange:x=>O(x),id:"partialSwitch"}),I.createElement("label",{className:"partial-label",htmlFor:"partialSwitch",style:{cursor:"pointer"}},"Allow Partial Payments?")),I.createElement("button",{type:"button",className:"request-payment-submit-button",onClick:Ce,disabled:U},U?"Loading...":"Send Request"),I.createElement("div",{className:"request-payment-fractal-powerd-by"},I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},I.createElement("path",{d:"M15.2165 4.11839C15.1973 3.69746 15.1973 3.29567 15.1973 2.89387C15.1973 2.56861 14.9486 2.31988 14.6234 2.31988C12.2317 2.31988 10.4141 1.63109 8.90257 0.157848C8.67298 -0.0526158 8.32858 -0.0526158 8.09898 0.157848C6.58748 1.63109 4.76984 2.31988 2.37821 2.31988C2.05295 2.31988 1.80422 2.56861 1.80422 2.89387C1.80422 3.29567 1.80422 3.69746 1.78508 4.11839C1.70855 8.13632 1.59375 13.6466 8.30945 15.9617L8.50078 16L8.69211 15.9617C15.3887 13.6466 15.293 8.15546 15.2165 4.11839ZM8.04159 9.6861C7.92679 9.78176 7.79286 9.83916 7.63979 9.83916H7.62066C7.46759 9.83916 7.31453 9.76263 7.21887 9.64783L5.43949 7.67713L6.30048 6.91181L7.69719 8.46158L10.7967 5.5151L11.5812 6.35695L8.04159 9.6861Z",fill:"#727272"})),"Secure payments powered by ",I.createElement("span",null,"Fractal"),I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},I.createElement("path",{d:"M17.4999 5.49758V7.01156C17.4999 7.05924 17.4595 7.09898 17.411 7.09898H12.3516C12.9169 6.54266 13.4781 5.99032 14.0434 5.434C14.0596 5.4181 14.0838 5.41016 14.104 5.41016H17.411C17.4595 5.41016 17.4999 5.44989 17.4999 5.49758Z",fill:"#61C699"}),I.createElement("path",{d:"M12.3462 10.9037V9.29836C12.3462 9.25067 12.3866 9.21094 12.435 9.21094H13.8523C13.929 9.21094 13.9694 9.30631 13.9129 9.35796C13.392 9.87455 12.8711 10.3911 12.3462 10.9037Z",fill:"#61C699"}),I.createElement("path",{d:"M12.4404 9.00523H15.6949C15.7434 9.00523 15.7838 8.96549 15.7838 8.91781V7.40383C15.7838 7.35614 15.7434 7.31641 15.6949 7.31641H12.4404C12.3919 7.31641 12.3516 7.35614 12.3516 7.40383V8.91781C12.3516 8.96549 12.3919 9.00523 12.4404 9.00523Z",fill:"#61C699"}),I.createElement("path",{d:"M10.1581 0.0120725L11.4906 0.77105C11.531 0.794892 11.5471 0.84655 11.5229 0.890261L8.99114 5.20173C8.78521 4.44275 8.57927 3.68775 8.37334 2.92877C8.36527 2.90493 8.3693 2.88109 8.38142 2.86122L10.0329 0.0438621C10.0612 0.000151419 10.1177 -0.0117697 10.1581 0.0120725Z",fill:"#61C699"}),I.createElement("path",{d:"M12.3382 7.10006L10.9289 6.29737C10.8886 6.27353 10.8724 6.22187 10.8966 6.17816L11.6033 4.97015C11.6436 4.9026 11.7446 4.91452 11.7648 4.99002C11.9546 5.69734 12.1484 6.40068 12.3382 7.10006Z",fill:"#61C699"}),I.createElement("path",{d:"M10.7107 6.0771L12.338 3.30345C12.3622 3.26372 12.346 3.20808 12.3057 3.18424L10.9732 2.42526C10.9328 2.40142 10.8763 2.41732 10.852 2.45705L9.22476 5.2307C9.20053 5.27044 9.21669 5.32607 9.25706 5.34991L10.5896 6.10889C10.634 6.13273 10.6865 6.11683 10.7107 6.0771Z",fill:"#61C699"}),I.createElement("path",{d:"M1.66713 3.51237L2.99963 2.75339C3.04001 2.72955 3.09654 2.74544 3.12077 2.78518L5.65251 7.09665C4.88128 6.89399 4.11408 6.69133 3.34285 6.48867C3.31862 6.4847 3.30247 6.4688 3.29036 6.44893L1.63483 3.63158C1.6106 3.58787 1.62271 3.53621 1.66713 3.51237Z",fill:"#61C699"}),I.createElement("path",{d:"M8.99793 5.20018L7.58871 5.99889C7.54833 6.02274 7.4918 6.00684 7.46757 5.9671L6.76095 4.76307C6.72057 4.69552 6.78517 4.61605 6.86189 4.63591C7.57256 4.82268 8.28726 5.00944 8.99793 5.20018Z",fill:"#61C699"}),I.createElement("path",{d:"M7.27986 6.07054L5.6526 3.2969C5.62837 3.25716 5.57588 3.24127 5.53146 3.26511L4.19896 4.02409C4.15858 4.04793 4.14243 4.09959 4.16666 4.1433L5.79392 6.91694C5.81815 6.95668 5.87064 6.97257 5.91506 6.94873L7.24756 6.18975C7.28794 6.16591 7.30409 6.11425 7.27986 6.07054Z",fill:"#61C699"}),I.createElement("path",{d:"M0.5 12.4998V10.9859C0.5 10.9382 0.540379 10.8984 0.588833 10.8984H5.64829C5.08299 11.4548 4.52172 12.0071 3.95642 12.5634C3.94027 12.5793 3.91604 12.5873 3.89585 12.5873H0.588833C0.540379 12.5873 0.5 12.5475 0.5 12.4998Z",fill:"#61C699"}),I.createElement("path",{d:"M5.65129 7.09766V8.70303C5.65129 8.75072 5.61091 8.79045 5.56246 8.79045H4.14516C4.06844 8.79045 4.02806 8.69508 4.08459 8.64343C4.60548 8.12685 5.12637 7.61424 5.65129 7.09766Z",fill:"#61C699"}),I.createElement("path",{d:"M5.55967 8.99609H2.30514C2.25669 8.99609 2.21631 9.03583 2.21631 9.08352V10.5975C2.21631 10.6452 2.25669 10.6849 2.30514 10.6849H5.55967C5.60813 10.6849 5.6485 10.6452 5.6485 10.5975V9.08352C5.6485 9.03583 5.60813 8.99609 5.55967 8.99609Z",fill:"#61C699"}),I.createElement("path",{d:"M7.82638 17.9865L6.49388 17.2276C6.4535 17.2037 6.43735 17.1521 6.46158 17.1083L8.99333 12.7969C9.19926 13.5559 9.40519 14.3109 9.61112 15.0698C9.6192 15.0937 9.61516 15.1175 9.60305 15.1374L7.95155 17.9547C7.91925 17.9985 7.86676 18.0104 7.82638 17.9865Z",fill:"#61C699"}),I.createElement("path",{d:"M5.64795 10.8984L7.05717 11.7011C7.09755 11.725 7.1137 11.7766 7.08947 11.8203L6.38284 13.0283C6.34246 13.0959 6.24152 13.084 6.22133 13.0085C6.02751 12.3012 5.83773 11.5978 5.64795 10.8984Z",fill:"#61C699"}),I.createElement("path",{d:"M7.2739 11.9258L5.64664 14.6994C5.62241 14.7392 5.63856 14.7948 5.67894 14.8187L7.01144 15.5776C7.05182 15.6015 7.10835 15.5856 7.13258 15.5458L8.75984 12.7722C8.78407 12.7325 8.76792 12.6768 8.72754 12.653L7.39504 11.894C7.35062 11.8702 7.29813 11.8861 7.2739 11.9258Z",fill:"#61C699"}),I.createElement("path",{d:"M16.3199 14.4866L14.9874 15.2456C14.947 15.2694 14.8904 15.2535 14.8662 15.2138L12.3345 10.9023C13.1057 11.105 13.8729 11.3077 14.6441 11.5103C14.6684 11.5143 14.6845 11.5302 14.6966 11.5501L16.3481 14.3674C16.3764 14.4111 16.3643 14.4628 16.3199 14.4866Z",fill:"#61C699"}),I.createElement("path",{d:"M8.99121 12.7983L10.4004 11.9956C10.4408 11.9717 10.4973 11.9876 10.5216 12.0274L11.2282 13.2354C11.2686 13.3029 11.204 13.3824 11.1272 13.3625C10.4166 13.1758 9.70188 12.989 8.99121 12.7983Z",fill:"#61C699"}),I.createElement("path",{d:"M10.7077 11.9285L12.3349 14.7021C12.3592 14.7418 12.4117 14.7577 12.4561 14.7339L13.7886 13.9749C13.829 13.9511 13.8451 13.8994 13.8209 13.8557L12.1936 11.0821C12.1694 11.0423 12.1169 11.0264 12.0725 11.0503L10.74 11.8092C10.6996 11.8331 10.6834 11.8847 10.7077 11.9285Z",fill:"#61C699"})))))),I.createElement(yn,{open:Pe,onClose:h,maxWidth:"500px"},I.createElement("div",{className:"fractal-popup-content",style:{padding:"0px",maxWidth:"500px"}},I.createElement("div",{className:"request-payment-success-container"},I.createElement("span",{className:"request-payment-close-popup",onClick:h},I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},I.createElement("g",{clipPath:"url(#clip0_12425_52336)"},I.createElement("path",{d:"M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z",fill:"#727272"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_12425_52336"},I.createElement("rect",{width:"16",height:"16",fill:"white"}))))),I.createElement("div",{className:"request-payment-success-tick-div"},I.createElement("div",{className:"request-payment-success-tick"},I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},I.createElement("path",{d:"M6.12669 13.9774C5.97396 14.131 5.76558 14.2167 5.54913 14.2167C5.33267 14.2167 5.1243 14.131 4.97157 13.9774L0.359012 9.36408C-0.119671 8.8854 -0.119671 8.10919 0.359012 7.6314L0.936573 7.05369C1.4154 6.57501 2.19072 6.57501 2.6694 7.05369L5.54913 9.93357L13.3306 2.15198C13.8094 1.6733 14.5855 1.6733 15.0634 2.15198L15.641 2.72969C16.1196 3.20837 16.1196 3.98444 15.641 4.46237L6.12669 13.9774Z",fill:"#61C699"})))),I.createElement("h6",{className:"request-payment-success-text"},"The request ",I.createElement("br",null),"was sent"),I.createElement("h6",{className:"request-payment-success-subtext"},"Please wait for the customer to pay"),I.createElement("div",{className:"request-payment-success-btn-div"},I.createElement("button",{onClick:h,className:"request-payment-success-btn2"},"Close")))))))}import"bootstrap/dist/js/bootstrap.bundle.min.js";import j,{useState as Zn,useEffect as Ja}from"react";import Qa from"axios";import{PatternFormat as Xa}from"react-number-format";function Da(e){let t=e.merchantPublicKey,H=e==null?void 0:e.discount,T=e==null?void 0:e.tax,B=e==null?void 0:e.surcharge,[Y,K]=Zn(!1),[U,ve]=Zn(!1),[Z,A]=Zn({}),[G,oe]=Zn(null),[w,C]=Zn({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),[ee,V]=Zn(""),[y,_e]=Zn(!1),[M,Te]=Zn(null),Pe=o=>/^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(o),me=/[+-]?([0-9]*[.])?[0-9]+/,ke=o=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o),ut=o=>/^[A-Za-z\s]*$/.test(o),Fe=()=>{K(!1),A({})},Me=()=>K(!0),ce=()=>{Je(M),_e(!1)};function Ye(){C({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),V("")}function Je(o){let r={type:"preview.compiledcheck",other:F(v({},o),{status:!0})};window.parent.postMessage(r,"*")}let ln=async o=>{if(o.currentTarget.blur(),!U&&!(Object.keys(Z).length>0)){if(A({}),!(w!=null&&w.email)&&G&&!Pe(G)){A(r=>F(v({},r),{phone:Zt.phonenumbervalid}));return}if(u())try{ve(!0);let r={fractalpayPublicKey:t,amount:ee,phone_number:G,order_id:w.order_id,action:"request",name:w.name,email:w.email,customer_id:e!=null&&e.customerId?e==null?void 0:e.customerId:"",discount:H,surcharge:B,tax:T,require_3ds:e==null?void 0:e.require_3ds},b=await Qa.post(`${Xe}send-request-pre-auth-payment`,r,{headers:v({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})});(b==null?void 0:b.status)===200&&(_e(!0),K(!1),Ye(),Te(b==null?void 0:b.data)),ve(!1)}catch(r){console.log(r),ve(!1)}}},Ut=Xe+"images/logo-img.png",h=o=>{let{value:r}=o.target,b=o.target.dataset.token;if(C(F(v({},w),{[b]:r})),b==="name"&&!ut(r)){A(P=>F(v({},P),{[b]:Zt.onlylettersallowed}));return}let k=Z;b==="email"&&!G&&(delete k.phone,A(k)),r&&(delete k[b],A(k)),b==="email"&&!r&&(delete k[b],A(k))},L=o=>{let{value:r}=o;if(Number(r)>0){let b=Z;delete b.amount,A(b)}V(r)},u=()=>{let o={};return ee||(o.amount=Zt.amountrequired),w.email&&!ke(w==null?void 0:w.email)&&(o.email=Zt.invalidemail),!G&&!(w!=null&&w.email)&&(o.phone=Zt.phoneoremailrequired),!G&&!(w!=null&&w.email)&&(o.email=Zt.phoneoremailrequired),!G&&w.email&&!ke(w==null?void 0:w.email)&&(o.email=Zt.invalidemail),e.from==="merchant"&&!w.order_id&&(o.order_id=Zt.orderidrequired),A(o),Object.keys(o).length===0};Ja(()=>{e&&(C(o=>F(v({},o),{order_id:e.orderID?e.orderID:"",name:e!=null&&e.name?e==null?void 0:e.name:"",email:e!=null&&e.email?e==null?void 0:e.email:""})),V(e.amount?e.amount:""),oe(e.phone?`${e.phone}`:null))},[e]);let Ce=o=>{let r=o==null?void 0:o.value;if(r&&(r==null?void 0:r.length)>0&&(r==null?void 0:r.length)!==10){A(k=>F(v({},k),{phone:Zt.phonenumberlength})),oe(r);return}else oe(r);let b=Z;delete b.phone,r&&!(w!=null&&w.email)&&delete b.email,A(b)};function a(o){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(o))}return j.createElement(j.Fragment,null,j.createElement(zi,null),j.createElement(an,{loading:U}),j.createElement(j.Fragment,null,j.createElement("button",{className:"paymentBtn",onClick:Me},"Send Request"),j.createElement("div",{className:"frac-form"},j.createElement(yn,{open:Y,onClose:()=>K(!1),maxWidth:"500px"},j.createElement("div",{className:"request-payment-amount-detail"},j.createElement("p",{className:"request-payment-merchantname"},"Authorization Request"),j.createElement("p",{className:"request-payment-pre-auth-merchantname"},"Pay ",e==null?void 0:e.webname),j.createElement("p",{className:"request-payment-amount"},a(e==null?void 0:e.amount)),(e==null?void 0:e.from)==="merchant"&&j.createElement("p",{className:"request-payment-orderid"},w==null?void 0:w.order_id),j.createElement("span",{className:"request-payment-close-popup",onClick:Fe},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},j.createElement("g",{clipPath:"url(#clip0_12425_52336)"},j.createElement("path",{d:"M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z",fill:"#727272"})),j.createElement("defs",null,j.createElement("clipPath",{id:"clip0_12425_52336"},j.createElement("rect",{width:"16",height:"16",fill:"white"})))))),j.createElement("form",{className:"request-payment-input-form"},j.createElement("div",{className:"request-payment-list-div"},j.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"FULL NAME"),j.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Full Name","data-token":"name",onChange:h,value:w==null?void 0:w.name}),Z.name&&j.createElement("small",{className:"request-payment-error-msg"},Z.name)),j.createElement("div",{className:"request-payment-list-div"},j.createElement("label",{htmlFor:"requestPhoneNumber",className:"request-payment-input-label"},"Phone Number"),j.createElement(Xa,{className:"request-payment-input-box",placeholder:"Mobile number",format:"+1 (###) ###-####",value:G,onValueChange:o=>{Ce(o)}}),Z.phone&&j.createElement("small",{className:"request-payment-error-msg"},Z.phone)),j.createElement("div",{className:"request-payment-list-div"},j.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"EMAIL"),j.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Email",onChange:h,"data-token":"email",value:w==null?void 0:w.email}),Z.email&&j.createElement("small",{className:"request-payment-error-msg"},Z.email)),j.createElement("button",{type:"button",className:"request-payment-submit-button",onClick:ln,disabled:U},U?"Loading...":"Send Request"),j.createElement("div",{className:"request-payment-fractal-powerd-by"},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},j.createElement("path",{d:"M15.2165 4.11839C15.1973 3.69746 15.1973 3.29567 15.1973 2.89387C15.1973 2.56861 14.9486 2.31988 14.6234 2.31988C12.2317 2.31988 10.4141 1.63109 8.90257 0.157848C8.67298 -0.0526158 8.32858 -0.0526158 8.09898 0.157848C6.58748 1.63109 4.76984 2.31988 2.37821 2.31988C2.05295 2.31988 1.80422 2.56861 1.80422 2.89387C1.80422 3.29567 1.80422 3.69746 1.78508 4.11839C1.70855 8.13632 1.59375 13.6466 8.30945 15.9617L8.50078 16L8.69211 15.9617C15.3887 13.6466 15.293 8.15546 15.2165 4.11839ZM8.04159 9.6861C7.92679 9.78176 7.79286 9.83916 7.63979 9.83916H7.62066C7.46759 9.83916 7.31453 9.76263 7.21887 9.64783L5.43949 7.67713L6.30048 6.91181L7.69719 8.46158L10.7967 5.5151L11.5812 6.35695L8.04159 9.6861Z",fill:"#727272"})),"Secure payments powered by ",j.createElement("span",null,"Fractal"),j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},j.createElement("path",{d:"M17.4999 5.49758V7.01156C17.4999 7.05924 17.4595 7.09898 17.411 7.09898H12.3516C12.9169 6.54266 13.4781 5.99032 14.0434 5.434C14.0596 5.4181 14.0838 5.41016 14.104 5.41016H17.411C17.4595 5.41016 17.4999 5.44989 17.4999 5.49758Z",fill:"#61C699"}),j.createElement("path",{d:"M12.3462 10.9037V9.29836C12.3462 9.25067 12.3866 9.21094 12.435 9.21094H13.8523C13.929 9.21094 13.9694 9.30631 13.9129 9.35796C13.392 9.87455 12.8711 10.3911 12.3462 10.9037Z",fill:"#61C699"}),j.createElement("path",{d:"M12.4404 9.00523H15.6949C15.7434 9.00523 15.7838 8.96549 15.7838 8.91781V7.40383C15.7838 7.35614 15.7434 7.31641 15.6949 7.31641H12.4404C12.3919 7.31641 12.3516 7.35614 12.3516 7.40383V8.91781C12.3516 8.96549 12.3919 9.00523 12.4404 9.00523Z",fill:"#61C699"}),j.createElement("path",{d:"M10.1581 0.0120725L11.4906 0.77105C11.531 0.794892 11.5471 0.84655 11.5229 0.890261L8.99114 5.20173C8.78521 4.44275 8.57927 3.68775 8.37334 2.92877C8.36527 2.90493 8.3693 2.88109 8.38142 2.86122L10.0329 0.0438621C10.0612 0.000151419 10.1177 -0.0117697 10.1581 0.0120725Z",fill:"#61C699"}),j.createElement("path",{d:"M12.3382 7.10006L10.9289 6.29737C10.8886 6.27353 10.8724 6.22187 10.8966 6.17816L11.6033 4.97015C11.6436 4.9026 11.7446 4.91452 11.7648 4.99002C11.9546 5.69734 12.1484 6.40068 12.3382 7.10006Z",fill:"#61C699"}),j.createElement("path",{d:"M10.7107 6.0771L12.338 3.30345C12.3622 3.26372 12.346 3.20808 12.3057 3.18424L10.9732 2.42526C10.9328 2.40142 10.8763 2.41732 10.852 2.45705L9.22476 5.2307C9.20053 5.27044 9.21669 5.32607 9.25706 5.34991L10.5896 6.10889C10.634 6.13273 10.6865 6.11683 10.7107 6.0771Z",fill:"#61C699"}),j.createElement("path",{d:"M1.66713 3.51237L2.99963 2.75339C3.04001 2.72955 3.09654 2.74544 3.12077 2.78518L5.65251 7.09665C4.88128 6.89399 4.11408 6.69133 3.34285 6.48867C3.31862 6.4847 3.30247 6.4688 3.29036 6.44893L1.63483 3.63158C1.6106 3.58787 1.62271 3.53621 1.66713 3.51237Z",fill:"#61C699"}),j.createElement("path",{d:"M8.99793 5.20018L7.58871 5.99889C7.54833 6.02274 7.4918 6.00684 7.46757 5.9671L6.76095 4.76307C6.72057 4.69552 6.78517 4.61605 6.86189 4.63591C7.57256 4.82268 8.28726 5.00944 8.99793 5.20018Z",fill:"#61C699"}),j.createElement("path",{d:"M7.27986 6.07054L5.6526 3.2969C5.62837 3.25716 5.57588 3.24127 5.53146 3.26511L4.19896 4.02409C4.15858 4.04793 4.14243 4.09959 4.16666 4.1433L5.79392 6.91694C5.81815 6.95668 5.87064 6.97257 5.91506 6.94873L7.24756 6.18975C7.28794 6.16591 7.30409 6.11425 7.27986 6.07054Z",fill:"#61C699"}),j.createElement("path",{d:"M0.5 12.4998V10.9859C0.5 10.9382 0.540379 10.8984 0.588833 10.8984H5.64829C5.08299 11.4548 4.52172 12.0071 3.95642 12.5634C3.94027 12.5793 3.91604 12.5873 3.89585 12.5873H0.588833C0.540379 12.5873 0.5 12.5475 0.5 12.4998Z",fill:"#61C699"}),j.createElement("path",{d:"M5.65129 7.09766V8.70303C5.65129 8.75072 5.61091 8.79045 5.56246 8.79045H4.14516C4.06844 8.79045 4.02806 8.69508 4.08459 8.64343C4.60548 8.12685 5.12637 7.61424 5.65129 7.09766Z",fill:"#61C699"}),j.createElement("path",{d:"M5.55967 8.99609H2.30514C2.25669 8.99609 2.21631 9.03583 2.21631 9.08352V10.5975C2.21631 10.6452 2.25669 10.6849 2.30514 10.6849H5.55967C5.60813 10.6849 5.6485 10.6452 5.6485 10.5975V9.08352C5.6485 9.03583 5.60813 8.99609 5.55967 8.99609Z",fill:"#61C699"}),j.createElement("path",{d:"M7.82638 17.9865L6.49388 17.2276C6.4535 17.2037 6.43735 17.1521 6.46158 17.1083L8.99333 12.7969C9.19926 13.5559 9.40519 14.3109 9.61112 15.0698C9.6192 15.0937 9.61516 15.1175 9.60305 15.1374L7.95155 17.9547C7.91925 17.9985 7.86676 18.0104 7.82638 17.9865Z",fill:"#61C699"}),j.createElement("path",{d:"M5.64795 10.8984L7.05717 11.7011C7.09755 11.725 7.1137 11.7766 7.08947 11.8203L6.38284 13.0283C6.34246 13.0959 6.24152 13.084 6.22133 13.0085C6.02751 12.3012 5.83773 11.5978 5.64795 10.8984Z",fill:"#61C699"}),j.createElement("path",{d:"M7.2739 11.9258L5.64664 14.6994C5.62241 14.7392 5.63856 14.7948 5.67894 14.8187L7.01144 15.5776C7.05182 15.6015 7.10835 15.5856 7.13258 15.5458L8.75984 12.7722C8.78407 12.7325 8.76792 12.6768 8.72754 12.653L7.39504 11.894C7.35062 11.8702 7.29813 11.8861 7.2739 11.9258Z",fill:"#61C699"}),j.createElement("path",{d:"M16.3199 14.4866L14.9874 15.2456C14.947 15.2694 14.8904 15.2535 14.8662 15.2138L12.3345 10.9023C13.1057 11.105 13.8729 11.3077 14.6441 11.5103C14.6684 11.5143 14.6845 11.5302 14.6966 11.5501L16.3481 14.3674C16.3764 14.4111 16.3643 14.4628 16.3199 14.4866Z",fill:"#61C699"}),j.createElement("path",{d:"M8.99121 12.7983L10.4004 11.9956C10.4408 11.9717 10.4973 11.9876 10.5216 12.0274L11.2282 13.2354C11.2686 13.3029 11.204 13.3824 11.1272 13.3625C10.4166 13.1758 9.70188 12.989 8.99121 12.7983Z",fill:"#61C699"}),j.createElement("path",{d:"M10.7077 11.9285L12.3349 14.7021C12.3592 14.7418 12.4117 14.7577 12.4561 14.7339L13.7886 13.9749C13.829 13.9511 13.8451 13.8994 13.8209 13.8557L12.1936 11.0821C12.1694 11.0423 12.1169 11.0264 12.0725 11.0503L10.74 11.8092C10.6996 11.8331 10.6834 11.8847 10.7077 11.9285Z",fill:"#61C699"}))))),j.createElement(yn,{open:y,onClose:ce,maxWidth:"500px"},j.createElement("div",{className:"fractal-popup-content",style:{padding:"0px",maxWidth:"500px"}},j.createElement("div",{className:"request-payment-success-container"},j.createElement("span",{className:"request-payment-close-popup",onClick:ce},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},j.createElement("g",{clipPath:"url(#clip0_12425_52336)"},j.createElement("path",{d:"M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z",fill:"#727272"})),j.createElement("defs",null,j.createElement("clipPath",{id:"clip0_12425_52336"},j.createElement("rect",{width:"16",height:"16",fill:"white"}))))),j.createElement("div",{className:"request-payment-success-tick-div"},j.createElement("div",{className:"request-payment-success-tick"},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},j.createElement("path",{d:"M6.12669 13.9774C5.97396 14.131 5.76558 14.2167 5.54913 14.2167C5.33267 14.2167 5.1243 14.131 4.97157 13.9774L0.359012 9.36408C-0.119671 8.8854 -0.119671 8.10919 0.359012 7.6314L0.936573 7.05369C1.4154 6.57501 2.19072 6.57501 2.6694 7.05369L5.54913 9.93357L13.3306 2.15198C13.8094 1.6733 14.5855 1.6733 15.0634 2.15198L15.641 2.72969C16.1196 3.20837 16.1196 3.98444 15.641 4.46237L6.12669 13.9774Z",fill:"#61C699"})))),j.createElement("h6",{className:"request-payment-success-text"},"The request ",j.createElement("br",null),"was sent"),j.createElement("h6",{className:"request-payment-success-subtext"},"Please wait for the customer to pay"),j.createElement("div",{className:"request-payment-success-btn-div"},j.createElement("button",{onClick:ce,className:"request-payment-success-btn2"},"Close"))))))))}import i,{useEffect as xa,useState as Bt}from"react";import Ra from"react";function Xn(){let e="#000",t="#fff",H="#212529",T="#dee2e6";return Ra.createElement("style",null,`
|
|
651
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
652
|
-
body
|
|
653
|
-
{
|
|
654
|
-
font-family: 'Inter', sans-serif !important;
|
|
655
|
-
}
|
|
656
|
-
input
|
|
657
|
-
{
|
|
658
|
-
font-family: 'Inter', sans-serif !important;
|
|
659
|
-
}
|
|
660
|
-
.frac-form .form-group{
|
|
661
|
-
margin:0 !important
|
|
662
|
-
}
|
|
663
|
-
.frac-form .mb-4{
|
|
664
|
-
margin-bottom : 10px !important
|
|
665
|
-
}
|
|
666
|
-
.frac-form .save-ach-div{
|
|
667
|
-
display:flex !important;
|
|
668
|
-
gap:5px !important;
|
|
669
|
-
align-items:center
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
.frac-form .card-cvv-in{
|
|
673
|
-
height : 36px !importantt;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
.frac-form .pay-payment-amount{
|
|
677
|
-
text-align:start !important
|
|
678
|
-
}
|
|
679
|
-
.frac-form .pay-amount{
|
|
680
|
-
text-align:start !important
|
|
681
|
-
}
|
|
682
|
-
.frac-form .pay-main-logo{
|
|
683
|
-
text-align:start !important
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
.paymentBtn {
|
|
689
|
-
background-color: black;
|
|
690
|
-
border: none;
|
|
691
|
-
color: white;
|
|
692
|
-
padding: 15px 32px;
|
|
693
|
-
text-align: center;
|
|
694
|
-
text-decoration: none;
|
|
695
|
-
display: inline-block;
|
|
696
|
-
font-size: 16px;
|
|
697
|
-
margin: 4px 2px;
|
|
698
|
-
cursor: pointer;
|
|
699
|
-
border-radius: 180px;
|
|
700
|
-
/* width: auto; */
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
.main-logo {
|
|
704
|
-
text-align: center;
|
|
705
|
-
margin-bottom: 20px;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
.main-logo img {
|
|
709
|
-
max-width: 180px;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
.pay-main-box {
|
|
713
|
-
width: 365px !important;
|
|
714
|
-
height: 93%;
|
|
715
|
-
background: 0 0 #ffffff;
|
|
716
|
-
border-radius: 12px;
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
border: 1px solid #E0DFE2;
|
|
720
|
-
margin: 0 auto;
|
|
721
|
-
display: block;
|
|
722
|
-
padding: 0px 26px !important
|
|
723
|
-
}
|
|
724
|
-
.pay-main-box .pay-header {
|
|
725
|
-
display: flex;
|
|
726
|
-
justify-content: center;
|
|
727
|
-
align-items: center;
|
|
728
|
-
text-align: center;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
.pay-main-box .pay-header button {
|
|
732
|
-
border: 0;
|
|
733
|
-
background: none;
|
|
734
|
-
padding: 0;
|
|
735
|
-
box-shadow: 0;
|
|
736
|
-
outline: inherit;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
.pay-main-box h1 {
|
|
740
|
-
margin: 0;
|
|
741
|
-
flex: 1;
|
|
742
|
-
padding: 10px 0;
|
|
743
|
-
font-size: 23px;
|
|
744
|
-
font-weight: 500;
|
|
745
|
-
color: #35254D;
|
|
746
|
-
align-items: start;
|
|
747
|
-
display: flex;
|
|
748
|
-
}
|
|
749
|
-
.tab {
|
|
750
|
-
overflow: hidden;
|
|
751
|
-
padding: 5px;
|
|
752
|
-
border-radius: 8px;
|
|
753
|
-
display: flex;
|
|
754
|
-
justify-content: space-around;
|
|
755
|
-
margin-bottom:12px
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
/* Style the buttons inside the tab */
|
|
759
|
-
.tab button {
|
|
760
|
-
float: left;
|
|
761
|
-
border: none;
|
|
762
|
-
outline: none;
|
|
763
|
-
cursor: pointer;
|
|
764
|
-
background:white;
|
|
765
|
-
padding: 11px 16px;
|
|
766
|
-
transition: 0.3s;
|
|
767
|
-
font-size: 16px;
|
|
768
|
-
width: 143px;
|
|
769
|
-
border-radius: 5px;
|
|
770
|
-
box-shadow: inherit;
|
|
771
|
-
outline: none;
|
|
772
|
-
color: ${e};
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
/* Change background color of buttons on hover */
|
|
776
|
-
.tab button:hover {
|
|
777
|
-
background-color: #f0f0f0;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
/* Create an active/current tablink class */
|
|
781
|
-
// .tab button.active {
|
|
782
|
-
// background-color: #ccc;
|
|
783
|
-
// }
|
|
784
|
-
|
|
785
|
-
/* Style the tab content */
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
.parent-pay-container{
|
|
789
|
-
padding: 24px;
|
|
790
|
-
}
|
|
791
|
-
.pay-container{
|
|
792
|
-
display: grid;
|
|
793
|
-
grid-template-columns: 2fr 3fr;
|
|
794
|
-
|
|
795
|
-
}
|
|
796
|
-
.pay-main{
|
|
797
|
-
padding-y: 20px}
|
|
798
|
-
|
|
799
|
-
.request-payment-close-popup {
|
|
800
|
-
position: absolute;
|
|
801
|
-
right: 20px;
|
|
802
|
-
top: 20px;
|
|
803
|
-
cursor: pointer;
|
|
804
|
-
}
|
|
805
|
-
.pay-conatiner-one{
|
|
806
|
-
border-right: 1px solid #E0DFE2;
|
|
807
|
-
}
|
|
808
|
-
.pay-conatiner-one-first{
|
|
809
|
-
min-height:530px
|
|
810
|
-
}
|
|
811
|
-
.pay-conatiner-one-last{
|
|
812
|
-
display:flex;
|
|
813
|
-
font-size:12px;
|
|
814
|
-
gap:5px;
|
|
815
|
-
max-width:250px;
|
|
816
|
-
align-items:center;
|
|
817
|
-
color:black !important
|
|
818
|
-
}
|
|
819
|
-
.pay-conatiner-one-last img{
|
|
820
|
-
width : 17px;
|
|
821
|
-
height:17px
|
|
822
|
-
}
|
|
823
|
-
.pay-conatiner-two{
|
|
824
|
-
padding: 0 5% 0;
|
|
825
|
-
}
|
|
826
|
-
.pay-logo-container{
|
|
827
|
-
border-bottom: 1px solid #E0DFE2
|
|
828
|
-
}
|
|
829
|
-
.pay-heading{
|
|
830
|
-
margin: 0;
|
|
831
|
-
flex: 1;
|
|
832
|
-
padding: 10px 0;
|
|
833
|
-
font-size: 23px;
|
|
834
|
-
font-weight: 500;
|
|
835
|
-
color: #35254D;
|
|
836
|
-
align-items: start;
|
|
837
|
-
display: flex;
|
|
838
|
-
}
|
|
839
|
-
.pay-main-logo > img{
|
|
840
|
-
width: 50%;
|
|
841
|
-
}
|
|
842
|
-
.pay-main-logo-res > img{
|
|
843
|
-
width: 50%;
|
|
844
|
-
display : none
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
.pay-payment-amount{
|
|
848
|
-
display: block;
|
|
849
|
-
font-size: 12px;
|
|
850
|
-
color: #727272;
|
|
851
|
-
margin-bottom: 8px;
|
|
852
|
-
}
|
|
853
|
-
.pay-amount-conatiner{
|
|
854
|
-
margin-top: 6%;
|
|
855
|
-
}
|
|
856
|
-
.pay-amount{
|
|
857
|
-
color: #000000;
|
|
858
|
-
font-size: 38px;
|
|
859
|
-
display: block;
|
|
860
|
-
line-height: 110%;
|
|
861
|
-
letter-spacing: -1px;
|
|
862
|
-
}
|
|
863
|
-
.frac-form label{
|
|
864
|
-
font-family: 'IBM Plex Mono', monospace !important;
|
|
865
|
-
color: #727272 !important;
|
|
866
|
-
margin-bottom: 2px !important;
|
|
867
|
-
font-weight: 600 !important;
|
|
868
|
-
font-size: 12px !important;
|
|
869
|
-
display:block !important;
|
|
870
|
-
text-align : left !important
|
|
871
|
-
}
|
|
872
|
-
.form-control{
|
|
873
|
-
display: block;
|
|
874
|
-
width: 100%;
|
|
875
|
-
padding: .375rem .75rem;
|
|
876
|
-
font-size: 1rem;
|
|
877
|
-
font-weight: 400;
|
|
878
|
-
line-height: 1.5;
|
|
879
|
-
color: ${H};
|
|
880
|
-
-webkit-appearance: none;
|
|
881
|
-
-moz-appearance: none;
|
|
882
|
-
appearance: none;
|
|
883
|
-
background-color: ${t};
|
|
884
|
-
background-clip: padding-box;
|
|
885
|
-
border: 1px solid ${T};
|
|
886
|
-
border-radius: 0.375rem;
|
|
887
|
-
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
|
888
|
-
}
|
|
889
|
-
.form-control:focus{
|
|
890
|
-
border-color: #86b7fe;
|
|
891
|
-
outline: 0;
|
|
892
|
-
}
|
|
893
|
-
.toggle-num-wrapper {
|
|
894
|
-
position: relative;
|
|
895
|
-
}
|
|
896
|
-
.card-number-new{
|
|
897
|
-
border-bottom: none;
|
|
898
|
-
border-bottom-left-radius: 0px;
|
|
899
|
-
border-bottom-right-radius: 0px;
|
|
900
|
-
}
|
|
901
|
-
.card-crdi {
|
|
902
|
-
display: flex;
|
|
903
|
-
border: 1px solid ${T};
|
|
904
|
-
border-radius: 0.375rem;
|
|
905
|
-
}
|
|
906
|
-
.card-expiry-new{
|
|
907
|
-
border-top-left-radius: 0px;
|
|
908
|
-
border-top-right-radius: 0px;
|
|
909
|
-
}
|
|
910
|
-
.exp-date-year-container{
|
|
911
|
-
display: flex;
|
|
912
|
-
flex-wrap: wrap;
|
|
913
|
-
}
|
|
914
|
-
.exp-date-year-container .form-group{
|
|
915
|
-
flex:1;
|
|
916
|
-
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
.exp-date {
|
|
920
|
-
float: left;
|
|
921
|
-
// width: 30%
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
.exp-date input {
|
|
925
|
-
width: calc(100% + 1px);
|
|
926
|
-
border-top-right-radius: 0;
|
|
927
|
-
border-bottom-right-radius: 0;
|
|
928
|
-
border: 0;
|
|
929
|
-
border-right: 1px solid ${T};
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
.exp-year {
|
|
934
|
-
float: left;
|
|
935
|
-
// width: 30%
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
.exp-year input {
|
|
939
|
-
width: calc(100% + 1px);
|
|
940
|
-
border-radius: 0;
|
|
941
|
-
border-top: 0;
|
|
942
|
-
border-bottom: 0;
|
|
943
|
-
border-right: 1px solid ${T};
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
.exp-date input:focus {
|
|
947
|
-
position: relative;
|
|
948
|
-
z-index: 10;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
.security-digit {
|
|
952
|
-
float: right;
|
|
953
|
-
// width: 40%;
|
|
954
|
-
position: relative;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
.security-digit input {
|
|
958
|
-
border-top-left-radius: 0;
|
|
959
|
-
border-bottom-left-radius: 0;
|
|
960
|
-
border-top: 0;
|
|
961
|
-
border-bottom: 0;
|
|
962
|
-
border-right:0;
|
|
963
|
-
}
|
|
964
|
-
.card-expiry-new{
|
|
965
|
-
border-top-left-radius: 0px;
|
|
966
|
-
border-top-right-radius: 0px;
|
|
967
|
-
}
|
|
968
|
-
.form-control{box-sizing: border-box ;}
|
|
969
|
-
#PaymentForm .form-group{
|
|
970
|
-
padding:5px 0 ;
|
|
971
|
-
matgin: 0 !important
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
.toggle-label {
|
|
975
|
-
position: relative;
|
|
976
|
-
display: inline-block;
|
|
977
|
-
width: 40px;
|
|
978
|
-
height: 24px;
|
|
979
|
-
background-color: #ccc;
|
|
980
|
-
border-radius: 12px;
|
|
981
|
-
cursor: pointer;
|
|
982
|
-
transition: background-color 0.3s;
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
.toggle-label::before {
|
|
986
|
-
content: "";
|
|
987
|
-
position: absolute;
|
|
988
|
-
top: 2px;
|
|
989
|
-
left: 2px;
|
|
990
|
-
width: 20px;
|
|
991
|
-
height: 20px;
|
|
992
|
-
background: #ffffff;
|
|
993
|
-
border-radius: 50%;
|
|
994
|
-
transition: left 300ms linear;
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
.toggle-checkbox {
|
|
998
|
-
display: none;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
.toggle-checkbox:checked + .toggle-label {
|
|
1002
|
-
background-color: #4caf50;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
.toggle-checkbox:checked + .toggle-label::before {
|
|
1006
|
-
left: 18px;
|
|
1007
|
-
}
|
|
1008
|
-
.ach-scrl {
|
|
1009
|
-
max-height: 380px;
|
|
1010
|
-
min-height: 380px;
|
|
1011
|
-
overflow-y: auto;
|
|
1012
|
-
padding-right: 6px;
|
|
1013
|
-
}
|
|
1014
|
-
.mb-4{
|
|
1015
|
-
margin-bottom:4px
|
|
1016
|
-
}
|
|
1017
|
-
.ach-scrl::-webkit-scrollbar {
|
|
1018
|
-
width: 3px;
|
|
1019
|
-
background-color: #F5F5F5;
|
|
1020
|
-
}
|
|
1021
|
-
.ach-scrl::-webkit-scrollbar-thumb {
|
|
1022
|
-
background-color: #35254D;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
.error-span{
|
|
1026
|
-
color:red !important;
|
|
1027
|
-
font-size:12px !important;
|
|
1028
|
-
text-align: left !important;
|
|
1029
|
-
width: 100% !important;
|
|
1030
|
-
display: block;
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
.charge-customer-name{
|
|
1034
|
-
color: #161616;
|
|
1035
|
-
font-family: Inter;
|
|
1036
|
-
font-size: 24px;
|
|
1037
|
-
font-style: normal;
|
|
1038
|
-
font-weight: 600;
|
|
1039
|
-
line-height: 32px;
|
|
1040
|
-
letter-spacing: -0.48px;
|
|
1041
|
-
text-transform: capitalize;
|
|
1042
|
-
margin-top:0;
|
|
1043
|
-
margin-bottom:16px !important;
|
|
1044
|
-
text-align:left !important
|
|
1045
|
-
}
|
|
1046
|
-
.card-ach-heading {
|
|
1047
|
-
color: #727272;
|
|
1048
|
-
font-family: Inter;
|
|
1049
|
-
font-size: 12px;
|
|
1050
|
-
font-style: normal;
|
|
1051
|
-
font-weight: 500;
|
|
1052
|
-
line-height: 18px;
|
|
1053
|
-
letter-spacing: -0.24px;
|
|
1054
|
-
margin : 0 0 10px !important;
|
|
1055
|
-
text-align : left
|
|
1056
|
-
}
|
|
1057
|
-
.card-list-div{
|
|
1058
|
-
max-height : 190px;
|
|
1059
|
-
overflow-y : auto;
|
|
1060
|
-
border:1px solid #E0DFE2;
|
|
1061
|
-
border-radius : 8px
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
.card-list-div::-webkit-scrollbar{
|
|
1066
|
-
width:2px;
|
|
1067
|
-
background-color:#F5F5F5
|
|
1068
|
-
}
|
|
1069
|
-
.card-list-div::-webkit-scrollbar-thumb{
|
|
1070
|
-
background-color:#35254D
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
.card-list-single-div{
|
|
1074
|
-
border-bottom: 1px solid #E0DFE2;
|
|
1075
|
-
padding : 8px 11px;
|
|
1076
|
-
display : flex ;
|
|
1077
|
-
align-items:center;
|
|
1078
|
-
justify-content : space-between;
|
|
1079
|
-
gap:12px
|
|
1080
|
-
}
|
|
1081
|
-
.card-list-single-div:last-child {
|
|
1082
|
-
border-bottom: none;
|
|
1083
|
-
}
|
|
1084
|
-
.card-lint-div-in{
|
|
1085
|
-
min-height:444px}
|
|
1086
|
-
.card-number-radio{
|
|
1087
|
-
display:flex;
|
|
1088
|
-
gap:12px;
|
|
1089
|
-
}
|
|
1090
|
-
.card-number-radio .card-number-last-four{
|
|
1091
|
-
color:#161616 !important;
|
|
1092
|
-
font-family:Inter !important;
|
|
1093
|
-
font-size:14px !important;
|
|
1094
|
-
font-weight:500 !important;
|
|
1095
|
-
font-style:normal !important;
|
|
1096
|
-
line-height : 18px !important;
|
|
1097
|
-
latter-spacing:-0.18px !important
|
|
1098
|
-
}
|
|
1099
|
-
.card-expiry-date{
|
|
1100
|
-
margin:0;
|
|
1101
|
-
color:#00000080;
|
|
1102
|
-
font-family:Inter;
|
|
1103
|
-
font-size:14px;
|
|
1104
|
-
font-weight:500;
|
|
1105
|
-
font-style"normal;
|
|
1106
|
-
line-height : 18px;
|
|
1107
|
-
latter-spacing:-0.18px
|
|
1108
|
-
}
|
|
1109
|
-
.pay-with-other-card {
|
|
1110
|
-
margin-top : 12px;
|
|
1111
|
-
padding:12px 32px;
|
|
1112
|
-
border :1px solid #E0DFE2;
|
|
1113
|
-
border-radius : 1000px;
|
|
1114
|
-
display: flex;
|
|
1115
|
-
justify-content : center;
|
|
1116
|
-
align-items:center;
|
|
1117
|
-
gap:10px;
|
|
1118
|
-
// width:100%;
|
|
1119
|
-
background:white;
|
|
1120
|
-
cursor:pointer;
|
|
1121
|
-
color:#161616;
|
|
1122
|
-
text-align:center
|
|
1123
|
-
font-family: Inter;
|
|
1124
|
-
font-size: 14px;
|
|
1125
|
-
font-style: normal;
|
|
1126
|
-
font-weight: 500;
|
|
1127
|
-
line-height: 24px;
|
|
1128
|
-
letter-spacing: -0.28px;
|
|
1129
|
-
// margin-bottom: 50px;
|
|
1130
|
-
}
|
|
1131
|
-
.charge-payment-back-btn {
|
|
1132
|
-
display: flex;
|
|
1133
|
-
padding: 5px 10px;
|
|
1134
|
-
align-items: center;
|
|
1135
|
-
gap: 6px;
|
|
1136
|
-
border-radius: 1000px;
|
|
1137
|
-
border: 1px solid #E0DFE2;
|
|
1138
|
-
background: #FFF;
|
|
1139
|
-
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
1140
|
-
font-size:16px;
|
|
1141
|
-
cursor:pointer;
|
|
1142
|
-
color:black
|
|
1143
|
-
}
|
|
1144
|
-
.res-charge-payment-back-btn{
|
|
1145
|
-
padding: 9px 16px;
|
|
1146
|
-
align-items: center;
|
|
1147
|
-
gap: 6px;
|
|
1148
|
-
margin-bottom: 20px;
|
|
1149
|
-
border-radius: 1000px;
|
|
1150
|
-
border: 1px solid #E0DFE2;
|
|
1151
|
-
background: #FFF;
|
|
1152
|
-
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
1153
|
-
font-size:16px;
|
|
1154
|
-
curso:pointer;
|
|
1155
|
-
color:black;
|
|
1156
|
-
display:none
|
|
1157
|
-
}
|
|
1158
|
-
.btn {
|
|
1159
|
-
padding: 11px 23px;
|
|
1160
|
-
background-color: black;
|
|
1161
|
-
color: white;
|
|
1162
|
-
border: none;
|
|
1163
|
-
border-radius: 6px;
|
|
1164
|
-
font-weight: bold;
|
|
1165
|
-
margin: 0 10px;
|
|
1166
|
-
cursor: pointer;
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
.custom-swal-icon {
|
|
1170
|
-
margin: 20px auto;
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
.custom-swal-popup {
|
|
1174
|
-
font-size: 16px;
|
|
1175
|
-
text-align: center;
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
.frac-form .res-pay-con{
|
|
1179
|
-
display:none
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
.frac-cash-discount{
|
|
1183
|
-
border-radius: 8px;
|
|
1184
|
-
background: #F6F6F7;
|
|
1185
|
-
justify-content: space-between;
|
|
1186
|
-
align-items: center;
|
|
1187
|
-
display: flex;
|
|
1188
|
-
padding: 9px 14px 9px 10px;
|
|
1189
|
-
font-family: Inter;
|
|
1190
|
-
color: #161616;
|
|
1191
|
-
font-style: normal;
|
|
1192
|
-
font-weight: 500;
|
|
1193
|
-
font-size: 14px;
|
|
1194
|
-
margin: 12px 0;
|
|
1195
|
-
}
|
|
1196
|
-
.frac-cash-discount .frac-cashlabel{
|
|
1197
|
-
color: #727272;
|
|
1198
|
-
font-size: 12px;
|
|
1199
|
-
font-style: normal;
|
|
1200
|
-
font-weight: 500;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
frac-tooltip-wrapper {
|
|
1204
|
-
position: absolute;
|
|
1205
|
-
right:0;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
.frac-tooltip-icon {
|
|
1209
|
-
cursor: pointer;
|
|
1210
|
-
}
|
|
1211
|
-
.frac-tooltip-mn{
|
|
1212
|
-
position:relative;
|
|
1213
|
-
}
|
|
1214
|
-
.frac-tooltip-text {
|
|
1215
|
-
display: none;
|
|
1216
|
-
position: absolute;
|
|
1217
|
-
top:-15px;
|
|
1218
|
-
right: 22px;
|
|
1219
|
-
background: #161616;
|
|
1220
|
-
color: white;
|
|
1221
|
-
padding: 15px;
|
|
1222
|
-
border-radius: 10px;
|
|
1223
|
-
width: 200px;
|
|
1224
|
-
font-size:12px;
|
|
1225
|
-
word-break: break-word;
|
|
1226
|
-
white-space: normal;
|
|
1227
|
-
z-index: 999;
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
.frac-tooltip-wrapper:hover .frac-tooltip-text {
|
|
1231
|
-
display: block;
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
.frac-tooltip-text p,.frac-tooltip-text b {
|
|
1235
|
-
font-size : 12px !important;
|
|
1236
|
-
line-height : 1.5 !important;
|
|
1237
|
-
margin-bottom : 10px !important;
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
@media (max-width: 768px) {
|
|
1241
|
-
.parent-pay-container{
|
|
1242
|
-
padding: 20px 5%;
|
|
1243
|
-
}
|
|
1244
|
-
.pay-container {
|
|
1245
|
-
grid-template-columns: 1fr;
|
|
1246
|
-
padding: 10px 5%;
|
|
1247
|
-
border:1px solid #E0DFE2;
|
|
1248
|
-
border-radius : 12px;
|
|
1249
|
-
gap:24px;
|
|
1250
|
-
}
|
|
1251
|
-
.pay-conatiner-one{
|
|
1252
|
-
border-right: none;
|
|
1253
|
-
}
|
|
1254
|
-
.pay-conatiner-one-first{
|
|
1255
|
-
min-height:0
|
|
1256
|
-
}
|
|
1257
|
-
.pay-main-logo > img{
|
|
1258
|
-
display: none;
|
|
1259
|
-
}
|
|
1260
|
-
.pay-main-logo-res > img {
|
|
1261
|
-
display:block;
|
|
1262
|
-
margin:auto
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
.pay-logo-container{
|
|
1266
|
-
border :none
|
|
1267
|
-
}
|
|
1268
|
-
// .res-charge-payment-back-btn {
|
|
1269
|
-
// display:flex !important
|
|
1270
|
-
// }
|
|
1271
|
-
// .charge-payment-back-btn{
|
|
1272
|
-
// display:none !important
|
|
1273
|
-
// }
|
|
1274
|
-
.fractal-popup-content{
|
|
1275
|
-
width: 90%;
|
|
1276
|
-
}
|
|
1277
|
-
// .frac-form .res-pay-con{
|
|
1278
|
-
// display:flex;
|
|
1279
|
-
// justify-content :space-between;
|
|
1280
|
-
// align-items:center;
|
|
1281
|
-
// padding-bottom : 10px
|
|
1282
|
-
// }
|
|
1283
|
-
// .frac-form .amt-pay-con{
|
|
1284
|
-
// display:none
|
|
1285
|
-
// }
|
|
1286
|
-
.pay-conatiner-one-last{
|
|
1287
|
-
display:none}
|
|
1288
|
-
.pay-conatiner-two{
|
|
1289
|
-
padding:0
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
}
|
|
1294
|
-
.amt-pay-con {
|
|
1295
|
-
padding-right: 24px;
|
|
1296
|
-
}
|
|
1297
|
-
@media (max-width : 512px){
|
|
1298
|
-
.tab button {
|
|
1299
|
-
padding: 6px 16px;
|
|
1300
|
-
}
|
|
1301
|
-
.amt-pay-con {
|
|
1302
|
-
padding-right: 0;
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
.frac-cash-discount-fee {
|
|
1308
|
-
display: flex;
|
|
1309
|
-
padding: 11px;
|
|
1310
|
-
justify-content: space-between;
|
|
1311
|
-
align-items: center;
|
|
1312
|
-
align-self: stretch;
|
|
1313
|
-
border-radius: 8px;
|
|
1314
|
-
border: 1px solid #E0DFE2;
|
|
1315
|
-
background: #F6F6F7;
|
|
1316
|
-
margin-top: 24px;
|
|
1317
|
-
}
|
|
1318
|
-
.frac-cash-discount-fee small {
|
|
1319
|
-
color:#727272;
|
|
1320
|
-
font-size: 12px;
|
|
1321
|
-
font-weight: 500;
|
|
1322
|
-
}
|
|
1323
|
-
.frac-cash-discount-fee p{
|
|
1324
|
-
margin:0px;
|
|
1325
|
-
font-size: 14px;
|
|
1326
|
-
font-weight: 500;
|
|
1327
|
-
}
|
|
1328
|
-
.frac-card-payment-heading {
|
|
1329
|
-
font-size: 24px;
|
|
1330
|
-
font-style: normal;
|
|
1331
|
-
font-weight: 600;
|
|
1332
|
-
margin:0px;
|
|
1333
|
-
}
|
|
1334
|
-
.exp-date-year-container .form-group {
|
|
1335
|
-
padding: 0px !important;
|
|
1336
|
-
}
|
|
1337
|
-
.frac-heading-card-wrap {
|
|
1338
|
-
display: flex;
|
|
1339
|
-
align-items: center;
|
|
1340
|
-
margin-bottom:12px;
|
|
1341
|
-
}
|
|
1342
|
-
.frac-backarrow {
|
|
1343
|
-
margin-right: 10px;
|
|
1344
|
-
}
|
|
1345
|
-
.frac-charge-payment-back-btn-wrap , .frac-tab-2{
|
|
1346
|
-
display: none;
|
|
1347
|
-
}
|
|
1348
|
-
.frac-pay-conatiner-one{
|
|
1349
|
-
display: flex;
|
|
1350
|
-
flex-direction: column;
|
|
1351
|
-
justify-content: space-between;
|
|
1352
|
-
min-height: auto;
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
.frac-partial-payment-input{
|
|
1356
|
-
margin-top: 12px !important;
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
`)}import si from"axios";import xt from"react";import er from"react";function Vi(){return er.createElement("style",null,`
|
|
1360
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
1361
|
-
|
|
1362
|
-
body{
|
|
1363
|
-
display: flex;
|
|
1364
|
-
justify-content: center;
|
|
1365
|
-
align-items: center;
|
|
1366
|
-
padding-top: 30px;
|
|
1367
|
-
margin: 0;
|
|
1368
|
-
/* background-color: #f8f9fa; */
|
|
1369
|
-
flex-direction: column;
|
|
1370
|
-
}
|
|
1371
|
-
.payment-msg-container{
|
|
1372
|
-
min-height : 550px
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
.logo-container {
|
|
1376
|
-
display: flex;
|
|
1377
|
-
justify-content: center;
|
|
1378
|
-
align-items: center;
|
|
1379
|
-
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1380
|
-
z-index: 10;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
.client-logo {
|
|
1384
|
-
max-width: 100px;
|
|
1385
|
-
height: auto;
|
|
1386
|
-
object-fit: contain;
|
|
1387
|
-
display: block;
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
.payment-success-container {
|
|
1391
|
-
display: flex;
|
|
1392
|
-
flex-direction: column;
|
|
1393
|
-
align-items: center;
|
|
1394
|
-
padding: 18px 20px 24px;
|
|
1395
|
-
width: 335px;
|
|
1396
|
-
height: 400px; /* Fixed height */
|
|
1397
|
-
background: #ffffff;
|
|
1398
|
-
border-radius: 12px;
|
|
1399
|
-
position: relative;
|
|
1400
|
-
/* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1401
|
-
border: 1px solid #e3e3e3; */
|
|
1402
|
-
justify-content: center;
|
|
1403
|
-
text-align: center;
|
|
1404
|
-
margin-top: 50px; /* Adjust this to move the content down */
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
.success-icon {
|
|
1408
|
-
display: flex;
|
|
1409
|
-
flex-direction: column;
|
|
1410
|
-
align-items: center;
|
|
1411
|
-
gap: 12px;
|
|
1412
|
-
width: 227px;
|
|
1413
|
-
height: 116px;
|
|
1414
|
-
z-index: 2;
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
.circle {
|
|
1418
|
-
width: 40px;
|
|
1419
|
-
height: 40px;
|
|
1420
|
-
border: 1px solid #49b182;
|
|
1421
|
-
border-radius: 50%;
|
|
1422
|
-
display: flex;
|
|
1423
|
-
justify-content: center;
|
|
1424
|
-
align-items: center;
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
.circle .fa-check-circle {
|
|
1428
|
-
font-size: 20px;
|
|
1429
|
-
color: #49b182;
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
.success-text {
|
|
1433
|
-
display: flex;
|
|
1434
|
-
flex-direction: column;
|
|
1435
|
-
justify-content: center;
|
|
1436
|
-
align-items: center;
|
|
1437
|
-
gap: 4px;
|
|
1438
|
-
width: 227px;
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
.payment-success-text {
|
|
1442
|
-
font-family: "Inter", sans-serif;
|
|
1443
|
-
font-weight: 500;
|
|
1444
|
-
font-size: 18px;
|
|
1445
|
-
line-height: 21px;
|
|
1446
|
-
text-align: center;
|
|
1447
|
-
letter-spacing: -0.02em;
|
|
1448
|
-
color: #161616;
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
.thank-you-text {
|
|
1452
|
-
font-family: "Inter", sans-serif;
|
|
1453
|
-
font-weight: 500;
|
|
1454
|
-
font-size: 14px;
|
|
1455
|
-
line-height: 18px;
|
|
1456
|
-
text-align: center;
|
|
1457
|
-
letter-spacing: -0.02em;
|
|
1458
|
-
color: #161616;
|
|
1459
|
-
opacity: 0.5;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
.charge-payment-success-tick-div {
|
|
1463
|
-
display: flex;
|
|
1464
|
-
justify-content: center;
|
|
1465
|
-
align-items: center;
|
|
1466
|
-
margin-top: 32px;
|
|
1467
|
-
}
|
|
1468
|
-
.charge-payment-success-tick {
|
|
1469
|
-
border-radius: 1000px;
|
|
1470
|
-
background: rgba(97, 198, 153, 0.14);
|
|
1471
|
-
display: flex;
|
|
1472
|
-
width: 60px;
|
|
1473
|
-
height: 60px;
|
|
1474
|
-
justify-content: center;
|
|
1475
|
-
align-items: center;
|
|
1476
|
-
}
|
|
1477
|
-
.charge-payment-success-text {
|
|
1478
|
-
color: #161616;
|
|
1479
|
-
text-align: center;
|
|
1480
|
-
font-family: Inter;
|
|
1481
|
-
font-size: 32px;
|
|
1482
|
-
font-style: normal;
|
|
1483
|
-
font-weight: 500;
|
|
1484
|
-
line-height: 36px;
|
|
1485
|
-
letter-spacing: -0.64px;
|
|
1486
|
-
margin-top: 20px;
|
|
1487
|
-
margin-bottom: 5px !important;
|
|
1488
|
-
}
|
|
1489
|
-
.charge-payment-success-container {
|
|
1490
|
-
display: flex;
|
|
1491
|
-
padding: 120px 48px 32px 48px;
|
|
1492
|
-
flex-direction: column;
|
|
1493
|
-
justify-content: center;
|
|
1494
|
-
align-items: center;
|
|
1495
|
-
}
|
|
1496
|
-
.charge-payment-success-subtext {
|
|
1497
|
-
color: #727272;
|
|
1498
|
-
text-align: center;
|
|
1499
|
-
font-family: Inter;
|
|
1500
|
-
font-size: 14px;
|
|
1501
|
-
font-style: normal;
|
|
1502
|
-
font-weight: 500;
|
|
1503
|
-
line-height: 18px; /* 128.571% */
|
|
1504
|
-
letter-spacing: -0.28px;
|
|
1505
|
-
margin:14px 0 !important
|
|
1506
|
-
|
|
1507
|
-
}
|
|
1508
|
-
.charge-success-payment-button-div {
|
|
1509
|
-
display: flex;
|
|
1510
|
-
gap: 10px;
|
|
1511
|
-
align-items: baseline;
|
|
1512
|
-
}
|
|
1513
|
-
.charge-success-btn1 {
|
|
1514
|
-
display: flex;
|
|
1515
|
-
padding: 9px 16px;
|
|
1516
|
-
align-items: center;
|
|
1517
|
-
gap: 6px;
|
|
1518
|
-
border-radius: 1000px;
|
|
1519
|
-
border: 1px solid #e0dfe2;
|
|
1520
|
-
background: #fff;
|
|
1521
|
-
color: #161616;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
.charge-payment-success-btn-div {
|
|
1525
|
-
display: flex;
|
|
1526
|
-
align-items: flex-start;
|
|
1527
|
-
justify-content: center;
|
|
1528
|
-
gap: 8px;
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
.charge-payment-success-btn1 {
|
|
1532
|
-
cursor: pointer;
|
|
1533
|
-
border-radius: 80px;
|
|
1534
|
-
border: 1px solid #e0dfe2;
|
|
1535
|
-
display: flex;
|
|
1536
|
-
padding: 12px 32px;
|
|
1537
|
-
justify-content: center;
|
|
1538
|
-
align-items: center;
|
|
1539
|
-
gap: 6px;
|
|
1540
|
-
background-color: #fff;
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
.charge-payment-success-btn2 {
|
|
1544
|
-
border-radius: 80px;
|
|
1545
|
-
cursor: pointer;
|
|
1546
|
-
border: 1px solid #e0dfe2;
|
|
1547
|
-
display: flex;
|
|
1548
|
-
padding: 12px 32px;
|
|
1549
|
-
justify-content: center;
|
|
1550
|
-
align-items: center;
|
|
1551
|
-
gap: 6px;
|
|
1552
|
-
background-color: #161616;
|
|
1553
|
-
color: #fff;
|
|
1554
|
-
}`)}function Wn(e,t,H){e.preventDefault();let B={type:"preview.compiledcheck",other:{msg:"Payment success!",status:t==="close",data:{tran_id:H,key:t}}};console.log("message:",B),window.parent.postMessage(B,"*")}function Dn({onClose:e,tranId:t}){return xt.createElement(xt.Fragment,null,xt.createElement(Vi,null),xt.createElement("div",{className:"payment-msg-container"},xt.createElement("div",{className:"charge-payment-success-container"},xt.createElement("div",{className:"charge-payment-success-tick-div"},xt.createElement("div",{className:"charge-payment-success-tick"},xt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},xt.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"})))),xt.createElement("h6",{className:"charge-payment-success-text"},"Your charge",xt.createElement("br",null),"was successful"),xt.createElement("h6",{className:"charge-payment-success-subtext"},"We\u2019ve processed your charge"),xt.createElement("div",{className:"charge-success-payment-button-div"},xt.createElement("button",{className:"charge-success-btn1",onClick:H=>Wn(H,"print",t)},xt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},xt.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"}),xt.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"),xt.createElement("button",{className:"charge-success-btn1",onClick:H=>Wn(H,"share",t)},xt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},xt.createElement("g",{clipPath:"url(#clip0_12420_50683)"},xt.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"})),xt.createElement("defs",null,xt.createElement("clipPath",{id:"clip0_12420_50683"},xt.createElement("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.5)"})))),"Send receipt"))),xt.createElement("div",{className:"charge-payment-success-btn-div"},xt.createElement("button",{className:"charge-payment-success-btn1",onClick:H=>Wn(H,"tran",t)},"Go to Transactions"),xt.createElement("button",{className:"charge-payment-success-btn2",onClick:H=>{e(),Wn(H,"close",t)}},"Close"))))}import xi from"sweetalert2";import{IoArrowBack as qi}from"react-icons/io5";import{useEffect as ba}from"react";function Cn(){return ba(()=>{let e=Jn;if(typeof window!="undefined"&&!window.DatacapWebToken&&!document.querySelector(`script[src="${e}"]`)){let t=document.createElement("script");t.src=e,t.async=!0,t.onload=()=>{window.DatacapWebToken||console.warn("\u26A0\uFE0F Script loaded, but DatacapWebToken not found")},t.onerror=H=>{console.error("\u274C Failed to load Datacap script",H)},document.head.appendChild(t)}},[]),ba(()=>{let e="forge-cdn-script";if(!document.getElementById(e)){let t=document.createElement("script");t.src="https://cdn.jsdelivr.net/npm/node-forge@1.0.0/dist/forge.min.js",t.id=e,t.async=!0,document.head.appendChild(t)}return()=>{let t=document.getElementById(e);t&&document.head.removeChild(t)}},[]),null}import wn from"react";import tr from"react";function Oi(){return tr.createElement("style",null,`
|
|
1555
|
-
.card-error .logo-container {
|
|
1556
|
-
display: flex;
|
|
1557
|
-
justify-content: center;
|
|
1558
|
-
align-items: center;
|
|
1559
|
-
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1560
|
-
z-index: 10;
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
.card-error .client-logo {
|
|
1564
|
-
max-width: 100px;
|
|
1565
|
-
height: auto;
|
|
1566
|
-
object-fit: contain;
|
|
1567
|
-
display: block;
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
|
-
.card-error .payment-error-container {
|
|
1571
|
-
display: flex;
|
|
1572
|
-
flex-direction: column;
|
|
1573
|
-
align-items: center;
|
|
1574
|
-
padding: 18px 20px 24px;
|
|
1575
|
-
// width: 335px;
|
|
1576
|
-
min-height: 250px; /* Fixed height */
|
|
1577
|
-
background: #FFFFFF;
|
|
1578
|
-
border-radius: 12px;
|
|
1579
|
-
position: relative;
|
|
1580
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1581
|
-
border: 1px solid #e3e3e3;
|
|
1582
|
-
justify-content: center;
|
|
1583
|
-
text-align: center;
|
|
1584
|
-
// margin-top: 50px; /* Adjust this to move the content down */
|
|
1585
|
-
margin: 50px auto 0 auto !important;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
.card-error .error-icon {
|
|
1589
|
-
display: flex;
|
|
1590
|
-
flex-direction: column;
|
|
1591
|
-
align-items: center;
|
|
1592
|
-
gap: 12px;
|
|
1593
|
-
min-height: 116px;
|
|
1594
|
-
z-index: 2;
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
.card-error .circle {
|
|
1598
|
-
width: 50px;
|
|
1599
|
-
height: 50px;
|
|
1600
|
-
border: 1px solid red;
|
|
1601
|
-
border-radius: 50%;
|
|
1602
|
-
display: flex;
|
|
1603
|
-
justify-content: center;
|
|
1604
|
-
align-items: center;
|
|
1605
|
-
margin-bottom:20px
|
|
1606
|
-
}
|
|
1607
|
-
|
|
1608
|
-
.card-error .circle .fa-times {
|
|
1609
|
-
font-size: 30px;
|
|
1610
|
-
color: red;
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
.card-error .error-text {
|
|
1614
|
-
display: flex;
|
|
1615
|
-
flex-direction: column;
|
|
1616
|
-
justify-content: center;
|
|
1617
|
-
align-items: center;
|
|
1618
|
-
gap: 4px;
|
|
1619
|
-
// width: 227px;
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
.card-error .payment-error-text {
|
|
1623
|
-
font-family: 'Inter', sans-serif;
|
|
1624
|
-
font-weight: 500;
|
|
1625
|
-
font-size: 18px;
|
|
1626
|
-
line-height: 21px;
|
|
1627
|
-
text-align: center;
|
|
1628
|
-
letter-spacing: -0.02em;
|
|
1629
|
-
color: #161616;
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
.card-error .thank-you-text {
|
|
1633
|
-
font-family: 'Inter', sans-serif;
|
|
1634
|
-
font-weight: 500;
|
|
1635
|
-
font-size: 16px;
|
|
1636
|
-
line-height: 18px;
|
|
1637
|
-
text-align: center;
|
|
1638
|
-
letter-spacing: -0.02em;
|
|
1639
|
-
color: #161616 !important;
|
|
1640
|
-
opacity: 0.5;
|
|
1641
|
-
padding-top:10px
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
.card-error .error-btn-div{
|
|
1645
|
-
padding-top:30px;
|
|
1646
|
-
|
|
1647
|
-
}
|
|
1648
|
-
.card-error .error-btn-div button{
|
|
1649
|
-
border-radius: 0.25em;
|
|
1650
|
-
border:none;
|
|
1651
|
-
background: initial;
|
|
1652
|
-
background-color: #7066e0;
|
|
1653
|
-
box-shadow: var(--swal2-confirm-button-box-shadow);
|
|
1654
|
-
color: white;
|
|
1655
|
-
font-size: 1em;
|
|
1656
|
-
padding:10px 17px;
|
|
1657
|
-
cursor:pointer;
|
|
1658
|
-
}
|
|
1659
|
-
`)}var nr=({onClose:e,error:t})=>wn.createElement(wn.Fragment,null,wn.createElement(Oi,null),wn.createElement("div",{className:"card-error"},wn.createElement("div",{className:"payment-error-container"},wn.createElement("div",{className:"error-icon"},wn.createElement("div",{className:"circle"},wn.createElement("i",{className:"fa fa-times","aria-hidden":"true"})),wn.createElement("div",{className:"error-text"},wn.createElement("div",{className:"payment-error-text"},t),wn.createElement("div",{className:"thank-you-text"},"Try again later ")),wn.createElement("div",{className:"error-btn-div"},wn.createElement("button",{onClick:e},"OK")))))),Fn=nr;import{io as ir}from"socket.io-client";var ar=ir(Xe,{transports:["websocket"],withCredentials:!1}),It=ar;import jn from"react";var Nn=e=>jn.createElement(jn.Fragment,null,jn.createElement("div",{className:`frac-card-bank-radio ${e.activetab===e.value?"frac-active":""}`,onClick:()=>e.onChange(e.value),role:"radio"},jn.createElement("div",{className:"frac-card-title-main"},jn.createElement("img",{src:e.label.toLowerCase()==="card"?bi:e.label.toLowerCase()==="reader"?Ii:fa,className:"frac-payment-type-logo",alt:""}),jn.createElement("div",{className:"frac-card-label"},jn.createElement("div",{className:"frac-card-label-text"},e.label),jn.createElement("div",{className:"frac-card-label-amount"},be(e.amount)))),jn.createElement("div",null,jn.createElement("input",{name:"paymenttype",checked:e.activetab===e.value,type:"radio",value:e.value,onChange:t=>{e.onChange(t.target.value)}}))));import rr from"react";function Kn({}){return rr.createElement("style",null,`
|
|
1660
|
-
.frac-card-bank-radio-main{
|
|
1661
|
-
display: flex;
|
|
1662
|
-
flex-direction: column;
|
|
1663
|
-
align-items: flex-start;
|
|
1664
|
-
align-self: stretch;
|
|
1665
|
-
border-radius: 14px;
|
|
1666
|
-
border: 1px solid #E0DFE2;
|
|
1667
|
-
overflow: hidden;
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
.frac-card-bank-radio{
|
|
1671
|
-
display: flex;
|
|
1672
|
-
padding: 12px 16px;
|
|
1673
|
-
justify-content: space-between;
|
|
1674
|
-
align-items: center;
|
|
1675
|
-
align-self: stretch;
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
input[type="radio"] {
|
|
1679
|
-
accent-color: #000;
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
.frac-card-title-main{
|
|
1683
|
-
display: flex;
|
|
1684
|
-
align-items: center;
|
|
1685
|
-
gap: 12px;
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
.frac-card-label{
|
|
1689
|
-
display: flex;
|
|
1690
|
-
flex-direction: column;
|
|
1691
|
-
align-items: flex-start;
|
|
1692
|
-
gap: 2px;
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
.frac-card-label-text{
|
|
1696
|
-
color: #727272;
|
|
1697
|
-
font-family: Inter;
|
|
1698
|
-
font-size: 12px;
|
|
1699
|
-
font-style: normal;
|
|
1700
|
-
font-weight: 500;
|
|
1701
|
-
line-height: 18px;
|
|
1702
|
-
letter-spacing: -0.24px;
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
.frac-card-label-amount{
|
|
1706
|
-
color: #161616;
|
|
1707
|
-
text-align: center;
|
|
1708
|
-
font-family: Inter;
|
|
1709
|
-
font-size: 16px;
|
|
1710
|
-
font-style: normal;
|
|
1711
|
-
font-weight: 500;
|
|
1712
|
-
line-height: 140%;
|
|
1713
|
-
letter-spacing: -0.32px;
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
.frac-payment-type-logo{
|
|
1717
|
-
width: 24px;
|
|
1718
|
-
height: 24px;
|
|
1719
|
-
aspect-ratio: 1/1;
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
.frac-card-bank-radio-main .frac-card-bank-radio:nth-child(2) {
|
|
1723
|
-
border-top: 1px solid #E0DFE2;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
.frac-card-bank-radio-main .frac-card-bank-radio:nth-child(3) {
|
|
1727
|
-
border-top: 1px solid #E0DFE2;
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
.frac-card-bank-radio.frac-active {
|
|
1731
|
-
background: #F6F6F7;
|
|
1732
|
-
}
|
|
1733
|
-
`)}import on from"react";var Bn=({listHeading:e="Card",ListItems:t,selectedCard:H,setSelectedCard:T,paymentGateway:B,handleDeleteCard:Y,otherButtonAction:K,otherButtonLabel:U,headingClass:ve})=>{let Z=ne+"widget/Trash.svg";return on.createElement(on.Fragment,null,on.createElement("h6",{className:ve||"card-ach-heading",style:{marginBottom:"10px !important"}},e),on.createElement("div",{className:"card-lint-div-in"},on.createElement("div",{className:"card-list-div"},t&&(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((A,G)=>{let oe=!1;return B&&(oe=B!=(A==null?void 0:A.payment_method_type)&&(A==null?void 0:A.card_type)!="Bank"),on.createElement("div",{key:A==null?void 0:A.id,className:"card-list-single-div"},on.createElement("div",{className:"card-number-radio"},on.createElement("input",{disabled:oe,type:"radio",className:"cardRadio",name:"selected_card",id:"",checked:(H==null?void 0:H.id)===(A==null?void 0:A.id),onChange:w=>T(A)}),on.createElement("label",{htmlFor:"",className:"card-number-last-four"},"**** ",A==null?void 0:A.cardlastfourdigit),(A==null?void 0:A.card_type)!="Bank"&&on.createElement("h6",{className:"card-expiry-date"},A==null?void 0:A.expmonth,"/",A==null?void 0:A.expyear)),on.createElement("div",{className:"card-number-radio"},on.createElement("span",{className:"visa-card"},on.createElement("img",{src:ha(A==null?void 0:A.card_type),alt:""})),on.createElement("span",{className:"visa-card",style:{cursor:"pointer"},onClick:()=>Y(A==null?void 0:A.id)},on.createElement("img",{src:Z,alt:""}))))}))),on.createElement("div",{className:"pay-with-other-card",onClick:K},U,on.createElement("img",{src:bi,alt:""}))))};import Mn from"react";var Bi=({listHeading:e="Readers",ListItems:t,selectedPax:H,setSlectedPax:T,headingClass:B})=>Mn.createElement(Mn.Fragment,null,Mn.createElement("h6",{className:B||"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((Y,K)=>Mn.createElement("div",{key:Y==null?void 0:Y.id,className:"card-list-single-div"},Mn.createElement("div",{className:"card-number-radio"},Mn.createElement("input",{type:"radio",className:"cardRadio",name:"selected_reader",id:"",checked:(H==null?void 0:H.id)===(Y==null?void 0:Y.id),onChange:U=>T(Y)}),Mn.createElement("label",{htmlFor:"",className:"card-number-last-four"},Y==null?void 0:Y.device_name)),Mn.createElement("div",{className:"card-number-radio"},Mn.createElement("span",{className:"visa-card"},Mn.createElement("img",{src:Ii,alt:""})))))))));function or(e){var Qe,rt,ht,qt,Mt,zt,Wt,ot,Ve,Yt,Ht,Dt,Rt,en,tn,nn,un,Gt,Oe,jt;let[t,H]=Bt(!1),[T,B]=Bt(!1),[Y,K]=Bt(""),[U,ve]=Bt(!1),[Z,A]=Bt(!1),[G,oe]=Bt("card"),[w,C]=Bt("card"),[ee,V]=Bt("form"),[y,_e]=Bt("form"),[M,Te]=Bt(!0),[Pe,me]=Bt(!1),[ke,ut]=Bt(!1),Fe=e.merchantPublicKey,Me=ne+"widget/mc-img.svg",ce=ne+"widget/visa-img.svg",Ye=ne+"widget/ae-img.svg",Je=ne+"widget/discover-img.svg",ln=ne+"widget/card.svg",Ut=ne+"widget/Trash.svg",h=ne+"widget/bank.svg",L=ne+"widget/secure-img.png",u=ne+"widget/pov-by.png",Ce=ne+"widget/pax.svg",[a,o]=Bt(),[r,b]=Bt({}),[k,P]=Bt(),[O,x]=Bt({}),[f,N]=Bt([]),[$e,dt]=Bt([]),[Ee,Ft]=Bt(),[mt,Re]=Bt(void 0),[ze,ue]=Bt(Number(e==null?void 0:e.amount)),[E,Le]=Bt(),[at,D]=Bt(""),St=()=>H(!0),Ze=()=>H(!1),_t=(_,g)=>{let se=(parseFloat(g)||0)/100,ge=_/(1+se);return Math.round(ge*100)/100};xa(()=>{if(Z){let _=_t(e==null?void 0:e.amount,(e==null?void 0:e.surcharge)||0);ue(_)}},[Z,e==null?void 0:e.pass_fee,e==null?void 0:e.amount,e==null?void 0:e.surcharge]);let S=()=>{A(!1),oe("card"),K(""),ve(!1),D(""),P({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),x({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),o({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),b({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),ut(!1),me(!1),Ft({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""}),Re(null),ue(0),C("card"),Te(!0),_e("form"),V("form"),B(!1),H(!1),dt([]),N([])},bn=()=>A(!0),Pt=_=>{oe(_)},ft=(_,g)=>{let se=_;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(se)){(g===""||/^[0-9]+$/.test(g))&&(b(te=>F(v({},te),{[se]:""})),o(te=>F(v({},te),{[se]:g})));return}b(te=>F(v({},te),{[se]:""})),o(te=>F(v({},te),{[se]:g}))},cn=_=>{var te;let g=_.target,{formatted:se,cursor:ge}=Pn(g.value,(te=g.selectionStart)!=null?te:0);b(Ke=>F(v({},Ke),{cardNumber:""})),o(Ke=>F(v({},Ke),{cardNumber:se})),requestAnimationFrame(()=>{g.setSelectionRange(ge,ge)})},vt=_=>{let{name:g,value:se}=_.target,ge=["routingNumber","accountNumber","confirmAccountNumber"];if(g=="name"){/^[a-zA-Z\s]*$/.test(se)&&(x(te=>F(v({},te),{[g]:""})),P(te=>F(v({},te),{[g]:se})));return}if(ge.includes(g)){(se===""||/^[0-9]+$/.test(se))&&(x(te=>F(v({},te),{[g]:""})),P(te=>F(v({},te),{[g]:se})));return}x(te=>F(v({},te),{[g]:""})),P(te=>F(v({},te),{[g]:se}))},Yn=()=>{var te,Ke,fe,wt,Ge,ct;let _={},g=a,se=parseInt((g==null?void 0:g.expiryMonth)||"",10),ge=(g==null?void 0:g.expiryYear)||"";if((te=g==null?void 0:g.cardName)!=null&&te.trim()||(_.cardName="Card name is required"),(Ke=g==null?void 0:g.cardNumber)!=null&&Ke.trim()||(_.cardNumber="Card number is required"),(!((fe=g==null?void 0:g.expiryMonth)!=null&&fe.trim())||!((wt=g==null?void 0:g.expiryYear)!=null&&wt.trim())||isNaN(se)||se<1||se>12||ge.length!==4)&&(_.expiryMonth="Invalid Expiration Date."),(Ge=g==null?void 0:g.cvv)!=null&&Ge.trim()||(_.cvv="CVV is required"),(ct=g==null?void 0:g.zipCode)!=null&&ct.trim()||(_.zipCode="ZIP code is required"),g!=null&&g.expiryMonth&&(g!=null&&g.expiryYear)&&g.expiryMonth.length<=2&&g.expiryYear.length===4){let Vt=parseInt(g.expiryMonth,10),p=parseInt(g.expiryYear,10),c=new Date,W=c.getMonth()+1,Se=c.getFullYear();(p<Se||p===Se&&Vt<W)&&(_.expiryMonth="Card is expired")}return b(_),Object.keys(_).length>0},Ln=()=>{var se,ge,te,Ke,fe,wt,Ge,ct;let _={},g=k;return(se=g==null?void 0:g.name)!=null&&se.trim()||(_.name="Name is required"),(ge=g==null?void 0:g.accountNumber)!=null&&ge.trim()||(_.accountNumber="Account number is required"),(te=g==null?void 0:g.accountNumber)!=null&&te.trim()&&((Ke=g==null?void 0:g.accountNumber)==null?void 0:Ke.trim())!==((fe=g==null?void 0:g.confirmAccountNumber)==null?void 0:fe.trim())&&(_.confirmAccountNumber="Account numbers must match"),(wt=g==null?void 0:g.bankName)!=null&&wt.trim()||(_.bankName="Bank name is required"),(Ge=g==null?void 0:g.routingNumber)!=null&&Ge.trim()||(_.routingNumber="Routing Number is required"),g!=null&&g.routingNumber&&((ct=g==null?void 0:g.routingNumber)==null?void 0:ct.length)!==9&&(_.routingNumber="Routing number must be 9 digits"),((g==null?void 0:g.accountType)==="business saving"||(g==null?void 0:g.accountType)==="business checking")&&(!(g!=null&&g.companyName)||(g==null?void 0:g.companyName)==="")&&(_.companyName="Company Name is required for business accounts"),x(_),Object.keys(_).length>0},Ct=async _=>{var se,ge,te,Ke,fe,wt,Ge,ct,Vt,p,c,W,Se,ie,et,we;_.preventDefault();let g=document.activeElement;if(g instanceof HTMLElement&&g.blur(),G!=="ach"){if(Yn())return;{let Ie=DatacapWebToken.validateCardNumber(a==null?void 0:a.cardNumber.replaceAll(" ","")),ae=DatacapWebToken.validateExpirationDate(a==null?void 0:a.expiryMonth,a==null?void 0:a.expiryYear),nt=DatacapWebToken.validateCVV(a==null?void 0:a.cvv),gt={};if(Ie||(gt.cardNumber="Invalid card Number"),ae||(gt.expiryMonth="Invalid Expiration Date."),nt||(gt.cvv="Invalid CVV"),b(gt),Ie&&nt&&ae){B(!0);try{let ye={amount:`${e.amount||0}`,fractalpayPublicKey:Fe,orderId:e==null?void 0:e.orderID,customer_id:e==null?void 0:e.customerId,discount:e==null?void 0:e.discount,surcharge:e==null?void 0:e.surcharge,tax:e==null?void 0:e.tax,pass_fee:e==null?void 0:e.pass_fee},re=await si.post(`${Xe}create-widget-order`,ye,{headers:v({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})}),Ot=async function(Lt){if(Lt.Error)K(Lt.Error),B(!1);else{let Ue=a==null?void 0:a.cardName,En=a==null?void 0:a.zipCode;Lt.name=Ue,Lt.postal_code=En,Lt.isCardSave=`${Pe}`,Lt.isCharge=!0,Lt.posSalesIdEncode=re==null?void 0:re.data.data.posSalesIdEncode,It.emit("sendMessage",Lt),It.on(re==null?void 0:re.data.data.posSalesIdEncode,st=>{if(ri(st==null?void 0:st.data)){let Be=JSON.parse(st.data);Be!=null&&Be.result?(o({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),me(!1),D(Be==null?void 0:Be.transactionId),ve(!0),B(!1)):(B(!1),K((Be==null?void 0:Be.message)||"Something went wrong."))}else K("Something went wrong.")})}};if((E==null?void 0:E.paymentGateway)===32){let Lt={method:"POST",redirect:"follow"};try{let Ue=await si.post(`${je}api/v1/widget/generate-session`,Lt),En=Number(a==null?void 0:a.expiryYear)%100,st=a==null?void 0:a.cardNumber;st=st==null?void 0:st.replace(/\s+/g,"");let Be=`${st}=${En}${a==null?void 0:a.expiryMonth} ${a==null?void 0:a.cvv}`,xn=forge.pki.publicKeyFromPem((ge=(se=Ue==null?void 0:Ue.data)==null?void 0:se.data)==null?void 0:ge.publicKeyPem).encrypt(Be,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),gn=forge.util.encode64(xn),Nt={"Content-Type":"application/json","x-app-session-key":(Ke=(te=Ue.data)==null?void 0:te.data)==null?void 0:Ke.session_key},le=JSON.stringify({enc_track2_data:`${gn}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(wt=(fe=Ue==null?void 0:Ue.data)==null?void 0:fe.data)==null?void 0:wt.session_key}`});try{let yt=await si.post(`${rn}tokenizer/tokenize`,le,{headers:Nt}),Jt=JSON.stringify(F(v({},(Ge=yt==null?void 0:yt.data)==null?void 0:Ge.data),{isSaveCardChecked:Pe,name:a==null?void 0:a.cardName,postal_code:a==null?void 0:a.zipCode,customer_id:e==null?void 0:e.customerId})),dn=JSON.stringify({pre_sales_id:`${(Vt=(ct=re==null?void 0:re.data)==null?void 0:ct.data)==null?void 0:Vt.posSalesIdEncode}`,token:`${(p=yt==null?void 0:yt.data)==null?void 0:p.data.token}`,json_response:`${Jt}`}),zn={method:"POST",headers:JSON.stringify({"Content-Type":"application/json"}),body:dn,redirect:"follow",isChargeviafractal:!0};It.emit("sendMessage",zn),It.on("chargeviafractalgateway",Et=>{var Gn;if(ri(Et==null?void 0:Et.data)){let hn=JSON.parse(Et==null?void 0:Et.data);hn!=null&&hn.result?(D((Gn=hn==null?void 0:hn.data)==null?void 0:Gn.transactionId),ve(!0),B(!1)):(B(!1),K((hn==null?void 0:hn.message)||"Something went wrong."))}else K("Something went wrong.")})}catch(yt){B(!1),K(((W=(c=yt==null?void 0:yt.response)==null?void 0:c.data)==null?void 0:W.message)||(yt==null?void 0:yt.message)||"Something went wrong.")}}catch(Ue){B(!1),K(((ie=(Se=Ue==null?void 0:Ue.response)==null?void 0:Se.data)==null?void 0:ie.message)||(Ue==null?void 0:Ue.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(re==null?void 0:re.data.data.dctoken,"PaymentForm",Ot)}catch(ye){B(!1),K(((we=(et=ye==null?void 0:ye.response)==null?void 0:et.data)==null?void 0:we.message)||(ye==null?void 0:ye.message)||"Something went wrong.")}}}}else{if(Ln())return;{B(!0);let Ie=v({fractalpayPublicKey:Fe,label:(k==null?void 0:k.name)||"John Doe",account_number:k==null?void 0:k.accountNumber,routing_number:k==null?void 0:k.routingNumber,bank_name:k==null?void 0:k.bankName,account_type:k==null?void 0:k.accountType,amount:String(ze||0),isSaveAch:ke,customer_id:e==null?void 0:e.customerId,order_id:e==null?void 0:e.orderID,tax:e==null?void 0:e.tax,discount:e==null?void 0:e.discount,surcharge:e==null?void 0:e.surcharge,isChargeACH:!0,company_name:(k==null?void 0:k.companyName)||""},(e==null?void 0:e.sessionToken)&&{sessionToken:e.sessionToken});It.emit("sendMessage",Ie),It.on("ach-incoming",ae=>{var nt;(ae==null?void 0:ae.status)=="Failed"?typeof(ae==null?void 0:ae.message)=="object"?Object.values(ae==null?void 0:ae.message).forEach(gt=>{K(gt||"Something went wrong")}):K((ae==null?void 0:ae.message)||"Something went wrong"):(D((nt=ae==null?void 0:ae.data)==null?void 0:nt.transaction_id),ve(!0),B(!1))})}}},An=async()=>{var _,g,se,ge,te,Ke,fe,wt,Ge,ct,Vt,p,c,W,Se,ie,et,we,tt,Ie,ae,nt,gt;St();try{let ye={fractalpayPublicKey:Fe,customer_id:e==null?void 0:e.customerId,pass_fee:e==null?void 0:e.pass_fee,isReader:e==null?void 0:e.isReader},re=await si.post(`${Xe}get-payment-details`,ye);if(Le((_=re==null?void 0:re.data)==null?void 0:_.data),(se=(g=re==null?void 0:re.data)==null?void 0:g.data)!=null&&se.paymentGateway||(S(),K("Something went wrong.")),(te=(ge=re==null?void 0:re.data)==null?void 0:ge.data)!=null&&te.card_list&&((wt=(fe=(Ke=re==null?void 0:re.data)==null?void 0:Ke.data)==null?void 0:fe.card_list)==null?void 0:wt.length)>0){let Ot=(Vt=(ct=(Ge=re==null?void 0:re.data)==null?void 0:Ge.data)==null?void 0:ct.card_list)==null?void 0:Vt.filter(Ue=>(Ue==null?void 0:Ue.card_type)=="Bank"),Lt=(W=(c=(p=re==null?void 0:re.data)==null?void 0:p.data)==null?void 0:c.card_list)==null?void 0:W.filter(Ue=>(Ue==null?void 0:Ue.card_type)!=="Bank");(Lt==null?void 0:Lt.length)>0&&V("list"),(Ot==null?void 0:Ot.length)>0&&_e("list"),N(Lt),dt(Ot)}else oe("card");(ie=(Se=re==null?void 0:re.data)==null?void 0:Se.data)!=null&&ie.paymentDeviceList&&((tt=(we=(et=re==null?void 0:re.data)==null?void 0:et.data)==null?void 0:we.paymentDeviceList)==null?void 0:tt.length)>0&&Re((ae=(Ie=re==null?void 0:re.data)==null?void 0:Ie.data)==null?void 0:ae.paymentDeviceList[0]),Ze()}catch(ye){console.log(ye),Ze(),K(((gt=(nt=ye==null?void 0:ye.response)==null?void 0:nt.data)==null?void 0:gt.message)||(ye==null?void 0:ye.message)||"Something went wrong")}},Sn=async _=>{if(_.currentTarget.blur(),T)return;let g=e==null?void 0:e.customerId,se=String(e==null?void 0:e.discount),ge=String(e==null?void 0:e.surcharge),te=String(e==null?void 0:e.tax),Ke=e==null?void 0:e.merchantPublicKey,fe=e==null?void 0:e.orderID,wt=String(e==null?void 0:e.amount),Ge=Ee==null?void 0:Ee.id,ct=Ee==null?void 0:Ee.card_type;if(Ke&&fe&&wt&&ze)if(g)if(Ge){let p=v({amount:ct==="Bank"?`${ze}`:wt,order_id:fe,customer_id:g,card_id:Ge,fractalpayPublicKey:Ke,isCardSave:Pe,discount:se,surcharge:ge,tax:te,pass_fee:e==null?void 0:e.pass_fee,require3ds:!1},(e==null?void 0:e.sessionToken)&&{sessionToken:e.sessionToken}),Vt=p,{isCardSave:c,pass_fee:W,require3ds:Se}=Vt,ie=Un(Vt,["isCardSave","pass_fee","require3ds"]),we=Xe+(ct==="Bank"?"charge-ach":"charge-by-card"),tt={"Content-Type":"application/json"};B(!0),It.emit("sendMessage",{url:we,body:ct=="Bank"?ie:p,isChargebycard:!0}),It.on("charge-by-card",Ie=>{var ae;(Ie==null?void 0:Ie.result)==!0||(Ie==null?void 0:Ie.status)==!0?(D((ae=Ie.data)==null?void 0:ae.transaction_id),ve(!0),B(!1)):K((Ie==null?void 0:Ie.message)||"Something went wrong.")})}else K("Please Select A Card/ACH");else K("Please Select Customer");else K("Something went wrong.")},_n=async _=>{var Ke,fe,wt,Ge,ct,Vt;if(_.currentTarget.blur(),T)return;let g=e==null?void 0:e.merchantPublicKey,se=e==null?void 0:e.orderID,ge=String(e==null?void 0:e.amount),te=e==null?void 0:e.customerId;if(!(mt!=null&&mt.device_id)){K("Please Select A Payment Device");return}if(g&&se&&ge){B(!0);let p={amount:ge,fractalpayPublicKey:g,customer_order_id:se,device_id:mt==null?void 0:mt.device_id,customer_id:te||""};try{let c=await si.post(`${Xe}charge-with-reader`,p);((Ke=c==null?void 0:c.data)==null?void 0:Ke.result)==!0?(D((wt=(fe=c==null?void 0:c.data)==null?void 0:fe.data)==null?void 0:wt.transaction_id),ve(!0),B(!1)):(K(((Ge=c==null?void 0:c.data)==null?void 0:Ge.message)||"Something went wrong."),B(!1))}catch(c){K(((Vt=(ct=c==null?void 0:c.response)==null?void 0:ct.data)==null?void 0:Vt.message)||"Something went wrong."),B(!1)}}else K("Something went wrong.")},Q=_=>{w==="card"?Sn(_):w==="reader"&&_n(_)};xa(()=>{Z&&Fe&&An()},[Fe,Z]);let $=async _=>{xi.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async g=>{if(g.isConfirmed){B(!0);try{let se={card_id:_,customer_id:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey},ge=await si.post(`${Xe}delete-customer-card`,se);B(!1),An(),xi.fire({icon:"success",title:"Deleted!",text:"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})}catch(se){B(!1),xi.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else g.dismiss===xi.DismissReason.cancel&&xi.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},We=_=>{switch(_==null?void 0:_.toLowerCase()){case"visa":return ce;case"mastercard":case"mc":case"m/c":return Me;case"amex":case"american express":case"ae":return Ye;case"discover":case"dcvr":return Je;case"bank":return h;default:return _}},Tt=()=>{let _=ze||0;return(Number(e.amount)-_).toFixed(0)};return i.createElement(i.Fragment,null,i.createElement(Cn,null),i.createElement(Xn,null),i.createElement(Kn,null),i.createElement(i.Fragment,null,i.createElement("button",{className:"paymentBtn",onClick:bn},"Pay"),i.createElement(yn,{open:Z,onClose:S},Y&&i.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},i.createElement(Fn,{error:Y,onClose:S})),U&&i.createElement(Dn,{onClose:S,tranId:at}),!Y&&!U&&i.createElement(i.Fragment,null,(t||T)&&i.createElement(an,{loading:t||T}),i.createElement("div",{className:"frac-card-payment-page frac-form"},i.createElement("div",{className:"parent-pay-container"},i.createElement("span",{className:"request-payment-close-popup",onClick:S},i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},i.createElement("g",{clipPath:"url(#clip0_12425_52336)"},i.createElement("path",{d:"M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z",fill:"#727272"})),i.createElement("defs",null,i.createElement("clipPath",{id:"clip0_12425_52336"},i.createElement("rect",{width:"16",height:"16",fill:"white"}))))),i.createElement("div",{className:"pay-main-logo-res"},i.createElement("img",{src:E==null?void 0:E.logo,id:"pay-logos"})),i.createElement("div",{className:"pay-container"},i.createElement("div",{className:"pay-header pay-conatiner-one frac-pay-conatiner-one"},i.createElement("div",{className:"pay-conatiner-one-first"},i.createElement("div",{className:"pay-logo-container"},i.createElement("div",{className:"pay-main-logo"},i.createElement("img",{src:E==null?void 0:E.logo,id:"pay-logos"})),(f==null?void 0:f.length)>0&&G!=="cardList"&&i.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>oe("cardList")}," ",i.createElement(qi,null)," Back")),i.createElement("div",{className:"amt-pay-con"},i.createElement("div",{className:"pay-amount-conatiner"},i.createElement("small",{className:"pay-payment-amount"},"Select paymet type")),i.createElement("div",{className:"frac-card-bank-radio-main"},i.createElement(Nn,{label:"Card",amount:(Qe=Number(e==null?void 0:e.amount))==null?void 0:Qe.toFixed(2),value:"card",onChange:Pt,activetab:G}),(E==null?void 0:E.isSkyFiAccount)&&i.createElement(Nn,{label:"Bank",amount:(rt=Number(ze))==null?void 0:rt.toFixed(2),value:"ach",onChange:Pt,activetab:G}),(e==null?void 0:e.isReader)&&(E==null?void 0:E.paymentDeviceList)&&((ht=E==null?void 0:E.paymentDeviceList)==null?void 0:ht.length)>0&&i.createElement(Nn,{label:"Reader",amount:(qt=Number(e==null?void 0:e.amount))==null?void 0:qt.toFixed(2),value:"reader",onChange:Pt,activetab:G})),!t&&(In(E==null?void 0:E.showSurcharge)?ze&&ze>0&&(e!=null&&e.pass_fee)?i.createElement("div",{className:"frac-cash-discount-fee"},i.createElement("small",null,G==="card"||G==="reader"?"Cash Discount":"Cash Discount Savings"," "),i.createElement("p",null,be((Number(e.amount)-ze).toFixed(2)))):null:ze&&ze>0&&(e!=null&&e.pass_fee)&&(G==="card"||G==="reader")?i.createElement("div",{className:"frac-cash-discount-fee"},i.createElement("small",null,G==="card"||G==="reader"?"Surcharge":null," "),i.createElement("p",null,be((Number(e.amount)-ze).toFixed(2)))):null))),i.createElement("div",{className:"pay-conatiner-one-last"},i.createElement("img",{src:L,alt:""}),i.createElement("img",{src:u,alt:""}),"Secure payments powered by Fractal")),i.createElement("div",{className:"pay-tab pay-conatiner-two"},!t&&i.createElement("div",{className:"col-md-12"},i.createElement("div",{id:"payment-form-div"},G!=="cardList"?i.createElement("div",{className:"frac-charge-payment-back-btn-wrap "},(f==null?void 0:f.length)>0&&i.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>oe("cardList")}," ",i.createElement(qi,null)," Back"),(E==null?void 0:E.isSkyFiAccount)&&i.createElement("div",{className:"tab"},i.createElement("button",{className:"tablinks",onClick:_=>{Pt("card")},style:{border:G==="card"?"1px solid":""}},i.createElement("i",{className:"fas fa-credit-card me-2",style:{marginRight:"8px",fontSize:"15px"}}),"Card"),i.createElement("button",{className:"tablinks",onClick:_=>{Pt("ach")},style:{border:G==="ach"?"1px solid":""}},i.createElement("i",{className:"fas fa-university me-2",style:{marginRight:"8px",fontSize:"15px"}}),"Bank")),i.createElement("div",{className:"res-pay-con"},i.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},i.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),i.createElement("strong",{className:"pay-amount"},"$",(Mt=Number(e==null?void 0:e.amount))==null?void 0:Mt.toFixed(2))),G!="ach"&&i.createElement("div",null,i.createElement("div",null,i.createElement("img",{src:ce,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Me,width:35,alt:""})),i.createElement("div",null,i.createElement("img",{src:Ye,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Je,width:35,alt:""}))))):i.createElement("div",null,i.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",E==null?void 0:E.customer_name),i.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," ",w==="card"?"Cards/Banks":"Readers"," "),i.createElement("div",{className:"res-pay-con"},i.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},i.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),i.createElement("strong",{className:"pay-amount"},"$",(zt=Number(e==null?void 0:e.amount))==null?void 0:zt.toFixed(2))),i.createElement("div",null,i.createElement("div",null,i.createElement("img",{src:ce,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Me,width:35,alt:""})),i.createElement("div",null,i.createElement("img",{src:Ye,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Je,width:35,alt:""}))))),i.createElement("div",{id:"card",style:{display:G==="card"?"block":"none"},className:"tabcontent"},i.createElement("div",{className:"frac-card-payment"},i.createElement("div",{className:"frac-heading-card-wrap"},i.createElement("div",{className:"frac-backarrow"},(f==null?void 0:f.length)>0&&ee==="form"&&i.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>V("list")}," ",i.createElement(qi,null))),i.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),G!="ach"&&i.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},i.createElement("img",{src:ce,alt:"",width:33}),i.createElement("img",{src:Me,width:33,alt:""}),i.createElement("img",{src:Ye,alt:"",width:33}),i.createElement("img",{src:Je,width:33,alt:""}))),ee==="list"?i.createElement(i.Fragment,null,i.createElement(Bn,{listHeading:"Cards",paymentGateway:E==null?void 0:E.paymentGateway,ListItems:f,selectedCard:Ee,setSelectedCard:Ft,handleDeleteCard:$,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{V("form")}}),i.createElement("div",{className:"form-group",style:{padding:"0"}},i.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",disabled:T,onClick:Q},be((Wt=Number(e==null?void 0:e.amount))==null?void 0:Wt.toFixed(2))))):i.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:Ct,onKeyDown:_=>{_.key==="Enter"&&T&&(_.preventDefault(),_.stopPropagation())}},i.createElement("div",{className:"ach-scrl",style:{minHeight:E!=null&&E.isSkyFiAccount&&(f==null?void 0:f.length)>0?"444px":E!=null&&E.isSkyFiAccount&&(f==null?void 0:f.length)==0?"456px":(f==null?void 0:f.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},i.createElement("div",{className:"form-group"},i.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),i.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"John Doe",value:(a==null?void 0:a.cardName)||"",onChange:_=>{let g=_.target.value;/^[a-zA-Z\s]*$/.test(g)&&ft("cardName",g)}}),(r==null?void 0:r.cardName)&&i.createElement("span",{className:"error-span"},r==null?void 0:r.cardName)),i.createElement("div",{className:"form-group"},i.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),i.createElement("div",{className:"toggle-num-wrapper"},i.createElement("input",{className:"form-control card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(a==null?void 0:a.cardNumber)||"",onChange:_=>cn(_),"data-token":"card_number"}),i.createElement("div",{className:"card-crdi card-expiry-new"},i.createElement("div",{className:"exp-date-year-container"},i.createElement("div",{className:"exp-date form-group"},i.createElement("input",{"data-token":"exp_month",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(a==null?void 0:a.expiryMonth)||"",onChange:_=>ft("expiryMonth",_.target.value)})),i.createElement("div",{className:"exp-year form-group"},i.createElement("input",{"data-token":"exp_year",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(a==null?void 0:a.expiryYear)||"",onChange:_=>ft("expiryYear",_.target.value)})),i.createElement("div",{className:"security-digit form-group"},i.createElement("input",{"data-token":"cvv",className:"form-control card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(a==null?void 0:a.cvv)||"",onChange:_=>ft("cvv",_.target.value)})))),(r==null?void 0:r.cardNumber)&&i.createElement("span",{className:"error-span"},r==null?void 0:r.cardNumber),i.createElement("p",{style:{margin:"0"}},r!=null&&r.expiryMonth||r!=null&&r.expiryYear?i.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},r==null?void 0:r.expiryMonth):"",(r==null?void 0:r.cvv)&&i.createElement("span",{className:"error-span"},r==null?void 0:r.cvv)))),i.createElement("div",{className:"form-group"},i.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),i.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"OID123456",disabled:!0,value:(ot=e==null?void 0:e.orderID)!=null?ot:"",style:{background:"#F6F6F7",color:"#727272"}})),i.createElement("div",{className:"form-group"},i.createElement("label",{htmlFor:"zip"},"ZIP"),i.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(Ve=a==null?void 0:a.zipCode)!=null?Ve:"",onChange:_=>ft("zipCode",_.target.value)}),(r==null?void 0:r.zipCode)&&i.createElement("span",{className:"error-span"},r==null?void 0:r.zipCode)),(e==null?void 0:e.customerId)&&i.createElement("div",{className:"form-group"},i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},i.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:Pe,onChange:_=>me(_.target.checked)}),i.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),i.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},i.createElement("g",{clipPath:"url(#clip0_12420_50192)"},i.createElement("rect",{width:"20",height:"20",fill:"white"}),i.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),i.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"})),i.createElement("defs",null,i.createElement("clipPath",{id:"clip0_12420_50192"},i.createElement("rect",{width:"20",height:"20",fill:"white"}))))))),i.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:"0"}},i.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},be((Yt=Number(e==null?void 0:e.amount))==null?void 0:Yt.toFixed(2)))))),i.createElement("div",{id:"ach",style:{display:G==="ach"?"block":"none"},className:"tabcontent"},i.createElement("div",{className:"frac-card-payment"},i.createElement("div",{className:"frac-heading-card-wrap"},i.createElement("div",{className:"frac-backarrow"},($e==null?void 0:$e.length)>0&&y==="form"&&i.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>_e("list")}," ",i.createElement(qi,null))),i.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment"))),y==="list"?i.createElement(i.Fragment,null,i.createElement(Bn,{listHeading:"Banks",paymentGateway:E==null?void 0:E.paymentGateway,ListItems:$e,selectedCard:Ee,setSelectedCard:Ft,handleDeleteCard:$,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{_e("form")}}),i.createElement("div",{className:"form-group",style:{padding:"0"}},i.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Q},be((Ht=Number(ze))==null?void 0:Ht.toFixed(2))))):i.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:Ct,autoComplete:"off",onKeyDown:_=>{_.key==="Enter"&&T&&(_.preventDefault(),_.stopPropagation())}},i.createElement("div",{className:"ach-scrl",style:{minHeight:E!=null&&E.isSkyFiAccount&&(f==null?void 0:f.length)>0?"444px":E!=null&&E.isSkyFiAccount&&(f==null?void 0:f.length)==0?"436px":(f==null?void 0:f.length)>0?"462px":"520px",maxHeight:E!=null&&E.isSkyFiAccount&&(f==null?void 0:f.length)>0?"444px":((f==null?void 0:f.length)>0,"380px")}},i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),i.createElement("input",{type:"text",id:"nameonaccount",className:"form-control",maxLength:100,placeholder:"John Doe",name:"name",value:(Dt=k==null?void 0:k.name)!=null?Dt:"",onChange:vt}),(O==null?void 0:O.name)&&i.createElement("span",{className:"error-span"},O==null?void 0:O.name)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"routingnumber"},"Routing number"),i.createElement("input",{type:"text",id:"routingnumber",className:"form-control",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(Rt=k==null?void 0:k.routingNumber)!=null?Rt:"",onChange:vt}),(O==null?void 0:O.routingNumber)&&i.createElement("span",{className:"error-span"},O==null?void 0:O.routingNumber)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"accountnumber"},"Account number"),i.createElement("input",{type:"text",id:"accountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(en=k==null?void 0:k.accountNumber)!=null?en:"",onChange:vt}),(O==null?void 0:O.accountNumber)&&i.createElement("span",{className:"error-span"},O==null?void 0:O.accountNumber)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),i.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(tn=k==null?void 0:k.confirmAccountNumber)!=null?tn:"",onChange:vt}),(O==null?void 0:O.confirmAccountNumber)&&i.createElement("span",{className:"error-span"},O==null?void 0:O.confirmAccountNumber)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"bankname"},"Bank name"),i.createElement("input",{type:"text",id:"bankname",className:"form-control",maxLength:100,placeholder:"My Bank",name:"bankName",value:(nn=k==null?void 0:k.bankName)!=null?nn:"",onChange:vt}),(O==null?void 0:O.bankName)&&i.createElement("span",{className:"error-span"},O==null?void 0:O.bankName)),((k==null?void 0:k.accountType)==="business saving"||(k==null?void 0:k.accountType)==="business checking")&&i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"companyName"},"Company name"),i.createElement("input",{type:"text",id:"companyName",className:"form-control",maxLength:100,placeholder:"My Company",name:"companyName",value:(un=k==null?void 0:k.companyName)!=null?un:"",onChange:vt}),(O==null?void 0:O.companyName)&&i.createElement("span",{className:"error-span"},O==null?void 0:O.companyName)),i.createElement("div",{className:"form-group mb-4"},i.createElement("label",{htmlFor:"accounttype"},"Select account type"),i.createElement("select",{name:"accountType",id:"accounttype",className:"form-control",value:(Gt=k==null?void 0:k.accountType)!=null?Gt:"",onChange:vt},i.createElement("option",{value:""},"Select account"),oi.map(_=>i.createElement("option",{key:_.value,value:_.value},_.label)))),(e==null?void 0:e.customerId)&&i.createElement("div",{className:"form-group mb-4 save-ach-div",style:{paddingTop:"5px"}},i.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:ke,onChange:_=>ut(_.target.checked)}),i.createElement("label",{htmlFor:"saveACH"},"Save ACH")),ke&&i.createElement("div",{className:"form-group mb-4",style:{fontSize:"12px",color:"#727272"}},i.createElement("p",null,"If checked, I agree for ",i.createElement("b",null,"ecommerce")," to have my permission to charge this credit card for agreed upon purchases in the future."))),i.createElement("div",{className:"form-group "},i.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},be((Oe=Number(ze))==null?void 0:Oe.toFixed(2)))))),i.createElement("div",{id:"reader",style:{display:G==="reader"?"block":"none"},className:"tabcontent"},i.createElement("div",{className:"frac-card-payment"},i.createElement("div",{className:"frac-heading-card-wrap"},i.createElement("div",{className:"frac-backarrow"}),i.createElement("h6",{className:"frac-card-payment-heading"},"Reader Payment"))),i.createElement(Bi,{listHeading:"Reader",ListItems:E==null?void 0:E.paymentDeviceList,selectedPax:mt,setSlectedPax:Re}),i.createElement("button",{onClick:_n,className:"pay-button"},"$",(jt=Number(e==null?void 0:e.amount))==null?void 0:jt.toFixed(2)))))))))))))}import m,{useEffect as Ki,useState as sn}from"react";import li from"axios";import Zi from"sweetalert2";import{IoArrowBack as sr}from"react-icons/io5";function lr(H){var T=H,{showButton:e=!0}=T,t=Un(T,["showButton"]);var ft,cn,vt,Yn,Ln,Ct,An,Sn,_n;let[B,Y]=sn(!1),[K,U]=sn(!1),[ve,Z]=sn(""),[A,G]=sn(!1),[oe,w]=sn(!1),[C,ee]=sn("card"),[V,y]=sn(!1),[_e,M]=sn("card"),[Te,Pe]=sn("form"),me=t.merchantPublicKey,[ke,ut]=sn(void 0);Ki(()=>{t.onTriggerPay&&t.onTriggerPay(()=>{ze()})},[t]);let Fe=ne+"widget/mc-img.svg",Me=ne+"widget/visa-img.svg",ce=ne+"widget/ae-img.svg",Ye=ne+"widget/discover-img.svg",Je=ne+"widget/card.svg",ln=ne+"widget/Trash.svg",Ut=ne+"widget/bank.svg",h=ne+"widget/secure-img.png",L=ne+"widget/pov-by.png",[u,Ce]=sn(),[a,o]=sn({}),[r,b]=sn([]),[k,P]=sn(),[O,x]=sn(void 0),[f,N]=sn(),[$e,dt]=sn(""),Ee=(Q,$)=>{let We=(parseFloat($)||0)/100,Tt=Q/(1+We);return Math.round(Tt*100)/100};Ki(()=>{if(t!=null&&t.pass_fee){let Q=Ee(t==null?void 0:t.amount,t==null?void 0:t.surcharge);x(Q)}},[t==null?void 0:t.pass_fee]);let Ft=()=>Y(!0),mt=()=>Y(!1),Re=()=>{w(!1),ee("card"),U(!1),Z(""),G(!1),dt(""),Ce({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),o({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),y(!1),P({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""})},ze=()=>w(!0),ue=(Q,$)=>{let We=Q;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(We)){($===""||/^[0-9]+$/.test($))&&(o(Qe=>F(v({},Qe),{[We]:""})),Ce(Qe=>F(v({},Qe),{[We]:$})));return}o(Qe=>F(v({},Qe),{[We]:""})),Ce(Qe=>F(v({},Qe),{[We]:$}))},E=Q=>{var rt;let $=Q.target,We=$.value.replace(/\D/g,""),{formatted:Tt,cursor:Qe}=Pn($.value,(rt=$.selectionStart)!=null?rt:0);o(ht=>F(v({},ht),{cardNumber:""})),Ce(ht=>F(v({},ht),{cardNumber:Tt})),requestAnimationFrame(()=>{$.setSelectionRange(Qe,Qe)})},Le=()=>{var Qe,rt,ht,qt,Mt,zt;let Q={},$=u,We=parseInt(($==null?void 0:$.expiryMonth)||"",10),Tt=($==null?void 0:$.expiryYear)||"";if((Qe=$==null?void 0:$.cardName)!=null&&Qe.trim()||(Q.cardName="Card name is required"),(rt=$==null?void 0:$.cardNumber)!=null&&rt.trim()||(Q.cardNumber="Card number is required"),(!((ht=$==null?void 0:$.expiryMonth)!=null&&ht.trim())||!((qt=$==null?void 0:$.expiryYear)!=null&&qt.trim())||isNaN(We)||We<1||We>12||Tt.length!==4)&&(Q.expiryMonth="Invalid Expiration Date."),(Mt=$==null?void 0:$.cvv)!=null&&Mt.trim()||(Q.cvv="CVV is required"),(zt=$==null?void 0:$.zipCode)!=null&&zt.trim()||(Q.zipCode="ZIP code is required"),$!=null&&$.expiryMonth&&($!=null&&$.expiryYear)&&$.expiryMonth.length<=2&&$.expiryYear.length===4){let Wt=parseInt($.expiryMonth,10),ot=parseInt($.expiryYear,10),Ve=new Date,Yt=Ve.getMonth()+1,Ht=Ve.getFullYear();(ot<Ht||ot===Ht&&Wt<Yt)&&(Q.expiryMonth="Card is expired")}return o(Q),Object.keys(Q).length>0},at=async Q=>{var We,Tt,Qe,rt,ht,qt,Mt,zt,Wt,ot,Ve,Yt,Ht,Dt,Rt,en,tn,nn,un;Q.preventDefault();let $=document.activeElement;if($ instanceof HTMLElement&&$.blur(),!K&&C=="card"){if(Le())return;{let Oe=DatacapWebToken.validateCardNumber(u==null?void 0:u.cardNumber.replaceAll(" ","")),jt=DatacapWebToken.validateExpirationDate(u==null?void 0:u.expiryMonth,u==null?void 0:u.expiryYear),_=DatacapWebToken.validateCVV(u==null?void 0:u.cvv),g={};if(Oe||(g.cardNumber="Invalid card Number"),jt||(g.expiryMonth="Invalid Expiration Date."),_||(g.cvv="Invalid CVV"),o(g),Oe&&_&&jt){U(!0);try{let se=async function(ge){if(ge.Error)Z(ge.Error),U(!1);else{let te=u==null?void 0:u.cardName,Ke=u==null?void 0:u.zipCode;ge.name=te,ge.postal_code=Ke,ge.fractalpayPublicKey=t==null?void 0:t.merchantPublicKey,ge.amount=t==null?void 0:t.amount,ge.order_id=t==null?void 0:t.orderID,ge.preAuth_id=(t==null?void 0:t.preauthId)||"",ge.isCardSave=V,ge.customer_id=t==null?void 0:t.customerId,ge.link_token="",ge.gateway_id=f==null?void 0:f.paymentGateway,ge.discount=t==null?void 0:t.discount,ge.tax=t==null?void 0:t.tax,ge.surcharge=t==null?void 0:t.surcharge,ge.pass_fee=t==null?void 0:t.pass_fee,new Headers().append("Content-Type","application/json");let wt={method:"POST",body:JSON.stringify(ge),redirect:"follow"};It.emit("sendMessage",v(F(v({},wt),{isChargePreauth:!0}),(t==null?void 0:t.sessionToken)&&{sessionToken:t.sessionToken})),It.on("charge-preauth",Ge=>{var ct;(Ge==null?void 0:Ge.status)=="Failed"?(U(!1),Z((Ge==null?void 0:Ge.message)||"Something went wrong. Please try again later.")):(G(!0),dt((ct=Ge==null?void 0:Ge.data)==null?void 0:ct.transaction_id),U(!1),Ce({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}))})}};if((f==null?void 0:f.paymentGateway)===32){let ge={method:"POST",redirect:"follow"};try{let te=await li.post(`${je}api/v1/widget/generate-session`,ge),Ke=Number(u==null?void 0:u.expiryYear)%100,fe=u==null?void 0:u.cardNumber;fe=fe==null?void 0:fe.replace(/\s+/g,"");let wt=`${fe}=${Ke}${u==null?void 0:u.expiryMonth} ${u==null?void 0:u.cvv}`,ct=forge.pki.publicKeyFromPem((Tt=(We=te==null?void 0:te.data)==null?void 0:We.data)==null?void 0:Tt.publicKeyPem).encrypt(wt,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Vt=forge.util.encode64(ct),p={"Content-Type":"application/json","x-app-session-key":(rt=(Qe=te.data)==null?void 0:Qe.data)==null?void 0:rt.session_key},c=JSON.stringify({enc_track2_data:`${Vt}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(qt=(ht=te==null?void 0:te.data)==null?void 0:ht.data)==null?void 0:qt.session_key}`});try{let W=await li.post(`${rn}tokenizer/tokenize`,c,{headers:p}),Se=JSON.stringify(F(v({},(Mt=W==null?void 0:W.data)==null?void 0:Mt.data),{name:u==null?void 0:u.cardName,postal_code:u==null?void 0:u.zipCode,customer_id:t==null?void 0:t.customerId,amount:t==null?void 0:t.amount,Token:`${(Wt=(zt=W==null?void 0:W.data)==null?void 0:zt.data)==null?void 0:Wt.token}`,fractalpayPublicKey:me,order_id:t==null?void 0:t.orderID,preAuth_id:(t==null?void 0:t.preauthId)||"",isCardSave:V,discount:t==null?void 0:t.discount,surcharge:t==null?void 0:t.surcharge,tax:t==null?void 0:t.tax,link_token:"",ExpirationYear:u==null?void 0:u.expiryYear,ExpirationMonth:u==null?void 0:u.expiryMonth,CVV:u==null?void 0:u.cvv,Last4:(Ve=(ot=W==null?void 0:W.data)==null?void 0:ot.data)==null?void 0:Ve.last4,Brand:(Ht=(Yt=W==null?void 0:W.data)==null?void 0:Yt.data)==null?void 0:Ht.brand,gateway_id:f==null?void 0:f.paymentGateway,pass_fee:t==null?void 0:t.pass_fee})),et={method:"POST",headers:{"Content-Type":"application/json"},body:Se,redirect:"follow"};It.emit("sendMessage",v(F(v({},et),{isFractalPreauth:!0}),(t==null?void 0:t.sessionToken)&&{sessionToken:t.sessionToken})),It.on("fractal-charge-preauth",we=>{var tt;(we==null?void 0:we.status)=="Failed"?(U(!1),Z((we==null?void 0:we.message)||"Something went wrong , Try again later")):(dt((tt=we==null?void 0:we.data)==null?void 0:tt.transaction_id),G(!0),U(!1))})}catch(W){console.log(W),U(!1),Z(((Rt=(Dt=W==null?void 0:W.response)==null?void 0:Dt.data)==null?void 0:Rt.message)||(W==null?void 0:W.message)||"Something went wrong , Try again later")}}catch(te){U(!1),Z(((tn=(en=te==null?void 0:te.response)==null?void 0:en.data)==null?void 0:tn.message)||(te==null?void 0:te.message)||"Something went wrong , Try again later")}}else DatacapWebToken.requestToken(f==null?void 0:f.dctoken,"PaymentForm",se)}catch(se){U(!1),Z(((un=(nn=se==null?void 0:se.response)==null?void 0:nn.data)==null?void 0:un.message)||(se==null?void 0:se.message)||"Something went wrong.")}}}}},D=async()=>{var Q,$,We,Tt,Qe,rt,ht,qt,Mt,zt,Wt,ot,Ve,Yt,Ht,Dt,Rt,en,tn,nn,un;Ft();try{let Gt={fractalpayPublicKey:me,customer_id:t==null?void 0:t.customerId,preauth:!0,isReader:!!(t!=null&&t.isReader)},Oe=await li.post(`${Xe}get-payment-details`,Gt);if(N((Q=Oe==null?void 0:Oe.data)==null?void 0:Q.data),(We=($=Oe==null?void 0:Oe.data)==null?void 0:$.data)!=null&&We.paymentGateway||(Re(),Z("Something went wrong.")),(Qe=(Tt=Oe==null?void 0:Oe.data)==null?void 0:Tt.data)!=null&&Qe.card_list&&((qt=(ht=(rt=Oe==null?void 0:Oe.data)==null?void 0:rt.data)==null?void 0:ht.card_list)==null?void 0:qt.length)>0){ee("card"),b((zt=(Mt=Oe==null?void 0:Oe.data)==null?void 0:Mt.data)==null?void 0:zt.card_list),((Ve=(ot=(Wt=Oe==null?void 0:Oe.data)==null?void 0:Wt.data)==null?void 0:ot.card_list)==null?void 0:Ve.length)>0&&Pe("list");let jt=(Dt=(Ht=(Yt=Oe==null?void 0:Oe.data)==null?void 0:Yt.data)==null?void 0:Ht.card_list)==null?void 0:Dt.filter(_=>(_==null?void 0:_.primary_card)==1);jt!=null&&jt[0]&&((Rt=jt==null?void 0:jt[0])==null?void 0:Rt.payment_method_type)==((tn=(en=Oe==null?void 0:Oe.data)==null?void 0:en.data)==null?void 0:tn.paymentGateway)&&P(jt[0])}else ee("card");mt()}catch(Gt){console.log(Gt),mt(),Z(((un=(nn=Gt==null?void 0:Gt.response)==null?void 0:nn.data)==null?void 0:un.message)||(Gt==null?void 0:Gt.message)||"Something went wrong")}},St=async Q=>{var Ve,Yt,Ht,Dt,Rt,en,tn;if(Q.currentTarget.blur(),K)return;let $=t==null?void 0:t.customerId,We=t==null?void 0:t.discount,Tt=t==null?void 0:t.surcharge,Qe=t==null?void 0:t.tax,rt=t==null?void 0:t.merchantPublicKey,ht=t==null?void 0:t.orderID,qt=t==null?void 0:t.amount,Mt=k==null?void 0:k.id,zt=k==null?void 0:k.card_type,Wt=(t==null?void 0:t.preauthId)||"";if(rt&&ht&&qt)if($)if(Mt){let nn={amount:qt,order_id:ht,customer_id:$,card_id:Mt,fractalpayPublicKey:rt,isCardSave:zt!="Bank",discount:We,surcharge:Tt,tax:Qe,preAuth_id:Wt},ot=nn,{isCardSave:un}=ot,Gt=Un(ot,["isCardSave"]),jt=Xe+"authorize-by-card",_=v({"Content-Type":"application/json"},(t==null?void 0:t.sessionToken)&&{"X-Session-Token":t.sessionToken});U(!0);try{let g=await li.post(jt,zt=="Bank"?Gt:nn,{headers:_});(Ve=g==null?void 0:g.data)!=null&&Ve.result&&(dt((Ht=(Yt=g==null?void 0:g.data)==null?void 0:Yt.data)==null?void 0:Ht.transaction_id),G(!0),U(!1))}catch(g){U(!1),console.log(g),Z(((Rt=(Dt=g==null?void 0:g.response)==null?void 0:Dt.data)==null?void 0:Rt.message)||((tn=(en=g==null?void 0:g.response)==null?void 0:en.data)==null?void 0:tn.status)||"Something went erong")}}else Z("Please Select A Card/ACH");else Z("Please Select Customer");else Z("Something went wrong.")};Ki(()=>{oe&&me&&D()},[me,oe]);let Ze=async Q=>{Zi.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 $=>{if($.isConfirmed){U(!0);try{let We={card_id:Q,customer_id:t==null?void 0:t.customerId,fractalpayPublicKey:t==null?void 0:t.merchantPublicKey},Tt=await li.post(`${Xe}delete-customer-card`,We);U(!1),D(),Zi.fire({icon:"success",title:"Deleted!",text:"The card has been deleted.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}catch(We){U(!1),Zi.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}})},_t=Q=>{switch(Q==null?void 0:Q.toLowerCase()){case"visa":return Me;case"mastercard":case"mc":case"m/c":return Fe;case"amex":case"american express":case"ae":return ce;case"discover":case"dcvr":return Ye;case"bank":return Ut;default:return Q}},S=Q=>{ee(Q)},bn=async Q=>{var rt,ht,qt,Mt,zt,Wt;if(Q.currentTarget.blur(),K)return;let $=t==null?void 0:t.merchantPublicKey,We=t==null?void 0:t.orderID,Tt=String(t==null?void 0:t.amount),Qe=t==null?void 0:t.customerId;if(!(ke!=null&&ke.device_id)){Z("Please Select A Payment Device");return}if($&&We&&Tt){U(!0);let ot={amount:Tt,fractalpayPublicKey:$,customer_order_id:We,device_id:ke==null?void 0:ke.device_id,customer_id:Qe||"",is_auth:!0};try{let Ve=await li.post(`${Xe}charge-with-reader`,ot);((rt=Ve==null?void 0:Ve.data)==null?void 0:rt.result)==!0?(dt((qt=(ht=Ve==null?void 0:Ve.data)==null?void 0:ht.data)==null?void 0:qt.transaction_id),G(!0),U(!1)):(Z(((Mt=Ve==null?void 0:Ve.data)==null?void 0:Mt.message)||"Something went wrong."),U(!1))}catch(Ve){Z(((Wt=(zt=Ve==null?void 0:Ve.response)==null?void 0:zt.data)==null?void 0:Wt.message)||"Something went wrong."),U(!1)}}else Z("Something went wrong.")},Pt=Q=>{_e==="card"?St(Q):_e==="reader"&&bn(Q)};return m.createElement(m.Fragment,null,m.createElement(Cn,null),m.createElement(Xn,null),m.createElement(Kn,null),m.createElement(m.Fragment,null,e&&m.createElement("button",{className:"paymentBtn",onClick:ze},"PreAuth Payment"),m.createElement(yn,{open:oe,onClose:Re},ve&&m.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},m.createElement(Fn,{error:ve,onClose:Re})),A&&m.createElement(Dn,{onClose:Re,tranId:$e}),!ve&&!A&&m.createElement(m.Fragment,null,(B||K)&&m.createElement(an,{loading:B||K}),m.createElement("div",null,m.createElement("div",{className:"frac-card-payment-page frac-form"},m.createElement("div",{className:"parent-pay-container"},m.createElement("span",{className:"request-payment-close-popup",onClick:Re},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},m.createElement("g",{clipPath:"url(#clip0_12425_52336)"},m.createElement("path",{d:"M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z",fill:"#727272"})),m.createElement("defs",null,m.createElement("clipPath",{id:"clip0_12425_52336"},m.createElement("rect",{width:"16",height:"16",fill:"white"}))))),m.createElement("div",{className:"pay-container"},m.createElement("div",{className:"pay-header pay-conatiner-one"},m.createElement("div",{className:"pay-conatiner-one-first"},m.createElement("div",{className:"pay-logo-container"},m.createElement("div",{className:"pay-main-logo"},m.createElement("img",{src:f==null?void 0:f.logo,id:"pay-logos"}))),m.createElement("div",{className:"amt-pay-con"},m.createElement("div",{className:"pay-amount-conatiner"},m.createElement("small",{className:"pay-payment-amount"},"Select paymet type")),m.createElement("div",{className:"frac-card-bank-radio-main"},m.createElement(Nn,{label:"Card",amount:(ft=Number(t==null?void 0:t.amount))==null?void 0:ft.toFixed(2),value:"card",onChange:S,activetab:C}),(t==null?void 0:t.isReader)&&(f==null?void 0:f.paymentDeviceList)&&((cn=f==null?void 0:f.paymentDeviceList)==null?void 0:cn.length)>0&&m.createElement(Nn,{label:"Reader",amount:(vt=Number(t==null?void 0:t.amount))==null?void 0:vt.toFixed(2),value:"reader",onChange:S,activetab:C})))),m.createElement("div",{className:"pay-conatiner-one-last"},m.createElement("img",{src:h,alt:""}),m.createElement("img",{src:L,alt:""}),"Secure payments powered by Fractal"),m.createElement("div",null)),!B&&m.createElement("div",{className:"pay-tab pay-conatiner-two"},m.createElement("div",{className:"col-md-12"},m.createElement("div",{id:"payment-form-div"},C!=="cardList"?m.createElement("div",null,m.createElement("div",{className:""},m.createElement("div",{className:"res-pay-con"},m.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},m.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),m.createElement("strong",{className:"pay-amount"},be((Yn=Number(t==null?void 0:t.amount))==null?void 0:Yn.toFixed(2)))),m.createElement("div",null,m.createElement("div",null,m.createElement("img",{src:Me,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Fe,width:35,alt:""})),m.createElement("div",null,m.createElement("img",{src:ce,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Ye,width:35,alt:""})))),O&&O>0&&m.createElement("div",{className:"res-pay-con frac-cash-discount"},m.createElement("div",{className:"frac-cashlabel"},In(f==null?void 0:f.showSurcharge)?"Surcharge":"Cash Discount"),m.createElement("div",null,be(O.toFixed(2)))))):m.createElement("div",null,m.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",f==null?void 0:f.customer_name),m.createElement("div",{className:"res-pay-con"},m.createElement("div",{className:"pay-amount-conatiner",style:{margin:0}},m.createElement("small",{className:"pay-payment-amount"},"Payment Amount"),m.createElement("strong",{className:"pay-amount"},be((Ln=Number(t==null?void 0:t.amount))==null?void 0:Ln.toFixed(2)))),m.createElement("div",null,m.createElement("div",null,m.createElement("img",{src:Me,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Fe,width:35,alt:""})),m.createElement("div",null,m.createElement("img",{src:ce,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Ye,width:35,alt:""})))),m.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," Cards")),m.createElement("div",{id:"card",style:{display:C==="card"?"block":"none"},className:"tabcontent"},m.createElement("div",{className:"frac-card-payment"},m.createElement("div",{className:"frac-heading-card-wrap"},m.createElement("div",{className:"frac-backarrow"},(r==null?void 0:r.length)>0&&Te==="form"&&m.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Pe("list")}," ",m.createElement(sr,null)),O&&O>0&&m.createElement("div",{className:"res-pay-con frac-cash-discount"},m.createElement("div",{className:"frac-cashlabel"},In(f==null?void 0:f.showSurcharge)?"Surcharge":"Cash Discount"),m.createElement("div",null,be(O.toFixed(2))))),m.createElement("h6",{className:"frac-card-payment-heading"},"Card Authorization")),C!="ach"&&m.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},m.createElement("img",{src:Me,alt:"",width:33}),m.createElement("img",{src:Fe,width:33,alt:""}),m.createElement("img",{src:ce,alt:"",width:33}),m.createElement("img",{src:Ye,width:33,alt:""}))),Te==="list"?m.createElement(m.Fragment,null,m.createElement(Bn,{listHeading:"Cards",paymentGateway:f==null?void 0:f.paymentGateway,ListItems:r,selectedCard:k,setSelectedCard:P,handleDeleteCard:Ze,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{Pe("form")}}),m.createElement("div",{className:"form-group",style:{padding:"0"}},m.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Pt},be((Ct=Number(t==null?void 0:t.amount))==null?void 0:Ct.toFixed(2))))):m.createElement("div",{id:"card",style:{display:C==="card"?"block":"none"},className:"tabcontent"},m.createElement("form",{id:"PaymentForm",onSubmit:at,onKeyDown:Q=>{Q.key==="Enter"&&K&&(Q.preventDefault(),Q.stopPropagation())}},m.createElement("div",{className:"ach-scrl",style:{minHeight:(r==null?void 0:r.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"cardHolderName"},"Name on Card"),m.createElement("input",{type:"text",className:"form-control",placeholder:"John Doe",value:(u==null?void 0:u.cardName)||"",onChange:Q=>{let $=Q.target.value;/^[a-zA-Z\s]*$/.test($)&&ue("cardName",$)}}),(a==null?void 0:a.cardName)&&m.createElement("span",{className:"error-span"},a==null?void 0:a.cardName)),m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"cardNumber"},"Card Number"),m.createElement("div",{className:"toggle-num-wrapper"},m.createElement("input",{className:"form-control card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(u==null?void 0:u.cardNumber)||"",onChange:Q=>E(Q),"data-token":"card_number"}),m.createElement("div",{className:"card-crdi card-expiry-new"},m.createElement("div",{className:"exp-date-year-container"},m.createElement("div",{className:"exp-date form-group"},m.createElement("input",{"data-token":"exp_month",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(u==null?void 0:u.expiryMonth)||"",onChange:Q=>ue("expiryMonth",Q.target.value)})),m.createElement("div",{className:"exp-year form-group"},m.createElement("input",{"data-token":"exp_year",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(u==null?void 0:u.expiryYear)||"",onChange:Q=>ue("expiryYear",Q.target.value)})),m.createElement("div",{className:"security-digit form-group"},m.createElement("input",{"data-token":"cvv",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(u==null?void 0:u.cvv)||"",onChange:Q=>ue("cvv",Q.target.value)})))),(a==null?void 0:a.cardNumber)&&m.createElement("span",{className:"error-span"},a==null?void 0:a.cardNumber),m.createElement("p",{style:{margin:"0"}},a!=null&&a.expiryMonth||a!=null&&a.expiryYear?m.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},a==null?void 0:a.expiryMonth):"",(a==null?void 0:a.cvv)&&m.createElement("span",{className:"error-span"},a==null?void 0:a.cvv)))),m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),m.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"Enter Order id",disabled:!0,value:t==null?void 0:t.orderID,onChange:Q=>ue("orderId",Q.target.value),style:{background:"#F6F6F7",color:"#727272"}})),m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"zip"},"ZIP"),m.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(An=u==null?void 0:u.zipCode)!=null?An:"",onChange:Q=>ue("zipCode",Q.target.value)}),(a==null?void 0:a.zipCode)&&m.createElement("span",{className:"error-span"},a==null?void 0:a.zipCode)),(t==null?void 0:t.customerId)&&m.createElement("div",{className:"form-group"},m.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},m.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:V,onChange:Q=>y(Q.target.checked)}),m.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),m.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),m.createElement("div",{className:"frac-tooltip-wrapper"},m.createElement("div",{className:"frac-tooltip-icon"},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},m.createElement("g",{clipPath:"url(#clip0_12420_50192)"},m.createElement("rect",{width:"20",height:"20",fill:"white"}),m.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),m.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"})),m.createElement("defs",null,m.createElement("clipPath",{id:"clip0_12420_50192"},m.createElement("rect",{width:"20",height:"20",fill:"white"}))))),m.createElement("div",{className:"frac-tooltip-text"},m.createElement("p",null,"If checked, I agree to give the ",m.createElement("b",null,(f==null?void 0:f.bname)||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),m.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:0}},m.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},be((Sn=Number(t==null?void 0:t.amount))==null?void 0:Sn.toFixed(2))))))),m.createElement("div",{id:"reader",style:{display:C==="reader"?"block":"none"},className:"tabcontent"},m.createElement("div",{className:"frac-card-payment"},m.createElement("div",{className:"frac-heading-card-wrap"},m.createElement("div",{className:"frac-backarrow"},O&&O>0&&m.createElement("div",{className:"res-pay-con frac-cash-discount"},m.createElement("div",{className:"frac-cashlabel"},In(f==null?void 0:f.showSurcharge)?"Surcharge":"Cash Discount"),m.createElement("div",null,be(O.toFixed(2))))),m.createElement("h6",{className:"frac-card-payment-heading"},"Reader Authorization"))),m.createElement(Bi,{listHeading:"Reader",ListItems:f==null?void 0:f.paymentDeviceList,selectedPax:ke,setSlectedPax:ut}),m.createElement("button",{onClick:bn,className:"pay-button"},"$",(_n=Number(t==null?void 0:t.amount))==null?void 0:_n.toFixed(2))))))))))))))}import Ne,{useEffect as ur,useRef as vi,useState as Rn}from"react";import gr from"sweetalert2";import Ci from"axios";import dr from"react";function Wi(){let e="#000",t="#fff",H="#212529",T="#dee2e6";return dr.createElement("style",null,`
|
|
1734
|
-
.add-card {
|
|
1735
|
-
max-width:380px;
|
|
1736
|
-
padding: 0 20px
|
|
1737
|
-
}
|
|
1738
|
-
.add-card .form-group {
|
|
1739
|
-
margin-bottom: 5px;
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
.add-card .idle-green-btn {
|
|
1743
|
-
color: white;
|
|
1744
|
-
background-color: rgba(97, 198, 153, 1);
|
|
1745
|
-
border-radius: 100px;
|
|
1746
|
-
border: none !important;
|
|
1747
|
-
padding: 12px 24px 12px 24px;
|
|
1748
|
-
width: 100%;
|
|
1749
|
-
cursor:pointer
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
.add-card .idle-green-btn:hover {
|
|
1753
|
-
background-color: rgba(65, 164, 120, 1) !important;
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
.add-card .idle-green-btn:focus {
|
|
1757
|
-
border: 2px solid rgba(90, 172, 136, 1) !important;
|
|
1758
|
-
background-color: rgba(97, 198, 153, 1) !important;
|
|
1759
|
-
padding: 10px 24px 10px 24px;
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
|
-
.add-card .container-creditcard {
|
|
1763
|
-
width: 426px;
|
|
1764
|
-
padding: 24px;
|
|
1765
|
-
background-color: #FFFFFF;
|
|
1766
|
-
border-radius: 24px;
|
|
1767
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
1768
|
-
}
|
|
1769
|
-
.add-card .container-creditcard .request-payment-close-popup{
|
|
1770
|
-
position:absolute;
|
|
1771
|
-
// background:red
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
.add-card h2 {
|
|
1775
|
-
font-size: 24px;
|
|
1776
|
-
line-height: 32px;
|
|
1777
|
-
font-weight: 500;
|
|
1778
|
-
color: #35254D;
|
|
1779
|
-
margin-bottom: 24px;
|
|
1780
|
-
text-align: center;
|
|
1781
|
-
}
|
|
1782
|
-
.add-card .form-group {
|
|
1783
|
-
margin-top: 20px;
|
|
1784
|
-
margin-bottom : 10px
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
.add-card .credit-card {
|
|
1788
|
-
display: flex;
|
|
1789
|
-
flex-direction: column;
|
|
1790
|
-
justify-content: space-between;
|
|
1791
|
-
align-items: flex-start;
|
|
1792
|
-
padding: 20px;
|
|
1793
|
-
background-color: #35254D;
|
|
1794
|
-
color: #FFFFFF;
|
|
1795
|
-
border-radius: 15px;
|
|
1796
|
-
margin-bottom: 20px;
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
|
-
.add-card .credit-card .chip {
|
|
1800
|
-
width: 50px;
|
|
1801
|
-
height: 30px;
|
|
1802
|
-
background-image: url('https://raw.githubusercontent.com/danieldasilvaa/creditcard-html-css/main/chip.png');
|
|
1803
|
-
background-size: cover;
|
|
1804
|
-
margin-bottom: 10px;
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
.add-card .credit-card .card-number {
|
|
1808
|
-
font-size: 18px;
|
|
1809
|
-
letter-spacing: 2px;
|
|
1810
|
-
margin-bottom: 10px;
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
.add-card .credit-card .card-info {
|
|
1814
|
-
font-size: 14px;
|
|
1815
|
-
margin-bottom: 5px;
|
|
1816
|
-
}
|
|
1817
|
-
|
|
1818
|
-
.add-card label {
|
|
1819
|
-
font-size: 12px;
|
|
1820
|
-
font-family: 'IBM Plex Mono', monospace;
|
|
1821
|
-
font-weight: 400;
|
|
1822
|
-
text-transform: uppercase;
|
|
1823
|
-
color: #35254D;
|
|
1824
|
-
margin-bottom: 6px;
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
.add-card input[type="text"],
|
|
1828
|
-
.add-card input[type="number"],
|
|
1829
|
-
.add-card input[type="date"],
|
|
1830
|
-
.add-card input[type="email"],
|
|
1831
|
-
.add-card select {
|
|
1832
|
-
width: 100%;
|
|
1833
|
-
padding: 12px;
|
|
1834
|
-
font-size: 14px;
|
|
1835
|
-
font-weight: 500;
|
|
1836
|
-
color: #35254D;
|
|
1837
|
-
border: 1px solid #D4CDDF;
|
|
1838
|
-
border-radius: 6px;
|
|
1839
|
-
background-color: #FFFFFF;
|
|
1840
|
-
box-sizing: border-box;
|
|
1841
|
-
// margin-bottom: 20px;
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
.add-card input[type="text"]::placeholder {
|
|
1845
|
-
color: #867C94;
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
// .add-card input[type="submit"] {
|
|
1849
|
-
// width: 100%;
|
|
1850
|
-
// padding: 12px;
|
|
1851
|
-
// background-color: #161616;
|
|
1852
|
-
// color: #FFFFFF;
|
|
1853
|
-
// font-size: 14px;
|
|
1854
|
-
// font-weight: 500;
|
|
1855
|
-
// border: none;
|
|
1856
|
-
// border-radius: 1000px;
|
|
1857
|
-
// cursor: pointer;
|
|
1858
|
-
// text-align: center;
|
|
1859
|
-
// }
|
|
1860
|
-
|
|
1861
|
-
.add-card input[type="submit"]:hover {
|
|
1862
|
-
background-color: #000000;
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
.add-card .error {
|
|
1866
|
-
font-size: 12px;
|
|
1867
|
-
color: red;
|
|
1868
|
-
margin-top: -15px;
|
|
1869
|
-
margin-bottom: 15px;
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
/* Tab Styling */
|
|
1873
|
-
.add-card .tabs {
|
|
1874
|
-
display: flex;
|
|
1875
|
-
gap: 4px;
|
|
1876
|
-
margin-bottom: 24px;
|
|
1877
|
-
justify-content: center;
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
.add-card .tab {
|
|
1881
|
-
display: flex;
|
|
1882
|
-
justify-content: center;
|
|
1883
|
-
align-items: center;
|
|
1884
|
-
padding: 6px 16px;
|
|
1885
|
-
font-size: 14px;
|
|
1886
|
-
font-weight: 500;
|
|
1887
|
-
border: 1px solid #D4CDDF;
|
|
1888
|
-
border-radius: 1000px;
|
|
1889
|
-
cursor: pointer;
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
.add-card .tab.active {
|
|
1893
|
-
border-color: #35254D;
|
|
1894
|
-
color: #35254D;
|
|
1895
|
-
}
|
|
1896
|
-
|
|
1897
|
-
.add-card .tab:hover {
|
|
1898
|
-
border-color: #867C94;
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
/* Buttons */
|
|
1902
|
-
.add-card .button-close {
|
|
1903
|
-
display: inline-block;
|
|
1904
|
-
background-color: #161616;
|
|
1905
|
-
color: #FFFFFF;
|
|
1906
|
-
font-size: 14px;
|
|
1907
|
-
font-weight: 500;
|
|
1908
|
-
padding: 12px 32px;
|
|
1909
|
-
border-radius: 1000px;
|
|
1910
|
-
text-align: center;
|
|
1911
|
-
cursor: pointer;
|
|
1912
|
-
width: 48%;
|
|
1913
|
-
box-sizing: border-box;
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
.add-card .button-close:hover {
|
|
1917
|
-
background-color: #000000;
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
.add-card .btn-add1 {
|
|
1921
|
-
display: inline-block;
|
|
1922
|
-
background-color: #61c699;
|
|
1923
|
-
color: #FFFFFF;
|
|
1924
|
-
font-size: 14px;
|
|
1925
|
-
font-weight: 500;
|
|
1926
|
-
padding: 12px 32px;
|
|
1927
|
-
border-radius: 1000px;
|
|
1928
|
-
text-align: center;
|
|
1929
|
-
cursor: pointer;
|
|
1930
|
-
width: 48%;
|
|
1931
|
-
box-sizing: border-box;
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
|
-
.add-card .btn-add1:hover {
|
|
1935
|
-
background-color: #B5E1CB;
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
/* Combined Expiration Date and CVC Row */
|
|
1939
|
-
.add-card .exp-cvc-container {
|
|
1940
|
-
display: flex;
|
|
1941
|
-
justify-content: space-between;
|
|
1942
|
-
gap: 16px;
|
|
1943
|
-
margin-bottom: 5px;
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
.add-card .exp-cvc-container input {
|
|
1947
|
-
flex: 1;
|
|
1948
|
-
padding: 12px;
|
|
1949
|
-
font-size: 14px;
|
|
1950
|
-
font-weight: 500;
|
|
1951
|
-
color: #35254D;
|
|
1952
|
-
border: 1px solid #D4CDDF;
|
|
1953
|
-
border-radius: 6px;
|
|
1954
|
-
background-color: #FFFFFF;
|
|
1955
|
-
box-sizing: border-box;
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
.add-card .exp-cvc-container input::placeholder {
|
|
1959
|
-
color: #867C94;
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
.card-scrl {
|
|
1963
|
-
overflow-y: auto;
|
|
1964
|
-
padding-right: 6px !important;
|
|
1965
|
-
}
|
|
1966
|
-
.card-scrl::-webkit-scrollbar {
|
|
1967
|
-
width: 3px;
|
|
1968
|
-
background-color: #F5F5F5;
|
|
1969
|
-
}
|
|
1970
|
-
.card-scrl::-webkit-scrollbar-thumb {
|
|
1971
|
-
background-color: #35254D;
|
|
1972
|
-
}
|
|
1973
|
-
|
|
1974
|
-
.custom-z-index {
|
|
1975
|
-
z-index: 9999 !important;
|
|
1976
|
-
}
|
|
1977
|
-
#add-credit-card-panel{
|
|
1978
|
-
padding: auto 10px !important}
|
|
1979
|
-
/* Responsive Design */
|
|
1980
|
-
@media screen and (max-width: 768px) {
|
|
1981
|
-
.add-card .container-creditcard {
|
|
1982
|
-
width: 90%;
|
|
1983
|
-
padding: 20px;
|
|
1984
|
-
}
|
|
1985
|
-
|
|
1986
|
-
.add-card input[type="submit"] {
|
|
1987
|
-
font-size: 12px;
|
|
1988
|
-
padding: 10px;
|
|
1989
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
|
|
1992
|
-
`)}import qn from"react";import mr from"react";function Gi(){return mr.createElement("style",null,`
|
|
1993
|
-
.card-success .logo-container {
|
|
1994
|
-
display: flex;
|
|
1995
|
-
justify-content: center;
|
|
1996
|
-
align-items: center;
|
|
1997
|
-
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1998
|
-
z-index: 10;
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
.card-success .client-logo {
|
|
2002
|
-
max-width: 100px;
|
|
2003
|
-
height: auto;
|
|
2004
|
-
object-fit: contain;
|
|
2005
|
-
display: block;
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
.card-success .payment-success-container {
|
|
2009
|
-
display: flex;
|
|
2010
|
-
flex-direction: column;
|
|
2011
|
-
align-items: center;
|
|
2012
|
-
padding: 18px 20px 24px;
|
|
2013
|
-
width: 335px;
|
|
2014
|
-
height: 400px; /* Fixed height */
|
|
2015
|
-
background: #FFFFFF;
|
|
2016
|
-
border-radius: 12px;
|
|
2017
|
-
position: relative;
|
|
2018
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
2019
|
-
border: 1px solid #e3e3e3;
|
|
2020
|
-
justify-content: center;
|
|
2021
|
-
text-align: center;
|
|
2022
|
-
// margin-top: 50px; /* Adjust this to move the content down */
|
|
2023
|
-
margin: 50px auto 0 auto !important;
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
.card-success .success-icon {
|
|
2027
|
-
display: flex;
|
|
2028
|
-
flex-direction: column;
|
|
2029
|
-
align-items: center;
|
|
2030
|
-
gap: 12px;
|
|
2031
|
-
width: 227px;
|
|
2032
|
-
height: 116px;
|
|
2033
|
-
z-index: 2;
|
|
2034
|
-
}
|
|
2035
|
-
|
|
2036
|
-
.card-success .circle {
|
|
2037
|
-
width: 40px;
|
|
2038
|
-
height: 40px;
|
|
2039
|
-
border: 1px solid #49B182;
|
|
2040
|
-
border-radius: 50%;
|
|
2041
|
-
display: flex;
|
|
2042
|
-
justify-content: center;
|
|
2043
|
-
align-items: center;
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
.card-success .circle .fa-check-circle {
|
|
2047
|
-
font-size: 20px;
|
|
2048
|
-
color: #49B182;
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
.card-success .success-text {
|
|
2052
|
-
display: flex;
|
|
2053
|
-
flex-direction: column;
|
|
2054
|
-
justify-content: center;
|
|
2055
|
-
align-items: center;
|
|
2056
|
-
gap: 4px;
|
|
2057
|
-
width: 227px;
|
|
2058
|
-
}
|
|
2059
|
-
|
|
2060
|
-
.card-success .payment-success-text {
|
|
2061
|
-
font-family: 'Inter', sans-serif;
|
|
2062
|
-
font-weight: 500;
|
|
2063
|
-
font-size: 18px;
|
|
2064
|
-
line-height: 21px;
|
|
2065
|
-
text-align: center;
|
|
2066
|
-
letter-spacing: -0.02em;
|
|
2067
|
-
color: #161616;
|
|
2068
|
-
}
|
|
2069
|
-
|
|
2070
|
-
.card-success .thank-you-text {
|
|
2071
|
-
font-family: 'Inter', sans-serif;
|
|
2072
|
-
font-weight: 500;
|
|
2073
|
-
font-size: 14px;
|
|
2074
|
-
line-height: 18px;
|
|
2075
|
-
text-align: center;
|
|
2076
|
-
letter-spacing: -0.02em;
|
|
2077
|
-
color: #161616;
|
|
2078
|
-
opacity: 0.5;
|
|
2079
|
-
}
|
|
2080
|
-
`)}var cr=({onClose:e})=>qn.createElement(qn.Fragment,null,qn.createElement(Gi,null),qn.createElement("div",{className:"card-success"},qn.createElement("div",{className:"payment-success-container"},qn.createElement("div",{className:"success-icon"},qn.createElement("div",{className:"circle"},qn.createElement("i",{className:"fa fa-check-circle","aria-hidden":"true"})),qn.createElement("div",{className:"success-text"},qn.createElement("div",{className:"payment-success-text"},"Your card was added successfully."),qn.createElement("div",{className:"thank-you-text"},"Thank you ")))))),va=cr;function pr(e){var Ut;let[t,H]=Rn(!1),[T,B]=Rn(!1),[Y,K]=Rn(""),[U,ve]=Rn(!1),Z=vi(null),A=vi(null),G=vi(null),oe=vi(null),w=vi(null),[C,ee]=Rn(),[V,y]=Rn({}),[_e,M]=Rn(),Te=()=>H(!0),Pe=()=>H(!1),me=h=>{gr.fire({icon:"error",text:h,customClass:{popup:"custom-z-index"}})},ke=()=>{ve(!1),B(!1),K(""),ee({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""})},ut=()=>ve(!0),Fe=()=>{ke()},Me=(h,L)=>{var a,o,r;let u=h,Ce=["expiryMonth","expiryYear","zipCode","cvv"];if(u==="expiryMonth"&&(L==null?void 0:L.length)===2&&((a=G==null?void 0:G.current)==null||a.focus()),u==="expiryYear"&&(L==null?void 0:L.length)===4&&((o=oe==null?void 0:oe.current)==null||o.focus()),u==="cvv"&&(L==null?void 0:L.length)===3&&((r=w==null?void 0:w.current)==null||r.focus()),Ce.includes(u)){(L===""||/^[0-9]+$/.test(L))&&(y(b=>F(v({},b),{[u]:""})),ee(b=>F(v({},b),{[u]:L})));return}y(b=>F(v({},b),{[u]:""})),console.log(L,u),ee(b=>F(v({},b),{[u]:L}))},ce=h=>{var o,r;let L=h.target,u=L.value.replace(/\D/g,""),{formatted:Ce,cursor:a}=Pn(L.value,(o=L.selectionStart)!=null?o:0);y(b=>F(v({},b),{cardNumber:""})),ee(b=>F(v({},b),{cardNumber:Ce})),console.log(u==null?void 0:u.length,"length"),(u==null?void 0:u.length)===16&&((r=A==null?void 0:A.current)==null||r.focus()),requestAnimationFrame(()=>{L.setSelectionRange(a,a)})},Ye=()=>{var a,o,r,b,k,P;let h={},L=C,u=parseInt((L==null?void 0:L.expiryMonth)||"",10),Ce=(L==null?void 0:L.expiryYear)||"";if((a=L==null?void 0:L.cardName)!=null&&a.trim()||(h.cardName="Card name is required"),(o=L==null?void 0:L.cardNumber)!=null&&o.trim()||(h.cardNumber="Card number is required"),(r=L==null?void 0:L.expiryMonth)!=null&&r.trim()?(Number(L==null?void 0:L.expiryMonth)>12||Number(L==null?void 0:L.expiryMonth)<1)&&(h.expiryMonth="Invalid Expiration Month."):h.expiryMonth="Expiration month is required",(b=L==null?void 0:L.expiryYear)!=null&&b.trim()?((k=L==null?void 0:L.expiryYear)==null?void 0:k.trim().length)!==4||Number(L==null?void 0:L.expiryYear)<2025?h.expiryYear="Invalid Expiration Year.":(isNaN(u)||u<1||u>12||Ce.length!==4)&&(h.expiryMonth="Invalid Expiration Date."):h.expiryYear="Expiration year is required",(P=L==null?void 0:L.cvv)!=null&&P.trim()||(h.cvv="CVC is required"),L!=null&&L.expiryMonth&&(L!=null&&L.expiryYear)&&L.expiryMonth.length<=2&&L.expiryYear.length===4){let O=parseInt(L.expiryMonth,10),x=parseInt(L.expiryYear,10),f=new Date,N=f.getMonth()+1,$e=f.getFullYear();(x<$e||x===$e&&O<N)&&(h.expiryMonth="Card is expired")}return y(h),Object.keys(h).length>0},Je=async()=>{var h,L,u;Te();try{let Ce={fractalpayPublicKey:e==null?void 0:e.merchantPublicKey,customer_id:e==null?void 0:e.customerId,addcard:!0},a=await Ci.post(`${Xe}get-payment-details`,Ce);console.log(a),M((h=a==null?void 0:a.data)==null?void 0:h.data),(u=(L=a==null?void 0:a.data)==null?void 0:L.data)!=null&&u.paymentGateway||(ke(),K("Something went wrong.")),Pe()}catch(Ce){console.log(Ce),Pe(),ke(),K("Something went wrong.")}};return ur(()=>{e!=null&&e.merchantPublicKey&&Je()},[e==null?void 0:e.merchantPublicKey]),Ne.createElement(Ne.Fragment,null,Ne.createElement(Cn,null),Ne.createElement(Wi,null),Ne.createElement(an,{loading:t}),Y&&Ne.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},Ne.createElement(Fn,{error:Y,onClose:ke})),T&&Ne.createElement(va,{onClose:Fe}),!Y&&!T&&Ne.createElement(Ne.Fragment,null,Ne.createElement("div",{className:"container-creditcard add-card modal-content",id:"add-credit-card-panel",style:{margin:"auto"}},Ne.createElement("form",{id:"creditCardForm",onSubmit:async h=>{var Ce,a,o,r,b,k,P,O,x,f,N,$e,dt,Ee,Ft,mt;h.preventDefault(),h.currentTarget.blur();let L=document.activeElement;if(L instanceof HTMLElement&&L.blur(),t)return;let u=Ye();if(console.log(C),!u){let Re=DatacapWebToken.validateCardNumber(C==null?void 0:C.cardNumber.replaceAll(" ","")),ze=DatacapWebToken.validateExpirationDate(C==null?void 0:C.expiryMonth,C==null?void 0:C.expiryYear),ue=DatacapWebToken.validateCVV(C==null?void 0:C.cvv),E={};if(Re||(E.cardNumber="Invalid card Number"),ze||(E.expiryMonth="Invalid Expiration Date."),ue||(E.cvv="Invalid CVV"),y(E),Re&&ue&&ze){Te();try{let Le=async function(at){var D,St,Ze;if(console.log(at),at.Error)console.log(at==null?void 0:at.Error),K(at.Error),Pe();else{let _t={userId:e==null?void 0:e.customerId,cardName:C==null?void 0:C.cardName,zip:C==null?void 0:C.zipCode,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey,token:at};try{let S=await Ci.post(`${Xe}add-card`,_t);console.log(S),(D=S==null?void 0:S.data)!=null&&D.result&&(B(!0),Pe(),ee({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),Wn(h,"close",""))}catch(S){console.log(S),Pe(),K(((Ze=(St=S==null?void 0:S.response)==null?void 0:St.data)==null?void 0:Ze.message)||(S==null?void 0:S.message)||"Something went wrong.")}}};if((_e==null?void 0:_e.paymentGateway)===32){let at={method:"POST",redirect:"follow"};try{let D=await Ci.post(`${je}api/v1/widget/generate-session`,at),St=Number(C==null?void 0:C.expiryYear)%100,Ze=C==null?void 0:C.cardNumber;Ze=Ze==null?void 0:Ze.replace(/\s+/g,"");let _t=`${Ze}=${St}${C==null?void 0:C.expiryMonth} ${C==null?void 0:C.cvv}`,bn=forge.pki.publicKeyFromPem((a=(Ce=D==null?void 0:D.data)==null?void 0:Ce.data)==null?void 0:a.publicKeyPem).encrypt(_t,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Pt=forge.util.encode64(bn),ft={"Content-Type":"application/json","x-app-session-key":(r=(o=D.data)==null?void 0:o.data)==null?void 0:r.session_key},cn=JSON.stringify({enc_track2_data:`${Pt}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(k=(b=D==null?void 0:D.data)==null?void 0:b.data)==null?void 0:k.session_key}`});try{let vt=await Ci.post(`${rn}tokenizer/tokenize`,cn,{headers:ft}),Yn=JSON.stringify(F(v({},(P=vt==null?void 0:vt.data)==null?void 0:P.data),{cvv:C==null?void 0:C.cvv,cardName:C==null?void 0:C.cardName,zip:C==null?void 0:C.zipCode,userId:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey})),Ln={"Content-Type":"application/json"};try{let Ct=await Ci.post(`${Xe}add-card`,Yn,{headers:Ln});console.log(Ct),(O=Ct==null?void 0:Ct.data)!=null&&O.result&&(B(!0),Pe(),Wn(h,"close",""))}catch(Ct){Pe(),K(((f=(x=Ct==null?void 0:Ct.response)==null?void 0:x.data)==null?void 0:f.message)||(Ct==null?void 0:Ct.message)||"Something went wrong.")}}catch(vt){Pe(),K((($e=(N=vt==null?void 0:vt.response)==null?void 0:N.data)==null?void 0:$e.message)||(vt==null?void 0:vt.message)||"Something went wrong.")}}catch(D){Pe(),K(((Ee=(dt=D==null?void 0:D.response)==null?void 0:dt.data)==null?void 0:Ee.message)||(D==null?void 0:D.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(_e==null?void 0:_e.dctoken,"creditCardForm",Le)}catch(Le){Pe(),K(((mt=(Ft=Le==null?void 0:Le.response)==null?void 0:Ft.data)==null?void 0:mt.message)||(Le==null?void 0:Le.message)||"Something went wrong.")}}}},onKeyDown:h=>{h.key==="Enter"&&t&&(h.preventDefault(),h.stopPropagation())},style:{padding:"0 10px"}},Ne.createElement("div",{style:{maxHeight:"350px",minHeight:"0"},className:"card-scrl"},Ne.createElement("div",{className:"form-group",style:{marginTop:"0",marginBottom:"10px"}},Ne.createElement("label",{htmlFor:"cardNumber"},"Card Number"),Ne.createElement("input",{type:"text","data-token":"card_number",placeholder:"Enter card number",maxLength:19,inputMode:"numeric",value:(C==null?void 0:C.cardNumber)||"",onChange:h=>ce(h),ref:Z}),(V==null?void 0:V.cardNumber)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cardNumber),Ne.createElement("br",null)),Ne.createElement("div",{className:"card-dtl"},Ne.createElement("div",{className:"exp-cvc-container",style:{margin:"0"}},Ne.createElement("div",{className:"form-group",style:{marginTop:"0"}},Ne.createElement("label",{htmlFor:"expMonth"},"MM"),Ne.createElement("input",{"data-token":"exp_month",className:"form-control required",type:"text",placeholder:"MM",maxLength:2,value:(C==null?void 0:C.expiryMonth)||"",onChange:h=>Me("expiryMonth",h.target.value),ref:A}),(V==null?void 0:V.expiryMonth)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.expiryMonth)),Ne.createElement("div",{className:"form-group",style:{marginTop:"0"}},Ne.createElement("label",{htmlFor:"expYear"},"YYYY"),Ne.createElement("input",{"data-token":"exp_year",className:"form-control required",type:"text",placeholder:"YYYY",maxLength:4,value:(C==null?void 0:C.expiryYear)||"",onChange:h=>Me("expiryYear",h.target.value),ref:G}),(V==null?void 0:V.expiryYear)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.expiryYear)),Ne.createElement("div",{className:"form-group",style:{marginTop:"0"}},Ne.createElement("label",{htmlFor:"cvc"},"CVC"),Ne.createElement("input",{"data-token":"cvv",className:"form-control required",type:"text",placeholder:"CVC",maxLength:4,value:(C==null?void 0:C.cvv)||"",onChange:h=>Me("cvv",h.target.value),ref:oe}),(V==null?void 0:V.cvv)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cvv)))),Ne.createElement("div",{className:"form-group",style:{marginTop:"0"}},Ne.createElement("label",{htmlFor:"cardholderName"},"Name on card"),Ne.createElement("input",{type:"text",id:"cardholderName",name:"cardholderName",placeholder:"Name on card required",value:(C==null?void 0:C.cardName)||"",onChange:h=>{let L=h.target.value;/^[a-zA-Z\s]*$/.test(L)&&Me("cardName",L)},ref:w}),(V==null?void 0:V.cardName)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.cardName)),Ne.createElement("div",{className:"form-group",style:{marginTop:"0"}},Ne.createElement("label",{htmlFor:"zipcode"},"Zip"),Ne.createElement("input",{type:"text",id:"",name:"zipcode",placeholder:"Zip",value:(Ut=C==null?void 0:C.zipCode)!=null?Ut:"",onChange:h=>Me("zipCode",h.target.value)}),(V==null?void 0:V.zipCode)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},V==null?void 0:V.zipCode))),Ne.createElement("input",{type:"submit",className:"idle-green-btn w-100",defaultValue:"Submit",disabled:t})))))}import q,{useState as di}from"react";import wi from"axios";var Hi={PROPAYKEY:"25",PAYARCKEY:"26",STRIPEKEYCC:"27",PAYRIXKEY:"28",SKYFIACHKEY:"29",JUSTIFIKEY:"30",INFINICEPTKEY:"31",FRACTALKEY:"32"};import fr from"react";function Ui({}){return fr.createElement("style",null,`
|
|
2081
|
-
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap");
|
|
2082
|
-
|
|
2083
|
-
.creditformbox {
|
|
2084
|
-
// max-width: 550px;
|
|
2085
|
-
margin: 0 auto;
|
|
2086
|
-
font-family: Poppins !important;
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
.name-row {
|
|
2090
|
-
display: grid;
|
|
2091
|
-
grid-gap: 10px;
|
|
2092
|
-
grid-template-columns:1fr 1fr;
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
label {
|
|
2096
|
-
display: block;
|
|
2097
|
-
color: #383838;
|
|
2098
|
-
font-size: 16px;
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
.form-group span.text-danger{
|
|
2102
|
-
color:red;
|
|
2103
|
-
}
|
|
2104
|
-
.form-group small.error{
|
|
2105
|
-
color:red;
|
|
2106
|
-
font-size:11px;
|
|
2107
|
-
}
|
|
2108
|
-
.name-row .form-group {
|
|
2109
|
-
display: block;
|
|
2110
|
-
width: 100%;
|
|
2111
|
-
margin-bottom: 15px;
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
|
-
.creditformbox input, .creditformbox select {
|
|
2115
|
-
border: 1.25px solid rgba(234, 236, 239, 1);
|
|
2116
|
-
color: rgba(94, 94, 94, 0.75);
|
|
2117
|
-
border-radius: 10px;
|
|
2118
|
-
width: -webkit-fill-available;
|
|
2119
|
-
padding: 10px 12px;
|
|
2120
|
-
font-size: .875rem;
|
|
2121
|
-
min-height: 20px;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
.form-pay-row {
|
|
2125
|
-
display: block;
|
|
2126
|
-
width: 100%;
|
|
2127
|
-
}
|
|
2128
|
-
|
|
2129
|
-
.form-pay-row .form-group {
|
|
2130
|
-
display: block;
|
|
2131
|
-
width: 100%;
|
|
2132
|
-
margin-bottom: 15px;
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
.card-pay-row {
|
|
2136
|
-
display: flex;
|
|
2137
|
-
width: 100%;
|
|
2138
|
-
gap: 10px;
|
|
2139
|
-
flex-wrap: wrap;
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
.card-pay-row .form-group {
|
|
2143
|
-
flex: 1;
|
|
2144
|
-
margin-bottom: 15px;
|
|
2145
|
-
min-width: 100px;
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
.creditformbox input:focus {
|
|
2149
|
-
color: #212529;
|
|
2150
|
-
background-color: #fff;
|
|
2151
|
-
border-color: #86b7fe;
|
|
2152
|
-
outline: 0;
|
|
2153
|
-
box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
.checks-row{
|
|
2157
|
-
display:flex;
|
|
2158
|
-
align-items:start;
|
|
2159
|
-
gap:10px
|
|
2160
|
-
}
|
|
2161
|
-
.checks-row input {
|
|
2162
|
-
border: 1.25px solid rgba(234, 236, 239, 1);
|
|
2163
|
-
color: rgba(94, 94, 94, 0.75);
|
|
2164
|
-
border-radius: 10px;
|
|
2165
|
-
min-width: 16px !important;
|
|
2166
|
-
width:16px !important;
|
|
2167
|
-
padding: 10px 12px;
|
|
2168
|
-
font-size: .875rem;
|
|
2169
|
-
max-height: 16px !important;
|
|
2170
|
-
height: 16px !important;
|
|
2171
|
-
}
|
|
2172
|
-
// .checks-row input.is-valid:checked{
|
|
2173
|
-
// background-color: #198754;
|
|
2174
|
-
// border-color: #198754;
|
|
2175
|
-
// background-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e);
|
|
2176
|
-
// }
|
|
2177
|
-
.check-error{
|
|
2178
|
-
color:red;
|
|
2179
|
-
font-size:11px;
|
|
2180
|
-
padding-left:25px
|
|
2181
|
-
}
|
|
2182
|
-
.button-row{
|
|
2183
|
-
display: flex;
|
|
2184
|
-
width: 100%;
|
|
2185
|
-
gap: 10px;
|
|
2186
|
-
flex-wrap: wrap;
|
|
2187
|
-
margin-top: 20px !important
|
|
2188
|
-
}
|
|
2189
|
-
.button-row .btn{
|
|
2190
|
-
flex: 1;
|
|
2191
|
-
margin-top:20px;
|
|
2192
|
-
}
|
|
2193
|
-
|
|
2194
|
-
.cancelbtn {
|
|
2195
|
-
font-size:15px;
|
|
2196
|
-
color: #000000 !important;
|
|
2197
|
-
background-color: transparent !important;
|
|
2198
|
-
background: transparent !important;
|
|
2199
|
-
border:1px solid #000000 !important;
|
|
2200
|
-
border-radius: 10px !important;
|
|
2201
|
-
padding: 10px 25px !important;
|
|
2202
|
-
cursor:pointer;
|
|
2203
|
-
font-size: 16px;
|
|
2204
|
-
}
|
|
2205
|
-
.cancelbtn:hover {
|
|
2206
|
-
background:#000000 !important;
|
|
2207
|
-
color:#ffffff !important;
|
|
2208
|
-
}
|
|
2209
|
-
|
|
2210
|
-
.savebtn {
|
|
2211
|
-
font-size:15px;
|
|
2212
|
-
color: #2979FF;
|
|
2213
|
-
background-color: transparent;
|
|
2214
|
-
background: transparent;
|
|
2215
|
-
border:1px solid #2979FF;
|
|
2216
|
-
border-radius: 10px;
|
|
2217
|
-
padding: 10px 25px;
|
|
2218
|
-
cursor:pointer;
|
|
2219
|
-
font-size: 16px;
|
|
2220
|
-
}
|
|
2221
|
-
.savebtn:hover {
|
|
2222
|
-
background:#2979FF;
|
|
2223
|
-
color:#ffffff;
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
|
-
.toggle-label {
|
|
2227
|
-
position: relative;
|
|
2228
|
-
display: inline-block;
|
|
2229
|
-
width: 40px;
|
|
2230
|
-
height: 24px;
|
|
2231
|
-
background-color: #ccc;
|
|
2232
|
-
border-radius: 12px;
|
|
2233
|
-
cursor: pointer;
|
|
2234
|
-
transition: background-color 0.3s;
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
.toggle-label::before {
|
|
2238
|
-
content: "";
|
|
2239
|
-
position: absolute;
|
|
2240
|
-
top: 2px;
|
|
2241
|
-
left: 2px;
|
|
2242
|
-
width: 20px;
|
|
2243
|
-
height: 20px;
|
|
2244
|
-
background: #ffffff;
|
|
2245
|
-
border-radius: 50%;
|
|
2246
|
-
transition: left 300ms linear;
|
|
2247
|
-
}
|
|
2248
|
-
|
|
2249
|
-
.toggle-checkbox {
|
|
2250
|
-
display: none;
|
|
2251
|
-
}
|
|
2252
|
-
|
|
2253
|
-
.toggle-checkbox:checked + .toggle-label {
|
|
2254
|
-
background-color: #4caf50;
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
|
-
.toggle-checkbox:checked + .toggle-label::before {
|
|
2258
|
-
left: 18px;
|
|
2259
|
-
}
|
|
2260
|
-
.pass-fee-toggle-div {
|
|
2261
|
-
display: flex;
|
|
2262
|
-
align-items: center;
|
|
2263
|
-
gap: 10px;
|
|
2264
|
-
padding-top: 10px;
|
|
2265
|
-
}
|
|
2266
|
-
`)}function hr({session_token:e,callback:t,isloading:H,onCancel:T,showChecks:B,merchantName:Y,signCheckbox:K,checkedSignCheckbox:U,onCheckSign:ve,cancelbtnClass:Z,savebtnClass:A,inputClass:G,isDual:oe}){var a;let[w,C]=di(!1),[ee,V]=di(!1),[y,_e]=di(),[M,Te]=di({}),[Pe,me]=di(""),ke=()=>C(!0),ut=()=>C(!1),[Fe,Me]=di(!1),ce=()=>{var P,O,x,f,N,$e,dt,Ee;let o={},r=y,b=parseInt((r==null?void 0:r.expiryMonth)||"",10),k=(r==null?void 0:r.expiryYear)||"";return(P=r==null?void 0:r.firstName)!=null&&P.trim()||(o.firstName="Please enter a first name."),(O=r==null?void 0:r.lastName)!=null&&O.trim()||(o.lastName="Please enter a last name."),(x=r==null?void 0:r.cardNumber)!=null&&x.trim()||(o.cardNumber="Please enter a card number."),(f=r==null?void 0:r.expiryMonth)!=null&&f.trim()?(Number(r==null?void 0:r.expiryMonth)>12||Number(r==null?void 0:r.expiryMonth)<1)&&(o.expiryMonth="Invalid Expiration Month."):o.expiryMonth="Please enter an expiry month.",(N=r==null?void 0:r.expiryYear)!=null&&N.trim()?(($e=r==null?void 0:r.expiryYear)==null?void 0:$e.trim().length)!==4||Number(r==null?void 0:r.expiryYear)<2025?o.expiryYear="Invalid Expiration Year.":(isNaN(b)||b<1||b>12||k.length!==4)&&(o.expiryMonth="Invalid Expiration Date."):o.expiryYear="Please enter an expiry year.",(dt=r==null?void 0:r.cvv)!=null&&dt.trim()||(o.cvv="Please enter a CVV."),(Ee=r==null?void 0:r.zipCode)!=null&&Ee.trim()||(o.zipCode="Please enter a zip code."),K&&!U&&(o.checkSign="You must authorize this before proceeding."),B&&!(r!=null&&r.authHold)&&(o.authHold="You must authorize this before proceeding."),B&&!(r!=null&&r.authorise)&&(o.authorise="Please confirm your authorization to continue."),Te(o),Object.keys(o).length>0},Ye=o=>{var O;let r=o.target,b=r.value.replace(/\D/g,""),{formatted:k,cursor:P}=Pn(r.value,(O=r.selectionStart)!=null?O:0);Te(x=>F(v({},x),{cardNumber:""})),_e(x=>F(v({},x),{cardNumber:k})),requestAnimationFrame(()=>{r.setSelectionRange(P,P)})},Je=(o,r)=>{let b=o;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(b)){(r===""||/^[0-9]+$/.test(r))&&(Te(P=>F(v({},P),{[b]:""})),_e(P=>F(v({},P),{[b]:r})));return}Te(P=>F(v({},P),{[b]:""})),_e(P=>F(v({},P),{[b]:r}))},ln=()=>{let o=DatacapWebToken.validateCardNumber(y==null?void 0:y.cardNumber.replaceAll(" ","")),r=DatacapWebToken.validateExpirationDate(y==null?void 0:y.expiryMonth,y==null?void 0:y.expiryYear),b=DatacapWebToken.validateCVV(y==null?void 0:y.cvv),k={};return o||(k.cardNumber="Invalid card Number"),r||(k.expiryMonth="Invalid Expiration Date."),b||(k.cvv="Invalid CVV"),Te(k),o&&b&&r},Ut=async o=>{var r,b;if(o.Error)me(o.Error),ut();else{let k={token:o.Token,resp:o},P=await wi.post(`${je}api/v1/gateway/update/token/${e}`,k);if((P==null?void 0:P.status)==200){let O=v(v({Token:(b=(r=P==null?void 0:P.data)==null?void 0:r.data)==null?void 0:b.gateway_token,Brand:o.Brand,ExpirationMonth:o.ExpirationMonth,ExpirationYear:o.ExpirationYear,Last4:o.Last4,Bin:o.Bin,CVV:o.CVV,postalCode:y==null?void 0:y.zipCode},B&&{authHold:y==null?void 0:y.authHold}),B&&{authorise:y==null?void 0:y.authorise});ut(),t(O)}}},h=async()=>{var o,r,b,k,P,O,x,f,N,$e,dt,Ee,Ft,mt;try{let Re={method:"POST",redirect:"follow"},ze=await wi.post(`${je}api/v1/widget/generate-session`,Re),ue=Number(y==null?void 0:y.expiryYear)%100,Le=`${(o=y==null?void 0:y.cardNumber)==null?void 0:o.replace(/\s+/g,"")}=${ue}${y==null?void 0:y.expiryMonth} ${y==null?void 0:y.cvv}`,D=forge.pki.publicKeyFromPem((b=(r=ze==null?void 0:ze.data)==null?void 0:r.data)==null?void 0:b.publicKeyPem).encrypt(Le,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),St=forge.util.encode64(D),Ze={"Content-Type":"application/json","x-app-session-key":(P=(k=ze.data)==null?void 0:k.data)==null?void 0:P.session_key},_t=JSON.stringify({enc_track2_data:St,algorithm:"RSAES_OAEP_SHA_1",session_key:(x=(O=ze==null?void 0:ze.data)==null?void 0:O.data)==null?void 0:x.session_key}),S=await wi.post(`${rn}tokenizer/tokenize`,_t,{headers:Ze});if((S==null?void 0:S.status)==200){let bn=(N=(f=S==null?void 0:S.data)==null?void 0:f.data)==null?void 0:N.token;try{let Pt=await wi.post(`${je}api/v1/gateway/verify-and-save/${e}`,{token:bn});if((Pt==null?void 0:Pt.status)==200){let ft=($e=Pt==null?void 0:Pt.data)==null?void 0:$e.data,cn={Token:ft.gateway_token,Brand:ft.card_data.brand,ExpirationMonth:ft.card_data.expire_mm,ExpirationYear:ft.card_data.expire_yy,Last4:ft.card_data.last4,Bin:ft.card_data.bin,postalCode:y==null?void 0:y.zipCode};t(cn),ut()}}catch(Pt){console.log(Pt,"error"),ut()}}}catch(Re){let ze="Something went wrong!";try{let ue=((dt=Re==null?void 0:Re.response)==null?void 0:dt.data)||(Re==null?void 0:Re.message)||"",E=typeof ue=="string"?ue:JSON.stringify(ue),at=(((Ft=(Ee=E.split)==null?void 0:Ee.call(E,`
|
|
2267
|
-
`))==null?void 0:Ft.filter(Boolean))||[]).at(-1)||"",D=(mt=at.split)==null?void 0:mt.call(at,": ");ze=(D==null?void 0:D.length)>1?D.pop().trim():at.trim()||ze}catch(ue){ze="Something went wrong!"}ut(),me(ze)}},L=async o=>{var P,O,x,f,N,$e,dt;o.preventDefault();let r=document.activeElement;if(r instanceof HTMLElement&&r.blur(),!(w||ce()||!ln())){ke();try{let Ee=await wi.get(`${je}api/v1/gateway/token/${e}`,{params:{pass_fee:Fe}});if((Ee==null?void 0:Ee.status)==200){let Ft=(O=(P=Ee==null?void 0:Ee.data)==null?void 0:P.data)==null?void 0:O.gateway_token;((f=(x=Ee==null?void 0:Ee.data)==null?void 0:x.data)==null?void 0:f.paymentGateway)==((N=Hi)==null?void 0:N.FRACTALKEY)?await h():DatacapWebToken.requestToken(Ft,"creditCardForm",Ut)}}catch(Ee){ut(),me(((dt=($e=Ee==null?void 0:Ee.response)==null?void 0:$e.data)==null?void 0:dt.message)||"Something went wrong!")}}},u=()=>{me("")},Ce=()=>{me(""),_e({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:"",authHold:!1,authorise:!1,checkSign:!1}),T()};return console.log(Fe,"aoapoaa"),q.createElement(q.Fragment,null,q.createElement(Cn,null),q.createElement(Ui,null),q.createElement(an,{loading:w||H}),Pe&&q.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},q.createElement(Fn,{error:Pe,onClose:u})),!Pe&&q.createElement("div",{className:"creditformbox"},q.createElement("form",{id:"creditCardForm",onSubmit:L,onKeyDown:o=>{o.key==="Enter"&&w&&(o.preventDefault(),o.stopPropagation())}},q.createElement("div",{className:"name-row"},q.createElement("div",{className:"form-group"},q.createElement("label",null," First Name ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(y==null?void 0:y.firstName)||"",onChange:o=>{let r=o.target.value;/^[a-zA-Z\s]*$/.test(r)&&Je("firstName",r)},className:G}),(M==null?void 0:M.firstName)&&q.createElement("small",{className:"error"},M==null?void 0:M.firstName)),q.createElement("div",{className:"form-group"},q.createElement("label",null," Last Name ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(y==null?void 0:y.lastName)||"",onChange:o=>{let r=o.target.value;/^[a-zA-Z\s]*$/.test(r)&&Je("lastName",r)},className:G}),(M==null?void 0:M.lastName)&&q.createElement("small",{className:"error"},M==null?void 0:M.lastName))),q.createElement("div",{className:"form-pay-row"},q.createElement("div",{className:"form-group"},q.createElement("label",null," Card Number ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(y==null?void 0:y.cardNumber)||"",onChange:o=>Ye(o),className:G}),(M==null?void 0:M.cardNumber)&&q.createElement("small",{className:"error"},M==null?void 0:M.cardNumber))),q.createElement("div",{className:"card-pay-row"},q.createElement("div",{className:"form-group"},q.createElement("label",null," Exp Month ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(y==null?void 0:y.expiryMonth)||"",onChange:o=>Je("expiryMonth",o.target.value),className:G}),(M==null?void 0:M.expiryMonth)&&q.createElement("small",{className:"error"},M==null?void 0:M.expiryMonth)),q.createElement("div",{className:"form-group"},q.createElement("label",null," Exp Year ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(y==null?void 0:y.expiryYear)||"",onChange:o=>Je("expiryYear",o.target.value),className:G}),(M==null?void 0:M.expiryYear)&&q.createElement("small",{className:"error"},M==null?void 0:M.expiryYear)),q.createElement("div",{className:"form-group"},q.createElement("label",null," CVV ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(y==null?void 0:y.cvv)||"",onChange:o=>Je("cvv",o.target.value),className:G}),(M==null?void 0:M.cvv)&&q.createElement("small",{className:"error"},M==null?void 0:M.cvv)),q.createElement("div",{className:"form-group"},q.createElement("label",null," Zip ",q.createElement("span",{className:"text-danger"},"*")),q.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(a=y==null?void 0:y.zipCode)!=null?a:"",onChange:o=>Je("zipCode",o.target.value),className:G}),(M==null?void 0:M.zipCode)&&q.createElement("small",{className:"error"},M==null?void 0:M.zipCode))),oe&&q.createElement("div",{className:"pass-fee-toggle-div"},q.createElement("input",{type:"checkbox",id:"pass_fee",className:"toggle-checkbox",checked:Fe,onChange:o=>{Me(o.target.checked)}}),q.createElement("label",{htmlFor:"pass_fee",className:"toggle-label"}),q.createElement("label",{htmlFor:"save_card"},"Cash Discount")),K&&q.createElement("div",{className:"checks-row"},q.createElement("input",{name:"discalosure",type:"checkbox",id:"disclosureCheck",checked:U,onChange:o=>ve(o.target.checked)}),q.createElement("label",{htmlFor:"disclosureCheck",className:"form-check-label"},"Please agree to the following in order to add Payment method.")),K&&(M==null?void 0:M.checkSign)&&q.createElement("small",{className:"check-error"},M==null?void 0:M.checkSign),B&&q.createElement(q.Fragment,null,q.createElement("div",{className:"checks-row"},q.createElement("input",{name:"authHold",type:"checkbox",id:"authHold",checked:!!(y!=null&&y.authHold),onChange:o=>Je("authHold",o.target.checked)}),q.createElement("label",{htmlFor:"authHold",className:"form-check-label"},"To securely save your card on file, we will place a temporary authorization hold of $1.00. This is not a charge and will be released by your card issuer shortly after verification.")),(M==null?void 0:M.authHold)&&q.createElement("small",{className:"check-error"},M==null?void 0:M.authHold),q.createElement("div",{className:"checks-row "},q.createElement("input",{name:"authorise",type:"checkbox",id:"authorise",checked:!!(y!=null&&y.authorise),onChange:o=>Je("authorise",o.target.checked)}),q.createElement("label",{htmlFor:"authorise",className:"form-check-label see-more"},ee?q.createElement(q.Fragment,null,q.createElement("span",null,"By providing your payment information, you authorize"," ",q.createElement("strong",null,Y),", a Sky Systemz merchant, to securely store your card on file for future payments. Your card information will be encrypted and stored in compliance with PCI-DSS (Payment Card Industry Data Security Standard) regulations using Sky Systemz\u2019s secure payment technology. This information will be used solely for transactions you authorize with"," ",q.createElement("strong",null,Y),". You may request the removal of your stored payment information at any time by contacting"," ",q.createElement("strong",null,Y)," directly. By signing or proceeding with this transaction, you acknowledge and agree to this card on file authorization.",q.createElement("a",{href:"#",onClick:o=>{o.preventDefault(),V(!1)}},"See less ..."))):q.createElement(q.Fragment,null,q.createElement("span",null,"By providing your payment information, you authorize ",Y,", a Sky Systemz merchant, to securely store your card on file for future pay..."," "),q.createElement("a",{href:"#",onClick:o=>{o.preventDefault(),V(!0)}},"See more ...")))),(M==null?void 0:M.authorise)&&q.createElement("small",{className:"check-error"},M==null?void 0:M.authorise)),q.createElement("div",{className:"button-row"},q.createElement("button",{className:`cancelbtn ${Z} `,type:"button",onClick:Ce},"Cancel"),q.createElement("button",{className:`savebtn ${A} `,disabled:w,type:"submit"},"Save")))))}import n,{useEffect as Yi,useRef as yr,useState as kt}from"react";import Ni from"axios";import ki from"sweetalert2";import{IoArrowBack as Ei}from"react-icons/io5";import{NumericFormat as br}from"react-number-format";function xr(e){var Yt,Ht,Dt,Rt,en,tn,nn,un,Gt,Oe,jt,_,g,se,ge,te,Ke,fe,wt,Ge,ct,Vt;let t=yr(null);Yi(()=>{e.onTriggerPay&&e.onTriggerPay(()=>{An()})},[e]);let H=ne+"widget/mc-img.svg",T=ne+"widget/visa-img.svg",B=ne+"widget/ae-img.svg",Y=ne+"widget/discover-img.svg",K=ne+"widget/card.svg",U=ne+"widget/Trash.svg",ve=ne+"widget/bank.svg",Z=ne+"widget/secure-img.png",A=ne+"widget/pov-by.png",G=ne+"widget/pax.svg",[oe,w]=kt(!1),[C,ee]=kt(!1),[V,y]=kt(""),[_e,M]=kt(!1),[Te,Pe]=kt(!1),[me,ke]=kt("card"),[ut,Fe]=kt("card"),[Me,ce]=kt("form"),[Ye,Je]=kt("form"),[ln,Ut]=kt(!0),[h,L]=kt(!1),[u,Ce]=kt(!1),a=e.merchantPublicKey,[o,r]=kt(),[b,k]=kt({}),[P,O]=kt(),[x,f]=kt({}),[N,$e]=kt([]),[dt,Ee]=kt([]),[Ft,mt]=kt(),[Re,ze]=kt(),[ue,E]=kt(Number(e==null?void 0:e.amount)),[Le,at]=kt(Number(e==null?void 0:e.amount)),[D,St]=kt(""),[Ze,_t]=kt("");console.log(D,"partialAmount");let[S,bn]=kt(),[Pt,ft]=kt(""),cn=()=>w(!0),vt=()=>w(!1),Yn=(p,c)=>{let W=(parseFloat(c)||0)/100;return p-p*W},Ln=(p,c)=>{let W=(Number(c)||0)/100;return+p+ +(p*W)};Yi(()=>{Te&&(e!=null&&e.pass_fee?(at(Number(e==null?void 0:e.amount)),E(Number(e==null?void 0:e.cashDiscount))):(at(Number(e==null?void 0:e.amount)),E(Number(e==null?void 0:e.amount))))},[Te,e==null?void 0:e.pass_fee,e==null?void 0:e.amount,e==null?void 0:e.surcharge]);let Ct=()=>{Pe(!1),ke("card"),y(""),M(!1),ft(""),O({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),f({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),r({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),k({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),Ce(!1),L(!1),mt({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""}),ze({}),E(0),Fe("card"),Ut(!0),Je("form"),ce("form"),ee(!1),w(!1),Ee([]),$e([]),St(""),_t("")},An=()=>Pe(!0),Sn=p=>{ke(p)},_n=(p,c)=>{let W=p;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(W)){(c===""||/^[0-9]+$/.test(c))&&(k(ie=>F(v({},ie),{[W]:""})),r(ie=>F(v({},ie),{[W]:c})));return}k(ie=>F(v({},ie),{[W]:""})),r(ie=>F(v({},ie),{[W]:c}))},Q=p=>{var et;let c=p.target,W=c.value.replace(/\D/g,""),{formatted:Se,cursor:ie}=Pn(c.value,(et=c.selectionStart)!=null?et:0);k(we=>F(v({},we),{cardNumber:""})),r(we=>F(v({},we),{cardNumber:Se})),requestAnimationFrame(()=>{c.setSelectionRange(ie,ie)})},$=p=>{let{name:c,value:W}=p.target,Se=["routingNumber","accountNumber","confirmAccountNumber"];if(c=="name"){/^[a-zA-Z\s]*$/.test(W)&&(f(ie=>F(v({},ie),{[c]:""})),O(ie=>F(v({},ie),{[c]:W})));return}if(Se.includes(c)){(W===""||/^[0-9]+$/.test(W))&&(f(ie=>F(v({},ie),{[c]:""})),O(ie=>F(v({},ie),{[c]:W})));return}f(ie=>F(v({},ie),{[c]:""})),O(ie=>F(v({},ie),{[c]:W}))},We=()=>{var ie,et,we,tt,Ie,ae;let p={},c=o,W=parseInt((c==null?void 0:c.expiryMonth)||"",10),Se=(c==null?void 0:c.expiryYear)||"";if((ie=c==null?void 0:c.cardName)!=null&&ie.trim()||(p.cardName="Card name is required"),(et=c==null?void 0:c.cardNumber)!=null&&et.trim()||(p.cardNumber="Card number is required"),(!((we=c==null?void 0:c.expiryMonth)!=null&&we.trim())||!((tt=c==null?void 0:c.expiryYear)!=null&&tt.trim())||isNaN(W)||W<1||W>12||Se.length!==4)&&(p.expiryMonth="Invalid Expiration Date."),(Ie=c==null?void 0:c.cvv)!=null&&Ie.trim()||(p.cvv="CVV is required"),(ae=c==null?void 0:c.zipCode)!=null&&ae.trim()||(p.zipCode="ZIP code is required"),c!=null&&c.expiryMonth&&(c!=null&&c.expiryYear)&&c.expiryMonth.length<=2&&c.expiryYear.length===4){let nt=parseInt(c.expiryMonth,10),gt=parseInt(c.expiryYear,10),ye=new Date,re=ye.getMonth()+1,Ot=ye.getFullYear();(gt<Ot||gt===Ot&&nt<re)&&(p.expiryMonth="Card is expired")}return k(p),Object.keys(p).length>0},Tt=()=>{var W,Se,ie,et,we,tt,Ie,ae;let p={},c=P;return(W=c==null?void 0:c.name)!=null&&W.trim()||(p.name="Name is required"),(Se=c==null?void 0:c.accountNumber)!=null&&Se.trim()||(p.accountNumber="Account number is required"),(ie=c==null?void 0:c.accountNumber)!=null&&ie.trim()&&((et=c==null?void 0:c.accountNumber)==null?void 0:et.trim())!==((we=c==null?void 0:c.confirmAccountNumber)==null?void 0:we.trim())&&(p.confirmAccountNumber="Account numbers must match"),(tt=c==null?void 0:c.bankName)!=null&&tt.trim()||(p.bankName="Bank name is required"),(Ie=c==null?void 0:c.routingNumber)!=null&&Ie.trim()||(p.routingNumber="Routing Number is required"),c!=null&&c.routingNumber&&((ae=c==null?void 0:c.routingNumber)==null?void 0:ae.length)!==9&&(p.routingNumber="Routing number must be 9 digits"),((c==null?void 0:c.accountType)==="business saving"||(c==null?void 0:c.accountType)==="business checking")&&(!(c!=null&&c.companyName)||(c==null?void 0:c.companyName)==="")&&(p.companyName="Company Name is required for business accounts"),f(p),Object.keys(p).length>0},Qe=async p=>{var W,Se,ie,et,we,tt,Ie,ae,nt,gt,ye,re,Ot,Lt,Ue;p.preventDefault();let c=document.activeElement;if(c instanceof HTMLElement&&c.blur(),!C&&!Ze)if(me!=="ach"){if(We())return;{let st=DatacapWebToken.validateCardNumber(o==null?void 0:o.cardNumber.replaceAll(" ","")),Be=DatacapWebToken.validateExpirationDate(o==null?void 0:o.expiryMonth,o==null?void 0:o.expiryYear),Tn=DatacapWebToken.validateCVV(o==null?void 0:o.cvv),xn={};if(st||(xn.cardNumber="Invalid card Number"),Be||(xn.expiryMonth="Invalid Expiration Date."),Tn||(xn.cvv="Invalid CVV"),k(xn),st&&Tn&&Be){ee(!0);try{let gn=async function(Nt){var le,yt;if(Nt.Error)y(Nt.Error),ee(!1);else{let Jt=o==null?void 0:o.cardName,dn=o==null?void 0:o.zipCode;Nt.name=Jt,Nt.postal_code=dn,Nt.isCardSave=`${h}`,Nt.isCharge=!0,Nt.posSalesIdEncode=(le=S==null?void 0:S.orderDetails)==null?void 0:le.orderId,Nt.partial_amount=D&&!Ze?D:Le,It.emit("sendMessage",Nt);let ei=(yt=S==null?void 0:S.orderDetails)==null?void 0:yt.orderId;It.on(ei,zn=>{if(ri(zn==null?void 0:zn.data)){let Et=JSON.parse(zn.data);Et!=null&&Et.result?(r({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),L(!1),ft(Et==null?void 0:Et.transactionId),M(!0),ee(!1)):(ee(!1),y((Et==null?void 0:Et.message)||"Something went wrong."))}else y("Something went wrong.")})}};if((S==null?void 0:S.paymentGateway)===32){let Nt={method:"POST",redirect:"follow"};try{let le=await Ni.post(`${je}api/v1/widget/generate-session`,Nt),yt=Number(o==null?void 0:o.expiryYear)%100,Jt=o==null?void 0:o.cardNumber;Jt=Jt==null?void 0:Jt.replace(/\s+/g,"");let dn=`${Jt}=${yt}${o==null?void 0:o.expiryMonth} ${o==null?void 0:o.cvv}`,zn=forge.pki.publicKeyFromPem((Se=(W=le==null?void 0:le.data)==null?void 0:W.data)==null?void 0:Se.publicKeyPem).encrypt(dn,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Et=forge.util.encode64(zn),Gn={"Content-Type":"application/json","x-app-session-key":(et=(ie=le.data)==null?void 0:ie.data)==null?void 0:et.session_key},hn=JSON.stringify({enc_track2_data:`${Et}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(tt=(we=le==null?void 0:le.data)==null?void 0:we.data)==null?void 0:tt.session_key}`});try{let mn=await Ni.post(`${rn}tokenizer/tokenize`,hn,{headers:Gn}),Si=JSON.stringify(F(v({},(Ie=mn==null?void 0:mn.data)==null?void 0:Ie.data),{isSaveCardChecked:h,name:o==null?void 0:o.cardName,postal_code:o==null?void 0:o.zipCode,customer_id:e==null?void 0:e.customerId,partial_amount:D&&!Ze?D:Le})),_i=JSON.stringify({pre_sales_id:`${(ae=S==null?void 0:S.orderDetails)==null?void 0:ae.orderId}`,token:`${(nt=mn==null?void 0:mn.data)==null?void 0:nt.data.token}`,json_response:`${Si}`}),Pi={method:"POST",headers:JSON.stringify({"Content-Type":"application/json"}),body:_i,redirect:"follow",isChargeviafractal:!0};It.emit("sendMessage",Pi),It.on("chargeviafractalgateway",Vn=>{var s;if(ri(Vn==null?void 0:Vn.data)){let l=JSON.parse(Vn==null?void 0:Vn.data);l!=null&&l.result?(ft((s=l==null?void 0:l.data)==null?void 0:s.transactionId),M(!0),ee(!1)):(ee(!1),y((l==null?void 0:l.message)||"Something went wrong."))}else y("Something went wrong.")})}catch(mn){ee(!1),y(((ye=(gt=mn==null?void 0:mn.response)==null?void 0:gt.data)==null?void 0:ye.message)||(mn==null?void 0:mn.message)||"Something went wrong.")}}catch(le){ee(!1),y(((Ot=(re=le==null?void 0:le.response)==null?void 0:re.data)==null?void 0:Ot.message)||(le==null?void 0:le.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(S==null?void 0:S.dctoken,"PaymentForm",gn)}catch(gn){ee(!1),y(((Ue=(Lt=gn==null?void 0:gn.response)==null?void 0:Lt.data)==null?void 0:Ue.message)||(gn==null?void 0:gn.message)||"Something went wrong.")}}}}else{if(Tt())return;{ee(!0);let st={fractalpayPublicKey:a,label:(P==null?void 0:P.name)||"John Doe",account_number:P==null?void 0:P.accountNumber,routing_number:P==null?void 0:P.routingNumber,bank_name:P==null?void 0:P.bankName,account_type:P==null?void 0:P.accountType,amount:D&&!Ze?D:String(ue||0),isSaveAch:u,customer_id:e==null?void 0:e.customerId,order_id:e==null?void 0:e.orderID,tax:e==null?void 0:e.tax,discount:e==null?void 0:e.discount,surcharge:e==null?void 0:e.surcharge,isChargeACH:!0,company_name:(P==null?void 0:P.companyName)||"",orderGuid:e==null?void 0:e.orderGuid};It.emit("sendMessage",st),It.on("ach-incoming",Be=>{var Tn;(Be==null?void 0:Be.status)=="Failed"?typeof(Be==null?void 0:Be.message)=="object"?Object.values(Be==null?void 0:Be.message).forEach(xn=>{y(xn||"Something went wrong")}):y((Be==null?void 0:Be.message)||"Something went wrong"):(ft((Tn=Be==null?void 0:Be.data)==null?void 0:Tn.transaction_id),M(!0),ee(!1))})}}},rt=async()=>{var p,c,W,Se,ie,et,we,tt,Ie,ae,nt,gt,ye,re,Ot,Lt,Ue,En,st,Be,Tn,xn,gn;cn();try{let Nt={fractalpayPublicKey:a,customer_id:e==null?void 0:e.customerId,pass_fee:e==null?void 0:e.pass_fee,orderGuid:e==null?void 0:e.orderGuid},le=await Ni.post(`${Xe}get-payment-details`,Nt);if(bn((p=le==null?void 0:le.data)==null?void 0:p.data),(W=(c=le==null?void 0:le.data)==null?void 0:c.data)!=null&&W.paymentGateway||(Ct(),y("Something went wrong.")),(ie=(Se=le==null?void 0:le.data)==null?void 0:Se.data)!=null&&ie.card_list&&((tt=(we=(et=le==null?void 0:le.data)==null?void 0:et.data)==null?void 0:we.card_list)==null?void 0:tt.length)>0){let yt=(nt=(ae=(Ie=le==null?void 0:le.data)==null?void 0:Ie.data)==null?void 0:ae.card_list)==null?void 0:nt.filter(dn=>(dn==null?void 0:dn.card_type)=="Bank"),Jt=(re=(ye=(gt=le==null?void 0:le.data)==null?void 0:gt.data)==null?void 0:ye.card_list)==null?void 0:re.filter(dn=>(dn==null?void 0:dn.card_type)!=="Bank");console.log(yt,"hohgohoo",Jt),(Jt==null?void 0:Jt.length)>0&&ce("list"),(yt==null?void 0:yt.length)>0&&Je("list"),$e(Jt),Ee(yt)}else ke("card");(Lt=(Ot=le==null?void 0:le.data)==null?void 0:Ot.data)!=null&&Lt.paymentDeviceList&&((st=(En=(Ue=le==null?void 0:le.data)==null?void 0:Ue.data)==null?void 0:En.paymentDeviceList)==null?void 0:st.length)>0&&ze((Tn=(Be=le==null?void 0:le.data)==null?void 0:Be.data)==null?void 0:Tn.paymentDeviceList[0]),vt()}catch(Nt){console.log(Nt),vt(),y(((gn=(xn=Nt==null?void 0:Nt.response)==null?void 0:xn.data)==null?void 0:gn.message)||(Nt==null?void 0:Nt.message)||"Something went wrong")}},ht=async p=>{if(p.currentTarget.blur(),C)return;let c=e==null?void 0:e.customerId,W=String(e==null?void 0:e.discount),Se=String(e==null?void 0:e.surcharge),ie=String(e==null?void 0:e.tax),et=e==null?void 0:e.merchantPublicKey,we=e==null?void 0:e.orderID,tt=D&&!Ze?D:String(Le),Ie=Ft==null?void 0:Ft.id,ae=Ft==null?void 0:Ft.card_type;if(!Ze)if(et&&we&&tt&&ue)if(c)if(Ie){let gt;D&&!Ze?gt=D:ae==="Bank"?gt=ue:gt=Le;let ye={amount:gt,order_id:we,customer_id:c,card_id:Ie,fractalpayPublicKey:et,isCardSave:h,discount:W,surcharge:Se,tax:ie,orderGuid:e==null?void 0:e.orderGuid,pass_fee:e==null?void 0:e.pass_fee,require3ds:!1};D&&!Ze&&ae!=="Bank"&&(ye.ispartialPayment=!0);let nt=ye,{isCardSave:re}=nt,Ot=Un(nt,["isCardSave"]),Ue=Xe+(ae==="Bank"?"charge-ach":"charge-by-card"),En={"Content-Type":"application/json"};ee(!0),It.emit("sendMessage",{url:Ue,body:ae=="Bank"?Ot:ye,isChargebycard:!0}),It.on("charge-by-card",st=>{var Be;(st==null?void 0:st.result)==!0||(st==null?void 0:st.status)==!0?(ft((Be=st.data)==null?void 0:Be.transaction_id),M(!0),ee(!1)):y((st==null?void 0:st.message)||"Something went wrong.")})}else y("Please Select A Card/ACH");else y("Please Select Customer");else y("Something went wrong.")},qt=async p=>{var et,we,tt,Ie,ae,nt;if(p.currentTarget.blur(),C)return;let c=e==null?void 0:e.merchantPublicKey,W=e==null?void 0:e.orderID,Se=D&&!Ze?D:String(Le),ie=e==null?void 0:e.customerId;if(!(Re!=null&&Re.device_id)){y("Please Select A Payment Device");return}if(c&&W&&Se){ee(!0);let gt={amount:Se,fractalpayPublicKey:c,customer_order_id:W,device_id:Re==null?void 0:Re.device_id,customer_id:ie||""};try{let ye=await Ni.post(`${Xe}charge-with-reader`,gt);((et=ye==null?void 0:ye.data)==null?void 0:et.result)==!0?(ft((tt=(we=ye==null?void 0:ye.data)==null?void 0:we.data)==null?void 0:tt.transaction_id),M(!0),ee(!1)):(y(((Ie=ye==null?void 0:ye.data)==null?void 0:Ie.message)||"Something went wrong."),ee(!1))}catch(ye){y(((nt=(ae=ye==null?void 0:ye.response)==null?void 0:ae.data)==null?void 0:nt.message)||"Something went wrong."),ee(!1)}}else y("Something went wrong.")},Mt=p=>{ut==="card"?ht(p):ut==="reader"&&qt(p)};Yi(()=>{Te&&a&&rt()},[a,Te]);let zt=async p=>{ki.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async c=>{if(c.isConfirmed){ee(!0);try{let W={card_id:p,customer_id:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey},Se=await Ni.post(`${Xe}delete-customer-card`,W);ee(!1),rt(),ki.fire({icon:"success",title:"Deleted!",text:"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})}catch(W){ee(!1),ki.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else c.dismiss===ki.DismissReason.cancel&&ki.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},Wt=p=>{switch(p==null?void 0:p.toLowerCase()){case"visa":return T;case"mastercard":case"mc":case"m/c":return H;case"amex":case"american express":case"ae":return B;case"discover":case"dcvr":return Y;case"bank":return ve;default:return p}},ot=()=>{let p=ue||0;return(Number(Le)-p).toFixed(0)};console.log(Me,"activeinCard","activeinBank",Ye);let Ve=p=>{var c,W,Se,ie;console.log(p,"values"),me==="ach"?((c=Number(ue))==null?void 0:c.toFixed(2))<(p==null?void 0:p.floatValue)||(p==null?void 0:p.floatValue)<=0?(St(p==null?void 0:p.value),_t(`Partial amount cannot exceed ${be((W=Number(ue))==null?void 0:W.toFixed(2))}`)):(St(p==null?void 0:p.value),_t("")):((Se=Number(Le))==null?void 0:Se.toFixed(2))<(p==null?void 0:p.floatValue)||(p==null?void 0:p.floatValue)<=0?(St(p==null?void 0:p.value),_t(`Partial amount cannot exceed ${be((ie=Number(Le))==null?void 0:ie.toFixed(2))}`)):(St(p==null?void 0:p.value),_t(""))};return Yi(()=>{let p=Number(me==="ach"?ue:Le),c=Number(D);D&&(c<=0||c>p)?_t(`Partial amount cannot exceed ${be(p.toFixed(2))}`):_t("")},[me,D,ue,Le]),console.log(me,"activetab"),n.createElement(n.Fragment,null,n.createElement(Cn,null),n.createElement(Xn,null),n.createElement(Kn,null),n.createElement(n.Fragment,null,n.createElement("button",{ref:t,style:{display:"none"},className:"paymentBtn",onClick:An},"Pay"),n.createElement(yn,{open:Te,onClose:Ct},V&&n.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},n.createElement(Fn,{error:V,onClose:Ct})),_e&&n.createElement(Dn,{onClose:Ct,tranId:Pt}),!V&&!_e&&n.createElement(n.Fragment,null,(oe||C)&&n.createElement(an,{loading:oe||C}),n.createElement("div",{className:"frac-card-payment-page frac-form"},n.createElement("div",{className:"parent-pay-container"},n.createElement("span",{className:"request-payment-close-popup",onClick:Ct},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},n.createElement("g",{clipPath:"url(#clip0_12425_52336)"},n.createElement("path",{d:"M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z",fill:"#727272"})),n.createElement("defs",null,n.createElement("clipPath",{id:"clip0_12425_52336"},n.createElement("rect",{width:"16",height:"16",fill:"white"}))))),n.createElement("div",{className:"pay-main-logo-res"},n.createElement("img",{src:S==null?void 0:S.logo,id:"pay-logos"})),n.createElement("div",{className:"pay-container"},n.createElement("div",{className:"pay-header pay-conatiner-one frac-pay-conatiner-one"},n.createElement("div",{className:"pay-conatiner-one-first"},n.createElement("div",{className:"pay-logo-container"},n.createElement("div",{className:"pay-main-logo"},n.createElement("img",{src:S==null?void 0:S.logo,id:"pay-logos"})),(N==null?void 0:N.length)>0&&me!=="cardList"&&n.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>ke("cardList")}," ",n.createElement(Ei,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(Nn,{label:"Card",amount:(Yt=Number(Le))==null?void 0:Yt.toFixed(2),value:"card",onChange:Sn,activetab:me}),(S==null?void 0:S.isSkyFiAccount)&&n.createElement(Nn,{label:"Bank",amount:(Ht=Number(ue))==null?void 0:Ht.toFixed(2),value:"ach",onChange:Sn,activetab:me})),In(S==null?void 0:S.showSurcharge)?ue&&ue>0&&(e!=null&&e.pass_fee)?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,me==="card"?"Cash Discount":"Cash Discount Savings"," "),n.createElement("p",null,be((Number(Le)-ue).toFixed(2)))):null:ue&&ue>0&&(e!=null&&e.pass_fee)&&me==="card"?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,me==="card"?"Surcharge":null," "),n.createElement("p",null,be((Number(Le)-ue).toFixed(2)))):null,(e==null?void 0:e.allowPartial)&&n.createElement("div",{className:"frac-partial-payment-input"},n.createElement("label",{htmlFor:"partialpayment"},"Partial Payment"),n.createElement(br,{prefix:"$",className:"form-control",value:D,onValueChange:p=>{Ve(p)},thousandSeparator:!0,placeholder:"Enter partial amount",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0}),Ze&&n.createElement("span",{className:"error-span"},Ze)))),n.createElement("div",{className:"pay-conatiner-one-last"},n.createElement("img",{src:Z,alt:""}),n.createElement("img",{src:A,alt:""}),"Secure payments powered by Fractal")),n.createElement("div",{className:"pay-tab pay-conatiner-two"},!oe&&n.createElement("div",{className:"col-md-12"},n.createElement("div",{id:"payment-form-div"},me!=="cardList"?n.createElement("div",{className:"frac-charge-payment-back-btn-wrap "},(N==null?void 0:N.length)>0&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>ke("cardList")}," ",n.createElement(Ei,null)," Back"),(S==null?void 0:S.isSkyFiAccount)&&n.createElement("div",{className:"tab"},n.createElement("button",{className:"tablinks",onClick:p=>{Sn("card")},style:{border:me==="card"?"1px solid":""}},n.createElement("i",{className:"fas fa-credit-card me-2",style:{marginRight:"8px",fontSize:"15px"}}),"Card"),n.createElement("button",{className:"tablinks",onClick:p=>{Sn("ach")},style:{border:me==="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"},"$",(Dt=Number(Le))==null?void 0:Dt.toFixed(2))),me!="ach"&&n.createElement("div",null,n.createElement("div",null,n.createElement("img",{src:T,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:H,width:35,alt:""})),n.createElement("div",null,n.createElement("img",{src:B,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:Y,width:35,alt:""})))),!oe&&In(S==null?void 0:S.showSurcharge)?ue&&ue>0&&(e!=null&&e.pass_fee)?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,me==="card"?"Cash Discount":"Cash Discount Savings"," "),n.createElement("p",null,be((Number(Le)-ue).toFixed(2)))):null:ue&&ue>0&&(e!=null&&e.pass_fee)&&me==="card"?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,me==="card"?"Surcharge":null," "),n.createElement("p",null,be((Number(Le)-ue).toFixed(2)))):null):n.createElement("div",null,n.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",S==null?void 0:S.customer_name),n.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," ",ut==="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"},"$",(Rt=Number(Le))==null?void 0:Rt.toFixed(2))),n.createElement("div",null,n.createElement("div",null,n.createElement("img",{src:T,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:H,width:35,alt:""})),n.createElement("div",null,n.createElement("img",{src:B,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:Y,width:35,alt:""}))))),n.createElement("div",{id:"card",style:{display:me==="card"?"block":"none"},className:"tabcontent"},n.createElement("div",{className:"frac-card-payment"},n.createElement("div",{className:"frac-heading-card-wrap"},n.createElement("div",{className:"frac-backarrow"},(N==null?void 0:N.length)>0&&Me==="form"&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>ce("list")}," ",n.createElement(Ei,null))),n.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),me!="ach"&&n.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},n.createElement("img",{src:T,alt:"",width:33}),n.createElement("img",{src:H,width:33,alt:""}),n.createElement("img",{src:B,alt:"",width:33}),n.createElement("img",{src:Y,width:33,alt:""}))),Me==="list"?n.createElement(n.Fragment,null,n.createElement(Bn,{listHeading:"Cards",paymentGateway:S==null?void 0:S.paymentGateway,ListItems:N,selectedCard:Ft,setSelectedCard:mt,handleDeleteCard:zt,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:Mt},D&&!Ze?be((en=Number(D))==null?void 0:en.toFixed(2)):be((tn=Number(Le))==null?void 0:tn.toFixed(2))))):n.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:Qe,onKeyDown:p=>{p.key==="Enter"&&C&&(p.preventDefault(),p.stopPropagation())}},n.createElement("div",{className:"ach-scrl",style:{minHeight:S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)>0?"444px":S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)==0?"456px":(N==null?void 0:N.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),n.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"John Doe",value:(o==null?void 0:o.cardName)||"",onChange:p=>{let c=p.target.value;/^[a-zA-Z\s]*$/.test(c)&&_n("cardName",c)}}),(b==null?void 0:b.cardName)&&n.createElement("span",{className:"error-span"},b==null?void 0:b.cardName)),n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),n.createElement("div",{className:"toggle-num-wrapper"},n.createElement("input",{className:"form-control card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(o==null?void 0:o.cardNumber)||"",onChange:p=>Q(p),"data-token":"card_number"}),n.createElement("div",{className:"card-crdi card-expiry-new"},n.createElement("div",{className:"exp-date-year-container"},n.createElement("div",{className:"exp-date form-group"},n.createElement("input",{"data-token":"exp_month",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(o==null?void 0:o.expiryMonth)||"",onChange:p=>_n("expiryMonth",p.target.value)})),n.createElement("div",{className:"exp-year form-group"},n.createElement("input",{"data-token":"exp_year",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(o==null?void 0:o.expiryYear)||"",onChange:p=>_n("expiryYear",p.target.value)})),n.createElement("div",{className:"security-digit form-group"},n.createElement("input",{"data-token":"cvv",className:"form-control card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(o==null?void 0:o.cvv)||"",onChange:p=>_n("cvv",p.target.value)})))),(b==null?void 0:b.cardNumber)&&n.createElement("span",{className:"error-span"},b==null?void 0:b.cardNumber),n.createElement("p",{style:{margin:"0"}},b!=null&&b.expiryMonth||b!=null&&b.expiryYear?n.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},b==null?void 0:b.expiryMonth):"",(b==null?void 0:b.cvv)&&n.createElement("span",{className:"error-span"},b==null?void 0:b.cvv)))),n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),n.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"Order Id",disabled:!0,value:(nn=e==null?void 0:e.orderID)!=null?nn:"",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:(un=o==null?void 0:o.zipCode)!=null?un:"",onChange:p=>_n("zipCode",p.target.value)}),(b==null?void 0:b.zipCode)&&n.createElement("span",{className:"error-span"},b==null?void 0:b.zipCode)),(e==null?void 0:e.customerId)&&n.createElement("div",{className:"form-group"},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},n.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:h,onChange:p=>L(p.target.checked)}),n.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),n.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},n.createElement("g",{clipPath:"url(#clip0_12420_50192)"},n.createElement("rect",{width:"20",height:"20",fill:"white"}),n.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),n.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"})),n.createElement("defs",null,n.createElement("clipPath",{id:"clip0_12420_50192"},n.createElement("rect",{width:"20",height:"20",fill:"white"}))))))),n.createElement("div",{className:"form-group",style:{marginTop:"20px",padding:"0"}},(S==null?void 0:S.paymentDeviceList)&&((Gt=S==null?void 0:S.paymentDeviceList)==null?void 0:Gt.length)>0&&n.createElement("button",{type:"button",style:{marginBottom:"10px"},className:"pay-button",onClick:()=>Ut(!ln)},ln?"Pay With Reader":"Pay With Card"),n.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},D&&!Ze?be((Oe=Number(D))==null?void 0:Oe.toFixed(2)):be((jt=Number(Le))==null?void 0:jt.toFixed(2)))))),n.createElement("div",{id:"ach",style:{display:me==="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"},(dt==null?void 0:dt.length)>0&&Ye==="form"&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Je("list")}," ",n.createElement(Ei,null))),n.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment"))),Ye==="list"?n.createElement(n.Fragment,null,n.createElement(Bn,{listHeading:"Banks",paymentGateway:S==null?void 0:S.paymentGateway,ListItems:dt,selectedCard:Ft,setSelectedCard:mt,handleDeleteCard:zt,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{Je("form")}}),n.createElement("div",{className:"form-group",style:{padding:"0"}},n.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Mt},D&&!Ze?be((_=Number(D))==null?void 0:_.toFixed(2)):be((g=Number(ue))==null?void 0:g.toFixed(2))))):n.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:Qe,autoComplete:"off",onKeyDown:p=>{p.key==="Enter"&&C&&(p.preventDefault(),p.stopPropagation())}},n.createElement("div",{className:"ach-scrl",style:{minHeight:S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)>0?"444px":S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)==0?"436px":(N==null?void 0:N.length)>0?"462px":"520px",maxHeight:S!=null&&S.isSkyFiAccount&&(N==null?void 0:N.length)>0?"444px":((N==null?void 0:N.length)>0,"380px")}},n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),n.createElement("input",{type:"text",id:"nameonaccount",className:"form-control",maxLength:100,placeholder:"John Doe",name:"name",value:(se=P==null?void 0:P.name)!=null?se:"",onChange:$}),(x==null?void 0:x.name)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.name)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"routingnumber"},"Routing number"),n.createElement("input",{type:"text",id:"routingnumber",className:"form-control",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(ge=P==null?void 0:P.routingNumber)!=null?ge:"",onChange:$}),(x==null?void 0:x.routingNumber)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.routingNumber)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"accountnumber"},"Account number"),n.createElement("input",{type:"text",id:"accountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(te=P==null?void 0:P.accountNumber)!=null?te:"",onChange:$}),(x==null?void 0:x.accountNumber)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.accountNumber)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),n.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(Ke=P==null?void 0:P.confirmAccountNumber)!=null?Ke:"",onChange:$}),(x==null?void 0:x.confirmAccountNumber)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.confirmAccountNumber)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"bankname"},"Bank name"),n.createElement("input",{type:"text",id:"bankname",className:"form-control",maxLength:100,placeholder:"My Bank",name:"bankName",value:(fe=P==null?void 0:P.bankName)!=null?fe:"",onChange:$}),(x==null?void 0:x.bankName)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.bankName)),((P==null?void 0:P.accountType)==="business saving"||(P==null?void 0:P.accountType)==="business checking")&&n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"companyName"},"Company name"),n.createElement("input",{type:"text",id:"companyName",className:"form-control",maxLength:100,placeholder:"My Company",name:"companyName",value:(wt=P==null?void 0:P.companyName)!=null?wt:"",onChange:$}),(x==null?void 0:x.companyName)&&n.createElement("span",{className:"error-span"},x==null?void 0:x.companyName)),n.createElement("div",{className:"form-group mb-4"},n.createElement("label",{htmlFor:"accounttype"},"Select account type"),n.createElement("select",{name:"accountType",id:"accounttype",className:"form-control",value:(Ge=P==null?void 0:P.accountType)!=null?Ge:"",onChange:$},n.createElement("option",{value:""},"Select account"),oi.map(p=>n.createElement("option",{key:p.value,value:p.value},p.label)))),(e==null?void 0:e.customerId)&&n.createElement("div",{className:"form-group mb-4 save-ach-div",style:{paddingTop:"5px"}},n.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:u,onChange:p=>Ce(p.target.checked)}),n.createElement("label",{htmlFor:"saveACH"},"Save ACH")),u&&n.createElement("div",{className:"form-group mb-4",style:{fontSize:"12px",color:"#727272"}},n.createElement("p",null,"If checked, I agree for ",n.createElement("b",null,"ecommerce")," to have my permission to charge this credit card for agreed upon purchases in the future."))),n.createElement("div",{className:"form-group "},n.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},D&&!Ze?be((ct=Number(D))==null?void 0:ct.toFixed(2)):be((Vt=Number(ue))==null?void 0:Vt.toFixed(2))))))))))))))))}import Hn,{useEffect as ea,useState as ci,useMemo as Tr}from"react";import vr from"react";function Ji(){let e="#000",t="#fff",H="#212529",T="#dee2e6";return vr.createElement("style",null,`
|
|
2268
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
2269
|
-
body
|
|
2270
|
-
{
|
|
2271
|
-
font-family: 'Inter', sans-serif;
|
|
2272
|
-
}
|
|
2273
|
-
input
|
|
2274
|
-
{
|
|
2275
|
-
font-family: 'Inter', sans-serif !important;
|
|
2276
|
-
}
|
|
2277
|
-
.frac-form .form-group-frac{
|
|
2278
|
-
margin:0 !important
|
|
2279
|
-
}
|
|
2280
|
-
.frac-form .mb-4{
|
|
2281
|
-
margin-bottom : 10px !important
|
|
2282
|
-
}
|
|
2283
|
-
.frac-form .save-ach-div{
|
|
2284
|
-
display:flex !important;
|
|
2285
|
-
gap:5px !important;
|
|
2286
|
-
align-items:center
|
|
2287
|
-
}
|
|
2288
|
-
|
|
2289
|
-
.frac-form .card-cvv-in{
|
|
2290
|
-
height : 36px !importantt;
|
|
2291
|
-
}
|
|
2292
|
-
|
|
2293
|
-
.frac-form .pay-payment-amount{
|
|
2294
|
-
text-align:start !important
|
|
2295
|
-
}
|
|
2296
|
-
.frac-form .pay-amount{
|
|
2297
|
-
text-align:start !important
|
|
2298
|
-
}
|
|
2299
|
-
.frac-form .pay-main-logo{
|
|
2300
|
-
text-align:start !important
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
.paymentBtn {
|
|
2306
|
-
background-color: black;
|
|
2307
|
-
border: none;
|
|
2308
|
-
color: white;
|
|
2309
|
-
padding: 15px 32px;
|
|
2310
|
-
text-align: center;
|
|
2311
|
-
text-decoration: none;
|
|
2312
|
-
display: inline-block;
|
|
2313
|
-
font-size: 16px;
|
|
2314
|
-
margin: 4px 2px;
|
|
2315
|
-
cursor: pointer;
|
|
2316
|
-
border-radius: 180px;
|
|
2317
|
-
/* width: auto; */
|
|
2318
|
-
}
|
|
2319
|
-
|
|
2320
|
-
.main-logo {
|
|
2321
|
-
text-align: center;
|
|
2322
|
-
margin-bottom: 20px;
|
|
2323
|
-
}
|
|
2324
|
-
|
|
2325
|
-
.main-logo img {
|
|
2326
|
-
max-width: 180px;
|
|
2327
|
-
}
|
|
2328
|
-
|
|
2329
|
-
.pay-main-box {
|
|
2330
|
-
width: 365px !important;
|
|
2331
|
-
height: 93%;
|
|
2332
|
-
background: 0 0 #ffffff;
|
|
2333
|
-
border-radius: 12px;
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
border: 1px solid #E0DFE2;
|
|
2337
|
-
margin: 0 auto;
|
|
2338
|
-
display: block;
|
|
2339
|
-
padding: 0px 26px !important
|
|
2340
|
-
}
|
|
2341
|
-
.pay-main-box .pay-header {
|
|
2342
|
-
display: flex;
|
|
2343
|
-
justify-content: center;
|
|
2344
|
-
align-items: center;
|
|
2345
|
-
text-align: center;
|
|
2346
|
-
}
|
|
2347
|
-
|
|
2348
|
-
.pay-main-box .pay-header button {
|
|
2349
|
-
border: 0;
|
|
2350
|
-
background: none;
|
|
2351
|
-
padding: 0;
|
|
2352
|
-
box-shadow: 0;
|
|
2353
|
-
outline: inherit;
|
|
2354
|
-
}
|
|
2355
|
-
|
|
2356
|
-
.pay-main-box h1 {
|
|
2357
|
-
margin: 0;
|
|
2358
|
-
flex: 1;
|
|
2359
|
-
padding: 10px 0;
|
|
2360
|
-
font-size: 23px;
|
|
2361
|
-
font-weight: 500;
|
|
2362
|
-
color: #35254D;
|
|
2363
|
-
align-items: start;
|
|
2364
|
-
display: flex;
|
|
2365
|
-
}
|
|
2366
|
-
.tab {
|
|
2367
|
-
overflow: hidden;
|
|
2368
|
-
padding: 5px;
|
|
2369
|
-
border-radius: 8px;
|
|
2370
|
-
display: flex;
|
|
2371
|
-
justify-content: space-around;
|
|
2372
|
-
margin-bottom:12px
|
|
2373
|
-
}
|
|
2374
|
-
|
|
2375
|
-
/* Style the buttons inside the tab */
|
|
2376
|
-
.tab button {
|
|
2377
|
-
float: left;
|
|
2378
|
-
border: none;
|
|
2379
|
-
outline: none;
|
|
2380
|
-
cursor: pointer;
|
|
2381
|
-
background:white;
|
|
2382
|
-
padding: 11px 16px;
|
|
2383
|
-
transition: 0.3s;
|
|
2384
|
-
font-size: 16px;
|
|
2385
|
-
width: 143px;
|
|
2386
|
-
border-radius: 5px;
|
|
2387
|
-
box-shadow: inherit;
|
|
2388
|
-
outline: none;
|
|
2389
|
-
color: ${e};
|
|
2390
|
-
}
|
|
2391
|
-
|
|
2392
|
-
/* Change background color of buttons on hover */
|
|
2393
|
-
.tab button:hover {
|
|
2394
|
-
background-color: #f0f0f0;
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
|
-
/* Create an active/current tablink class */
|
|
2398
|
-
// .tab button.active {
|
|
2399
|
-
// background-color: #ccc;
|
|
2400
|
-
// }
|
|
2401
|
-
|
|
2402
|
-
/* Style the tab content */
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
.parent-pay-container{
|
|
2406
|
-
padding: 24px;
|
|
2407
|
-
}
|
|
2408
|
-
.pay-container{
|
|
2409
|
-
display: grid;
|
|
2410
|
-
grid-template-columns: 2fr 3fr;
|
|
2411
|
-
|
|
2412
|
-
}
|
|
2413
|
-
.pay-main{
|
|
2414
|
-
padding-y: 20px}
|
|
2415
|
-
|
|
2416
|
-
.request-payment-close-popup {
|
|
2417
|
-
position: absolute;
|
|
2418
|
-
right: 20px;
|
|
2419
|
-
top: 20px;
|
|
2420
|
-
cursor: pointer;
|
|
2421
|
-
}
|
|
2422
|
-
.pay-conatiner-one{
|
|
2423
|
-
border-right: 1px solid #E0DFE2;
|
|
2424
|
-
display: flex;
|
|
2425
|
-
flex-direction: column;
|
|
2426
|
-
justify-content: space-between;
|
|
2427
|
-
}
|
|
2428
|
-
.pay-conatiner-one-first{
|
|
2429
|
-
|
|
2430
|
-
min-height:inherit !important;
|
|
2431
|
-
}
|
|
2432
|
-
.pay-conatiner-one-last{
|
|
2433
|
-
display:flex;
|
|
2434
|
-
font-size:12px;
|
|
2435
|
-
gap:5px;
|
|
2436
|
-
max-width:250px;
|
|
2437
|
-
align-items:center;
|
|
2438
|
-
color:black !important
|
|
2439
|
-
}
|
|
2440
|
-
.pay-conatiner-one-last img{
|
|
2441
|
-
width : 17px;
|
|
2442
|
-
height:17px
|
|
2443
|
-
}
|
|
2444
|
-
.pay-conatiner-two{
|
|
2445
|
-
padding: 0 5% 0;
|
|
2446
|
-
}
|
|
2447
|
-
.pay-logo-container{
|
|
2448
|
-
border-bottom: 1px solid #E0DFE2
|
|
2449
|
-
}
|
|
2450
|
-
.pay-heading{
|
|
2451
|
-
margin: 0;
|
|
2452
|
-
flex: 1;
|
|
2453
|
-
padding: 10px 0;
|
|
2454
|
-
font-size: 23px;
|
|
2455
|
-
font-weight: 500;
|
|
2456
|
-
color: #35254D;
|
|
2457
|
-
align-items: start;
|
|
2458
|
-
display: flex;
|
|
2459
|
-
}
|
|
2460
|
-
.pay-main-logo > img{
|
|
2461
|
-
width: 50%;
|
|
2462
|
-
}
|
|
2463
|
-
.pay-main-logo-res > img{
|
|
2464
|
-
width: 50%;
|
|
2465
|
-
display : none
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
|
-
.pay-payment-amount{
|
|
2469
|
-
display: block;
|
|
2470
|
-
font-size: 12px;
|
|
2471
|
-
color: #727272;
|
|
2472
|
-
margin-bottom: 8px;
|
|
2473
|
-
}
|
|
2474
|
-
.pay-amount-conatiner{
|
|
2475
|
-
margin-top: 6%;
|
|
2476
|
-
}
|
|
2477
|
-
.pay-amount{
|
|
2478
|
-
color: #000000;
|
|
2479
|
-
font-size: 38px;
|
|
2480
|
-
display: block;
|
|
2481
|
-
line-height: 110%;
|
|
2482
|
-
letter-spacing: -1px;
|
|
2483
|
-
}
|
|
2484
|
-
.frac-form label{
|
|
2485
|
-
font-family: 'IBM Plex Mono', monospace !important;
|
|
2486
|
-
color: #727272 !important;
|
|
2487
|
-
margin-bottom: 2px !important;
|
|
2488
|
-
font-weight: 600 !important;
|
|
2489
|
-
font-size: 12px !important;
|
|
2490
|
-
display:block !important;
|
|
2491
|
-
text-align : left !important
|
|
2492
|
-
}
|
|
2493
|
-
.form-control-frac{
|
|
2494
|
-
display: block;
|
|
2495
|
-
width: 100%;
|
|
2496
|
-
padding: .375rem .75rem;
|
|
2497
|
-
font-size: 1rem;
|
|
2498
|
-
font-weight: 400;
|
|
2499
|
-
line-height: 1.5;
|
|
2500
|
-
color: ${H};
|
|
2501
|
-
-webkit-appearance: none;
|
|
2502
|
-
-moz-appearance: none;
|
|
2503
|
-
appearance: none;
|
|
2504
|
-
background-color: ${t};
|
|
2505
|
-
background-clip: padding-box;
|
|
2506
|
-
border: 1px solid ${T};
|
|
2507
|
-
border-radius: 0.375rem;
|
|
2508
|
-
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
|
2509
|
-
}
|
|
2510
|
-
.form-control-frac:focus{
|
|
2511
|
-
border-color: #86b7fe;
|
|
2512
|
-
outline: 0;
|
|
2513
|
-
}
|
|
2514
|
-
.toggle-num-wrapper {
|
|
2515
|
-
position: relative;
|
|
2516
|
-
}
|
|
2517
|
-
.card-number-new{
|
|
2518
|
-
border-bottom: none;
|
|
2519
|
-
border-bottom-left-radius: 0px;
|
|
2520
|
-
border-bottom-right-radius: 0px;
|
|
2521
|
-
}
|
|
2522
|
-
.card-crdi {
|
|
2523
|
-
display: flex;
|
|
2524
|
-
border: 1px solid ${T};
|
|
2525
|
-
border-radius: 0.375rem;
|
|
2526
|
-
}
|
|
2527
|
-
.card-expiry-new{
|
|
2528
|
-
border-top-left-radius: 0px;
|
|
2529
|
-
border-top-right-radius: 0px;
|
|
2530
|
-
}
|
|
2531
|
-
.exp-date-year-container{
|
|
2532
|
-
display: flex;
|
|
2533
|
-
flex-wrap: wrap;
|
|
2534
|
-
}
|
|
2535
|
-
.exp-date-year-container .form-group-frac{
|
|
2536
|
-
flex:1;
|
|
2537
|
-
padding: 0px !important
|
|
2538
|
-
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
.exp-date {
|
|
2542
|
-
float: left;
|
|
2543
|
-
// width: 30%
|
|
2544
|
-
}
|
|
2545
|
-
|
|
2546
|
-
.exp-date input {
|
|
2547
|
-
width: calc(100% + 1px);
|
|
2548
|
-
border-top-right-radius: 0;
|
|
2549
|
-
border-bottom-right-radius: 0;
|
|
2550
|
-
border: 0;
|
|
2551
|
-
border-right: 1px solid ${T};
|
|
2552
|
-
}
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
.exp-year {
|
|
2556
|
-
float: left;
|
|
2557
|
-
// width: 30%
|
|
2558
|
-
}
|
|
2559
|
-
|
|
2560
|
-
.exp-year input {
|
|
2561
|
-
width: calc(100% + 1px);
|
|
2562
|
-
border-radius: 0;
|
|
2563
|
-
border-top: 0;
|
|
2564
|
-
border-bottom: 0;
|
|
2565
|
-
border-right: 1px solid ${T};
|
|
2566
|
-
}
|
|
2567
|
-
|
|
2568
|
-
.exp-date input:focus {
|
|
2569
|
-
position: relative;
|
|
2570
|
-
z-index: 10;
|
|
2571
|
-
}
|
|
2572
|
-
|
|
2573
|
-
.security-digit {
|
|
2574
|
-
float: right;
|
|
2575
|
-
// width: 40%;
|
|
2576
|
-
position: relative;
|
|
2577
|
-
}
|
|
2578
|
-
|
|
2579
|
-
.security-digit input {
|
|
2580
|
-
border-top-left-radius: 0;
|
|
2581
|
-
border-bottom-left-radius: 0;
|
|
2582
|
-
border-top: 0;
|
|
2583
|
-
border-bottom: 0;
|
|
2584
|
-
border-right:0;
|
|
2585
|
-
}
|
|
2586
|
-
.card-expiry-new{
|
|
2587
|
-
border-top-left-radius: 0px;
|
|
2588
|
-
border-top-right-radius: 0px;
|
|
2589
|
-
}
|
|
2590
|
-
.form-control-frac{box-sizing: border-box ;}
|
|
2591
|
-
#PaymentForm .form-group-frac{
|
|
2592
|
-
padding:5px 0 ;
|
|
2593
|
-
matgin: 0 !important
|
|
2594
|
-
}
|
|
2595
|
-
|
|
2596
|
-
.toggle-label {
|
|
2597
|
-
position: relative;
|
|
2598
|
-
display: inline-block;
|
|
2599
|
-
width: 40px;
|
|
2600
|
-
height: 24px;
|
|
2601
|
-
background-color: #ccc;
|
|
2602
|
-
border-radius: 12px;
|
|
2603
|
-
cursor: pointer;
|
|
2604
|
-
transition: background-color 0.3s;
|
|
2605
|
-
}
|
|
2606
|
-
|
|
2607
|
-
.toggle-label::before {
|
|
2608
|
-
content: "";
|
|
2609
|
-
position: absolute;
|
|
2610
|
-
top: 2px;
|
|
2611
|
-
left: 2px;
|
|
2612
|
-
width: 20px;
|
|
2613
|
-
height: 20px;
|
|
2614
|
-
background: #ffffff;
|
|
2615
|
-
border-radius: 50%;
|
|
2616
|
-
transition: left 300ms linear;
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
.toggle-checkbox {
|
|
2620
|
-
display: none;
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
.toggle-checkbox:checked + .toggle-label {
|
|
2624
|
-
background-color: #4caf50;
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
.toggle-checkbox:checked + .toggle-label::before {
|
|
2628
|
-
left: 18px;
|
|
2629
|
-
}
|
|
2630
|
-
.ach-scrl {
|
|
2631
|
-
max-height: 380px;
|
|
2632
|
-
min-height: 380px;
|
|
2633
|
-
overflow-y: auto;
|
|
2634
|
-
padding-right: 6px;
|
|
2635
|
-
}
|
|
2636
|
-
.mb-4{
|
|
2637
|
-
margin-bottom:4px
|
|
2638
|
-
}
|
|
2639
|
-
.ach-scrl::-webkit-scrollbar {
|
|
2640
|
-
width: 3px;
|
|
2641
|
-
background-color: #F5F5F5;
|
|
2642
|
-
}
|
|
2643
|
-
.ach-scrl::-webkit-scrollbar-thumb {
|
|
2644
|
-
background-color: #35254D;
|
|
2645
|
-
}
|
|
2646
|
-
|
|
2647
|
-
.error-span{
|
|
2648
|
-
color:red !important;
|
|
2649
|
-
font-size:12px !important;
|
|
2650
|
-
text-align: left !important;
|
|
2651
|
-
width: 100% !important;
|
|
2652
|
-
display: block;
|
|
2653
|
-
}
|
|
2654
|
-
|
|
2655
|
-
.charge-customer-name-frac{
|
|
2656
|
-
color: #161616;
|
|
2657
|
-
font-family: Inter;
|
|
2658
|
-
font-size: 24px;
|
|
2659
|
-
font-style: normal;
|
|
2660
|
-
font-weight: 600;
|
|
2661
|
-
line-height: 32px;
|
|
2662
|
-
letter-spacing: -0.48px;
|
|
2663
|
-
text-transform: capitalize;
|
|
2664
|
-
margin-top:0;
|
|
2665
|
-
margin-bottom:16px !important;
|
|
2666
|
-
text-align:left !important
|
|
2667
|
-
}
|
|
2668
|
-
.card-ach-heading-frac {
|
|
2669
|
-
color: #727272;
|
|
2670
|
-
font-family: Inter;
|
|
2671
|
-
font-size: 12px;
|
|
2672
|
-
font-style: normal;
|
|
2673
|
-
font-weight: 500;
|
|
2674
|
-
line-height: 18px;
|
|
2675
|
-
letter-spacing: -0.24px;
|
|
2676
|
-
margin : 0 0 10px !important;
|
|
2677
|
-
text-align : left
|
|
2678
|
-
}
|
|
2679
|
-
.card-list-div{
|
|
2680
|
-
max-height : 190px;
|
|
2681
|
-
overflow-y : auto;
|
|
2682
|
-
border:1px solid #E0DFE2;
|
|
2683
|
-
border-radius : 8px
|
|
2684
|
-
}
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
.card-list-div::-webkit-scrollbar{
|
|
2688
|
-
width:2px;
|
|
2689
|
-
background-color:#F5F5F5
|
|
2690
|
-
}
|
|
2691
|
-
.card-list-div::-webkit-scrollbar-thumb{
|
|
2692
|
-
background-color:#35254D
|
|
2693
|
-
}
|
|
2694
|
-
|
|
2695
|
-
.card-list-single-div{
|
|
2696
|
-
border-bottom: 1px solid #E0DFE2;
|
|
2697
|
-
padding : 8px 11px;
|
|
2698
|
-
display : flex ;
|
|
2699
|
-
align-items:center;
|
|
2700
|
-
justify-content : space-between;
|
|
2701
|
-
gap:12px
|
|
2702
|
-
}
|
|
2703
|
-
.card-list-single-div:last-child {
|
|
2704
|
-
border-bottom: none;
|
|
2705
|
-
}
|
|
2706
|
-
.card-lint-div-in{
|
|
2707
|
-
min-height:444px}
|
|
2708
|
-
.card-number-radio{
|
|
2709
|
-
display:flex;
|
|
2710
|
-
gap:12px;
|
|
2711
|
-
}
|
|
2712
|
-
.card-number-radio .card-number-last-four{
|
|
2713
|
-
color:#161616 !important;
|
|
2714
|
-
font-family:Inter !important;
|
|
2715
|
-
font-size:14px !important;
|
|
2716
|
-
font-weight:500 !important;
|
|
2717
|
-
font-style:normal !important;
|
|
2718
|
-
line-height : 18px !important;
|
|
2719
|
-
latter-spacing:-0.18px !important
|
|
2720
|
-
}
|
|
2721
|
-
.card-expiry-date{
|
|
2722
|
-
margin:0;
|
|
2723
|
-
color:#00000080;
|
|
2724
|
-
font-family:Inter;
|
|
2725
|
-
font-size:14px;
|
|
2726
|
-
font-weight:500;
|
|
2727
|
-
font-style"normal;
|
|
2728
|
-
line-height : 18px;
|
|
2729
|
-
latter-spacing:-0.18px
|
|
2730
|
-
}
|
|
2731
|
-
.pay-with-other-card {
|
|
2732
|
-
margin-top : 12px;
|
|
2733
|
-
padding:12px 32px;
|
|
2734
|
-
border :1px solid #E0DFE2;
|
|
2735
|
-
border-radius : 1000px;
|
|
2736
|
-
display: flex;
|
|
2737
|
-
justify-content : center;
|
|
2738
|
-
align-items:center;
|
|
2739
|
-
gap:10px;
|
|
2740
|
-
// width:100%;
|
|
2741
|
-
background:white;
|
|
2742
|
-
cursor:pointer;
|
|
2743
|
-
color:#161616;
|
|
2744
|
-
text-align:center
|
|
2745
|
-
font-family: Inter;
|
|
2746
|
-
font-size: 14px;
|
|
2747
|
-
font-style: normal;
|
|
2748
|
-
font-weight: 500;
|
|
2749
|
-
line-height: 24px;
|
|
2750
|
-
letter-spacing: -0.28px;
|
|
2751
|
-
// margin-bottom: 50px;
|
|
2752
|
-
}
|
|
2753
|
-
.charge-payment-back-btn {
|
|
2754
|
-
display: flex;
|
|
2755
|
-
padding: 6px 12px !important ;
|
|
2756
|
-
align-items: center;
|
|
2757
|
-
gap: 6px;
|
|
2758
|
-
border-radius: 1000px;
|
|
2759
|
-
border: 1px solid #E0DFE2;
|
|
2760
|
-
background: #FFF;
|
|
2761
|
-
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
2762
|
-
font-size:16px;
|
|
2763
|
-
curso:pointer;
|
|
2764
|
-
color:black
|
|
2765
|
-
}
|
|
2766
|
-
.res-charge-payment-back-btn{
|
|
2767
|
-
padding: 9px 16px;
|
|
2768
|
-
align-items: center;
|
|
2769
|
-
gap: 6px;
|
|
2770
|
-
margin-bottom: 20px;
|
|
2771
|
-
border-radius: 1000px;
|
|
2772
|
-
border: 1px solid #E0DFE2;
|
|
2773
|
-
background: #FFF;
|
|
2774
|
-
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
2775
|
-
font-size:16px;
|
|
2776
|
-
curso:pointer;
|
|
2777
|
-
color:black;
|
|
2778
|
-
display:none
|
|
2779
|
-
}
|
|
2780
|
-
.btn {
|
|
2781
|
-
padding: 11px 23px;
|
|
2782
|
-
background-color: black;
|
|
2783
|
-
color: white;
|
|
2784
|
-
border: none;
|
|
2785
|
-
border-radius: 6px;
|
|
2786
|
-
font-weight: bold;
|
|
2787
|
-
margin: 0 10px;
|
|
2788
|
-
cursor: pointer;
|
|
2789
|
-
}
|
|
2790
|
-
|
|
2791
|
-
.custom-swal-icon {
|
|
2792
|
-
margin: 20px auto;
|
|
2793
|
-
}
|
|
2794
|
-
|
|
2795
|
-
.custom-swal-popup {
|
|
2796
|
-
font-size: 16px;
|
|
2797
|
-
text-align: center;
|
|
2798
|
-
}
|
|
2799
|
-
|
|
2800
|
-
.frac-form .res-pay-con{
|
|
2801
|
-
display:none
|
|
2802
|
-
}
|
|
2803
|
-
|
|
2804
|
-
.saveachtext p, .saveachtext b {
|
|
2805
|
-
font-size: 12px !important;
|
|
2806
|
-
color: #727272 !important;
|
|
2807
|
-
}
|
|
2808
|
-
|
|
2809
|
-
.cardicon-img img {
|
|
2810
|
-
margin-top: -2px !important;
|
|
2811
|
-
}
|
|
2812
|
-
|
|
2813
|
-
.bankicon-img img {
|
|
2814
|
-
margin-top: -4px !important;
|
|
2815
|
-
}
|
|
2816
|
-
|
|
2817
|
-
.cardicon {
|
|
2818
|
-
margin-right : 8px !important;
|
|
2819
|
-
width : 18px !important;
|
|
2820
|
-
}
|
|
2821
|
-
|
|
2822
|
-
.bankicon {
|
|
2823
|
-
margin-right : 8px !important;
|
|
2824
|
-
width : 18px !important;
|
|
2825
|
-
}
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
.frac-tooltip-wrapper {
|
|
2829
|
-
position: absolute;
|
|
2830
|
-
right:0;
|
|
2831
|
-
}
|
|
2832
|
-
|
|
2833
|
-
.frac-tooltip-icon {
|
|
2834
|
-
cursor: pointer;
|
|
2835
|
-
}
|
|
2836
|
-
.frac-tooltip-mn{
|
|
2837
|
-
position:relative;
|
|
2838
|
-
}
|
|
2839
|
-
.frac-tooltip-text {
|
|
2840
|
-
display: none;
|
|
2841
|
-
position: absolute;
|
|
2842
|
-
top:-15px;
|
|
2843
|
-
right: 22px;
|
|
2844
|
-
background: #161616;
|
|
2845
|
-
color: white;
|
|
2846
|
-
padding: 15px;
|
|
2847
|
-
border-radius: 10px;
|
|
2848
|
-
width: 200px;
|
|
2849
|
-
font-size:12px;
|
|
2850
|
-
word-break: break-word;
|
|
2851
|
-
white-space: normal;
|
|
2852
|
-
z-index: 999;
|
|
2853
|
-
}
|
|
2854
|
-
|
|
2855
|
-
.frac-tooltip-wrapper:hover .frac-tooltip-text {
|
|
2856
|
-
display: block;
|
|
2857
|
-
}
|
|
2858
|
-
|
|
2859
|
-
.frac-tooltip-text p,.frac-tooltip-text b {
|
|
2860
|
-
font-size : 12px !important;
|
|
2861
|
-
line-height : 1.5 !important;
|
|
2862
|
-
margin-bottom : 10px !important;
|
|
2863
|
-
}
|
|
2864
|
-
|
|
2865
|
-
.amt-pay-con {
|
|
2866
|
-
padding-right: 24px;
|
|
2867
|
-
}
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
@media (max-width: 768px) {
|
|
2872
|
-
.card-lint-div-in {
|
|
2873
|
-
min-height: auto;
|
|
2874
|
-
margin-bottom: 10px;
|
|
2875
|
-
}
|
|
2876
|
-
.ach-scrl {
|
|
2877
|
-
min-height: auto !important;
|
|
2878
|
-
margin-bottom: 10px;
|
|
2879
|
-
}
|
|
2880
|
-
.request-payment-close-popup {
|
|
2881
|
-
right: 12px !important;
|
|
2882
|
-
top: 12px !important;
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
|
-
.parent-pay-container{
|
|
2886
|
-
padding:24px;
|
|
2887
|
-
}
|
|
2888
|
-
.pay-container {
|
|
2889
|
-
grid-template-columns: 1fr;
|
|
2890
|
-
padding: 10px 5%;
|
|
2891
|
-
border:1px solid #E0DFE2;
|
|
2892
|
-
border-radius : 12px
|
|
2893
|
-
}
|
|
2894
|
-
.pay-conatiner-one{
|
|
2895
|
-
border-right: none;
|
|
2896
|
-
}
|
|
2897
|
-
.pay-conatiner-one-first{
|
|
2898
|
-
min-height:0
|
|
2899
|
-
}
|
|
2900
|
-
.pay-main-logo > img{
|
|
2901
|
-
display: none;
|
|
2902
|
-
}
|
|
2903
|
-
.pay-main-logo-res > img {
|
|
2904
|
-
display:block;
|
|
2905
|
-
margin:auto
|
|
2906
|
-
}
|
|
2907
|
-
|
|
2908
|
-
.pay-logo-container{
|
|
2909
|
-
border :none
|
|
2910
|
-
}
|
|
2911
|
-
// .res-charge-payment-back-btn {
|
|
2912
|
-
// display:flex !important
|
|
2913
|
-
// }
|
|
2914
|
-
// .charge-payment-back-btn{
|
|
2915
|
-
// display:none !important
|
|
2916
|
-
// }
|
|
2917
|
-
|
|
2918
|
-
.frac-new-form .pay-amount-conatiner {
|
|
2919
|
-
margin-top: 0px;
|
|
2920
|
-
margin-bottom: 24px;
|
|
2921
|
-
}
|
|
2922
|
-
.frac-form .res-pay-con{
|
|
2923
|
-
display:flex;
|
|
2924
|
-
justify-content :space-between;
|
|
2925
|
-
align-items:center;
|
|
2926
|
-
padding-bottom : 10px
|
|
2927
|
-
}
|
|
2928
|
-
.amt-pay-con {
|
|
2929
|
-
padding-right: 0px;
|
|
2930
|
-
}
|
|
2931
|
-
.pay-conatiner-one-last{
|
|
2932
|
-
display:none}
|
|
2933
|
-
.pay-conatiner-two{
|
|
2934
|
-
padding:0
|
|
2935
|
-
}
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
}
|
|
2939
|
-
@media (max-width : 512px){
|
|
2940
|
-
.tab button {
|
|
2941
|
-
padding: 6px 16px;
|
|
2942
|
-
}
|
|
2943
|
-
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
.frac-cash-discount-fee {
|
|
2948
|
-
display: flex;
|
|
2949
|
-
padding: 11px;
|
|
2950
|
-
justify-content: space-between;
|
|
2951
|
-
align-items: center;
|
|
2952
|
-
align-self: stretch;
|
|
2953
|
-
border-radius: 8px;
|
|
2954
|
-
border: 1px solid #E0DFE2;
|
|
2955
|
-
background: #F6F6F7;
|
|
2956
|
-
margin-top: 24px;
|
|
2957
|
-
}
|
|
2958
|
-
.frac-cash-discount-fee small {
|
|
2959
|
-
color:#727272;
|
|
2960
|
-
font-size: 12px;
|
|
2961
|
-
font-weight: 500;
|
|
2962
|
-
}
|
|
2963
|
-
.frac-cash-discount-fee p{
|
|
2964
|
-
margin:0px;
|
|
2965
|
-
font-size: 14px;
|
|
2966
|
-
font-weight: 500;
|
|
2967
|
-
}
|
|
2968
|
-
.frac-card-payment-heading {
|
|
2969
|
-
font-size: 24px;
|
|
2970
|
-
font-style: normal;
|
|
2971
|
-
font-weight: 600;
|
|
2972
|
-
margin:0px;
|
|
2973
|
-
}
|
|
2974
|
-
|
|
2975
|
-
.frac-heading-card-wrap {
|
|
2976
|
-
display: flex;
|
|
2977
|
-
align-items: center;
|
|
2978
|
-
margin-bottom:12px;
|
|
2979
|
-
}
|
|
2980
|
-
.frac-backarrow {
|
|
2981
|
-
margin-right: 10px;
|
|
2982
|
-
}
|
|
2983
|
-
.frac-charge-payment-back-btn-wrap , .frac-tab-2{
|
|
2984
|
-
display: none;
|
|
2985
|
-
}
|
|
2986
|
-
.frac-pay-conatiner-one{
|
|
2987
|
-
display: flex;
|
|
2988
|
-
flex-direction: column;
|
|
2989
|
-
justify-content: space-between;
|
|
2990
|
-
min-height: auto;
|
|
2991
|
-
}
|
|
2992
|
-
|
|
2993
|
-
.frac-form .saveachlabel {
|
|
2994
|
-
margin-bottom : 0px !important;
|
|
2995
|
-
}
|
|
2996
|
-
|
|
2997
|
-
.frac-partial-payment-input{
|
|
2998
|
-
margin-top: 12px !important;
|
|
2999
|
-
}
|
|
3000
|
-
|
|
3001
|
-
.challengeUrlclass-frac{
|
|
3002
|
-
height : 90vh;
|
|
3003
|
-
width : 100%;
|
|
3004
|
-
border-radius : 8px;
|
|
3005
|
-
border : none;
|
|
3006
|
-
}
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
`)}import d,{useCallback as Mr,useEffect as $i,useRef as Xi,useState as it}from"react";import kn from"axios";import mi from"sweetalert2";import{useEffect as Cr,useRef as wr}from"react";function Ca({challengeUrl:e,fractalToken:t,stripeIntentId:H,onSuccess:T,onError:B,containerRef:Y}){let K=wr(null);return Cr(()=>{if(!e||typeof window=="undefined")return;let U=Y.current;if(!U)return;K.current&&U.contains(K.current)&&U.removeChild(K.current);let ve=document.createElement("iframe");ve.className="challengeUrlclass-frac",ve.src=e,K.current=ve,U.appendChild(ve);let Z=A=>{var G;((G=A.data)==null?void 0:G.type)==="3ds-authentication-challenge-complete"&&(U.innerHTML="",A.data.status==="succeeded"?T(t,H):B(A.data.status))};return window.addEventListener("message",Z),()=>{window.removeEventListener("message",Z),K.current&&U.contains(K.current)&&U.removeChild(K.current)}},[e,Y,t,H,T,B]),null}import{Elements as _r}from"@stripe/react-stripe-js";import{loadStripe as Pr}from"@stripe/stripe-js";import{PaymentElement as wa,useElements as Nr,useStripe as kr}from"@stripe/react-stripe-js";import Sr from"axios";import{useState as Na}from"react";var ka=({onSuccess:e,showLoader:t,setError:H,session_token:T,callback:B,hideLoader:Y,handleClose:K,amount:U,isPreAuth:ve})=>{var V;let Z=kr(),A=Nr(),[G,oe]=Na(!1),[w,C]=Na(null);return React.createElement("form",{onSubmit:async y=>{var _e,M,Te,Pe,me,ke,ut;if(y.preventDefault(),!Z||!A){console.warn("stripe nopt loaded");return}console.log("Stripe:",Z),console.log("Elements:",A),console.log("PaymentElement:",A.getElement(wa)),t(),oe(!0);try{let{error:Fe,paymentIntent:Me}=await Z.confirmPayment({elements:A,confirmParams:{},redirect:"if_required"});if(oe(!1),Fe)console.log(Fe,"paymentIntent error"),H(Fe.message||"Payment failed.");else if((Me==null?void 0:Me.status)==="succeeded"){if(C("\u2705 Payment successful!"),e){console.log(Me,"paymentIntent");try{let ce=await Sr.post(`${je}api/v1/gateway/secure-charge/${T}`,{stripe_id:Me==null?void 0:Me.id});if(console.log(ce,"chargeDetails"),(_e=ce==null?void 0:ce.data)!=null&&_e.result){let Ye=(M=ce==null?void 0:ce.data)==null?void 0:M.data;console.log(Ye,"callbackdata"),B(F(v({},Ye),{isPreAuth:ve})),K(),Y()}console.log((Te=ce==null?void 0:ce.data)==null?void 0:Te.data,"chargeDetails")}catch(ce){console.log(ce==null?void 0:ce.response,"error"),H(((me=(Pe=ce==null?void 0:ce.response)==null?void 0:Pe.data)==null?void 0:me.message)||"Something went wrong"),Y()}}setTimeout(()=>window.close(),1500)}else C("Processing payment...")}catch(Fe){console.log(Fe==null?void 0:Fe.response,"error"),H(((ut=(ke=Fe==null?void 0:Fe.response)==null?void 0:ke.data)==null?void 0:ut.message)||"Something went wrong"),Y()}}},React.createElement(wa,null),React.createElement("button",{className:"pay-button",disabled:G||!Z},G?"Processing...":`${be((V=Number(U))==null?void 0:V.toFixed(2))}`))};var Fr=Pr(Qn);function Qi({clientSecret:e,onSuccess:t,showLoader:H,setError:T,session_token:B,callback:Y,hideLoader:K,handleClose:U,amount:ve,isPreAuth:Z}){return e?React.createElement(_r,{stripe:Fr,options:{clientSecret:e}},React.createElement(ka,{onSuccess:t,showLoader:H,hideLoader:K,setError:T,session_token:B,callback:Y,handleClose:U,amount:ve,isPreAuth:Z})):null}import{IoArrowBack as Di}from"react-icons/io5";import{NumericFormat as Lr}from"react-number-format";var Ar=({amount:e,bankAmount:t,submitBtnText:H="Pay",session_token:T,customerId:B,callback:Y,merchantName:K="merchant",isPreAuth:U,surcharge:ve="0",submitBtnClass:Z,submitBtnIcon:A,isRequest:G,pass_fee:oe,pass_fee_amount:w,require3ds:C=!1,autoTrigger:ee=!1,show:V,setShow:y,setHandleCloseRef:_e,isPartial:M,bankSurcharge:Te,partialRef:Pe,loadingPrev:me=!1,orderGuid:ke,remainingAmount:ut})=>{var Nt,le,yt,Jt,dn,ei,zn,Et,Gn,hn,mn,Si,_i,ji,Pi,Vn;let Fe=Xi(!1),Me=Xi(!1),ce=Xi(null),[Ye,Je]=it("card"),[ln,Ut]=it("card"),[h,L]=it(),[u,Ce]=it({}),[a,o]=it(),[r,b]=it({}),[k,P]=it(!1),[O,x]=it(!1),[f,N]=it(""),[$e,dt]=it(!1),[Ee,Ft]=it(""),[mt,Re]=it(!1),[ze,ue]=it(!1),[E,Le]=it([]),[at,D]=it([]),[St,Ze]=it(),[_t,S]=it(Number(e)),[bn,Pt]=it("form"),[ft,cn]=it("form"),[vt,Yn]=it(!1),[Ln,Ct]=it(0),[An,Sn]=it(""),[_n,Q]=it(null),[$,We]=it(!1),[Tt,Qe]=it(!1),[rt,ht]=it(null),[qt,Mt]=it(!1),[zt,Wt]=it(ke||null),[ot,Ve]=it(""),[Yt,Ht]=it(""),[Dt,Rt]=it(""),en=ne+"widget/mc-img.svg",tn=ne+"widget/visa-img.svg",nn=ne+"widget/ae-img.svg",un=ne+"widget/discover-img.svg",Gt=ne+"widget/card.svg",Oe=ne+"widget/Trash.svg",jt=ne+"widget/bank.svg",_=ne+"widget/secure-img.png",g=ne+"widget/pov-by.png",se=ne+"widget/pax.svg",ge=ne+"widget/cardicon.svg",te=ne+"widget/bankicon.svg",Ke=()=>Re(!0),fe=()=>Re(!1),wt=(s,l)=>{let X=(parseFloat(l)||0)/100,de=s/(1+X);return Math.round(de*100)/100},Ge=async s=>{var l,X,de,R,xe,Ae,he,De,pe;try{let J=v({pass_fee_amount:Number(e)-_t,pass_fee:oe,Token:s==null?void 0:s.Token,amount:ot||e,postal_code:s==null?void 0:s.postalCode,require3ds:C,isPartial:M,orderGuid:zt||ke},O?{card:{postal_code:h==null?void 0:h.zipCode,customer_id:B,gateway_token:(s==null?void 0:s.Token)||(s==null?void 0:s.gateway_token),name:h==null?void 0:h.cardName}}:null);C&&(s!=null&&s.stripe_3ds_auth_id)&&(J.stripe_3ds_auth_id=s==null?void 0:s.stripe_3ds_auth_id);let z=await kn.post(`${je}api/v1/gateway/charge/${T}`,J);if((l=z==null?void 0:z.data)!=null&&l.result){let lt={callback:F(v({},(X=z==null?void 0:z.data)==null?void 0:X.data),{name:h==null?void 0:h.cardName,isPreAuth:U})};Y(lt),fe(),nt()}}catch(J){N(((R=(de=J==null?void 0:J.response)==null?void 0:de.data)==null?void 0:R.message)||"Something went wrong!"),Y({error:((Ae=(xe=J==null?void 0:J.response)==null?void 0:xe.data)==null?void 0:Ae.message)||"Something went wrong!",result:(De=(he=J==null?void 0:J.response)==null?void 0:he.data)==null?void 0:De.result,statusCode:(pe=J==null?void 0:J.response)==null?void 0:pe.status}),fe()}},ct=async s=>{var l,X,de,R,xe,Ae,he,De,pe;try{let J=v({Token:s==null?void 0:s.Token,amount:e,postal_code:s==null?void 0:s.postalCode},O?{card:{postal_code:h==null?void 0:h.zipCode,customer_id:B,gateway_token:(s==null?void 0:s.Token)||(s==null?void 0:s.gateway_token),name:h==null?void 0:h.cardName}}:null),z=await kn.post(`${je}api/v1/gateway/preauth/${T}`,J);if((l=z==null?void 0:z.data)!=null&&l.result){let lt,At={callback:F(v({},(X=z==null?void 0:z.data)==null?void 0:X.data),{name:h==null?void 0:h.cardName,isPreAuth:U})};Y(At),fe(),nt()}}catch(J){N(((R=(de=J==null?void 0:J.response)==null?void 0:de.data)==null?void 0:R.message)||"Something went wrong!"),Y({error:((Ae=(xe=J==null?void 0:J.response)==null?void 0:xe.data)==null?void 0:Ae.message)||"Something went wrong!",result:(De=(he=J==null?void 0:J.response)==null?void 0:he.data)==null?void 0:De.result,statusCode:(pe=J==null?void 0:J.response)==null?void 0:pe.status}),fe()}},Vt=async s=>{var l,X,de,R,xe,Ae,he,De,pe;if(s.Error)N(s.Error),Y({error:s.Error||"Something went wrong!"}),fe();else{let J={token:s.Token,resp:s};try{let z=await kn.post(`${je}api/v1/gateway/update/token/${T}`,J);if((z==null?void 0:z.status)==200){let lt={Token:(X=(l=z==null?void 0:z.data)==null?void 0:l.data)==null?void 0:X.gateway_token,Brand:s.Brand,ExpirationMonth:s.ExpirationMonth,ExpirationYear:s.ExpirationYear,Last4:s.Last4,Bin:s.Bin,CVV:s.CVV,postalCode:h==null?void 0:h.zipCode},At;U?ct(lt):Ge(lt)}}catch(z){console.log(z,"error"),fe(),N(((R=(de=z==null?void 0:z.response)==null?void 0:de.data)==null?void 0:R.message)||"Something went wrong!"),Y({error:((Ae=(xe=z==null?void 0:z.response)==null?void 0:xe.data)==null?void 0:Ae.message)||"Something went wrong!",result:(De=(he=z==null?void 0:z.response)==null?void 0:he.data)==null?void 0:De.result,statusCode:(pe=z==null?void 0:z.response)==null?void 0:pe.status})}}},p=s=>{Je(s)},c=()=>{var X,de,R,xe,Ae,he,De,pe;let s={},l=a;return(X=l==null?void 0:l.name)!=null&&X.trim()||(s.name="Name is required"),(de=l==null?void 0:l.accountNumber)!=null&&de.trim()||(s.accountNumber="Account number is required"),(R=l==null?void 0:l.accountNumber)!=null&&R.trim()&&((xe=l==null?void 0:l.accountNumber)==null?void 0:xe.trim())!==((Ae=l==null?void 0:l.confirmAccountNumber)==null?void 0:Ae.trim())&&(s.confirmAccountNumber="Account numbers must match"),(he=l==null?void 0:l.bankName)!=null&&he.trim()||(s.bankName="Bank name is required"),(De=l==null?void 0:l.routingNumber)!=null&&De.trim()||(s.routingNumber="Routing Number is required"),l!=null&&l.routingNumber&&((pe=l==null?void 0:l.routingNumber)==null?void 0:pe.length)!==9&&(s.routingNumber="Routing number must be 9 digits"),((l==null?void 0:l.accountType)==="business saving"||(l==null?void 0:l.accountType)==="business checking")&&(!(l!=null&&l.companyName)||(l==null?void 0:l.companyName)==="")&&(s.companyName="Company Name is required for business accounts"),b(s),Object.keys(s).length>0},W=async(s,l)=>{var X,de,R,xe,Ae,he,De,pe;try{let J=s,z=await kn.post(`${je}api/v1/gateway/verify-and-save/${T}`,{token:J,require3ds:C,pass_fee:oe});if((z==null?void 0:z.status)==200){let lt=(X=z==null?void 0:z.data)==null?void 0:X.data,At={Token:lt.gateway_token,Brand:lt.card_data.brand,ExpirationMonth:lt.card_data.expire_mm,ExpirationYear:lt.card_data.expire_yy,Last4:lt.card_data.last4,Bin:lt.card_data.bin,postalCode:h==null?void 0:h.zipCode,stripe_3ds_auth_id:l};U?ct(At):Ge(At)}}catch(J){console.log(J,"error"),N(((R=(de=J==null?void 0:J.response)==null?void 0:de.data)==null?void 0:R.message)||"Something went wrong!"),Y({error:((Ae=(xe=J==null?void 0:J.response)==null?void 0:xe.data)==null?void 0:Ae.message)||"Something went wrong!",result:(De=(he=J==null?void 0:J.response)==null?void 0:he.data)==null?void 0:De.result,statusCode:(pe=J==null?void 0:J.response)==null?void 0:pe.status}),fe()}},Se=async()=>{var s,l,X,de,R,xe,Ae,he,De,pe,J,z,lt,At,Qt,ti,pt,ui,bt,gi,Fi,ni,Kt,$t,pi,fi,ta,na,ia,aa,ra,oa;try{let pn={method:"POST",redirect:"follow"},vn=await kn.post(`${je}api/v1/widget/generate-session`,pn),ii=Number(h==null?void 0:h.expiryYear)%100,sa=`${(s=h==null?void 0:h.cardNumber)==null?void 0:s.replace(/\s+/g,"")}=${ii}${h==null?void 0:h.expiryMonth} ${h==null?void 0:h.cvv}`,ai=forge.pki.publicKeyFromPem((X=(l=vn==null?void 0:vn.data)==null?void 0:l.data)==null?void 0:X.publicKeyPem).encrypt(sa,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Sa=forge.util.encode64(ai),_a={"Content-Type":"application/json","x-app-session-key":(R=(de=vn.data)==null?void 0:de.data)==null?void 0:R.session_key},la={enc_track2_data:Sa,algorithm:"RSAES_OAEP_SHA_1",session_key:(Ae=(xe=vn==null?void 0:vn.data)==null?void 0:xe.data)==null?void 0:Ae.session_key};if(C&&typeof window!="undefined"&&typeof navigator!="undefined"){let Xt=(he=navigator.languages)!=null?he:[navigator.language],da=Array.isArray(Xt)?Xt[0]:Xt;la.three_ds_data={amount:Math.round(ot?parseFloat(ot)*100:parseFloat(e)*100),currency:"usd",channel:{type:"browser",browser:{language:typeof da=="string"?da:null,color_depth:(pe=(De=window.screen)==null?void 0:De.colorDepth)!=null?pe:null,java_enabled:typeof navigator.javaEnabled=="function"?navigator.javaEnabled():!1,screen_height:(z=(J=window.screen)==null?void 0:J.height)!=null?z:null,screen_width:(At=(lt=window.screen)==null?void 0:lt.width)!=null?At:null,timezoneOffset:new Date().getTimezoneOffset()}}}}let Pa=JSON.stringify(la),fn=await kn.post(`${rn}tokenizer/tokenize`,Pa,{headers:_a});if((fn==null?void 0:fn.status)==200){let Xt=(ti=(Qt=fn==null?void 0:fn.data)==null?void 0:Qt.data)==null?void 0:ti.stripe_three_ds_response;C&&!Xt&&Xt.status==="200 OK"&&((pt=Xt==null?void 0:Xt.data)!=null&&pt.challenge_url)&&N("Something went wrong. Please try again later."),C?(ui=Xt==null?void 0:Xt.data)!=null&&ui.challenge_url?(fe(),ht(F(v({},Xt==null?void 0:Xt.data),{fractalToken:(Kt=(ni=fn==null?void 0:fn.data)==null?void 0:ni.data)==null?void 0:Kt.token}))):W((gi=(bt=fn==null?void 0:fn.data)==null?void 0:bt.data)==null?void 0:gi.token,(Fi=Xt==null?void 0:Xt.data)==null?void 0:Fi.id):W((pi=($t=fn==null?void 0:fn.data)==null?void 0:$t.data)==null?void 0:pi.token,null)}}catch(pn){fe(),console.log(pn,"error");let vn="Something went wrong!";try{let ii=((fi=pn==null?void 0:pn.response)==null?void 0:fi.data)||(pn==null?void 0:pn.message)||"",Mi=typeof ii=="string"?ii:JSON.stringify(ii),hi=(((na=(ta=Mi.split)==null?void 0:ta.call(Mi,`
|
|
3013
|
-
`))==null?void 0:na.filter(Boolean))||[]).at(-1)||"",ai=(ia=hi.split)==null?void 0:ia.call(hi,": ");vn=(ai==null?void 0:ai.length)>1?ai.pop().trim():hi.trim()||vn}catch(ii){vn="Something went wrong!"}N(vn),Y({error:vn,result:(ra=(aa=pn==null?void 0:pn.response)==null?void 0:aa.data)==null?void 0:ra.result,statusCode:(oa=pn==null?void 0:pn.response)==null?void 0:oa.status})}},ie=()=>{var R,xe,Ae,he,De,pe;let s={},l=h,X=parseInt((l==null?void 0:l.expiryMonth)||"",10),de=(l==null?void 0:l.expiryYear)||"";if((R=l==null?void 0:l.cardName)!=null&&R.trim()||(s.cardName="Card name is required"),(xe=l==null?void 0:l.cardNumber)!=null&&xe.trim()||(s.cardNumber="Card number is required"),(!((Ae=l==null?void 0:l.expiryMonth)!=null&&Ae.trim())||!((he=l==null?void 0:l.expiryYear)!=null&&he.trim())||isNaN(X)||X<1||X>12||de.length!==4)&&(s.expiryMonth="Invalid Expiration Date."),(De=l==null?void 0:l.cvv)!=null&&De.trim()||(s.cvv="CVV is required"),(pe=l==null?void 0:l.zipCode)!=null&&pe.trim()||(s.zipCode="ZIP code is required"),l!=null&&l.expiryMonth&&(l!=null&&l.expiryYear)&&l.expiryMonth.length<=2&&l.expiryYear.length===4){let J=parseInt(l.expiryMonth,10),z=parseInt(l.expiryYear,10),lt=new Date,At=lt.getMonth()+1,Qt=lt.getFullYear();(z<Qt||z===Qt&&J<At)&&(s.expiryMonth="Card is expired")}return Ce(s),Object.keys(s).length>0},et=()=>{let s=DatacapWebToken.validateCardNumber(h==null?void 0:h.cardNumber.replaceAll(" ","")),l=DatacapWebToken.validateExpirationDate(h==null?void 0:h.expiryMonth,h==null?void 0:h.expiryYear),X=DatacapWebToken.validateCVV(h==null?void 0:h.cvv),de={};return s||(de.cardNumber="Invalid card Number"),l||(de.expiryMonth="Invalid Expiration Date."),X||(de.cvv="Invalid CVV"),Ce(de),s&&X&&l},we=async s=>{var X,de,R,xe,Ae,he,De,pe,J,z,lt,At,Qt,ti,pt,ui;s.preventDefault();let l=document.activeElement;if(l instanceof HTMLElement&&l.blur(),!mt&&!Yt){if(Ye!=="ach"){if(ie()||!et())return}else if(c())return;try{Ke();let bt=await kn.get(`${je}api/v1/gateway/token/${T}`,{params:{require3ds:C,pass_fee:oe}});if((bt==null?void 0:bt.status)==200){let gi=(de=(X=bt==null?void 0:bt.data)==null?void 0:X.data)==null?void 0:de.gateway_token,Fi=(xe=(R=bt==null?void 0:bt.data)==null?void 0:R.data)==null?void 0:xe.paymentGateway;if(Ye!=="ach")Fi==((Ae=Hi)==null?void 0:Ae.FRACTALKEY)?await Se():DatacapWebToken.requestToken(gi,"PaymentForm",Vt);else{let ni;try{let Kt=await kn.post(`${je}api/v1/gateway/bank-charge/${T}`,v({label:a==null?void 0:a.name,account_number:a==null?void 0:a.accountNumber,routing_number:a==null?void 0:a.routingNumber,bank_name:a==null?void 0:a.bankName,account_type:a==null?void 0:a.accountType,amount:`${t}`,customer_id:null,isSaveAch:!1,tax:"0.00",discount:"0.00",surcharge:"0.00",order_id:"",company_name:(a==null?void 0:a.companyName)||""},k?{bank:{name:a==null?void 0:a.name,account_number:a==null?void 0:a.accountNumber,routing_number:a==null?void 0:a.routingNumber,bank_name:a==null?void 0:a.bankName,account_type:a==null?void 0:a.accountType,customer_id:B||"",company_name:(a==null?void 0:a.companyName)||""}}:null));(he=Kt==null?void 0:Kt.data)!=null&&he.result&&(ni=F(v({},ni),{callback:F(v({},(De=Kt==null?void 0:Kt.data)==null?void 0:De.data),{name:a==null?void 0:a.name,isPreAuth:U})}),Y(ni),nt(),fe())}catch(Kt){console.log(Kt,"errororor");let $t=(pe=Kt==null?void 0:Kt.response)==null?void 0:pe.data;typeof($t==null?void 0:$t.message)=="object"?Object.values($t==null?void 0:$t.message).forEach(pi=>{var fi;N(pi||"Something went wrong"),Y({error:pi||"Something went wrong!",result:($t==null?void 0:$t.result)||!1,statusCode:(fi=Kt==null?void 0:Kt.response)==null?void 0:fi.status})}):(N(($t==null?void 0:$t.message)||"Something went wrong"),Y({error:($t==null?void 0:$t.message)||"Something went wrong!",result:($t==null?void 0:$t.result)||!1,statusCode:(J=Kt==null?void 0:Kt.response)==null?void 0:J.status})),fe()}}}}catch(bt){fe(),Y({error:((lt=(z=bt==null?void 0:bt.response)==null?void 0:z.data)==null?void 0:lt.message)||"Something went wrong!",result:(Qt=(At=bt==null?void 0:bt.response)==null?void 0:At.data)==null?void 0:Qt.result,statusCode:(ti=bt==null?void 0:bt.response)==null?void 0:ti.status}),N(((ui=(pt=bt==null?void 0:bt.response)==null?void 0:pt.data)==null?void 0:ui.message)||"Something went wrong!")}}},tt=(s,l)=>{let X=s;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(X)){(l===""||/^[0-9]+$/.test(l))&&(Ce(R=>F(v({},R),{[X]:""})),L(R=>F(v({},R),{[X]:l})));return}Ce(R=>F(v({},R),{[X]:""})),L(R=>F(v({},R),{[X]:l}))},Ie=s=>{var xe;let l=s.target,X=l.value.replace(/\D/g,""),{formatted:de,cursor:R}=Pn(l.value,(xe=l.selectionStart)!=null?xe:0);Ce(Ae=>F(v({},Ae),{cardNumber:""})),L(Ae=>F(v({},Ae),{cardNumber:de})),requestAnimationFrame(()=>{l.setSelectionRange(R,R)})},ae=s=>{let{name:l,value:X}=s.target,de=["routingNumber","accountNumber","confirmAccountNumber"];if(l=="name"){/^[a-zA-Z\s]*$/.test(X)&&(b(R=>F(v({},R),{[l]:""})),o(R=>F(v({},R),{[l]:X})));return}if(de.includes(l)){(X===""||/^[0-9]+$/.test(X))&&(b(R=>F(v({},R),{[l]:""})),o(R=>F(v({},R),{[l]:X})));return}b(R=>F(v({},R),{[l]:""})),o(R=>F(v({},R),{[l]:X}))},nt=()=>{y(!1),Je("card"),N(""),dt(!1),Ft(""),o({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),b({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),L({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),Ce({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),P(!1),x(!1),cn("form"),Pt("form"),Yn(!1),Ct(0),S(0),Le([]),Q(null),Sn(null),We(!1),Qe(!1),ht(null),Wt(null),Ve(""),Ht(""),Rt("")},gt=async()=>{var s,l,X,de,R,xe,Ae,he,De;Ke();try{let pe={isPreAuth:U,customerId:B},J=await kn.post(`${je}api/v1/gateway/card-list/${T}`,pe),z=((l=(s=J==null?void 0:J.data)==null?void 0:s.data)==null?void 0:l.cardList)||[],lt=z==null?void 0:z.filter(Qt=>(Qt==null?void 0:Qt.card_type)=="Bank"),At=z==null?void 0:z.filter(Qt=>(Qt==null?void 0:Qt.card_type)!=="Bank");At&&(At==null?void 0:At.length)>0?(Je("card"),Pt("list"),Le(At)):(Je("card"),Le([])),lt&&(lt==null?void 0:lt.length)>0?(cn("list"),D(lt)):D([]),fe()}catch(pe){console.log(pe),fe(),Y({error:((de=(X=pe==null?void 0:pe.response)==null?void 0:X.data)==null?void 0:de.message)||"Something went wrong!",result:(xe=(R=pe==null?void 0:pe.response)==null?void 0:R.data)==null?void 0:xe.result,statusCode:(Ae=pe==null?void 0:pe.response)==null?void 0:Ae.status}),N(((De=(he=pe==null?void 0:pe.response)==null?void 0:he.data)==null?void 0:De.message)||(pe==null?void 0:pe.message)||"Something went wrong")}},ye=s=>{switch(s==null?void 0:s.toLowerCase()){case"visa":return tn;case"mastercard":case"mc":case"m/c":return en;case"amex":case"american express":case"ae":return nn;case"discover":case"dcvr":return un;case"bank":return jt;default:return s}},re=async s=>{mi.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async l=>{var X,de;if(l.isConfirmed){ue(!0);try{let R={card_id:s,customer_id:B},xe=await kn.patch(`${je}api/v1/gateway/delete-card/${T}`,R);(X=xe==null?void 0:xe.data)!=null&&X.result?(ue(!1),gt(),mi.fire({icon:"success",title:"Deleted!",text:((de=xe==null?void 0:xe.data)==null?void 0:de.message)||"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})):(ue(!1),mi.fire({icon:"error",title:"Failure!",text:"Card not deleted.",timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}}))}catch(R){ue(!1),mi.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else l.dismiss===mi.DismissReason.cancel&&mi.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},Ot=async s=>{var R,xe,Ae,he,De,pe,J,z,lt;if(s.currentTarget.blur(),mt)return;let l=B,X=St==null?void 0:St.id,de=St==null?void 0:St.card_type;if(!Yt)if(e)if(l)if(X){let At={amount:(de==null?void 0:de.toLowerCase())==="bank"?`${t}`:ot||e,customer_id:l,card_id:X,pass_fee:oe,pass_fee_amount:Number(e)-_t};M&&(At.orderGuid=zt||ke,ot&&(At.ispartialPayment=!0)),U&&(At.isPreauth=!0);let Qt=je+"api/v1/gateway/charge-by-saved-details/"+T,ti={"Content-Type":"application/json"};try{Ke();let pt=await kn.post(Qt,At);(R=pt==null?void 0:pt.data)!=null&&R.result&&(Y({callback:F(v({},(xe=pt==null?void 0:pt.data)==null?void 0:xe.data),{isPreAuth:U})}),fe(),nt())}catch(pt){console.log(pt==null?void 0:pt.response,"error by saved details"),Y({error:((he=(Ae=pt==null?void 0:pt.response)==null?void 0:Ae.data)==null?void 0:he.message)||"Something went wrong!",result:(pe=(De=pt==null?void 0:pt.response)==null?void 0:De.data)==null?void 0:pe.result,statusCode:(J=pt==null?void 0:pt.response)==null?void 0:J.status}),fe(),N(((lt=(z=pt==null?void 0:pt.response)==null?void 0:z.data)==null?void 0:lt.message)||"Something went wrong!")}}else N("Please Select A Card/Bank"),Y({error:"Please Select A Card/Bank"});else N("Please Select Customer"),Y({error:"Please Select Customer"});else N("Something went wrong."),Y({error:"Something went wrong."})},Lt=async()=>{var s,l,X,de,R,xe,Ae,he,De,pe,J;if(!mt)try{Ke();let z=await kn.get(`${je}api/v1/gateway/get-payment-details/${T}`);(z==null?void 0:z.status)==200&&(Yn((l=(s=z==null?void 0:z.data)==null?void 0:s.data)==null?void 0:l.isBankActive),Ct(Number((de=(X=z==null?void 0:z.data)==null?void 0:X.data)==null?void 0:de.fee)||0),fe())}catch(z){console.log((xe=(R=z==null?void 0:z.response)==null?void 0:R.data)==null?void 0:xe.result,"error while getting payment details"),Y({error:((he=(Ae=z==null?void 0:z.response)==null?void 0:Ae.data)==null?void 0:he.message)||"Something went wrong!",result:(pe=(De=z==null?void 0:z.response)==null?void 0:De.data)==null?void 0:pe.result,statusCode:(J=z==null?void 0:z.response)==null?void 0:J.status}),fe()}},Ue=async()=>{var s,l,X,de,R,xe,Ae;if(!qt){Mt(!0),Fe.current=!0;try{let he=await kn.post(`${je}api/v1/gateway/create-pay-order/${T}`,{amount:e,cashDiscount:_t,bankAmount:t,bankSurcharge:Te,customerId:B,passFee:oe,passFeeAmount:w||Number(e)-_t,require3ds:C,isPartial:M});(s=he==null?void 0:he.data)!=null&&s.result&&(Mt(!1),Wt((X=(l=he==null?void 0:he.data)==null?void 0:l.data)==null?void 0:X.orderGuid),Rt((R=(de=he==null?void 0:he.data)==null?void 0:de.data)==null?void 0:R.remainingAmount))}catch(he){console.log("error in creating order",he),N(((Ae=(xe=he==null?void 0:he.response)==null?void 0:xe.data)==null?void 0:Ae.message)||"Something went wrong"),Mt(!1)}}};$i(()=>{!V&&!ee&&(Fe.current=!1,Me.current=!1)},[V,ee]),$i(()=>{!Fe.current&&(V||ee)&&(Lt(),M&&!Pe&&Ue())},[V,ee,M]),$i(()=>{if((V||ee)&&w){let s=Number(e)-Number(w);s&&!isNaN(s)&&S(s)}else if((V||ee)&&oe&&Ln){let s=wt(e,Ln);s&&!isNaN(s)&&S(s)}else S(Number(e));!Me.current&&B&&(V||ee)&&!G&&(Me.current=!0,gt())},[B,V,e,Ln,ee]);let En=()=>U?"Cards":"Cards/Bank",st=Mr(async()=>{try{We(!0);let l=await(await fetch(`${je}api/v1/gateway/create-payment-intent/${T}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:e,require3ds:C,pass_fee:oe})})).json();l.is3dEnable?(We(!1),Sn(l.clientSecret),Qe(l.is3dEnable)):(We(!1),Qe(l.is3dEnable)),l.result||N(l.error||(l==null?void 0:l.message)||"Failed to get client secret")}catch(s){console.log(s.response,"err.response"),N(s.message)}},[e]),Be=()=>{},Tn=(s,l)=>{Ke(),W(s,l),ht(null)},xn=s=>{console.error("3DS Auth failed \u274C",s),N(`3DS Authentication ${s}`)};$i(()=>{_e&&_e(()=>nt)},[]);let gn=s=>{var l,X;((l=Number(Dt||ut))==null?void 0:l.toFixed(2))<(s==null?void 0:s.floatValue)||(s==null?void 0:s.floatValue)<0?(Ve(s==null?void 0:s.value),Ht(`Partial amount cannot exceed ${be((X=Number(Dt||ut))==null?void 0:X.toFixed(2))}`)):(s==null?void 0:s.floatValue)==0?(Ve(s==null?void 0:s.value),Ht("Partial amount must be greater than 0")):(Ve(s==null?void 0:s.value),Ht(""))};return d.createElement(d.Fragment,null,$&&d.createElement(an,{loading:$}),f&&d.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},d.createElement(Fn,{error:f,onClose:nt})),!f&&d.createElement(d.Fragment,null,(mt||ze)&&d.createElement(an,{loading:mt||ze||me||qt}),d.createElement("div",{className:"frac-card-payment-page frac-form frac-new-form"},d.createElement("div",{ref:ce,style:{width:"100%",height:"100%"}}),rt!=null&&rt.challenge_url?d.createElement(Ca,{containerRef:ce,challengeUrl:rt.challenge_url,fractalToken:rt.fractalToken,stripeIntentId:rt.id,onSuccess:Tn,onError:xn}):d.createElement("div",{className:"parent-pay-container"},d.createElement("span",{style:{display:ee?"none":"block"},className:"request-payment-close-popup",onClick:nt},d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},d.createElement("g",{clipPath:"url(#clip0_12425_52336)"},d.createElement("path",{d:"M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z",fill:"#727272"})),d.createElement("defs",null,d.createElement("clipPath",{id:"clip0_12425_52336"},d.createElement("rect",{width:"16",height:"16",fill:"white"}))))),d.createElement("div",{className:"pay-main-logo-res"}),d.createElement("div",{className:"pay-container"},d.createElement("div",{className:"pay-header pay-conatiner-one"},d.createElement("div",{className:"pay-conatiner-one-first"},d.createElement("div",{className:"pay-logo-container"},d.createElement("div",{className:"pay-main-logo"}),d.createElement("h1",{className:"pay-heading"},"Pay"),(E==null?void 0:E.length)>0&&Ye!=="cardList"&&d.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>Je("cardList")}," ",d.createElement(Di,null)," Back")),d.createElement("div",{className:"amt-pay-con"},d.createElement("div",{className:"pay-amount-conatiner"},d.createElement("small",{className:"pay-payment-amount"},"Select payment type"),d.createElement("div",{className:"frac-card-bank-radio-main"},d.createElement(Nn,{label:"Card",amount:(Nt=Number(e))==null?void 0:Nt.toFixed(2),value:"card",onChange:p,activetab:Ye}),!U&&vt&&!M&&d.createElement(Nn,{label:"Bank",amount:(le=Number(t))==null?void 0:le.toFixed(2),value:"ach",onChange:p,activetab:Ye})),oe&&Ye==="card"&&_t&&Number(e)-Number(_t)>0?d.createElement("div",{className:"frac-cash-discount-fee"},d.createElement("small",null,Ye==="card"?"Cash Discount":"Cash Discount Savings"," "),d.createElement("p",null,be((Number(e)-Number(_t)).toFixed(2)))):null,M&&d.createElement("div",{className:"frac-partial-payment-input"},d.createElement("label",{htmlFor:"partialpayment"},"Partial Payment"),d.createElement(Lr,{prefix:"$",className:"form-control-frac",value:ot,onValueChange:s=>{gn(s)},thousandSeparator:!0,placeholder:"Enter partial amount",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,isAllowed:s=>{let{floatValue:l=0,value:X}=s;return X===""||X==="0"||X.startsWith("0.")?!0:l===0?!1:l>0}}),Yt&&d.createElement("span",{className:"error-span"},Yt))))),d.createElement("div",{className:"pay-conatiner-one-last"},d.createElement("img",{src:_,alt:""}),d.createElement("img",{src:g,alt:""}),"Secure payments powered by Fractal")),d.createElement("div",{className:"pay-tab pay-conatiner-two"},d.createElement("div",{className:"col-md-12"},d.createElement("div",{id:"payment-form-div"},Tt?An&&d.createElement(Qi,{onSuccess:Be,clientSecret:An,amount:e,showLoader:Ke,hideLoader:fe,callback:Y,session_token:T,handleClose:nt,setError:N,isPreAuth:U}):d.createElement(d.Fragment,null,d.createElement("div",{id:"ach",style:{display:Ye==="card"?"block":"none"},className:"tabcontent"},d.createElement("div",{className:"frac-heading-card-wrap"},d.createElement("div",{className:"frac-backarrow"},(E==null?void 0:E.length)>0&&bn==="form"&&d.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Pt("list")}," ",d.createElement(Di,null))),d.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),d.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},d.createElement("img",{src:tn,alt:"",width:33}),d.createElement("img",{src:en,width:33,alt:""}),d.createElement("img",{src:nn,alt:"",width:33}),d.createElement("img",{src:un,width:33,alt:""})),bn==="list"&&(E==null?void 0:E.length)>0?d.createElement(d.Fragment,null,d.createElement(Bn,{headingClass:"card-ach-heading-frac",listHeading:"Card",ListItems:E,selectedCard:St,setSelectedCard:Ze,handleDeleteCard:re,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{Pt("form")}}),d.createElement("div",{className:"form-group-frac",style:{padding:"0"}},d.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Ot},ot?be((yt=Number(ot))==null?void 0:yt.toFixed(2)):be((Jt=Number(e))==null?void 0:Jt.toFixed(2))))):d.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:we,onKeyDown:s=>{s.key==="Enter"&&mt&&(s.preventDefault(),s.stopPropagation())}},d.createElement("div",{className:"ach-scrl",style:{minHeight:"398px",maxHeight:"398px",overflow:"auto",marginRight:"5px"}},d.createElement("div",{className:"form-group-frac"},d.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),d.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"John Doe",value:(h==null?void 0:h.cardName)||"",onChange:s=>{let l=s.target.value;/^[a-zA-Z\s]*$/.test(l)&&tt("cardName",l)}}),(u==null?void 0:u.cardName)&&d.createElement("span",{className:"error-span"},u==null?void 0:u.cardName)),d.createElement("div",{className:"form-group-frac"},d.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),d.createElement("div",{className:"toggle-num-wrapper"},d.createElement("input",{className:"form-control-frac card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(h==null?void 0:h.cardNumber)||"",onChange:s=>Ie(s),"data-token":"card_number"}),d.createElement("div",{className:"card-crdi card-expiry-new"},d.createElement("div",{className:"exp-date-year-container"},d.createElement("div",{className:"exp-date form-group-frac"},d.createElement("input",{"data-token":"exp_month",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(h==null?void 0:h.expiryMonth)||"",onChange:s=>tt("expiryMonth",s.target.value)})),d.createElement("div",{className:"exp-year form-group-frac"},d.createElement("input",{"data-token":"exp_year",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(h==null?void 0:h.expiryYear)||"",onChange:s=>tt("expiryYear",s.target.value)})),d.createElement("div",{className:"security-digit form-group-frac"},d.createElement("input",{"data-token":"cvv",className:"form-control-frac card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(h==null?void 0:h.cvv)||"",onChange:s=>tt("cvv",s.target.value)})))),(u==null?void 0:u.cardNumber)&&d.createElement("span",{className:"error-span"},u==null?void 0:u.cardNumber),d.createElement("p",{style:{margin:"0"}},u!=null&&u.expiryMonth||u!=null&&u.expiryYear?d.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},u==null?void 0:u.expiryMonth):"",(u==null?void 0:u.cvv)&&d.createElement("span",{className:"error-span"},u==null?void 0:u.cvv)))),d.createElement("div",{className:"form-group-frac"},d.createElement("label",{htmlFor:"zip"},"ZIP"),d.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"000000",value:(dn=h==null?void 0:h.zipCode)!=null?dn:"",onChange:s=>tt("zipCode",s.target.value)}),(u==null?void 0:u.zipCode)&&d.createElement("span",{className:"error-span"},u==null?void 0:u.zipCode)),B&&d.createElement("div",{className:"form-group-frac"},d.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},d.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:O,onChange:s=>x(s.target.checked)}),d.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),d.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),d.createElement("div",{className:"frac-tooltip-wrapper"},d.createElement("div",{className:"frac-tooltip-icon"},d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},d.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),d.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"}))),d.createElement("div",{className:"frac-tooltip-text"},d.createElement("p",null,"If checked, I agree to give the ",d.createElement("b",null,K||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),d.createElement("div",{className:"form-group-frac",style:{marginTop:"20px",padding:"0"}},d.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ot?be((ei=Number(ot))==null?void 0:ei.toFixed(2)):be((zn=Number(e))==null?void 0:zn.toFixed(2)))))),d.createElement("div",{id:"ach",style:{display:Ye==="ach"?"block":"none"},className:"tabcontent"},d.createElement(d.Fragment,null,d.createElement("div",{className:"frac-heading-card-wrap"},d.createElement("div",{className:"frac-backarrow"},(at==null?void 0:at.length)>0&&ft==="form"&&d.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>cn("list")}," ",d.createElement(Di,null))),d.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment")),ft==="list"&&(at==null?void 0:at.length)>0?d.createElement(d.Fragment,null,d.createElement(Bn,{headingClass:"card-ach-heading-frac",listHeading:"Banks",ListItems:at,selectedCard:St,setSelectedCard:Ze,handleDeleteCard:re,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{cn("form")}}),d.createElement("div",{className:"form-group-frac",style:{padding:"0"}},d.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Ot},be((Et=Number(t))==null?void 0:Et.toFixed(2))))):d.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:we,autoComplete:"off",onKeyDown:s=>{s.key==="Enter"&&mt&&(s.preventDefault(),s.stopPropagation())}},d.createElement("div",{className:"ach-scrl",style:{minHeight:"444px",maxHeight:"444px"}},d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),d.createElement("input",{type:"text",id:"nameonaccount",className:"form-control-frac",maxLength:100,placeholder:"John Doe",name:"name",value:(Gn=a==null?void 0:a.name)!=null?Gn:"",onChange:ae}),(r==null?void 0:r.name)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.name)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"routingnumber"},"Routing number"),d.createElement("input",{type:"text",id:"routingnumber",className:"form-control-frac",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(hn=a==null?void 0:a.routingNumber)!=null?hn:"",onChange:ae}),(r==null?void 0:r.routingNumber)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.routingNumber)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"accountnumber"},"Account number"),d.createElement("input",{type:"text",id:"accountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(mn=a==null?void 0:a.accountNumber)!=null?mn:"",onChange:ae}),(r==null?void 0:r.accountNumber)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.accountNumber)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),d.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(Si=a==null?void 0:a.confirmAccountNumber)!=null?Si:"",onChange:ae}),(r==null?void 0:r.confirmAccountNumber)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.confirmAccountNumber)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"bankname"},"Bank name"),d.createElement("input",{type:"text",id:"bankname",className:"form-control-frac",maxLength:100,placeholder:"My Bank",name:"bankName",value:(_i=a==null?void 0:a.bankName)!=null?_i:"",onChange:ae}),(r==null?void 0:r.bankName)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.bankName)),((a==null?void 0:a.accountType)==="business saving"||(a==null?void 0:a.accountType)==="business checking")&&d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"companyName"},"Company name"),d.createElement("input",{type:"text",id:"companyName",className:"form-control-frac",maxLength:100,placeholder:"My Company",name:"companyName",value:(ji=a==null?void 0:a.companyName)!=null?ji:"",onChange:ae}),(r==null?void 0:r.companyName)&&d.createElement("span",{className:"error-span"},r==null?void 0:r.companyName)),d.createElement("div",{className:"form-group-frac mb-4"},d.createElement("label",{htmlFor:"accounttype"},"Select account type"),d.createElement("select",{name:"accountType",id:"accounttype",className:"form-control-frac",value:(Pi=a==null?void 0:a.accountType)!=null?Pi:"",onChange:ae},d.createElement("option",{value:""},"Select account"),oi.map(s=>d.createElement("option",{key:s.value,value:s.value},s.label)))),B&&d.createElement("div",{className:"form-group-frac mb-4 save-ach-div",style:{paddingTop:"5px"}},d.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:k,onChange:s=>P(s.target.checked)}),d.createElement("label",{className:"saveachlabel",htmlFor:"saveACH"},"Save ACH")),k&&d.createElement("div",{className:"form-group-frac mb-4 saveachtext"},d.createElement("p",null,"If checked, I agree to give the ",d.createElement("b",null,K||"merchant")," permission to charge this bank account for agreed-upon purchases in the future."))),d.createElement("div",{className:"form-group-frac "},d.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},be((Vn=Number(t))==null?void 0:Vn.toFixed(2))))))))))))))))},Ri=Ar;import zr from"axios";var Ir=({amount:e,bankAmount:t,submitBtnText:H="Pay",session_token:T,customerId:B,callback:Y,merchantName:K="merchant",isPreAuth:U,surcharge:ve="0",submitBtnClass:Z,submitBtnIcon:A,isRequest:G,pass_fee:oe,pass_fee_amount:w,require3ds:C=!1,autoTrigger:ee=!1,isPartial:V,bankSurcharge:y,partialRef:_e,onTriggerPay:M})=>{let[Te,Pe]=ci(!1),[me,ke]=ci(!1),[ut,Fe]=ci(()=>()=>{}),[Me,ce]=ci(null),[Ye,Je]=ci(null),ln=Tr(()=>({amount:e,bankAmount:t,submitBtnText:H,session_token:T,customerId:B,callback:Y,merchantName:K,isPreAuth:U,surcharge:ve,submitBtnClass:Z,submitBtnIcon:A,isRequest:G,pass_fee:oe,pass_fee_amount:w,require3ds:C,autoTrigger:ee,setShow:Pe,setHandleCloseRef:Fe,isPartial:V,bankSurcharge:y,partialRef:_e}),[e,t,H,T,B,Y,K,U,ve,Z,A,G,oe,w,C,ee,V,y,_e]),[Ut,h]=ci(ln);ea(()=>{Te&&h(ln)},[Te,ln,T]);let L=async()=>{var u;ke(!0);try{let Ce=await zr.get(`${je}api/v1/gateway/get-order-details/${T}`,{params:{isPartial:V,partialRef:_e}});if((u=Ce==null?void 0:Ce.data)!=null&&u.result){let a=Ce.data.data;a!=null&&a.orderGuid&&(ce(a==null?void 0:a.orderGuid),Je(a==null?void 0:a.remainingAmount)),h(o=>F(v({},o),{amount:a.amount,pass_fee_amount:a.pass_fee_amount,pass_fee:a.pass_fee}))}}catch(Ce){console.log("error while getting skyosorderdeatils",Ce)}finally{ke(!1)}};return ea(()=>{Te&&V&&_e&&T&&L()},[Te,V,_e,T]),ea(()=>{M&&M(u=>{Pe(!0),h(F(v({},Ut),{session_token:u}))})},[M]),Hn.createElement(Hn.Fragment,null,Hn.createElement("link",{href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"}),Hn.createElement(Cn,null),Hn.createElement(Ji,null),Hn.createElement(Kn,null),Hn.createElement(Ti,null),!ee&&Hn.createElement("button",{className:Z||"paymentBtn",style:{display:M?"none":"block"},onClick:()=>Pe(!0)},H,A),ee?Hn.createElement(Ri,F(v({show:Te,loadingPrev:me},Ut),{orderGuid:Me,remainingAmount:Ye})):Hn.createElement(yn,{open:Te,onClose:ut},Hn.createElement(Ri,F(v({show:Te,loadingPrev:me},Ut),{orderGuid:Me,remainingAmount:Ye}))))};export{pr as AddCard,hr as CardOnFile,or as GetPaymentPage,xr as PartialPayment,Ir as PaymentWidget,lr as PreAuthPayment,Ua as RequestPayment,Da as RequestPreAuthPayment};
|