@fractalpay/fractalpay-next-dev 0.0.126 → 0.0.128
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/PayButtonWithForm-W24VCSTS.mjs +737 -0
- package/dist/{chunk-2W4FA4ZD.mjs → chunk-ZTH6DLOE.mjs} +160 -156
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +32 -24
- package/dist/index.mjs +14 -14
- package/package.json +1 -1
- package/dist/PayButtonWithForm-EW657LG4.mjs +0 -733
|
@@ -0,0 +1,737 @@
|
|
|
1
|
+
"use client";import{a as F,b as L,e as lt,f as ne,g as I,i as dn,j as gn,k as un,l as fn,n as bn,o as me,q as yn,r as hn,s as pt,t as xn,u as ct,v as vn}from"./chunk-ZTH6DLOE.mjs";import de,{useEffect as Sn,useState as Je,useMemo as ma}from"react";import Rn from"react";function mt(){let f="#000",Y="#fff",G="#212529",k="#dee2e6";return Rn.createElement("style",null,`
|
|
2
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
3
|
+
body
|
|
4
|
+
{
|
|
5
|
+
font-family: 'Inter', sans-serif;
|
|
6
|
+
}
|
|
7
|
+
input
|
|
8
|
+
{
|
|
9
|
+
font-family: 'Inter', sans-serif !important;
|
|
10
|
+
}
|
|
11
|
+
.frac-form .form-group-frac{
|
|
12
|
+
margin:0 !important
|
|
13
|
+
}
|
|
14
|
+
.frac-form .mb-4{
|
|
15
|
+
margin-bottom : 10px !important
|
|
16
|
+
}
|
|
17
|
+
.frac-form .save-ach-div{
|
|
18
|
+
display:flex !important;
|
|
19
|
+
gap:5px !important;
|
|
20
|
+
align-items:center
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.frac-form .card-cvv-in{
|
|
24
|
+
height : 36px !importantt;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.frac-form .pay-payment-amount{
|
|
28
|
+
text-align:start !important
|
|
29
|
+
}
|
|
30
|
+
.frac-form .pay-amount{
|
|
31
|
+
text-align:start !important
|
|
32
|
+
}
|
|
33
|
+
.frac-form .pay-main-logo{
|
|
34
|
+
text-align:start !important
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
.paymentBtn {
|
|
40
|
+
background-color: black;
|
|
41
|
+
border: none;
|
|
42
|
+
color: white;
|
|
43
|
+
padding: 15px 32px;
|
|
44
|
+
text-align: center;
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
display: inline-block;
|
|
47
|
+
font-size: 16px;
|
|
48
|
+
margin: 4px 2px;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
border-radius: 180px;
|
|
51
|
+
/* width: auto; */
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.main-logo {
|
|
55
|
+
text-align: center;
|
|
56
|
+
margin-bottom: 20px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.main-logo img {
|
|
60
|
+
max-width: 180px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.pay-main-box {
|
|
64
|
+
width: 365px !important;
|
|
65
|
+
height: 93%;
|
|
66
|
+
background: 0 0 #ffffff;
|
|
67
|
+
border-radius: 12px;
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
border: 1px solid #E0DFE2;
|
|
71
|
+
margin: 0 auto;
|
|
72
|
+
display: block;
|
|
73
|
+
padding: 0px 26px !important
|
|
74
|
+
}
|
|
75
|
+
.pay-main-box .pay-header {
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
text-align: center;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.pay-main-box .pay-header button {
|
|
83
|
+
border: 0;
|
|
84
|
+
background: none;
|
|
85
|
+
padding: 0;
|
|
86
|
+
box-shadow: 0;
|
|
87
|
+
outline: inherit;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.pay-main-box h1 {
|
|
91
|
+
margin: 0;
|
|
92
|
+
flex: 1;
|
|
93
|
+
padding: 10px 0;
|
|
94
|
+
font-size: 23px;
|
|
95
|
+
font-weight: 500;
|
|
96
|
+
color: #35254D;
|
|
97
|
+
align-items: start;
|
|
98
|
+
display: flex;
|
|
99
|
+
}
|
|
100
|
+
.tab {
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
padding: 5px;
|
|
103
|
+
border-radius: 8px;
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: space-around;
|
|
106
|
+
margin-bottom:12px
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Style the buttons inside the tab */
|
|
110
|
+
.tab button {
|
|
111
|
+
float: left;
|
|
112
|
+
border: none;
|
|
113
|
+
outline: none;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
background:white;
|
|
116
|
+
padding: 11px 16px;
|
|
117
|
+
transition: 0.3s;
|
|
118
|
+
font-size: 16px;
|
|
119
|
+
width: 143px;
|
|
120
|
+
border-radius: 5px;
|
|
121
|
+
box-shadow: inherit;
|
|
122
|
+
outline: none;
|
|
123
|
+
color: ${f};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Change background color of buttons on hover */
|
|
127
|
+
.tab button:hover {
|
|
128
|
+
background-color: #f0f0f0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Create an active/current tablink class */
|
|
132
|
+
// .tab button.active {
|
|
133
|
+
// background-color: #ccc;
|
|
134
|
+
// }
|
|
135
|
+
|
|
136
|
+
/* Style the tab content */
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
.parent-pay-container{
|
|
140
|
+
padding: 24px;
|
|
141
|
+
}
|
|
142
|
+
.pay-container{
|
|
143
|
+
display: grid;
|
|
144
|
+
grid-template-columns: 2fr 3fr;
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
.pay-main{
|
|
148
|
+
padding-y: 20px}
|
|
149
|
+
|
|
150
|
+
.request-payment-close-popup {
|
|
151
|
+
position: absolute;
|
|
152
|
+
right: 20px;
|
|
153
|
+
top: 20px;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
}
|
|
156
|
+
.pay-conatiner-one{
|
|
157
|
+
border-right: 1px solid #E0DFE2;
|
|
158
|
+
display: flex;
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
justify-content: space-between;
|
|
161
|
+
}
|
|
162
|
+
.pay-conatiner-one-first{
|
|
163
|
+
|
|
164
|
+
min-height:inherit !important;
|
|
165
|
+
}
|
|
166
|
+
.pay-conatiner-one-last{
|
|
167
|
+
display:flex;
|
|
168
|
+
font-size:12px;
|
|
169
|
+
gap:5px;
|
|
170
|
+
max-width:250px;
|
|
171
|
+
align-items:center;
|
|
172
|
+
color:black !important
|
|
173
|
+
}
|
|
174
|
+
.pay-conatiner-one-last img{
|
|
175
|
+
width : 17px;
|
|
176
|
+
height:17px
|
|
177
|
+
}
|
|
178
|
+
.pay-conatiner-two{
|
|
179
|
+
padding: 0 5% 0;
|
|
180
|
+
}
|
|
181
|
+
.pay-logo-container{
|
|
182
|
+
border-bottom: 1px solid #E0DFE2
|
|
183
|
+
}
|
|
184
|
+
.pay-heading{
|
|
185
|
+
margin: 0;
|
|
186
|
+
flex: 1;
|
|
187
|
+
padding: 10px 0;
|
|
188
|
+
font-size: 23px;
|
|
189
|
+
font-weight: 500;
|
|
190
|
+
color: #35254D;
|
|
191
|
+
align-items: start;
|
|
192
|
+
display: flex;
|
|
193
|
+
}
|
|
194
|
+
.pay-main-logo > img{
|
|
195
|
+
width: 50%;
|
|
196
|
+
}
|
|
197
|
+
.pay-main-logo-res > img{
|
|
198
|
+
width: 50%;
|
|
199
|
+
display : none
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.pay-payment-amount{
|
|
203
|
+
display: block;
|
|
204
|
+
font-size: 12px;
|
|
205
|
+
color: #727272;
|
|
206
|
+
margin-bottom: 8px;
|
|
207
|
+
}
|
|
208
|
+
.pay-amount-conatiner{
|
|
209
|
+
margin-top: 6%;
|
|
210
|
+
}
|
|
211
|
+
.pay-amount{
|
|
212
|
+
color: #000000;
|
|
213
|
+
font-size: 38px;
|
|
214
|
+
display: block;
|
|
215
|
+
line-height: 110%;
|
|
216
|
+
letter-spacing: -1px;
|
|
217
|
+
}
|
|
218
|
+
.frac-form label{
|
|
219
|
+
font-family: 'IBM Plex Mono', monospace !important;
|
|
220
|
+
color: #727272 !important;
|
|
221
|
+
margin-bottom: 2px !important;
|
|
222
|
+
font-weight: 600 !important;
|
|
223
|
+
font-size: 12px !important;
|
|
224
|
+
display:block !important;
|
|
225
|
+
text-align : left !important
|
|
226
|
+
}
|
|
227
|
+
.form-control-frac{
|
|
228
|
+
display: block;
|
|
229
|
+
width: 100%;
|
|
230
|
+
padding: .375rem .75rem;
|
|
231
|
+
font-size: 1rem;
|
|
232
|
+
font-weight: 400;
|
|
233
|
+
line-height: 1.5;
|
|
234
|
+
color: ${G};
|
|
235
|
+
-webkit-appearance: none;
|
|
236
|
+
-moz-appearance: none;
|
|
237
|
+
appearance: none;
|
|
238
|
+
background-color: ${Y};
|
|
239
|
+
background-clip: padding-box;
|
|
240
|
+
border: 1px solid ${k};
|
|
241
|
+
border-radius: 0.375rem;
|
|
242
|
+
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
|
243
|
+
}
|
|
244
|
+
.form-control-frac:focus{
|
|
245
|
+
border-color: #86b7fe;
|
|
246
|
+
outline: 0;
|
|
247
|
+
}
|
|
248
|
+
.toggle-num-wrapper {
|
|
249
|
+
position: relative;
|
|
250
|
+
}
|
|
251
|
+
.card-number-new{
|
|
252
|
+
border-bottom: none;
|
|
253
|
+
border-bottom-left-radius: 0px;
|
|
254
|
+
border-bottom-right-radius: 0px;
|
|
255
|
+
}
|
|
256
|
+
.card-crdi {
|
|
257
|
+
display: flex;
|
|
258
|
+
border: 1px solid ${k};
|
|
259
|
+
border-radius: 0.375rem;
|
|
260
|
+
}
|
|
261
|
+
.card-expiry-new{
|
|
262
|
+
border-top-left-radius: 0px;
|
|
263
|
+
border-top-right-radius: 0px;
|
|
264
|
+
}
|
|
265
|
+
.exp-date-year-container{
|
|
266
|
+
display: flex;
|
|
267
|
+
flex-wrap: wrap;
|
|
268
|
+
}
|
|
269
|
+
.exp-date-year-container .form-group-frac{
|
|
270
|
+
flex:1;
|
|
271
|
+
padding: 0px !important
|
|
272
|
+
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.exp-date {
|
|
276
|
+
float: left;
|
|
277
|
+
// width: 30%
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.exp-date input {
|
|
281
|
+
width: calc(100% + 1px);
|
|
282
|
+
border-top-right-radius: 0;
|
|
283
|
+
border-bottom-right-radius: 0;
|
|
284
|
+
border: 0;
|
|
285
|
+
border-right: 1px solid ${k};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
.exp-year {
|
|
290
|
+
float: left;
|
|
291
|
+
// width: 30%
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.exp-year input {
|
|
295
|
+
width: calc(100% + 1px);
|
|
296
|
+
border-radius: 0;
|
|
297
|
+
border-top: 0;
|
|
298
|
+
border-bottom: 0;
|
|
299
|
+
border-right: 1px solid ${k};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.exp-date input:focus {
|
|
303
|
+
position: relative;
|
|
304
|
+
z-index: 10;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.security-digit {
|
|
308
|
+
float: right;
|
|
309
|
+
// width: 40%;
|
|
310
|
+
position: relative;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.security-digit input {
|
|
314
|
+
border-top-left-radius: 0;
|
|
315
|
+
border-bottom-left-radius: 0;
|
|
316
|
+
border-top: 0;
|
|
317
|
+
border-bottom: 0;
|
|
318
|
+
border-right:0;
|
|
319
|
+
}
|
|
320
|
+
.card-expiry-new{
|
|
321
|
+
border-top-left-radius: 0px;
|
|
322
|
+
border-top-right-radius: 0px;
|
|
323
|
+
}
|
|
324
|
+
.form-control-frac{box-sizing: border-box ;}
|
|
325
|
+
#PaymentForm .form-group-frac{
|
|
326
|
+
padding:5px 0 ;
|
|
327
|
+
matgin: 0 !important
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.toggle-label {
|
|
331
|
+
position: relative;
|
|
332
|
+
display: inline-block;
|
|
333
|
+
width: 40px;
|
|
334
|
+
height: 24px;
|
|
335
|
+
background-color: #ccc;
|
|
336
|
+
border-radius: 12px;
|
|
337
|
+
cursor: pointer;
|
|
338
|
+
transition: background-color 0.3s;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.toggle-label::before {
|
|
342
|
+
content: "";
|
|
343
|
+
position: absolute;
|
|
344
|
+
top: 2px;
|
|
345
|
+
left: 2px;
|
|
346
|
+
width: 20px;
|
|
347
|
+
height: 20px;
|
|
348
|
+
background: #ffffff;
|
|
349
|
+
border-radius: 50%;
|
|
350
|
+
transition: left 300ms linear;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.toggle-checkbox {
|
|
354
|
+
display: none;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.toggle-checkbox:checked + .toggle-label {
|
|
358
|
+
background-color: #4caf50;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.toggle-checkbox:checked + .toggle-label::before {
|
|
362
|
+
left: 18px;
|
|
363
|
+
}
|
|
364
|
+
.ach-scrl {
|
|
365
|
+
max-height: 380px;
|
|
366
|
+
min-height: 380px;
|
|
367
|
+
overflow-y: auto;
|
|
368
|
+
padding-right: 6px;
|
|
369
|
+
}
|
|
370
|
+
.mb-4{
|
|
371
|
+
margin-bottom:4px
|
|
372
|
+
}
|
|
373
|
+
.ach-scrl::-webkit-scrollbar {
|
|
374
|
+
width: 3px;
|
|
375
|
+
background-color: #F5F5F5;
|
|
376
|
+
}
|
|
377
|
+
.ach-scrl::-webkit-scrollbar-thumb {
|
|
378
|
+
background-color: #35254D;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.error-span{
|
|
382
|
+
color:red !important;
|
|
383
|
+
font-size:12px !important;
|
|
384
|
+
text-align: left !important;
|
|
385
|
+
width: 100% !important;
|
|
386
|
+
display: block;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.charge-customer-name-frac{
|
|
390
|
+
color: #161616;
|
|
391
|
+
font-family: Inter;
|
|
392
|
+
font-size: 24px;
|
|
393
|
+
font-style: normal;
|
|
394
|
+
font-weight: 600;
|
|
395
|
+
line-height: 32px;
|
|
396
|
+
letter-spacing: -0.48px;
|
|
397
|
+
text-transform: capitalize;
|
|
398
|
+
margin-top:0;
|
|
399
|
+
margin-bottom:16px !important;
|
|
400
|
+
text-align:left !important
|
|
401
|
+
}
|
|
402
|
+
.card-ach-heading-frac {
|
|
403
|
+
color: #727272;
|
|
404
|
+
font-family: Inter;
|
|
405
|
+
font-size: 12px;
|
|
406
|
+
font-style: normal;
|
|
407
|
+
font-weight: 500;
|
|
408
|
+
line-height: 18px;
|
|
409
|
+
letter-spacing: -0.24px;
|
|
410
|
+
margin : 0 0 10px !important;
|
|
411
|
+
text-align : left
|
|
412
|
+
}
|
|
413
|
+
.card-list-div{
|
|
414
|
+
max-height : 190px;
|
|
415
|
+
overflow-y : auto;
|
|
416
|
+
border:1px solid #E0DFE2;
|
|
417
|
+
border-radius : 8px
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
.card-list-div::-webkit-scrollbar{
|
|
422
|
+
width:2px;
|
|
423
|
+
background-color:#F5F5F5
|
|
424
|
+
}
|
|
425
|
+
.card-list-div::-webkit-scrollbar-thumb{
|
|
426
|
+
background-color:#35254D
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.card-list-single-div{
|
|
430
|
+
border-bottom: 1px solid #E0DFE2;
|
|
431
|
+
padding : 8px 11px;
|
|
432
|
+
display : flex ;
|
|
433
|
+
align-items:center;
|
|
434
|
+
justify-content : space-between;
|
|
435
|
+
gap:12px
|
|
436
|
+
}
|
|
437
|
+
.card-list-single-div:last-child {
|
|
438
|
+
border-bottom: none;
|
|
439
|
+
}
|
|
440
|
+
.card-lint-div-in{
|
|
441
|
+
min-height:444px}
|
|
442
|
+
.card-number-radio{
|
|
443
|
+
display:flex;
|
|
444
|
+
gap:12px;
|
|
445
|
+
}
|
|
446
|
+
.card-number-radio .card-number-last-four{
|
|
447
|
+
color:#161616 !important;
|
|
448
|
+
font-family:Inter !important;
|
|
449
|
+
font-size:14px !important;
|
|
450
|
+
font-weight:500 !important;
|
|
451
|
+
font-style:normal !important;
|
|
452
|
+
line-height : 18px !important;
|
|
453
|
+
latter-spacing:-0.18px !important
|
|
454
|
+
}
|
|
455
|
+
.card-expiry-date{
|
|
456
|
+
margin:0;
|
|
457
|
+
color:#00000080;
|
|
458
|
+
font-family:Inter;
|
|
459
|
+
font-size:14px;
|
|
460
|
+
font-weight:500;
|
|
461
|
+
font-style"normal;
|
|
462
|
+
line-height : 18px;
|
|
463
|
+
latter-spacing:-0.18px
|
|
464
|
+
}
|
|
465
|
+
.pay-with-other-card {
|
|
466
|
+
margin-top : 12px;
|
|
467
|
+
padding:12px 32px;
|
|
468
|
+
border :1px solid #E0DFE2;
|
|
469
|
+
border-radius : 1000px;
|
|
470
|
+
display: flex;
|
|
471
|
+
justify-content : center;
|
|
472
|
+
align-items:center;
|
|
473
|
+
gap:10px;
|
|
474
|
+
// width:100%;
|
|
475
|
+
background:white;
|
|
476
|
+
cursor:pointer;
|
|
477
|
+
color:#161616;
|
|
478
|
+
text-align:center
|
|
479
|
+
font-family: Inter;
|
|
480
|
+
font-size: 14px;
|
|
481
|
+
font-style: normal;
|
|
482
|
+
font-weight: 500;
|
|
483
|
+
line-height: 24px;
|
|
484
|
+
letter-spacing: -0.28px;
|
|
485
|
+
// margin-bottom: 50px;
|
|
486
|
+
}
|
|
487
|
+
.charge-payment-back-btn {
|
|
488
|
+
display: flex;
|
|
489
|
+
padding: 6px 12px !important ;
|
|
490
|
+
align-items: center;
|
|
491
|
+
gap: 6px;
|
|
492
|
+
border-radius: 1000px;
|
|
493
|
+
border: 1px solid #E0DFE2;
|
|
494
|
+
background: #FFF;
|
|
495
|
+
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
496
|
+
font-size:16px;
|
|
497
|
+
curso:pointer;
|
|
498
|
+
color:black
|
|
499
|
+
}
|
|
500
|
+
.res-charge-payment-back-btn{
|
|
501
|
+
padding: 9px 16px;
|
|
502
|
+
align-items: center;
|
|
503
|
+
gap: 6px;
|
|
504
|
+
margin-bottom: 20px;
|
|
505
|
+
border-radius: 1000px;
|
|
506
|
+
border: 1px solid #E0DFE2;
|
|
507
|
+
background: #FFF;
|
|
508
|
+
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
|
509
|
+
font-size:16px;
|
|
510
|
+
curso:pointer;
|
|
511
|
+
color:black;
|
|
512
|
+
display:none
|
|
513
|
+
}
|
|
514
|
+
.btn {
|
|
515
|
+
padding: 11px 23px;
|
|
516
|
+
background-color: black;
|
|
517
|
+
color: white;
|
|
518
|
+
border: none;
|
|
519
|
+
border-radius: 6px;
|
|
520
|
+
font-weight: bold;
|
|
521
|
+
margin: 0 10px;
|
|
522
|
+
cursor: pointer;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.custom-swal-icon {
|
|
526
|
+
margin: 20px auto;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.custom-swal-popup {
|
|
530
|
+
font-size: 16px;
|
|
531
|
+
text-align: center;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.frac-form .res-pay-con{
|
|
535
|
+
display:none
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.saveachtext p, .saveachtext b {
|
|
539
|
+
font-size: 12px !important;
|
|
540
|
+
color: #727272 !important;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.cardicon-img img {
|
|
544
|
+
margin-top: -2px !important;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.bankicon-img img {
|
|
548
|
+
margin-top: -4px !important;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.cardicon {
|
|
552
|
+
margin-right : 8px !important;
|
|
553
|
+
width : 18px !important;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.bankicon {
|
|
557
|
+
margin-right : 8px !important;
|
|
558
|
+
width : 18px !important;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
.frac-tooltip-wrapper {
|
|
563
|
+
position: absolute;
|
|
564
|
+
right:0;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.frac-tooltip-icon {
|
|
568
|
+
cursor: pointer;
|
|
569
|
+
}
|
|
570
|
+
.frac-tooltip-mn{
|
|
571
|
+
position:relative;
|
|
572
|
+
}
|
|
573
|
+
.frac-tooltip-text {
|
|
574
|
+
display: none;
|
|
575
|
+
position: absolute;
|
|
576
|
+
top:-15px;
|
|
577
|
+
right: 22px;
|
|
578
|
+
background: #161616;
|
|
579
|
+
color: white;
|
|
580
|
+
padding: 15px;
|
|
581
|
+
border-radius: 10px;
|
|
582
|
+
width: 200px;
|
|
583
|
+
font-size:12px;
|
|
584
|
+
word-break: break-word;
|
|
585
|
+
white-space: normal;
|
|
586
|
+
z-index: 999;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.frac-tooltip-wrapper:hover .frac-tooltip-text {
|
|
590
|
+
display: block;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.frac-tooltip-text p,.frac-tooltip-text b {
|
|
594
|
+
font-size : 12px !important;
|
|
595
|
+
line-height : 1.5 !important;
|
|
596
|
+
margin-bottom : 10px !important;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.amt-pay-con {
|
|
600
|
+
padding-right: 24px;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
@media (max-width: 768px) {
|
|
606
|
+
.request-payment-close-popup {
|
|
607
|
+
right: 12px !important;
|
|
608
|
+
top: 12px !important;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.parent-pay-container{
|
|
612
|
+
padding:24px;
|
|
613
|
+
}
|
|
614
|
+
.pay-container {
|
|
615
|
+
grid-template-columns: 1fr;
|
|
616
|
+
padding: 10px 5%;
|
|
617
|
+
border:1px solid #E0DFE2;
|
|
618
|
+
border-radius : 12px
|
|
619
|
+
}
|
|
620
|
+
.pay-conatiner-one{
|
|
621
|
+
border-right: none;
|
|
622
|
+
}
|
|
623
|
+
.pay-conatiner-one-first{
|
|
624
|
+
min-height:0
|
|
625
|
+
}
|
|
626
|
+
.pay-main-logo > img{
|
|
627
|
+
display: none;
|
|
628
|
+
}
|
|
629
|
+
.pay-main-logo-res > img {
|
|
630
|
+
display:block;
|
|
631
|
+
margin:auto
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.pay-logo-container{
|
|
635
|
+
border :none
|
|
636
|
+
}
|
|
637
|
+
// .res-charge-payment-back-btn {
|
|
638
|
+
// display:flex !important
|
|
639
|
+
// }
|
|
640
|
+
// .charge-payment-back-btn{
|
|
641
|
+
// display:none !important
|
|
642
|
+
// }
|
|
643
|
+
|
|
644
|
+
.frac-new-form .pay-amount-conatiner {
|
|
645
|
+
margin-top: 0px;
|
|
646
|
+
margin-bottom: 24px;
|
|
647
|
+
}
|
|
648
|
+
.frac-form .res-pay-con{
|
|
649
|
+
display:flex;
|
|
650
|
+
justify-content :space-between;
|
|
651
|
+
align-items:center;
|
|
652
|
+
padding-bottom : 10px
|
|
653
|
+
}
|
|
654
|
+
.amt-pay-con {
|
|
655
|
+
padding-right: 0px;
|
|
656
|
+
}
|
|
657
|
+
.pay-conatiner-one-last{
|
|
658
|
+
display:none}
|
|
659
|
+
.pay-conatiner-two{
|
|
660
|
+
padding:0
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
}
|
|
665
|
+
@media (max-width : 512px){
|
|
666
|
+
.tab button {
|
|
667
|
+
padding: 6px 16px;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
.frac-cash-discount-fee {
|
|
673
|
+
display: flex;
|
|
674
|
+
padding: 11px;
|
|
675
|
+
justify-content: space-between;
|
|
676
|
+
align-items: center;
|
|
677
|
+
align-self: stretch;
|
|
678
|
+
border-radius: 8px;
|
|
679
|
+
border: 1px solid #E0DFE2;
|
|
680
|
+
background: #F6F6F7;
|
|
681
|
+
margin-top: 24px;
|
|
682
|
+
}
|
|
683
|
+
.frac-cash-discount-fee small {
|
|
684
|
+
color:#727272;
|
|
685
|
+
font-size: 12px;
|
|
686
|
+
font-weight: 500;
|
|
687
|
+
}
|
|
688
|
+
.frac-cash-discount-fee p{
|
|
689
|
+
margin:0px;
|
|
690
|
+
font-size: 14px;
|
|
691
|
+
font-weight: 500;
|
|
692
|
+
}
|
|
693
|
+
.frac-card-payment-heading {
|
|
694
|
+
font-size: 24px;
|
|
695
|
+
font-style: normal;
|
|
696
|
+
font-weight: 600;
|
|
697
|
+
margin:0px;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
.frac-heading-card-wrap {
|
|
701
|
+
display: flex;
|
|
702
|
+
align-items: center;
|
|
703
|
+
margin-bottom:12px;
|
|
704
|
+
}
|
|
705
|
+
.frac-backarrow {
|
|
706
|
+
margin-right: 10px;
|
|
707
|
+
}
|
|
708
|
+
.frac-charge-payment-back-btn-wrap , .frac-tab-2{
|
|
709
|
+
display: none;
|
|
710
|
+
}
|
|
711
|
+
.frac-pay-conatiner-one{
|
|
712
|
+
display: flex;
|
|
713
|
+
flex-direction: column;
|
|
714
|
+
justify-content: space-between;
|
|
715
|
+
min-height: auto;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.frac-form .saveachlabel {
|
|
719
|
+
margin-bottom : 0px !important;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.frac-partial-payment-input{
|
|
723
|
+
margin-top: 12px !important;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.challengeUrlclass-frac{
|
|
727
|
+
height : 90vh;
|
|
728
|
+
width : 100%;
|
|
729
|
+
border-radius : 8px;
|
|
730
|
+
border : none;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
`)}import e,{useCallback as la,useEffect as Ge,useRef as gt,useState as S}from"react";import Z from"axios";import Le from"sweetalert2";import{useEffect as ea,useRef as ta}from"react";function wn({challengeUrl:f,fractalToken:Y,stripeIntentId:G,onSuccess:k,onError:$,containerRef:w}){let K=ta(null);return ea(()=>{if(!f||typeof window=="undefined")return;let P=w.current;if(!P)return;K.current&&P.contains(K.current)&&P.removeChild(K.current);let ae=document.createElement("iframe");ae.className="challengeUrlclass-frac",ae.src=f,K.current=ae,P.appendChild(ae);let D=ee=>{var ge;((ge=ee.data)==null?void 0:ge.type)==="3ds-authentication-challenge-complete"&&(P.innerHTML="",ee.data.status==="succeeded"?k(Y,G):$(ee.data.status))};return window.addEventListener("message",D),()=>{window.removeEventListener("message",D),K.current&&P.contains(K.current)&&P.removeChild(K.current)}},[f,w,Y,G,k,$]),null}import{Elements as ra}from"@stripe/react-stripe-js";import{loadStripe as ia}from"@stripe/stripe-js";import{PaymentElement as Cn,useElements as na,useStripe as aa}from"@stripe/react-stripe-js";import oa from"axios";import{useState as Nn}from"react";var kn=({onSuccess:f,showLoader:Y,setError:G,session_token:k,callback:$,hideLoader:w,handleClose:K,amount:P,isPreAuth:ae})=>{var U;let D=aa(),ee=na(),[ge,te]=Nn(!1),[be,J]=Nn(null);return React.createElement("form",{onSubmit:async Pe=>{var re,V,xe,Be,ve,we,R;if(Pe.preventDefault(),!D||!ee){console.warn("stripe nopt loaded");return}console.log("Stripe:",D),console.log("Elements:",ee),console.log("PaymentElement:",ee.getElement(Cn)),Y(),te(!0);try{let{error:j,paymentIntent:ie}=await D.confirmPayment({elements:ee,confirmParams:{},redirect:"if_required"});if(te(!1),j)console.log(j,"paymentIntent error"),G(j.message||"Payment failed.");else if((ie==null?void 0:ie.status)==="succeeded"){if(J("\u2705 Payment successful!"),f){console.log(ie,"paymentIntent");try{let z=await oa.post(`${I}api/v1/gateway/secure-charge/${k}`,{stripe_id:ie==null?void 0:ie.id});if(console.log(z,"chargeDetails"),(re=z==null?void 0:z.data)!=null&&re.result){let r=(V=z==null?void 0:z.data)==null?void 0:V.data;console.log(r,"callbackdata"),$(L(F({},r),{isPreAuth:ae})),K(),w()}console.log((xe=z==null?void 0:z.data)==null?void 0:xe.data,"chargeDetails")}catch(z){console.log(z==null?void 0:z.response,"error"),G(((ve=(Be=z==null?void 0:z.response)==null?void 0:Be.data)==null?void 0:ve.message)||"Something went wrong"),w()}}setTimeout(()=>window.close(),1500)}else J("Processing payment...")}catch(j){console.log(j==null?void 0:j.response,"error"),G(((R=(we=j==null?void 0:j.response)==null?void 0:we.data)==null?void 0:R.message)||"Something went wrong"),w()}}},React.createElement(Cn,null),React.createElement("button",{className:"pay-button",disabled:ge||!D},ge?"Processing...":`${me((U=Number(P))==null?void 0:U.toFixed(2))}`))};var sa=ia(gn);function dt({clientSecret:f,onSuccess:Y,showLoader:G,setError:k,session_token:$,callback:w,hideLoader:K,handleClose:P,amount:ae,isPreAuth:D}){return f?React.createElement(ra,{stripe:sa,options:{clientSecret:f}},React.createElement(kn,{onSuccess:Y,showLoader:G,hideLoader:K,setError:k,session_token:$,callback:w,handleClose:P,amount:ae,isPreAuth:D})):null}import{IoArrowBack as ut}from"react-icons/io5";import{NumericFormat as pa}from"react-number-format";var ca=({amount:f,bankAmount:Y,submitBtnText:G="Pay",session_token:k,customerId:$,callback:w,merchantName:K="merchant",isPreAuth:P,surcharge:ae="0",submitBtnClass:D,submitBtnIcon:ee,isRequest:ge,pass_fee:te,pass_fee_amount:be,require3ds:J=!1,autoTrigger:Q=!1,show:U,setShow:Pe,setHandleCloseRef:re,isPartial:V,bankSurcharge:xe,partialRef:Be,loadingPrev:ve=!1})=>{var Zt,Gt,Jt,Qt,Xt,Dt,Rt,en,tn,nn,an,on,rn,sn,ln,pn;let we=gt(null),[R,j]=S("card"),[ie,z]=S("card"),[r,Ce]=S(),[d,ue]=S({}),[o,Ye]=S(),[b,Ae]=S({}),[Qe,bt]=S(!1),[Te,yt]=S(!1),[Xe,A]=S(""),[ga,Fn]=S(!1),[ua,_n]=S(""),[ht,xt]=S(!1),[vt,Ve]=S(!1),[fe,De]=S([]),[Ne,wt]=S([]),[ye,Ct]=S(),[ke,qe]=S(Number(f)),[Nt,We]=S("form"),[kt,Ke]=S("form"),[Pn,St]=S(!1),[Re,Ft]=S(0),[_t,Pt]=S(""),[fa,Bn]=S(null),[Bt,Ue]=S(!1),[Mn,et]=S(!1),[Me,tt]=S(null),[Mt,nt]=S(!1),[$t,Lt]=S(null),[oe,at]=S(""),[At,ot]=S(""),[Tt,Et]=S(""),zt=ne+"widget/mc-img.svg",It=ne+"widget/visa-img.svg",jt=ne+"widget/ae-img.svg",Ht=ne+"widget/discover-img.svg",ba=ne+"widget/card.svg",ya=ne+"widget/Trash.svg",$n=ne+"widget/bank.svg",Ln=ne+"widget/secure-img.png",An=ne+"widget/pov-by.png",ha=ne+"widget/pax.svg",xa=ne+"widget/cardicon.svg",va=ne+"widget/bankicon.svg",$e=()=>xt(!0),E=()=>xt(!1),Tn=(t,n)=>{let i=(parseFloat(n)||0)/100,p=t/(1+i);return Math.round(p*100)/100},Ot=async t=>{var n,i,p,s,l,y,h,x,c,m,a,C,B,T,N,se,le,pe;try{let v={pass_fee_amount:Number(f)-ke,pass_fee:te,Token:t==null?void 0:t.Token,amount:oe||f,postal_code:t==null?void 0:t.postalCode,require3ds:J,isPartial:V,orderGuid:$t};J&&(t!=null&&t.stripe_3ds_auth_id)&&(v.stripe_3ds_auth_id=t==null?void 0:t.stripe_3ds_auth_id);let O=await Z.post(`${I}api/v1/gateway/charge/${k}`,v);if((n=O==null?void 0:O.data)!=null&&n.result){let M;if(Te&&$)try{let u={postal_code:r==null?void 0:r.zipCode,customer_id:$,gateway_token:(t==null?void 0:t.gateway_token)||(t==null?void 0:t.Token)};M=await Z.post(`${I}api/v1/gateway/add-card/${k}`,u),(i=M==null?void 0:M.data)!=null&&i.result&&(M=(p=M==null?void 0:M.data)==null?void 0:p.data)}catch(u){console.log(u,"error"),E(),w({error:((l=(s=u==null?void 0:u.response)==null?void 0:s.data)==null?void 0:l.message)||"Something went wrong!",result:(h=(y=u==null?void 0:u.response)==null?void 0:y.data)==null?void 0:h.result,statusCode:(x=u==null?void 0:u.response)==null?void 0:x.status}),A(((m=(c=u==null?void 0:u.response)==null?void 0:c.data)==null?void 0:m.message)||"Something went wrong!")}let ce={cardDetails:F(F({},M),t),callback:L(F({},(a=O==null?void 0:O.data)==null?void 0:a.data),{name:r==null?void 0:r.cardName,isPreAuth:P})};Te||delete ce.cardDetails,w(ce),E(),he()}}catch(v){A(((B=(C=v==null?void 0:v.response)==null?void 0:C.data)==null?void 0:B.message)||"Something went wrong!"),w({error:((N=(T=v==null?void 0:v.response)==null?void 0:T.data)==null?void 0:N.message)||"Something went wrong!",result:(le=(se=v==null?void 0:v.response)==null?void 0:se.data)==null?void 0:le.result,statusCode:(pe=v==null?void 0:v.response)==null?void 0:pe.status}),E()}},Yt=async t=>{var n,i,p,s,l,y,h,x,c,m,a,C,B,T,N,se,le,pe;try{let v={Token:t==null?void 0:t.Token,amount:f,postal_code:t==null?void 0:t.postalCode},O=await Z.post(`${I}api/v1/gateway/preauth/${k}`,v);if((n=O==null?void 0:O.data)!=null&&n.result){let M;if(Te&&$)try{let u={postal_code:r==null?void 0:r.zipCode,customer_id:$,gateway_token:(t==null?void 0:t.Token)||(t==null?void 0:t.gateway_token)};M=await Z.post(`${I}api/v1/gateway/add-card/${k}`,u),(i=M==null?void 0:M.data)!=null&&i.result&&(M=(p=M==null?void 0:M.data)==null?void 0:p.data)}catch(u){console.log(u,"error"),E(),A(((l=(s=u==null?void 0:u.response)==null?void 0:s.data)==null?void 0:l.message)||"Something went wrong!"),w({error:((h=(y=u==null?void 0:u.response)==null?void 0:y.data)==null?void 0:h.message)||"Something went wrong!",result:(c=(x=u==null?void 0:u.response)==null?void 0:x.data)==null?void 0:c.result,statusCode:(m=u==null?void 0:u.response)==null?void 0:m.status})}let ce={cardDetails:F(F({},M),t),callback:L(F({},(a=O==null?void 0:O.data)==null?void 0:a.data),{name:r==null?void 0:r.cardName,isPreAuth:P})};Te||delete ce.cardDetails,w(ce),E(),he()}}catch(v){A(((B=(C=v==null?void 0:v.response)==null?void 0:C.data)==null?void 0:B.message)||"Something went wrong!"),w({error:((N=(T=v==null?void 0:v.response)==null?void 0:T.data)==null?void 0:N.message)||"Something went wrong!",result:(le=(se=v==null?void 0:v.response)==null?void 0:se.data)==null?void 0:le.result,statusCode:(pe=v==null?void 0:v.response)==null?void 0:pe.status}),E()}},En=async t=>{var n,i,p,s,l,y,h,x,c;if(t.Error)A(t.Error),w({error:t.Error||"Something went wrong!"}),E();else{let m={token:t.Token,resp:t};try{let a=await Z.post(`${I}api/v1/gateway/update/token/${k}`,m);if((a==null?void 0:a.status)==200){let C={Token:(i=(n=a==null?void 0:a.data)==null?void 0:n.data)==null?void 0:i.gateway_token,Brand:t.Brand,ExpirationMonth:t.ExpirationMonth,ExpirationYear:t.ExpirationYear,Last4:t.Last4,Bin:t.Bin,CVV:t.CVV,postalCode:r==null?void 0:r.zipCode},B;P?Yt(C):Ot(C)}}catch(a){console.log(a,"error"),E(),A(((s=(p=a==null?void 0:a.response)==null?void 0:p.data)==null?void 0:s.message)||"Something went wrong!"),w({error:((y=(l=a==null?void 0:a.response)==null?void 0:l.data)==null?void 0:y.message)||"Something went wrong!",result:(x=(h=a==null?void 0:a.response)==null?void 0:h.data)==null?void 0:x.result,statusCode:(c=a==null?void 0:a.response)==null?void 0:c.status})}}},Vt=t=>{j(t)},zn=()=>{var i,p,s,l,y,h,x,c;let t={},n=o;return(i=n==null?void 0:n.name)!=null&&i.trim()||(t.name="Name is required"),(p=n==null?void 0:n.accountNumber)!=null&&p.trim()||(t.accountNumber="Account number is required"),(s=n==null?void 0:n.accountNumber)!=null&&s.trim()&&((l=n==null?void 0:n.accountNumber)==null?void 0:l.trim())!==((y=n==null?void 0:n.confirmAccountNumber)==null?void 0:y.trim())&&(t.confirmAccountNumber="Account numbers must match"),(h=n==null?void 0:n.bankName)!=null&&h.trim()||(t.bankName="Bank name is required"),(x=n==null?void 0:n.routingNumber)!=null&&x.trim()||(t.routingNumber="Routing Number is required"),n!=null&&n.routingNumber&&((c=n==null?void 0:n.routingNumber)==null?void 0:c.length)!==9&&(t.routingNumber="Routing number must be 9 digits"),((n==null?void 0:n.accountType)==="business saving"||(n==null?void 0:n.accountType)==="business checking")&&(!(n!=null&&n.companyName)||(n==null?void 0:n.companyName)==="")&&(t.companyName="Company Name is required for business accounts"),Ae(t),Object.keys(t).length>0},rt=async(t,n)=>{var i,p,s,l,y,h,x,c;try{let m=t,a=await Z.post(`${I}api/v1/gateway/verify-and-save/${k}`,{token:m,require3ds:J,pass_fee:te});if((a==null?void 0:a.status)==200){let C=(i=a==null?void 0:a.data)==null?void 0:i.data,B={Token:C.gateway_token,Brand:C.card_data.brand,ExpirationMonth:C.card_data.expire_mm,ExpirationYear:C.card_data.expire_yy,Last4:C.card_data.last4,Bin:C.card_data.bin,postalCode:r==null?void 0:r.zipCode,stripe_3ds_auth_id:n};P?Yt(B):Ot(B)}}catch(m){console.log(m,"error"),A(((s=(p=m==null?void 0:m.response)==null?void 0:p.data)==null?void 0:s.message)||"Something went wrong!"),w({error:((y=(l=m==null?void 0:m.response)==null?void 0:l.data)==null?void 0:y.message)||"Something went wrong!",result:(x=(h=m==null?void 0:m.response)==null?void 0:h.data)==null?void 0:x.result,statusCode:(c=m==null?void 0:m.response)==null?void 0:c.status}),E()}},In=async()=>{var t,n,i,p,s,l,y,h,x,c,m,a,C,B,T,N,se,le,pe,v,O,M,ce,u,ze,_,Ie,Ze,Fe,H,g,je;try{let q={method:"POST",redirect:"follow"},_e=await Z.post(`${I}api/v1/widget/generate-session`,q),Zn=Number(r==null?void 0:r.expiryYear)%100,Gn=`${(t=r==null?void 0:r.cardNumber)==null?void 0:t.replace(/\s+/g,"")}=${Zn}${r==null?void 0:r.expiryMonth} ${r==null?void 0:r.cvv}`,Jn=forge.pki.publicKeyFromPem((i=(n=_e==null?void 0:_e.data)==null?void 0:n.data)==null?void 0:i.publicKeyPem).encrypt(Gn,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Qn=forge.util.encode64(Jn),Xn={"Content-Type":"application/json","x-app-session-key":(s=(p=_e.data)==null?void 0:p.data)==null?void 0:s.session_key},cn={enc_track2_data:Qn,algorithm:"RSAES_OAEP_SHA_1",session_key:(y=(l=_e==null?void 0:_e.data)==null?void 0:l.data)==null?void 0:y.session_key};if(J&&typeof window!="undefined"&&typeof navigator!="undefined"){let W=(h=navigator.languages)!=null?h:[navigator.language],mn=Array.isArray(W)?W[0]:W;cn.three_ds_data={amount:Math.round(oe?parseFloat(oe)*100:parseFloat(f)*100),currency:"usd",channel:{type:"browser",browser:{language:typeof mn=="string"?mn:null,color_depth:(c=(x=window.screen)==null?void 0:x.colorDepth)!=null?c:null,java_enabled:typeof navigator.javaEnabled=="function"?navigator.javaEnabled():!1,screen_height:(a=(m=window.screen)==null?void 0:m.height)!=null?a:null,screen_width:(B=(C=window.screen)==null?void 0:C.width)!=null?B:null,timezoneOffset:new Date().getTimezoneOffset()}}}}let Dn=JSON.stringify(cn),X=await Z.post(`${dn}tokenizer/tokenize`,Dn,{headers:Xn});if((X==null?void 0:X.status)==200){let W=(N=(T=X==null?void 0:X.data)==null?void 0:T.data)==null?void 0:N.stripe_three_ds_response;J&&!W&&W.status==="200 OK"&&((se=W==null?void 0:W.data)!=null&&se.challenge_url)&&A("Something went wrong. Please try again later."),J?(le=W==null?void 0:W.data)!=null&&le.challenge_url?(E(),tt(L(F({},W==null?void 0:W.data),{fractalToken:(ce=(M=X==null?void 0:X.data)==null?void 0:M.data)==null?void 0:ce.token}))):rt((v=(pe=X==null?void 0:X.data)==null?void 0:pe.data)==null?void 0:v.token,(O=W==null?void 0:W.data)==null?void 0:O.id):rt((ze=(u=X==null?void 0:X.data)==null?void 0:u.data)==null?void 0:ze.token,null)}}catch(q){E(),console.log(q,"error"),A(((Ie=(_=q==null?void 0:q.response)==null?void 0:_.data)==null?void 0:Ie.message)||"Something went wrong!"),w({error:((Fe=(Ze=q==null?void 0:q.response)==null?void 0:Ze.data)==null?void 0:Fe.message)||"Something went wrong!",result:(g=(H=q==null?void 0:q.response)==null?void 0:H.data)==null?void 0:g.result,statusCode:(je=q==null?void 0:q.response)==null?void 0:je.status})}},jn=()=>{var s,l,y,h,x,c;let t={},n=r,i=parseInt((n==null?void 0:n.expiryMonth)||"",10),p=(n==null?void 0:n.expiryYear)||"";if((s=n==null?void 0:n.cardName)!=null&&s.trim()||(t.cardName="Card name is required"),(l=n==null?void 0:n.cardNumber)!=null&&l.trim()||(t.cardNumber="Card number is required"),(!((y=n==null?void 0:n.expiryMonth)!=null&&y.trim())||!((h=n==null?void 0:n.expiryYear)!=null&&h.trim())||isNaN(i)||i<1||i>12||p.length!==4)&&(t.expiryMonth="Invalid Expiration Date."),(x=n==null?void 0:n.cvv)!=null&&x.trim()||(t.cvv="CVV is required"),(c=n==null?void 0:n.zipCode)!=null&&c.trim()||(t.zipCode="ZIP code is required"),n!=null&&n.expiryMonth&&(n!=null&&n.expiryYear)&&n.expiryMonth.length<=2&&n.expiryYear.length===4){let m=parseInt(n.expiryMonth,10),a=parseInt(n.expiryYear,10),C=new Date,B=C.getMonth()+1,T=C.getFullYear();(a<T||a===T&&m<B)&&(t.expiryMonth="Card is expired")}return ue(t),Object.keys(t).length>0},Hn=()=>{let t=DatacapWebToken.validateCardNumber(r==null?void 0:r.cardNumber.replaceAll(" ","")),n=DatacapWebToken.validateExpirationDate(r==null?void 0:r.expiryMonth,r==null?void 0:r.expiryYear),i=DatacapWebToken.validateCVV(r==null?void 0:r.cvv),p={};return t||(p.cardNumber="Invalid card Number"),n||(p.expiryMonth="Invalid Expiration Date."),i||(p.cvv="Invalid CVV"),ue(p),t&&i&&n},qt=async t=>{var n,i,p,s,l,y,h,x,c,m,a,C,B,T,N,se,le,pe,v,O,M,ce,u,ze;if(t.preventDefault(),R!=="ach"){if(jn()||!Hn())return}else if(zn())return;try{$e();let _=await Z.get(`${I}api/v1/gateway/token/${k}`,{params:{require3ds:J,pass_fee:te}});if((_==null?void 0:_.status)==200){let Ie=(i=(n=_==null?void 0:_.data)==null?void 0:n.data)==null?void 0:i.gateway_token,Ze=(s=(p=_==null?void 0:_.data)==null?void 0:p.data)==null?void 0:s.paymentGateway;if(R!=="ach")Ze==((l=vn)==null?void 0:l.FRACTALKEY)?await In():DatacapWebToken.requestToken(Ie,"PaymentForm",En);else{let Fe;try{let H=await Z.post(`${I}api/v1/gateway/bank-charge/${k}`,{label:o==null?void 0:o.name,account_number:o==null?void 0:o.accountNumber,routing_number:o==null?void 0:o.routingNumber,bank_name:o==null?void 0:o.bankName,account_type:o==null?void 0:o.accountType,amount:`${Y}`,customer_id:null,isSaveAch:!1,tax:"0.00",discount:"0.00",surcharge:"0.00",order_id:"",company_name:(o==null?void 0:o.companyName)||""});if((y=H==null?void 0:H.data)!=null&&y.result){if(Qe&&$)try{let g=await Z.post(`${I}api/v1/gateway/add-bank/${k}`,{name:o==null?void 0:o.name,account_number:o==null?void 0:o.accountNumber,routing_number:o==null?void 0:o.routingNumber,bank_name:o==null?void 0:o.bankName,account_type:o==null?void 0:o.accountType,customer_id:$||"",company_name:(o==null?void 0:o.companyName)||""});g.data.result&&(Fe={bankDetails:L(F({},(h=g==null?void 0:g.data)==null?void 0:h.data),{account_type:o==null?void 0:o.accountType})})}catch(g){E(),A(((c=(x=g==null?void 0:g.response)==null?void 0:x.data)==null?void 0:c.message)||"Something went wrong!"),w({error:((a=(m=g==null?void 0:g.response)==null?void 0:m.data)==null?void 0:a.message)||"Something went wrong!",result:(B=(C=g==null?void 0:g.response)==null?void 0:C.data)==null?void 0:B.result,statusCode:(T=g==null?void 0:g.response)==null?void 0:T.status})}Fe=L(F({},Fe),{callback:L(F({},(N=H==null?void 0:H.data)==null?void 0:N.data),{name:o==null?void 0:o.name,isPreAuth:P})}),w(Fe),he(),E()}}catch(H){console.log(H,"errororor");let g=(se=H==null?void 0:H.response)==null?void 0:se.data;typeof(g==null?void 0:g.message)=="object"?Object.values(g==null?void 0:g.message).forEach(je=>{var q;A(je||"Something went wrong"),w({error:je||"Something went wrong!",result:(g==null?void 0:g.result)||!1,statusCode:(q=H==null?void 0:H.response)==null?void 0:q.status})}):(A((g==null?void 0:g.message)||"Something went wrong"),w({error:(g==null?void 0:g.message)||"Something went wrong!",result:(g==null?void 0:g.result)||!1,statusCode:(le=H==null?void 0:H.response)==null?void 0:le.status})),E()}}}}catch(_){E(),w({error:((v=(pe=_==null?void 0:_.response)==null?void 0:pe.data)==null?void 0:v.message)||"Something went wrong!",result:(M=(O=_==null?void 0:_.response)==null?void 0:O.data)==null?void 0:M.result,statusCode:(ce=_==null?void 0:_.response)==null?void 0:ce.status}),A(((ze=(u=_==null?void 0:_.response)==null?void 0:u.data)==null?void 0:ze.message)||"Something went wrong!")}},Ee=(t,n)=>{let i=t;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(i)){(n===""||/^[0-9]+$/.test(n))&&(ue(s=>L(F({},s),{[i]:""})),Ce(s=>L(F({},s),{[i]:n})));return}ue(s=>L(F({},s),{[i]:""})),Ce(s=>L(F({},s),{[i]:n}))},On=t=>{let i=t.target.value.replace(/\D/g,""),p="";/^3[47]/.test(i)?p=i.slice(0,15).replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(l,y,h,x)=>[y,h,x].filter(Boolean).join(" ")):p=i.slice(0,16).replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(l,y,h,x,c)=>[y,h,x,c].filter(Boolean).join(" ")),ue(s=>L(F({},s),{cardNumber:""})),Ce(s=>L(F({},s),{cardNumber:p}))},Se=t=>{let{name:n,value:i}=t.target,p=["routingNumber","accountNumber","confirmAccountNumber"];if(n=="name"){/^[a-zA-Z\s]*$/.test(i)&&(Ae(s=>L(F({},s),{[n]:""})),Ye(s=>L(F({},s),{[n]:i})));return}if(p.includes(n)){(i===""||/^[0-9]+$/.test(i))&&(Ae(s=>L(F({},s),{[n]:""})),Ye(s=>L(F({},s),{[n]:i})));return}Ae(s=>L(F({},s),{[n]:""})),Ye(s=>L(F({},s),{[n]:i}))},he=()=>{Pe(!1),j("card"),A(""),Fn(!1),_n(""),Ye({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),Ae({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),Ce({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),ue({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),bt(!1),yt(!1),Ke("form"),We("form"),St(!1),Ft(0),qe(0),De([]),Bn(null),Pt(null),Ue(!1),et(!1),tt(null),Lt(null),at(""),ot(""),Et("")},Wt=async()=>{var t,n,i,p,s,l,y,h,x;$e();try{let c={isPreAuth:P,customerId:$},m=await Z.post(`${I}api/v1/gateway/card-list/${k}`,c),a=((n=(t=m==null?void 0:m.data)==null?void 0:t.data)==null?void 0:n.cardList)||[],C=a==null?void 0:a.filter(T=>(T==null?void 0:T.card_type)=="Bank"),B=a==null?void 0:a.filter(T=>(T==null?void 0:T.card_type)!=="Bank");B&&(B==null?void 0:B.length)>0?(j("card"),We("list"),De(B)):(j("card"),De([])),C&&(C==null?void 0:C.length)>0?(Ke("list"),wt(C)):wt([]),E()}catch(c){console.log(c),E(),w({error:((p=(i=c==null?void 0:c.response)==null?void 0:i.data)==null?void 0:p.message)||"Something went wrong!",result:(l=(s=c==null?void 0:c.response)==null?void 0:s.data)==null?void 0:l.result,statusCode:(y=c==null?void 0:c.response)==null?void 0:y.status}),A(((x=(h=c==null?void 0:c.response)==null?void 0:h.data)==null?void 0:x.message)||(c==null?void 0:c.message)||"Something went wrong")}},wa=t=>{switch(t==null?void 0:t.toLowerCase()){case"visa":return It;case"mastercard":case"mc":case"m/c":return zt;case"amex":case"american express":case"ae":return jt;case"discover":case"dcvr":return Ht;case"bank":return $n;default:return t}},Kt=async t=>{Le.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 n=>{var i,p;if(n.isConfirmed){Ve(!0);try{let s={card_id:t,customer_id:$},l=await Z.patch(`${I}api/v1/gateway/delete-card/${k}`,s);(i=l==null?void 0:l.data)!=null&&i.result?(Ve(!1),Wt(),Le.fire({icon:"success",title:"Deleted!",text:((p=l==null?void 0:l.data)==null?void 0:p.message)||"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})):(Ve(!1),Le.fire({icon:"error",title:"Failure!",text:"Card not deleted.",timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}}))}catch(s){Ve(!1),Le.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else n.dismiss===Le.DismissReason.cancel&&Le.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},Ut=async()=>{var p,s,l,y,h,x,c,m,a;let t=$,n=ye==null?void 0:ye.id,i=ye==null?void 0:ye.card_type;if(f)if(t)if(n){let C={amount:(i==null?void 0:i.toLowerCase())==="bank"?`${Y}`:oe||f,customer_id:t,card_id:n,pass_fee_amount:Number(f)-ke};V&&(C.orderGuid=$t,oe&&(C.ispartialPayment=!0)),P&&(C.isPreauth=!0);let B=I+"api/v1/gateway/charge-by-saved-details/"+k,T={"Content-Type":"application/json"};try{$e();let N=await Z.post(B,C);(p=N==null?void 0:N.data)!=null&&p.result&&(w({callback:L(F({},(s=N==null?void 0:N.data)==null?void 0:s.data),{isPreAuth:P})}),E(),he())}catch(N){console.log(N==null?void 0:N.response,"error by saved details"),w({error:((y=(l=N==null?void 0:N.response)==null?void 0:l.data)==null?void 0:y.message)||"Something went wrong!",result:(x=(h=N==null?void 0:N.response)==null?void 0:h.data)==null?void 0:x.result,statusCode:(c=N==null?void 0:N.response)==null?void 0:c.status}),E(),A(((a=(m=N==null?void 0:N.response)==null?void 0:m.data)==null?void 0:a.message)||"Something went wrong!")}}else A("Please Select A Card/Bank"),w({error:"Please Select A Card/Bank"});else A("Please Select Customer"),w({error:"Please Select Customer"});else A("Something went wrong."),w({error:"Something went wrong."})},Yn=async()=>{var t,n,i,p,s,l,y,h,x,c,m;try{$e();let a=await Z.get(`${I}api/v1/gateway/get-payment-details/${k}`);(a==null?void 0:a.status)==200&&(St((n=(t=a==null?void 0:a.data)==null?void 0:t.data)==null?void 0:n.isBankActive),Ft(Number((p=(i=a==null?void 0:a.data)==null?void 0:i.data)==null?void 0:p.fee)||0),E())}catch(a){console.log((l=(s=a==null?void 0:a.response)==null?void 0:s.data)==null?void 0:l.result,"error while getting payment details"),w({error:((h=(y=a==null?void 0:a.response)==null?void 0:y.data)==null?void 0:h.message)||"Something went wrong!",result:(c=(x=a==null?void 0:a.response)==null?void 0:x.data)==null?void 0:c.result,statusCode:(m=a==null?void 0:a.response)==null?void 0:m.status}),E()}},Vn=async()=>{var t,n,i,p,s;if(nt(!0),!Mt)try{let l=await Z.post(`${I}api/v1/gateway/create-pay-order/${k}`,{amount:f,cashDiscount:ke,bankAmount:Y,bankSurcharge:xe,customerId:$,passFee:te,passFeeAmount:be||Number(f)-ke,require3ds:J,isPartial:V});(t=l==null?void 0:l.data)!=null&&t.result&&(nt(!1),Lt((i=(n=l==null?void 0:l.data)==null?void 0:n.data)==null?void 0:i.orderGuid),Et((s=(p=l==null?void 0:l.data)==null?void 0:p.data)==null?void 0:s.remainingAmount))}catch(l){console.log("error in creating order",l),nt(!1)}},it=gt(!1),st=gt(!1);Ge(()=>{!U&&!Q&&(it.current=!1,st.current=!1)},[U,Q]),Ge(()=>{!it.current&&(U||Q)&&(it.current=!0,Yn(),V&&Vn())},[U,Q,V]),Ge(()=>{if((U||Q)&&be){let t=Number(f)-Number(be);t&&!isNaN(t)&&qe(t)}else if((U||Q)&&te&&Re){let t=Tn(f,Re);t&&!isNaN(t)&&qe(t)}else qe(Number(f));!st.current&&$&&(U||Q)&&!ge&&(st.current=!0,Wt())},[$,U,f,Re,Q]);let Ca=()=>P?"Cards":"Cards/Bank",Na=la(async()=>{try{Ue(!0);let n=await(await fetch(`${I}api/v1/gateway/create-payment-intent/${k}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:f,require3ds:J,pass_fee:te})})).json();n.is3dEnable?(Ue(!1),Pt(n.clientSecret),et(n.is3dEnable)):(Ue(!1),et(n.is3dEnable)),n.result||A(n.error||(n==null?void 0:n.message)||"Failed to get client secret")}catch(t){console.log(t.response,"err.response"),A(t.message)}},[f]),qn=()=>{},Wn=(t,n)=>{$e(),rt(t,n),tt(null)},Kn=t=>{console.error("3DS Auth failed \u274C",t),A(`3DS Authentication ${t}`)};Ge(()=>{re&&re(()=>he)},[]);let Un=t=>{var n,i;((n=Number(Tt))==null?void 0:n.toFixed(2))<(t==null?void 0:t.floatValue)||(t==null?void 0:t.floatValue)<=0?(at(t==null?void 0:t.value),ot(`Partial amount cannot exceeds ${me((i=Number(Tt))==null?void 0:i.toFixed(2))}`)):(at(t==null?void 0:t.value),ot(""))};return e.createElement(e.Fragment,null,Bt&&e.createElement(lt,{loading:Bt}),Xe&&e.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},e.createElement(hn,{error:Xe,onClose:he})),!Xe&&e.createElement(e.Fragment,null,(ht||vt)&&e.createElement(lt,{loading:ht||vt||ve||Mt}),e.createElement("div",{className:"frac-card-payment-page frac-form frac-new-form"},e.createElement("div",{ref:we,style:{width:"100%",height:"100%"}}),Me!=null&&Me.challenge_url?e.createElement(wn,{containerRef:we,challengeUrl:Me.challenge_url,fractalToken:Me.fractalToken,stripeIntentId:Me.id,onSuccess:Wn,onError:Kn}):e.createElement("div",{className:"parent-pay-container"},e.createElement("span",{style:{display:Q?"none":"block"},className:"request-payment-close-popup",onClick:he},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},e.createElement("g",{clipPath:"url(#clip0_12425_52336)"},e.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"})),e.createElement("defs",null,e.createElement("clipPath",{id:"clip0_12425_52336"},e.createElement("rect",{width:"16",height:"16",fill:"white"}))))),e.createElement("div",{className:"pay-main-logo-res"}),e.createElement("div",{className:"pay-container"},e.createElement("div",{className:"pay-header pay-conatiner-one"},e.createElement("div",{className:"pay-conatiner-one-first"},e.createElement("div",{className:"pay-logo-container"},e.createElement("div",{className:"pay-main-logo"}),e.createElement("h1",{className:"pay-heading"},"Pay"),(fe==null?void 0:fe.length)>0&&R!=="cardList"&&e.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>j("cardList")}," ",e.createElement(ut,null)," Back")),e.createElement("div",{className:"amt-pay-con"},e.createElement("div",{className:"pay-amount-conatiner"},e.createElement("small",{className:"pay-payment-amount"},"Select payment type"),e.createElement("div",{className:"frac-card-bank-radio-main"},e.createElement(pt,{label:"Card",amount:(Zt=Number(f))==null?void 0:Zt.toFixed(2),value:"card",onChange:Vt,activetab:R}),!P&&Pn&&!V&&e.createElement(pt,{label:"Bank",amount:(Gt=Number(Y))==null?void 0:Gt.toFixed(2),value:"ach",onChange:Vt,activetab:R})),te&&R==="card"&&ke&&Number(f)-Number(ke)>0?e.createElement("div",{className:"frac-cash-discount-fee"},e.createElement("small",null,R==="card"?"Cash Discount":"Cash Discount Savings"," "),e.createElement("p",null,me((Number(f)-Number(ke)).toFixed(2)))):null,V&&e.createElement("div",{className:"frac-partial-payment-input"},e.createElement("label",{htmlFor:"partialpayment"},"Partial Payment"),e.createElement(pa,{prefix:"$",className:"form-control-frac",value:oe,onValueChange:t=>{Un(t)},thousandSeparator:!0,placeholder:"Enter partial amount",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0}),At&&e.createElement("span",{className:"error-span"},At))))),e.createElement("div",{className:"pay-conatiner-one-last"},e.createElement("img",{src:Ln,alt:""}),e.createElement("img",{src:An,alt:""}),"Secure payments powered by Fractal")),e.createElement("div",{className:"pay-tab pay-conatiner-two"},e.createElement("div",{className:"col-md-12"},e.createElement("div",{id:"payment-form-div"},Mn?_t&&e.createElement(dt,{onSuccess:qn,clientSecret:_t,amount:f,showLoader:$e,hideLoader:E,callback:w,session_token:k,handleClose:he,setError:A,isPreAuth:P}):e.createElement(e.Fragment,null,e.createElement("div",{id:"ach",style:{display:R==="card"?"block":"none"},className:"tabcontent"},e.createElement("div",{className:"frac-heading-card-wrap"},e.createElement("div",{className:"frac-backarrow"},(fe==null?void 0:fe.length)>0&&Nt==="form"&&e.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>We("list")}," ",e.createElement(ut,null))),e.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),e.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},e.createElement("img",{src:It,alt:"",width:33}),e.createElement("img",{src:zt,width:33,alt:""}),e.createElement("img",{src:jt,alt:"",width:33}),e.createElement("img",{src:Ht,width:33,alt:""})),Nt==="list"&&(fe==null?void 0:fe.length)>0?e.createElement(e.Fragment,null,e.createElement(ct,{headingClass:"card-ach-heading-frac",listHeading:"Card",ListItems:fe,selectedCard:ye,setSelectedCard:Ct,handleDeleteCard:Kt,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{We("form")}}),e.createElement("div",{className:"form-group-frac",style:{padding:"0"}},e.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Ut},oe?me((Jt=Number(oe))==null?void 0:Jt.toFixed(2)):me((Qt=Number(f))==null?void 0:Qt.toFixed(2))))):e.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:qt},e.createElement("div",{className:"ach-scrl",style:{minHeight:"398px",maxHeight:"398px",overflow:"auto",marginRight:"5px"}},e.createElement("div",{className:"form-group-frac"},e.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),e.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"John Doe",value:(r==null?void 0:r.cardName)||"",onChange:t=>{let n=t.target.value;/^[a-zA-Z\s]*$/.test(n)&&Ee("cardName",n)}}),(d==null?void 0:d.cardName)&&e.createElement("span",{className:"error-span"},d==null?void 0:d.cardName)),e.createElement("div",{className:"form-group-frac"},e.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),e.createElement("div",{className:"toggle-num-wrapper"},e.createElement("input",{className:"form-control-frac card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(r==null?void 0:r.cardNumber)||"",onChange:t=>On(t),"data-token":"card_number"}),e.createElement("div",{className:"card-crdi card-expiry-new"},e.createElement("div",{className:"exp-date-year-container"},e.createElement("div",{className:"exp-date form-group-frac"},e.createElement("input",{"data-token":"exp_month",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(r==null?void 0:r.expiryMonth)||"",onChange:t=>Ee("expiryMonth",t.target.value)})),e.createElement("div",{className:"exp-year form-group-frac"},e.createElement("input",{"data-token":"exp_year",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(r==null?void 0:r.expiryYear)||"",onChange:t=>Ee("expiryYear",t.target.value)})),e.createElement("div",{className:"security-digit form-group-frac"},e.createElement("input",{"data-token":"cvv",className:"form-control-frac card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(r==null?void 0:r.cvv)||"",onChange:t=>Ee("cvv",t.target.value)})))),(d==null?void 0:d.cardNumber)&&e.createElement("span",{className:"error-span"},d==null?void 0:d.cardNumber),e.createElement("p",{style:{margin:"0"}},d!=null&&d.expiryMonth||d!=null&&d.expiryYear?e.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},d==null?void 0:d.expiryMonth):"",(d==null?void 0:d.cvv)&&e.createElement("span",{className:"error-span"},d==null?void 0:d.cvv)))),e.createElement("div",{className:"form-group-frac"},e.createElement("label",{htmlFor:"zip"},"ZIP"),e.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"000000",value:(Xt=r==null?void 0:r.zipCode)!=null?Xt:"",onChange:t=>Ee("zipCode",t.target.value)}),(d==null?void 0:d.zipCode)&&e.createElement("span",{className:"error-span"},d==null?void 0:d.zipCode)),$&&e.createElement("div",{className:"form-group-frac"},e.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},e.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:Te,onChange:t=>yt(t.target.checked)}),e.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),e.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),e.createElement("div",{className:"frac-tooltip-wrapper"},e.createElement("div",{className:"frac-tooltip-icon"},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),e.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"}))),e.createElement("div",{className:"frac-tooltip-text"},e.createElement("p",null,"If checked, I agree to give the ",e.createElement("b",null,K||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),e.createElement("div",{className:"form-group-frac",style:{marginTop:"20px",padding:"0"}},e.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},oe?me((Dt=Number(oe))==null?void 0:Dt.toFixed(2)):me((Rt=Number(f))==null?void 0:Rt.toFixed(2)))))),e.createElement("div",{id:"ach",style:{display:R==="ach"?"block":"none"},className:"tabcontent"},e.createElement(e.Fragment,null,e.createElement("div",{className:"frac-heading-card-wrap"},e.createElement("div",{className:"frac-backarrow"},(Ne==null?void 0:Ne.length)>0&&kt==="form"&&e.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Ke("list")}," ",e.createElement(ut,null))),e.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment")),kt==="list"&&(Ne==null?void 0:Ne.length)>0?e.createElement(e.Fragment,null,e.createElement(ct,{headingClass:"card-ach-heading-frac",listHeading:"Banks",ListItems:Ne,selectedCard:ye,setSelectedCard:Ct,handleDeleteCard:Kt,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{Ke("form")}}),e.createElement("div",{className:"form-group-frac",style:{padding:"0"}},e.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:Ut},me((en=Number(Y))==null?void 0:en.toFixed(2))))):e.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:qt,autoComplete:"off"},e.createElement("div",{className:"ach-scrl",style:{minHeight:"444px",maxHeight:"444px"}},e.createElement("div",{className:"form-group-frac mb-4"},e.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),e.createElement("input",{type:"text",id:"nameonaccount",className:"form-control-frac",maxLength:100,placeholder:"John Doe",name:"name",value:(tn=o==null?void 0:o.name)!=null?tn:"",onChange:Se}),(b==null?void 0:b.name)&&e.createElement("span",{className:"error-span"},b==null?void 0:b.name)),e.createElement("div",{className:"form-group-frac mb-4"},e.createElement("label",{htmlFor:"routingnumber"},"Routing number"),e.createElement("input",{type:"text",id:"routingnumber",className:"form-control-frac",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(nn=o==null?void 0:o.routingNumber)!=null?nn:"",onChange:Se}),(b==null?void 0:b.routingNumber)&&e.createElement("span",{className:"error-span"},b==null?void 0:b.routingNumber)),e.createElement("div",{className:"form-group-frac mb-4"},e.createElement("label",{htmlFor:"accountnumber"},"Account number"),e.createElement("input",{type:"text",id:"accountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(an=o==null?void 0:o.accountNumber)!=null?an:"",onChange:Se}),(b==null?void 0:b.accountNumber)&&e.createElement("span",{className:"error-span"},b==null?void 0:b.accountNumber)),e.createElement("div",{className:"form-group-frac mb-4"},e.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),e.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(on=o==null?void 0:o.confirmAccountNumber)!=null?on:"",onChange:Se}),(b==null?void 0:b.confirmAccountNumber)&&e.createElement("span",{className:"error-span"},b==null?void 0:b.confirmAccountNumber)),e.createElement("div",{className:"form-group-frac mb-4"},e.createElement("label",{htmlFor:"bankname"},"Bank name"),e.createElement("input",{type:"text",id:"bankname",className:"form-control-frac",maxLength:100,placeholder:"My Bank",name:"bankName",value:(rn=o==null?void 0:o.bankName)!=null?rn:"",onChange:Se}),(b==null?void 0:b.bankName)&&e.createElement("span",{className:"error-span"},b==null?void 0:b.bankName)),((o==null?void 0:o.accountType)==="business saving"||(o==null?void 0:o.accountType)==="business checking")&&e.createElement("div",{className:"form-group-frac mb-4"},e.createElement("label",{htmlFor:"companyName"},"Company name"),e.createElement("input",{type:"text",id:"companyName",className:"form-control-frac",maxLength:100,placeholder:"My Company",name:"companyName",value:(sn=o==null?void 0:o.companyName)!=null?sn:"",onChange:Se}),(b==null?void 0:b.companyName)&&e.createElement("span",{className:"error-span"},b==null?void 0:b.companyName)),e.createElement("div",{className:"form-group-frac mb-4"},e.createElement("label",{htmlFor:"accounttype"},"Select account type"),e.createElement("select",{name:"accountType",id:"accounttype",className:"form-control-frac",value:(ln=o==null?void 0:o.accountType)!=null?ln:"",onChange:Se},e.createElement("option",{value:""},"Select account"),bn.map(t=>e.createElement("option",{key:t.value,value:t.value},t.label)))),$&&e.createElement("div",{className:"form-group-frac mb-4 save-ach-div",style:{paddingTop:"5px"}},e.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:Qe,onChange:t=>bt(t.target.checked)}),e.createElement("label",{className:"saveachlabel",htmlFor:"saveACH"},"Save ACH")),Qe&&e.createElement("div",{className:"form-group-frac mb-4 saveachtext"},e.createElement("p",null,"If checked, I agree to give the ",e.createElement("b",null,K||"merchant")," permission to charge this bank account for agreed-upon purchases in the future."))),e.createElement("div",{className:"form-group-frac "},e.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},me((pn=Number(Y))==null?void 0:pn.toFixed(2))))))))))))))))},ft=ca;import da from"axios";var vo=({amount:f,bankAmount:Y,submitBtnText:G="Pay",session_token:k,customerId:$,callback:w,merchantName:K="merchant",isPreAuth:P,surcharge:ae="0",submitBtnClass:D,submitBtnIcon:ee,isRequest:ge,pass_fee:te,pass_fee_amount:be,require3ds:J=!1,autoTrigger:Q=!1,isPartial:U=!1,bankSurcharge:Pe,partialRef:re})=>{let[V,xe]=Je(!1),[Be,ve]=Je(!1),[we,R]=Je(()=>()=>{}),j=ma(()=>({amount:f,bankAmount:Y,submitBtnText:G,session_token:k,customerId:$,callback:w,merchantName:K,isPreAuth:P,surcharge:ae,submitBtnClass:D,submitBtnIcon:ee,isRequest:ge,pass_fee:te,pass_fee_amount:be,require3ds:J,autoTrigger:Q,setShow:xe,setHandleCloseRef:R,isPartial:U,bankSurcharge:Pe,partialRef:re}),[f,Y,G,k,$,w,K,P,ae,D,ee,ge,te,be,J,Q,U,Pe,re]),[ie,z]=Je(j);Sn(()=>{V&&z(j)},[V,j]);let r=async()=>{var Ce;ve(!0);try{let d=await da.get(`${I}api/v1/gateway/get-order-details/${k}`,{params:{isPartial:U,partialRef:re}});if((Ce=d==null?void 0:d.data)!=null&&Ce.result){let ue=d.data.data;z(o=>L(F({},o),{amount:ue.amount,pass_fee_amount:ue.pass_fee_amount,pass_fee:ue.pass_fee}))}}catch(d){console.log("error while getting skyosorderdeatils",d)}finally{ve(!1)}};return Sn(()=>{V&&U&&re&&r()},[V,U,re]),de.createElement(de.Fragment,null,de.createElement("link",{href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"}),de.createElement(yn,null),de.createElement(mt,null),de.createElement(xn,null),de.createElement(un,null),!Q&&de.createElement("button",{className:D||"paymentBtn",onClick:()=>xe(!0)},G,ee),Q?de.createElement(ft,F({show:V,loadingPrev:Be},ie)):de.createElement(fn,{open:V,onClose:we},de.createElement(ft,F({show:V,loadingPrev:Be},ie))))};export{vo as PaymentWidget};
|