@fractalpay/fractalpay-next 0.0.23 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8075 -38
- package/dist/index.js.map +1 -0
- package/package.json +12 -10
- package/types/fractal.d.ts +11 -0
- package/dist/index.d.mts +0 -137
- 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 qi=Object.getOwnPropertySymbols;var ma=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable;var da=(e,t,$)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:$}):e[t]=$,C=(e,t)=>{for(var $ in t||(t={}))ma.call(t,$)&&da(e,$,t[$]);if(qi)for(var $ of qi(t))ca.call(t,$)&&da(e,$,t[$]);return e},M=(e,t)=>Ma(e,La(t));var ii=(e,t)=>{var $={};for(var I in e)ma.call(e,I)&&t.indexOf(I)<0&&($[I]=e[I]);if(e!=null&&qi)for(var I of qi(e))t.indexOf(I)<0&&ca.call(e,I)&&($[I]=e[I]);return $};var Aa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ga=Aa((Er,Ba)=>{Ba.exports={name:"@fractalpay/fractalpay-next",version:"0.0.23",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 B,{useState as Un,useEffect as ha}from"react";import Xn from"react";import za from"react";var Ia=e=>za.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
|
-
`),ua=Ia;var Ta=e=>Xn.createElement(Xn.Fragment,null,Xn.createElement(ua,null),(e==null?void 0:e.loading)&&Xn.createElement("div",{className:"loader"},Xn.createElement("div",{className:"lds-ellipsis"},Xn.createElement("div",null),Xn.createElement("div",null),Xn.createElement("div",null),Xn.createElement("div",null)))),mn=Ta;var{name:Yi}=ga(),R="https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/";Yi==="@fractalpay/fractalpay-next-dev"?(Ie="https://dev-sky-node.fractalpay.com/",et="https://dev-widget.fractalpay.com/",cn="https://api-dev.merchant-trends.com/",ai="https://token-cert.dcap.com/v1/client",ri="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw"):Yi==="@fractalpay/fractalpay-next-test"?(Ie="https://testapi.fractalpay.com/",et="https://staging-widget.fractalpay.com/",cn="https://api-dev.merchant-trends.com/",ai="https://token-cert.dcap.com/v1/client",ri="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw"):Yi==="@fractalpay/fractalpay-next-testprod"?(Ie="https://sky-node-prod.fractalpay.com/",et="https://widget-prod.fractalpay.com/",cn="https://api.merchant-trends.com/",ai="https://token.dcap.com/v1/client",ri="pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB"):Yi==="@fractalpay/fractalpay-next"?(Ie="https://api.fractalpay.com/",et="https://widget.fractalpay.com/",cn="https://api.merchant-trends.com/",ai="https://token.dcap.com/v1/client",ri="pk_live_51RH5WXCZ90rBGeaYwqmjWqgUmudTgxL6uKOE1keu617jvRx9OvW2ke6zGf6SKgv4ixsBLcIPQ4sQIEhp8MgBX39500CqULxOPB"):(et="http://localhost:8082/",Ie="http://localhost:8081/",cn="https://api-dev.merchant-trends.com/",ai="https://token-cert.dcap.com/v1/client",ri="pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw");var Ie,et,cn,ai,ri;var Ut={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 ki from"react";import qa from"react";var Ya=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
|
-
`),$i=Ya;var $a=({open:e,onClose:t,children:$,maxWidth:I})=>e?ki.createElement(ki.Fragment,null,ki.createElement($i,null),ki.createElement("div",{className:"fractal-popup"},ki.createElement("div",{className:"fractal-popup-content request-payment-popup-container",style:{maxWidth:`${I!=null?I:"auto"}`}},$))):null,Sn=$a;import Wa from"axios";import{PatternFormat as Ga}from"react-number-format";import Ha from"react";var ja=e=>Ha.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
|
-
`),Hi=ja;var ci=e=>{try{let t=JSON.parse(e);return typeof t=="object"&&t!==null}catch(t){return!1}},ui=[{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 fe(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 Va=R+"widget/mc-img.svg",Oa=R+"widget/visa-img.svg",Ea=R+"widget/ae-img.svg",Ka=R+"widget/discover-img.svg",Si=R+"widget/card.svg",Za=R+"widget/bank.svg",ro=R+"widget/Trash.svg",oo=R+"widget/secure-img.png",so=R+"widget/pov-by.png",ji=R+"widget/pax.svg",pa=R+"widget/Bank _New.svg",fa=e=>{switch(e==null?void 0:e.toLowerCase()){case"visa":return Oa;case"mastercard":case"mc":case"m/c":return Va;case"amex":case"american express":case"ae":return Ea;case"discover":case"dcvr":return Ka;case"bank":return Za;default:return Si}},In=(e,t)=>{let $=e.replace(/\D/g,""),I=e.slice(0,t).replace(/\D/g,"").length,z="",q="";if(/^3[47]/.test($)?(z=$.slice(0,15),q=z.replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(E,L,Z,ie)=>[L,Z,ie].filter(Boolean).join(" "))):(z=$.slice(0,16),q=z.replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(E,L,Z,ie,N)=>[L,Z,ie,N].filter(Boolean).join(" "))),I===0)return{formatted:q,cursor:0};let G=q.length,ye=0;for(let E=0;E<q.length;E++)if(/\d/.test(q[E])&&ye++,ye===I){G=E+1;break}return{formatted:q,cursor:G}},En=e=>e==1?!1:(e==0,!0);function Ua(e){let t=e.merchantPublicKey,$=e==null?void 0:e.discount,I=e==null?void 0:e.tax,z=e==null?void 0:e.surcharge,[q,W]=Un(!1),[G,ye]=Un(!1),[E,L]=Un({}),[Z,ie]=Un(null),[N,y]=Un({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),[D,O]=Un(!1),[b,Fe]=Un(void 0),[_,tt]=Un(""),[Me,oe]=Un(!1),[Le,bt]=Un(null),ke=x=>/^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(x),Te=/[+-]?([0-9]*[.])?[0-9]+/,se=x=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x),Ee=x=>/^[A-Za-z\s]*$/.test(x),Ue=(x,p)=>{let F=(parseFloat(p)||0)/100,Ke=x/(1+F);return Math.round(Ke*100)/100};ha(()=>{if(e!=null&&e.pass_fee){let x=Ue(e==null?void 0:e.amount,e==null?void 0:e.surcharge);Fe(x)}},[e==null?void 0:e.pass_fee]);let hn=()=>{W(!1),L({})},an=()=>W(!0),h=()=>{console.log(Le,"apiresponse"),u(Le),oe(!1)};function S(){y({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),tt("")}function u(x){let p={type:"preview.compiledcheck",other:M(C({},x),{status:!0})};window.parent.postMessage(p,"*")}let me=async()=>{if(!(Object.keys(E).length>0)){if(L({}),!(N!=null&&N.email)&&Z&&!ke(Z)){L(x=>M(C({},x),{phone:Ut.phonenumbervalid}));return}if(w())try{ye(!0);let x={fractalpayPublicKey:t,amount:_,phone_number:Z,order_id:N.order_id,action:"request",name:N.name,email:N.email,customer_id:e!=null&&e.customerId?e==null?void 0:e.customerId:"",discount:$,surcharge:z,tax:I,require_3ds:e==null?void 0:e.require_3ds,pass_fee:e==null?void 0:e.pass_fee,allow_partial:D},p=await Wa.post(`${et}create-widget-order`,x,{headers:C({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})});(p==null?void 0:p.status)===200&&(oe(!0),W(!1),S(),bt(p==null?void 0:p.data)),ye(!1)}catch(x){console.log(x),ye(!1)}}},o=et+"images/logo-img.png",r=x=>{let{value:p}=x.target,F=x.target.dataset.token;if(y(M(C({},N),{[F]:p})),F==="name"&&!Ee(p)){L(Se=>M(C({},Se),{[F]:Ut.onlylettersallowed}));return}let Ke=E;F==="email"&&!Z&&(delete Ke.phone,L(Ke)),p&&(delete Ke[F],L(Ke)),F==="email"&&!p&&(delete Ke[F],L(Ke))},a=x=>{let{value:p}=x;if(Number(p)>0){let F=E;delete F.amount,L(F)}tt(p)},w=()=>{let x={};return _||(x.amount=Ut.amountrequired),N.email&&!se(N==null?void 0:N.email)&&(x.email=Ut.invalidemail),!Z&&!(N!=null&&N.email)&&(x.phone=Ut.phoneoremailrequired),!Z&&!(N!=null&&N.email)&&(x.email=Ut.phoneoremailrequired),!Z&&N.email&&!se(N==null?void 0:N.email)&&(x.email=Ut.invalidemail),e.from==="merchant"&&!N.order_id&&(x.order_id=Ut.orderidrequired),L(x),Object.keys(x).length===0};ha(()=>{e&&(y(x=>M(C({},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:""})),tt(e.amount?e.amount:""),ie(e.phone?`${e.phone}`:null))},[e]);let k=x=>{let p=x==null?void 0:x.value;if(p&&(p==null?void 0:p.length)>0&&(p==null?void 0:p.length)!==10){L(Ke=>M(C({},Ke),{phone:Ut.phonenumberlength})),ie(p);return}else ie(p);let F=E;delete F.phone,p&&!(N!=null&&N.email)&&delete F.email,L(F)};function P(x){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(x))}let H=x=>{let p=x.target.checked;O(p)};return B.createElement(B.Fragment,null,B.createElement(Hi,null),B.createElement(mn,{loading:G}),B.createElement(B.Fragment,null,B.createElement("button",{className:"paymentBtn",onClick:an},"Request Payment"),B.createElement(Sn,{open:q,onClose:()=>W(!1),maxWidth:"500px"},B.createElement("div",{style:{maxWidth:"500px"}},B.createElement("div",{className:"request-payment-amount-detail frac-form"},B.createElement("p",{className:"request-payment-merchantname"},"Pay ",e==null?void 0:e.webname),B.createElement("p",{className:"request-payment-amount"},P(e==null?void 0:e.amount)),b&&b>0&&B.createElement("div",{className:"frac-req-cash-discount"},B.createElement("div",{className:"frac-cashlabel"},En(e==null?void 0:e.showSurcharge)?"Surcharge":"Cash Discount"," :"),B.createElement("div",null,fe((Number(e.amount)-b).toFixed(2)))),(e==null?void 0:e.from)==="merchant"&&B.createElement("p",{className:"request-payment-orderid"},N==null?void 0:N.order_id),B.createElement("span",{className:"request-payment-close-popup",onClick:hn},B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},B.createElement("g",{clipPath:"url(#clip0_12425_52336)"},B.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"})),B.createElement("defs",null,B.createElement("clipPath",{id:"clip0_12425_52336"},B.createElement("rect",{width:"16",height:"16",fill:"white"})))))),B.createElement("form",{className:"request-payment-input-form"},B.createElement("div",{className:"request-payment-list-div"},B.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"FULL NAME"),B.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Full Name","data-token":"name",onChange:r,value:N==null?void 0:N.name}),E.name&&B.createElement("small",{className:"request-payment-error-msg"},E.name)),B.createElement("div",{className:"request-payment-list-div"},B.createElement("label",{htmlFor:"requestPhoneNumber",className:"request-payment-input-label"},"Phone Number"),B.createElement(Ga,{className:"request-payment-input-box",placeholder:"Mobile number",format:"+1 (###) ###-####",value:Z,onValueChange:x=>{k(x)}}),E.phone&&B.createElement("small",{className:"request-payment-error-msg"},E.phone)),B.createElement("div",{className:"request-payment-list-div"},B.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"EMAIL"),B.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Email",onChange:r,"data-token":"email",value:N==null?void 0:N.email}),E.email&&B.createElement("small",{className:"request-payment-error-msg"},E.email)),B.createElement("div",{className:"partial-toggle-div"},B.createElement("input",{className:"partial-input",type:"checkbox",role:"switch",style:{cursor:"pointer"},checked:D,onChange:x=>H(x),id:"partialSwitch"}),B.createElement("label",{className:"partial-label",htmlFor:"partialSwitch",style:{cursor:"pointer"}},"Allow Partial Payments?")),B.createElement("button",{type:"button",className:"request-payment-submit-button",onClick:me,disabled:G},G?"Loading...":"Send Request"),B.createElement("div",{className:"request-payment-fractal-powerd-by"},B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},B.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 ",B.createElement("span",null,"Fractal"),B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"}),B.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"})))))),B.createElement(Sn,{open:Me,onClose:h,maxWidth:"500px"},B.createElement("div",{className:"fractal-popup-content",style:{padding:"0px",maxWidth:"500px"}},B.createElement("div",{className:"request-payment-success-container"},B.createElement("span",{className:"request-payment-close-popup",onClick:h},B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},B.createElement("g",{clipPath:"url(#clip0_12425_52336)"},B.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"})),B.createElement("defs",null,B.createElement("clipPath",{id:"clip0_12425_52336"},B.createElement("rect",{width:"16",height:"16",fill:"white"}))))),B.createElement("div",{className:"request-payment-success-tick-div"},B.createElement("div",{className:"request-payment-success-tick"},B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},B.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"})))),B.createElement("h6",{className:"request-payment-success-text"},"The request ",B.createElement("br",null),"was sent"),B.createElement("h6",{className:"request-payment-success-subtext"},"Please wait for the customer to pay"),B.createElement("div",{className:"request-payment-success-btn-div"},B.createElement("button",{onClick:h,className:"request-payment-success-btn2"},"Close")))))))}import"bootstrap/dist/js/bootstrap.bundle.min.js";import V,{useState as Rn,useEffect as Ja}from"react";import Qa from"axios";import{PatternFormat as Xa}from"react-number-format";function Da(e){let t=e.merchantPublicKey,$=e==null?void 0:e.discount,I=e==null?void 0:e.tax,z=e==null?void 0:e.surcharge,[q,W]=Rn(!1),[G,ye]=Rn(!1),[E,L]=Rn({}),[Z,ie]=Rn(null),[N,y]=Rn({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),[D,O]=Rn(""),[b,Fe]=Rn(!1),[_,tt]=Rn(null),Me=r=>/^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/.test(r),oe=/[+-]?([0-9]*[.])?[0-9]+/,Le=r=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r),bt=r=>/^[A-Za-z\s]*$/.test(r),ke=()=>{W(!1),L({})},Te=()=>W(!0),se=()=>{console.log(_,"apiresponse"),Ue(_),Fe(!1)};function Ee(){y({email:"",phone_number:"",order_id:"",name:"",fractalpayPublicKey:t}),O("")}function Ue(r){let a={type:"preview.compiledcheck",other:M(C({},r),{status:!0})};window.parent.postMessage(a,"*")}let hn=async()=>{if(!(Object.keys(E).length>0)){if(L({}),!(N!=null&&N.email)&&Z&&!Me(Z)){L(r=>M(C({},r),{phone:Ut.phonenumbervalid}));return}if(u())try{ye(!0);let r={fractalpayPublicKey:t,amount:D,phone_number:Z,order_id:N.order_id,action:"request",name:N.name,email:N.email,customer_id:e!=null&&e.customerId?e==null?void 0:e.customerId:"",discount:$,surcharge:z,tax:I,require_3ds:e==null?void 0:e.require_3ds},a=await Qa.post(`${et}send-request-pre-auth-payment`,r,{headers:C({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})});(a==null?void 0:a.status)===200&&(Fe(!0),W(!1),Ee(),tt(a==null?void 0:a.data)),ye(!1)}catch(r){console.log(r),ye(!1)}}},an=et+"images/logo-img.png",h=r=>{let{value:a}=r.target,w=r.target.dataset.token;if(y(M(C({},N),{[w]:a})),w==="name"&&!bt(a)){L(P=>M(C({},P),{[w]:Ut.onlylettersallowed}));return}let k=E;w==="email"&&!Z&&(delete k.phone,L(k)),a&&(delete k[w],L(k)),w==="email"&&!a&&(delete k[w],L(k))},S=r=>{let{value:a}=r;if(Number(a)>0){let w=E;delete w.amount,L(w)}O(a)},u=()=>{let r={};return D||(r.amount=Ut.amountrequired),N.email&&!Le(N==null?void 0:N.email)&&(r.email=Ut.invalidemail),!Z&&!(N!=null&&N.email)&&(r.phone=Ut.phoneoremailrequired),!Z&&!(N!=null&&N.email)&&(r.email=Ut.phoneoremailrequired),!Z&&N.email&&!Le(N==null?void 0:N.email)&&(r.email=Ut.invalidemail),e.from==="merchant"&&!N.order_id&&(r.order_id=Ut.orderidrequired),L(r),Object.keys(r).length===0};Ja(()=>{e&&(y(r=>M(C({},r),{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:""})),O(e.amount?e.amount:""),ie(e.phone?`${e.phone}`:null))},[e]);let me=r=>{let a=r==null?void 0:r.value;if(a&&(a==null?void 0:a.length)>0&&(a==null?void 0:a.length)!==10){L(k=>M(C({},k),{phone:Ut.phonenumberlength})),ie(a);return}else ie(a);let w=E;delete w.phone,a&&!(N!=null&&N.email)&&delete w.email,L(w)};function o(r){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(r))}return V.createElement(V.Fragment,null,V.createElement(Hi,null),V.createElement(mn,{loading:G}),V.createElement(V.Fragment,null,V.createElement("button",{className:"paymentBtn",onClick:Te},"Send Request"),V.createElement("div",{className:"frac-form"},V.createElement(Sn,{open:q,onClose:()=>W(!1),maxWidth:"500px"},V.createElement("div",{className:"request-payment-amount-detail"},V.createElement("p",{className:"request-payment-merchantname"},"Authorization Request"),V.createElement("p",{className:"request-payment-pre-auth-merchantname"},"Pay ",e==null?void 0:e.webname),V.createElement("p",{className:"request-payment-amount"},o(e==null?void 0:e.amount)),(e==null?void 0:e.from)==="merchant"&&V.createElement("p",{className:"request-payment-orderid"},N==null?void 0:N.order_id),V.createElement("span",{className:"request-payment-close-popup",onClick:ke},V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},V.createElement("g",{clipPath:"url(#clip0_12425_52336)"},V.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"})),V.createElement("defs",null,V.createElement("clipPath",{id:"clip0_12425_52336"},V.createElement("rect",{width:"16",height:"16",fill:"white"})))))),V.createElement("form",{className:"request-payment-input-form"},V.createElement("div",{className:"request-payment-list-div"},V.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"FULL NAME"),V.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Full Name","data-token":"name",onChange:h,value:N==null?void 0:N.name}),E.name&&V.createElement("small",{className:"request-payment-error-msg"},E.name)),V.createElement("div",{className:"request-payment-list-div"},V.createElement("label",{htmlFor:"requestPhoneNumber",className:"request-payment-input-label"},"Phone Number"),V.createElement(Xa,{className:"request-payment-input-box",placeholder:"Mobile number",format:"+1 (###) ###-####",value:Z,onValueChange:r=>{me(r)}}),E.phone&&V.createElement("small",{className:"request-payment-error-msg"},E.phone)),V.createElement("div",{className:"request-payment-list-div"},V.createElement("label",{htmlFor:"exampleFormControlInput2",className:"request-payment-input-label"},"EMAIL"),V.createElement("input",{className:"request-payment-input-box",type:"text",placeholder:"Email",onChange:h,"data-token":"email",value:N==null?void 0:N.email}),E.email&&V.createElement("small",{className:"request-payment-error-msg"},E.email)),V.createElement("button",{type:"button",className:"request-payment-submit-button",onClick:hn,disabled:G},G?"Loading...":"Send Request"),V.createElement("div",{className:"request-payment-fractal-powerd-by"},V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},V.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 ",V.createElement("span",null,"Fractal"),V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}),V.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"}))))),V.createElement(Sn,{open:b,onClose:se,maxWidth:"500px"},V.createElement("div",{className:"fractal-popup-content",style:{padding:"0px",maxWidth:"500px"}},V.createElement("div",{className:"request-payment-success-container"},V.createElement("span",{className:"request-payment-close-popup",onClick:se},V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},V.createElement("g",{clipPath:"url(#clip0_12425_52336)"},V.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"})),V.createElement("defs",null,V.createElement("clipPath",{id:"clip0_12425_52336"},V.createElement("rect",{width:"16",height:"16",fill:"white"}))))),V.createElement("div",{className:"request-payment-success-tick-div"},V.createElement("div",{className:"request-payment-success-tick"},V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},V.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"})))),V.createElement("h6",{className:"request-payment-success-text"},"The request ",V.createElement("br",null),"was sent"),V.createElement("h6",{className:"request-payment-success-subtext"},"Please wait for the customer to pay"),V.createElement("div",{className:"request-payment-success-btn-div"},V.createElement("button",{onClick:se,className:"request-payment-success-btn2"},"Close"))))))))}import i,{useEffect as ba,useState as qt}from"react";import Ra from"react";function oi(){let e="#000",t="#fff",$="#212529",I="#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: ${$};
|
|
880
|
-
-webkit-appearance: none;
|
|
881
|
-
-moz-appearance: none;
|
|
882
|
-
appearance: none;
|
|
883
|
-
background-color: ${t};
|
|
884
|
-
background-clip: padding-box;
|
|
885
|
-
border: 1px solid ${I};
|
|
886
|
-
border-radius: 0.375rem;
|
|
887
|
-
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
|
888
|
-
}
|
|
889
|
-
.form-control:focus{
|
|
890
|
-
border-color: #86b7fe;
|
|
891
|
-
outline: 0;
|
|
892
|
-
}
|
|
893
|
-
.toggle-num-wrapper {
|
|
894
|
-
position: relative;
|
|
895
|
-
}
|
|
896
|
-
.card-number-new{
|
|
897
|
-
border-bottom: none;
|
|
898
|
-
border-bottom-left-radius: 0px;
|
|
899
|
-
border-bottom-right-radius: 0px;
|
|
900
|
-
}
|
|
901
|
-
.card-crdi {
|
|
902
|
-
display: flex;
|
|
903
|
-
border: 1px solid ${I};
|
|
904
|
-
border-radius: 0.375rem;
|
|
905
|
-
}
|
|
906
|
-
.card-expiry-new{
|
|
907
|
-
border-top-left-radius: 0px;
|
|
908
|
-
border-top-right-radius: 0px;
|
|
909
|
-
}
|
|
910
|
-
.exp-date-year-container{
|
|
911
|
-
display: flex;
|
|
912
|
-
flex-wrap: wrap;
|
|
913
|
-
}
|
|
914
|
-
.exp-date-year-container .form-group{
|
|
915
|
-
flex:1;
|
|
916
|
-
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
.exp-date {
|
|
920
|
-
float: left;
|
|
921
|
-
// width: 30%
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
.exp-date input {
|
|
925
|
-
width: calc(100% + 1px);
|
|
926
|
-
border-top-right-radius: 0;
|
|
927
|
-
border-bottom-right-radius: 0;
|
|
928
|
-
border: 0;
|
|
929
|
-
border-right: 1px solid ${I};
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
.exp-year {
|
|
934
|
-
float: left;
|
|
935
|
-
// width: 30%
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
.exp-year input {
|
|
939
|
-
width: calc(100% + 1px);
|
|
940
|
-
border-radius: 0;
|
|
941
|
-
border-top: 0;
|
|
942
|
-
border-bottom: 0;
|
|
943
|
-
border-right: 1px solid ${I};
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
.exp-date input:focus {
|
|
947
|
-
position: relative;
|
|
948
|
-
z-index: 10;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
.security-digit {
|
|
952
|
-
float: right;
|
|
953
|
-
// width: 40%;
|
|
954
|
-
position: relative;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
.security-digit input {
|
|
958
|
-
border-top-left-radius: 0;
|
|
959
|
-
border-bottom-left-radius: 0;
|
|
960
|
-
border-top: 0;
|
|
961
|
-
border-bottom: 0;
|
|
962
|
-
border-right:0;
|
|
963
|
-
}
|
|
964
|
-
.card-expiry-new{
|
|
965
|
-
border-top-left-radius: 0px;
|
|
966
|
-
border-top-right-radius: 0px;
|
|
967
|
-
}
|
|
968
|
-
.form-control{box-sizing: border-box ;}
|
|
969
|
-
#PaymentForm .form-group{
|
|
970
|
-
padding:5px 0 ;
|
|
971
|
-
matgin: 0 !important
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
.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 gi from"axios";import wt from"react";import er from"react";function Ui(){return er.createElement("style",null,`
|
|
1360
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
|
1361
|
-
|
|
1362
|
-
body{
|
|
1363
|
-
display: flex;
|
|
1364
|
-
justify-content: center;
|
|
1365
|
-
align-items: center;
|
|
1366
|
-
padding-top: 30px;
|
|
1367
|
-
margin: 0;
|
|
1368
|
-
/* background-color: #f8f9fa; */
|
|
1369
|
-
flex-direction: column;
|
|
1370
|
-
}
|
|
1371
|
-
.payment-msg-container{
|
|
1372
|
-
min-height : 550px
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
.logo-container {
|
|
1376
|
-
display: flex;
|
|
1377
|
-
justify-content: center;
|
|
1378
|
-
align-items: center;
|
|
1379
|
-
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1380
|
-
z-index: 10;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
.client-logo {
|
|
1384
|
-
max-width: 100px;
|
|
1385
|
-
height: auto;
|
|
1386
|
-
object-fit: contain;
|
|
1387
|
-
display: block;
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
.payment-success-container {
|
|
1391
|
-
display: flex;
|
|
1392
|
-
flex-direction: column;
|
|
1393
|
-
align-items: center;
|
|
1394
|
-
padding: 18px 20px 24px;
|
|
1395
|
-
width: 335px;
|
|
1396
|
-
height: 400px; /* Fixed height */
|
|
1397
|
-
background: #ffffff;
|
|
1398
|
-
border-radius: 12px;
|
|
1399
|
-
position: relative;
|
|
1400
|
-
/* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1401
|
-
border: 1px solid #e3e3e3; */
|
|
1402
|
-
justify-content: center;
|
|
1403
|
-
text-align: center;
|
|
1404
|
-
margin-top: 50px; /* Adjust this to move the content down */
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
.success-icon {
|
|
1408
|
-
display: flex;
|
|
1409
|
-
flex-direction: column;
|
|
1410
|
-
align-items: center;
|
|
1411
|
-
gap: 12px;
|
|
1412
|
-
width: 227px;
|
|
1413
|
-
height: 116px;
|
|
1414
|
-
z-index: 2;
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
.circle {
|
|
1418
|
-
width: 40px;
|
|
1419
|
-
height: 40px;
|
|
1420
|
-
border: 1px solid #49b182;
|
|
1421
|
-
border-radius: 50%;
|
|
1422
|
-
display: flex;
|
|
1423
|
-
justify-content: center;
|
|
1424
|
-
align-items: center;
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
.circle .fa-check-circle {
|
|
1428
|
-
font-size: 20px;
|
|
1429
|
-
color: #49b182;
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
.success-text {
|
|
1433
|
-
display: flex;
|
|
1434
|
-
flex-direction: column;
|
|
1435
|
-
justify-content: center;
|
|
1436
|
-
align-items: center;
|
|
1437
|
-
gap: 4px;
|
|
1438
|
-
width: 227px;
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
.payment-success-text {
|
|
1442
|
-
font-family: "Inter", sans-serif;
|
|
1443
|
-
font-weight: 500;
|
|
1444
|
-
font-size: 18px;
|
|
1445
|
-
line-height: 21px;
|
|
1446
|
-
text-align: center;
|
|
1447
|
-
letter-spacing: -0.02em;
|
|
1448
|
-
color: #161616;
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
.thank-you-text {
|
|
1452
|
-
font-family: "Inter", sans-serif;
|
|
1453
|
-
font-weight: 500;
|
|
1454
|
-
font-size: 14px;
|
|
1455
|
-
line-height: 18px;
|
|
1456
|
-
text-align: center;
|
|
1457
|
-
letter-spacing: -0.02em;
|
|
1458
|
-
color: #161616;
|
|
1459
|
-
opacity: 0.5;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
.charge-payment-success-tick-div {
|
|
1463
|
-
display: flex;
|
|
1464
|
-
justify-content: center;
|
|
1465
|
-
align-items: center;
|
|
1466
|
-
margin-top: 32px;
|
|
1467
|
-
}
|
|
1468
|
-
.charge-payment-success-tick {
|
|
1469
|
-
border-radius: 1000px;
|
|
1470
|
-
background: rgba(97, 198, 153, 0.14);
|
|
1471
|
-
display: flex;
|
|
1472
|
-
width: 60px;
|
|
1473
|
-
height: 60px;
|
|
1474
|
-
justify-content: center;
|
|
1475
|
-
align-items: center;
|
|
1476
|
-
}
|
|
1477
|
-
.charge-payment-success-text {
|
|
1478
|
-
color: #161616;
|
|
1479
|
-
text-align: center;
|
|
1480
|
-
font-family: Inter;
|
|
1481
|
-
font-size: 32px;
|
|
1482
|
-
font-style: normal;
|
|
1483
|
-
font-weight: 500;
|
|
1484
|
-
line-height: 36px;
|
|
1485
|
-
letter-spacing: -0.64px;
|
|
1486
|
-
margin-top: 20px;
|
|
1487
|
-
margin-bottom: 5px !important;
|
|
1488
|
-
}
|
|
1489
|
-
.charge-payment-success-container {
|
|
1490
|
-
display: flex;
|
|
1491
|
-
padding: 120px 48px 32px 48px;
|
|
1492
|
-
flex-direction: column;
|
|
1493
|
-
justify-content: center;
|
|
1494
|
-
align-items: center;
|
|
1495
|
-
}
|
|
1496
|
-
.charge-payment-success-subtext {
|
|
1497
|
-
color: #727272;
|
|
1498
|
-
text-align: center;
|
|
1499
|
-
font-family: Inter;
|
|
1500
|
-
font-size: 14px;
|
|
1501
|
-
font-style: normal;
|
|
1502
|
-
font-weight: 500;
|
|
1503
|
-
line-height: 18px; /* 128.571% */
|
|
1504
|
-
letter-spacing: -0.28px;
|
|
1505
|
-
margin:14px 0 !important
|
|
1506
|
-
|
|
1507
|
-
}
|
|
1508
|
-
.charge-success-payment-button-div {
|
|
1509
|
-
display: flex;
|
|
1510
|
-
gap: 10px;
|
|
1511
|
-
align-items: baseline;
|
|
1512
|
-
}
|
|
1513
|
-
.charge-success-btn1 {
|
|
1514
|
-
display: flex;
|
|
1515
|
-
padding: 9px 16px;
|
|
1516
|
-
align-items: center;
|
|
1517
|
-
gap: 6px;
|
|
1518
|
-
border-radius: 1000px;
|
|
1519
|
-
border: 1px solid #e0dfe2;
|
|
1520
|
-
background: #fff;
|
|
1521
|
-
color: #161616;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
.charge-payment-success-btn-div {
|
|
1525
|
-
display: flex;
|
|
1526
|
-
align-items: flex-start;
|
|
1527
|
-
justify-content: center;
|
|
1528
|
-
gap: 8px;
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
.charge-payment-success-btn1 {
|
|
1532
|
-
cursor: pointer;
|
|
1533
|
-
border-radius: 80px;
|
|
1534
|
-
border: 1px solid #e0dfe2;
|
|
1535
|
-
display: flex;
|
|
1536
|
-
padding: 12px 32px;
|
|
1537
|
-
justify-content: center;
|
|
1538
|
-
align-items: center;
|
|
1539
|
-
gap: 6px;
|
|
1540
|
-
background-color: #fff;
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
.charge-payment-success-btn2 {
|
|
1544
|
-
border-radius: 80px;
|
|
1545
|
-
cursor: pointer;
|
|
1546
|
-
border: 1px solid #e0dfe2;
|
|
1547
|
-
display: flex;
|
|
1548
|
-
padding: 12px 32px;
|
|
1549
|
-
justify-content: center;
|
|
1550
|
-
align-items: center;
|
|
1551
|
-
gap: 6px;
|
|
1552
|
-
background-color: #161616;
|
|
1553
|
-
color: #fff;
|
|
1554
|
-
}`)}function ei(e,t,$){e.preventDefault();let z={type:"preview.compiledcheck",other:{msg:"Payment success!",status:t==="close",data:{tran_id:$,key:t}}};console.log("message:",z),window.parent.postMessage(z,"*")}function si({onClose:e,tranId:t}){return wt.createElement(wt.Fragment,null,wt.createElement(Ui,null),wt.createElement("div",{className:"payment-msg-container"},wt.createElement("div",{className:"charge-payment-success-container"},wt.createElement("div",{className:"charge-payment-success-tick-div"},wt.createElement("div",{className:"charge-payment-success-tick"},wt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},wt.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"})))),wt.createElement("h6",{className:"charge-payment-success-text"},"Your charge",wt.createElement("br",null),"was successful"),wt.createElement("h6",{className:"charge-payment-success-subtext"},"We\u2019ve processed your charge"),wt.createElement("div",{className:"charge-success-payment-button-div"},wt.createElement("button",{className:"charge-success-btn1",onClick:$=>ei($,"print",t)},wt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},wt.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"}),wt.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"),wt.createElement("button",{className:"charge-success-btn1",onClick:$=>ei($,"share",t)},wt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},wt.createElement("g",{clipPath:"url(#clip0_12420_50683)"},wt.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"})),wt.createElement("defs",null,wt.createElement("clipPath",{id:"clip0_12420_50683"},wt.createElement("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.5)"})))),"Send receipt"))),wt.createElement("div",{className:"charge-payment-success-btn-div"},wt.createElement("button",{className:"charge-payment-success-btn1",onClick:$=>ei($,"tran",t)},"Go to Transactions"),wt.createElement("button",{className:"charge-payment-success-btn2",onClick:$=>{e(),ei($,"close",t)}},"Close"))))}import _i from"sweetalert2";import{IoArrowBack as Oi}from"react-icons/io5";import{useEffect as ya}from"react";function Fn(){return ya(()=>{let e=ai;if(typeof window!="undefined"&&!window.DatacapWebToken&&!document.querySelector(`script[src="${e}"]`)){let t=document.createElement("script");t.src=e,t.async=!0,t.onload=()=>{window.DatacapWebToken||console.warn("\u26A0\uFE0F Script loaded, but DatacapWebToken not found")},t.onerror=$=>{console.error("\u274C Failed to load Datacap script",$)},document.head.appendChild(t)}},[]),ya(()=>{let e="forge-cdn-script";if(!document.getElementById(e)){let t=document.createElement("script");t.src="https://cdn.jsdelivr.net/npm/node-forge@1.0.0/dist/forge.min.js",t.id=e,t.async=!0,document.head.appendChild(t)}return()=>{let t=document.getElementById(e);t&&document.head.removeChild(t)}},[]),null}import Mn from"react";import tr from"react";function Ji(){return tr.createElement("style",null,`
|
|
1555
|
-
.card-error .logo-container {
|
|
1556
|
-
display: flex;
|
|
1557
|
-
justify-content: center;
|
|
1558
|
-
align-items: center;
|
|
1559
|
-
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1560
|
-
z-index: 10;
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
.card-error .client-logo {
|
|
1564
|
-
max-width: 100px;
|
|
1565
|
-
height: auto;
|
|
1566
|
-
object-fit: contain;
|
|
1567
|
-
display: block;
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
|
-
.card-error .payment-error-container {
|
|
1571
|
-
display: flex;
|
|
1572
|
-
flex-direction: column;
|
|
1573
|
-
align-items: center;
|
|
1574
|
-
padding: 18px 20px 24px;
|
|
1575
|
-
// width: 335px;
|
|
1576
|
-
min-height: 250px; /* Fixed height */
|
|
1577
|
-
background: #FFFFFF;
|
|
1578
|
-
border-radius: 12px;
|
|
1579
|
-
position: relative;
|
|
1580
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1581
|
-
border: 1px solid #e3e3e3;
|
|
1582
|
-
justify-content: center;
|
|
1583
|
-
text-align: center;
|
|
1584
|
-
// margin-top: 50px; /* Adjust this to move the content down */
|
|
1585
|
-
margin: 50px auto 0 auto !important;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
.card-error .error-icon {
|
|
1589
|
-
display: flex;
|
|
1590
|
-
flex-direction: column;
|
|
1591
|
-
align-items: center;
|
|
1592
|
-
gap: 12px;
|
|
1593
|
-
min-height: 116px;
|
|
1594
|
-
z-index: 2;
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
.card-error .circle {
|
|
1598
|
-
width: 50px;
|
|
1599
|
-
height: 50px;
|
|
1600
|
-
border: 1px solid red;
|
|
1601
|
-
border-radius: 50%;
|
|
1602
|
-
display: flex;
|
|
1603
|
-
justify-content: center;
|
|
1604
|
-
align-items: center;
|
|
1605
|
-
margin-bottom:20px
|
|
1606
|
-
}
|
|
1607
|
-
|
|
1608
|
-
.card-error .circle .fa-times {
|
|
1609
|
-
font-size: 30px;
|
|
1610
|
-
color: red;
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
.card-error .error-text {
|
|
1614
|
-
display: flex;
|
|
1615
|
-
flex-direction: column;
|
|
1616
|
-
justify-content: center;
|
|
1617
|
-
align-items: center;
|
|
1618
|
-
gap: 4px;
|
|
1619
|
-
// width: 227px;
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
.card-error .payment-error-text {
|
|
1623
|
-
font-family: 'Inter', sans-serif;
|
|
1624
|
-
font-weight: 500;
|
|
1625
|
-
font-size: 18px;
|
|
1626
|
-
line-height: 21px;
|
|
1627
|
-
text-align: center;
|
|
1628
|
-
letter-spacing: -0.02em;
|
|
1629
|
-
color: #161616;
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
.card-error .thank-you-text {
|
|
1633
|
-
font-family: 'Inter', sans-serif;
|
|
1634
|
-
font-weight: 500;
|
|
1635
|
-
font-size: 16px;
|
|
1636
|
-
line-height: 18px;
|
|
1637
|
-
text-align: center;
|
|
1638
|
-
letter-spacing: -0.02em;
|
|
1639
|
-
color: #161616 !important;
|
|
1640
|
-
opacity: 0.5;
|
|
1641
|
-
padding-top:10px
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
.card-error .error-btn-div{
|
|
1645
|
-
padding-top:30px;
|
|
1646
|
-
|
|
1647
|
-
}
|
|
1648
|
-
.card-error .error-btn-div button{
|
|
1649
|
-
border-radius: 0.25em;
|
|
1650
|
-
border:none;
|
|
1651
|
-
background: initial;
|
|
1652
|
-
background-color: #7066e0;
|
|
1653
|
-
box-shadow: var(--swal2-confirm-button-box-shadow);
|
|
1654
|
-
color: white;
|
|
1655
|
-
font-size: 1em;
|
|
1656
|
-
padding:10px 17px;
|
|
1657
|
-
cursor:pointer;
|
|
1658
|
-
}
|
|
1659
|
-
`)}var nr=({onClose:e,error:t})=>Mn.createElement(Mn.Fragment,null,Mn.createElement(Ji,null),Mn.createElement("div",{className:"card-error"},Mn.createElement("div",{className:"payment-error-container"},Mn.createElement("div",{className:"error-icon"},Mn.createElement("div",{className:"circle"},Mn.createElement("i",{className:"fa fa-times","aria-hidden":"true"})),Mn.createElement("div",{className:"error-text"},Mn.createElement("div",{className:"payment-error-text"},t),Mn.createElement("div",{className:"thank-you-text"},"Try again later ")),Mn.createElement("div",{className:"error-btn-div"},Mn.createElement("button",{onClick:e},"OK")))))),Tn=nr;import{io as ir}from"socket.io-client";var ar=ir(et,{transports:["websocket"],withCredentials:!1}),Bt=ar;import Jn from"react";var Ln=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"?Si:e.label.toLowerCase()==="reader"?ji:pa,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"},fe(e.amount)))),Jn.createElement("div",null,Jn.createElement("input",{name:"paymenttype",checked:e.activetab===e.value,type:"radio",value:e.value,onChange:t=>{e.onChange(t.target.value)}}))));import rr from"react";function Dn({}){return rr.createElement("style",null,`
|
|
1660
|
-
.frac-card-bank-radio-main{
|
|
1661
|
-
display: flex;
|
|
1662
|
-
flex-direction: column;
|
|
1663
|
-
align-items: flex-start;
|
|
1664
|
-
align-self: stretch;
|
|
1665
|
-
border-radius: 14px;
|
|
1666
|
-
border: 1px solid #E0DFE2;
|
|
1667
|
-
overflow: hidden;
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
.frac-card-bank-radio{
|
|
1671
|
-
display: flex;
|
|
1672
|
-
padding: 12px 16px;
|
|
1673
|
-
justify-content: space-between;
|
|
1674
|
-
align-items: center;
|
|
1675
|
-
align-self: stretch;
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
input[type="radio"] {
|
|
1679
|
-
accent-color: #000;
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
.frac-card-title-main{
|
|
1683
|
-
display: flex;
|
|
1684
|
-
align-items: center;
|
|
1685
|
-
gap: 12px;
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
.frac-card-label{
|
|
1689
|
-
display: flex;
|
|
1690
|
-
flex-direction: column;
|
|
1691
|
-
align-items: flex-start;
|
|
1692
|
-
gap: 2px;
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
.frac-card-label-text{
|
|
1696
|
-
color: #727272;
|
|
1697
|
-
font-family: Inter;
|
|
1698
|
-
font-size: 12px;
|
|
1699
|
-
font-style: normal;
|
|
1700
|
-
font-weight: 500;
|
|
1701
|
-
line-height: 18px;
|
|
1702
|
-
letter-spacing: -0.24px;
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
.frac-card-label-amount{
|
|
1706
|
-
color: #161616;
|
|
1707
|
-
text-align: center;
|
|
1708
|
-
font-family: Inter;
|
|
1709
|
-
font-size: 16px;
|
|
1710
|
-
font-style: normal;
|
|
1711
|
-
font-weight: 500;
|
|
1712
|
-
line-height: 140%;
|
|
1713
|
-
letter-spacing: -0.32px;
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
.frac-payment-type-logo{
|
|
1717
|
-
width: 24px;
|
|
1718
|
-
height: 24px;
|
|
1719
|
-
aspect-ratio: 1/1;
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
.frac-card-bank-radio-main .frac-card-bank-radio:nth-child(2) {
|
|
1723
|
-
border-top: 1px solid #E0DFE2;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
.frac-card-bank-radio-main .frac-card-bank-radio:nth-child(3) {
|
|
1727
|
-
border-top: 1px solid #E0DFE2;
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
.frac-card-bank-radio.frac-active {
|
|
1731
|
-
background: #F6F6F7;
|
|
1732
|
-
}
|
|
1733
|
-
`)}import un from"react";var Kn=({listHeading:e="Card",ListItems:t,selectedCard:$,setSelectedCard:I,paymentGateway:z,handleDeleteCard:q,otherButtonAction:W,otherButtonLabel:G,headingClass:ye})=>{let E=R+"widget/Trash.svg";return un.createElement(un.Fragment,null,un.createElement("h6",{className:ye||"card-ach-heading",style:{marginBottom:"10px !important"}},e),un.createElement("div",{className:"card-lint-div-in"},un.createElement("div",{className:"card-list-div"},t&&(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((L,Z)=>{let ie=!1;return z&&(ie=z!=(L==null?void 0:L.payment_method_type)&&(L==null?void 0:L.card_type)!="Bank"),un.createElement("div",{key:L==null?void 0:L.id,className:"card-list-single-div"},un.createElement("div",{className:"card-number-radio"},un.createElement("input",{disabled:ie,type:"radio",className:"cardRadio",name:"selected_card",id:"",checked:($==null?void 0:$.id)===(L==null?void 0:L.id),onChange:N=>I(L)}),un.createElement("label",{htmlFor:"",className:"card-number-last-four"},"**** ",L==null?void 0:L.cardlastfourdigit),(L==null?void 0:L.card_type)!="Bank"&&un.createElement("h6",{className:"card-expiry-date"},L==null?void 0:L.expmonth,"/",L==null?void 0:L.expyear)),un.createElement("div",{className:"card-number-radio"},un.createElement("span",{className:"visa-card"},un.createElement("img",{src:fa(L==null?void 0:L.card_type),alt:""})),un.createElement("span",{className:"visa-card",style:{cursor:"pointer"},onClick:()=>q(L==null?void 0:L.id)},un.createElement("img",{src:E,alt:""}))))}))),un.createElement("div",{className:"pay-with-other-card",onClick:W},G,un.createElement("img",{src:Si,alt:""}))))};import Bn from"react";var Vi=({listHeading:e="Readers",ListItems:t,selectedPax:$,setSlectedPax:I,headingClass:z})=>Bn.createElement(Bn.Fragment,null,Bn.createElement("h6",{className:z||"card-ach-heading",style:{marginBottom:"10px !important"}},e),Bn.createElement("div",{className:"card-lint-div-in"},Bn.createElement("div",{className:"card-list-div"},t&&(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((q,W)=>Bn.createElement("div",{key:q==null?void 0:q.id,className:"card-list-single-div"},Bn.createElement("div",{className:"card-number-radio"},Bn.createElement("input",{type:"radio",className:"cardRadio",name:"selected_reader",id:"",checked:($==null?void 0:$.id)===(q==null?void 0:q.id),onChange:G=>I(q)}),Bn.createElement("label",{htmlFor:"",className:"card-number-last-four"},q==null?void 0:q.device_name)),Bn.createElement("div",{className:"card-number-radio"},Bn.createElement("span",{className:"visa-card"},Bn.createElement("img",{src:ji,alt:""})))))))));function or(e){var Je,gt,vt,$t,At,Ht,Jt,be,Ot,Et,jt,on,sn,ln,dn,yn,Cn,Zt,Ze,Wt;let[t,$]=qt(!1),[I,z]=qt(!1),[q,W]=qt(""),[G,ye]=qt(!1),[E,L]=qt(!1),[Z,ie]=qt("card"),[N,y]=qt("card"),[D,O]=qt("form"),[b,Fe]=qt("form"),[_,tt]=qt(!0),[Me,oe]=qt(!1),[Le,bt]=qt(!1),ke=e.merchantPublicKey,Te=R+"widget/mc-img.svg",se=R+"widget/visa-img.svg",Ee=R+"widget/ae-img.svg",Ue=R+"widget/discover-img.svg",hn=R+"widget/card.svg",an=R+"widget/Trash.svg",h=R+"widget/bank.svg",S=R+"widget/secure-img.png",u=R+"widget/pov-by.png",me=R+"widget/pax.svg",[o,r]=qt(),[a,w]=qt({}),[k,P]=qt(),[H,x]=qt({}),[p,F]=qt([]),[Ke,Se]=qt([]),[Nt,zt]=qt(),[St,mt]=qt(void 0),[Be,re]=qt(Number(e==null?void 0:e.amount));console.log(Nt,"selectedCard");let[T,_e]=qt(),[qe,ae]=qt(""),ft=()=>$(!0),ut=()=>$(!1),_t=(v,f)=>{let Q=(parseFloat(f)||0)/100,he=v/(1+Q);return Math.round(he*100)/100};ba(()=>{if(E){let v=_t(e==null?void 0:e.amount,(e==null?void 0:e.surcharge)||0);re(v)}},[E,e==null?void 0:e.pass_fee,e==null?void 0:e.amount,e==null?void 0:e.surcharge]);let A=()=>{L(!1),ie("card"),W(""),ye(!1),ae(""),P({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),x({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),r({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),w({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),bt(!1),oe(!1),zt({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""}),mt(null),re(0),y("card"),tt(!0),Fe("form"),O("form"),z(!1),$(!1),Se([]),F([])},It=()=>L(!0),xt=v=>{ie(v)},je=(v,f)=>{let Q=v;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(Q)){(f===""||/^[0-9]+$/.test(f))&&(w(ce=>M(C({},ce),{[Q]:""})),r(ce=>M(C({},ce),{[Q]:f})));return}w(ce=>M(C({},ce),{[Q]:""})),r(ce=>M(C({},ce),{[Q]:f}))},Lt=v=>{var ce;let f=v.target,{formatted:Q,cursor:he}=In(f.value,(ce=f.selectionStart)!=null?ce:0);w(Ye=>M(C({},Ye),{cardNumber:""})),r(Ye=>M(C({},Ye),{cardNumber:Q})),requestAnimationFrame(()=>{f.setSelectionRange(he,he)})},rn=v=>{let{name:f,value:Q}=v.target,he=["routingNumber","accountNumber","confirmAccountNumber"];if(f=="name"){/^[a-zA-Z\s]*$/.test(Q)&&(x(ce=>M(C({},ce),{[f]:""})),P(ce=>M(C({},ce),{[f]:Q})));return}if(he.includes(f)){(Q===""||/^[0-9]+$/.test(Q))&&(x(ce=>M(C({},ce),{[f]:""})),P(ce=>M(C({},ce),{[f]:Q})));return}x(ce=>M(C({},ce),{[f]:""})),P(ce=>M(C({},ce),{[f]:Q}))},Gn=()=>{var ce,Ye,ge,nt,ht,Pt;let v={},f=o,Q=parseInt((f==null?void 0:f.expiryMonth)||"",10),he=(f==null?void 0:f.expiryYear)||"";if((ce=f==null?void 0:f.cardName)!=null&&ce.trim()||(v.cardName="Card name is required"),(Ye=f==null?void 0:f.cardNumber)!=null&&Ye.trim()||(v.cardNumber="Card number is required"),(!((ge=f==null?void 0:f.expiryMonth)!=null&&ge.trim())||!((nt=f==null?void 0:f.expiryYear)!=null&&nt.trim())||isNaN(Q)||Q<1||Q>12||he.length!==4)&&(v.expiryMonth="Invalid Expiration Date."),(ht=f==null?void 0:f.cvv)!=null&&ht.trim()||(v.cvv="CVV is required"),(Pt=f==null?void 0:f.zipCode)!=null&&Pt.trim()||(v.zipCode="ZIP code is required"),f!=null&&f.expiryMonth&&(f!=null&&f.expiryYear)&&f.expiryMonth.length<=2&&f.expiryYear.length===4){let Qt=parseInt(f.expiryMonth,10),g=parseInt(f.expiryYear,10),d=new Date,ee=d.getMonth()+1,Ae=d.getFullYear();(g<Ae||g===Ae&&Qt<ee)&&(v.expiryMonth="Card is expired")}return w(v),Object.keys(v).length>0},Vt=()=>{var Q,he,ce,Ye,ge,nt,ht,Pt;let v={},f=k;return(Q=f==null?void 0:f.name)!=null&&Q.trim()||(v.name="Name is required"),(he=f==null?void 0:f.accountNumber)!=null&&he.trim()||(v.accountNumber="Account number is required"),(ce=f==null?void 0:f.accountNumber)!=null&&ce.trim()&&((Ye=f==null?void 0:f.accountNumber)==null?void 0:Ye.trim())!==((ge=f==null?void 0:f.confirmAccountNumber)==null?void 0:ge.trim())&&(v.confirmAccountNumber="Account numbers must match"),(nt=f==null?void 0:f.bankName)!=null&&nt.trim()||(v.bankName="Bank name is required"),(ht=f==null?void 0:f.routingNumber)!=null&&ht.trim()||(v.routingNumber="Routing Number is required"),f!=null&&f.routingNumber&&((Pt=f==null?void 0:f.routingNumber)==null?void 0:Pt.length)!==9&&(v.routingNumber="Routing number must be 9 digits"),((f==null?void 0:f.accountType)==="business saving"||(f==null?void 0:f.accountType)==="business checking")&&(!(f!=null&&f.companyName)||(f==null?void 0:f.companyName)==="")&&(v.companyName="Company Name is required for business accounts"),x(v),Object.keys(v).length>0},vn=async v=>{var f,Q,he,ce,Ye,ge,nt,ht,Pt,Qt,g,d,ee,Ae,te,Pe;if(v.preventDefault(),Z!=="ach"){if(Gn())return;{let xe=DatacapWebToken.validateCardNumber(o==null?void 0:o.cardNumber.replaceAll(" ","")),pe=DatacapWebToken.validateExpirationDate(o==null?void 0:o.expiryMonth,o==null?void 0:o.expiryYear),De=DatacapWebToken.validateCVV(o==null?void 0:o.cvv),it={};if(xe||(it.cardNumber="Invalid card Number"),pe||(it.expiryMonth="Invalid Expiration Date."),De||(it.cvv="Invalid CVV"),w(it),xe&&De&&pe){z(!0);try{let Ce={amount:`${e.amount||0}`,fractalpayPublicKey:ke,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},at=await gi.post(`${et}create-widget-order`,Ce,{headers:C({},(e==null?void 0:e.sessionToken)&&{"X-Session-Token":e.sessionToken})}),ve=async function(yt){if(yt.Error)W(yt.Error),z(!1);else{let ot=o==null?void 0:o.cardName,Xt=o==null?void 0:o.zipCode;yt.name=ot,yt.postal_code=Xt,yt.isCardSave=`${Me}`,yt.isCharge=!0,yt.posSalesIdEncode=at==null?void 0:at.data.data.posSalesIdEncode,Bt.emit("sendMessage",yt),Bt.on(at==null?void 0:at.data.data.posSalesIdEncode,pt=>{if(ci(pt==null?void 0:pt.data)){let Ve=JSON.parse(pt.data);Ve!=null&&Ve.result?(r({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),oe(!1),ae(Ve==null?void 0:Ve.transactionId),ye(!0),z(!1)):(z(!1),W((Ve==null?void 0:Ve.message)||"Something went wrong."))}else W("Something went wrong.")})}};if((T==null?void 0:T.paymentGateway)===32){let yt={method:"POST",redirect:"follow"};try{let ot=await gi.post(`${Ie}api/v1/widget/generate-session`,yt),Xt=Number(o==null?void 0:o.expiryYear)%100,pt=o==null?void 0:o.cardNumber;pt=pt==null?void 0:pt.replace(/\s+/g,"");let Ve=`${pt}=${Xt}${o==null?void 0:o.expiryMonth} ${o==null?void 0:o.cvv}`,_n=forge.pki.publicKeyFromPem((Q=(f=ot==null?void 0:ot.data)==null?void 0:f.data)==null?void 0:Q.publicKeyPem).encrypt(Ve,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),bn=forge.util.encode64(_n),Rt={"Content-Type":"application/json","x-app-session-key":(ce=(he=ot.data)==null?void 0:he.data)==null?void 0:ce.session_key},st=JSON.stringify({enc_track2_data:`${bn}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(ge=(Ye=ot==null?void 0:ot.data)==null?void 0:Ye.data)==null?void 0:ge.session_key}`});try{let le=await gi.post(`${cn}tokenizer/tokenize`,st,{headers:Rt}),en=JSON.stringify(M(C({},(nt=le==null?void 0:le.data)==null?void 0:nt.data),{isSaveCardChecked:Me,name:o==null?void 0:o.cardName,postal_code:o==null?void 0:o.zipCode,customer_id:e==null?void 0:e.customerId})),wn=JSON.stringify({pre_sales_id:`${(Pt=(ht=at==null?void 0:at.data)==null?void 0:ht.data)==null?void 0:Pt.posSalesIdEncode}`,token:`${(Qt=le==null?void 0:le.data)==null?void 0:Qt.data.token}`,json_response:`${en}`}),$n={method:"POST",headers:JSON.stringify({"Content-Type":"application/json"}),body:wn,redirect:"follow",isChargeviafractal:!0};Bt.emit("sendMessage",$n),Bt.on("chargeviafractalgateway",Kt=>{var ti;if(ci(Kt==null?void 0:Kt.data)){let kn=JSON.parse(Kt==null?void 0:Kt.data);kn!=null&&kn.result?(ae((ti=kn==null?void 0:kn.data)==null?void 0:ti.transactionId),ye(!0),z(!1)):(z(!1),W((kn==null?void 0:kn.message)||"Something went wrong."))}else W("Something went wrong.")})}catch(le){z(!1),W(((d=(g=le==null?void 0:le.response)==null?void 0:g.data)==null?void 0:d.message)||(le==null?void 0:le.message)||"Something went wrong.")}}catch(ot){z(!1),W(((Ae=(ee=ot==null?void 0:ot.response)==null?void 0:ee.data)==null?void 0:Ae.message)||(ot==null?void 0:ot.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(at==null?void 0:at.data.data.dctoken,"PaymentForm",ve)}catch(Ce){z(!1),W(((Pe=(te=Ce==null?void 0:Ce.response)==null?void 0:te.data)==null?void 0:Pe.message)||(Ce==null?void 0:Ce.message)||"Something went wrong.")}}}}else{if(Vt())return;{z(!0);let xe=C({fractalpayPublicKey:ke,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(Be||0),isSaveAch:Le,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});Bt.emit("sendMessage",xe),Bt.on("ach-incoming",pe=>{var De;(pe==null?void 0:pe.status)=="Failed"?typeof(pe==null?void 0:pe.message)=="object"?Object.values(pe==null?void 0:pe.message).forEach(it=>{W(it||"Something went wrong")}):W((pe==null?void 0:pe.message)||"Something went wrong"):(ae((De=pe==null?void 0:pe.data)==null?void 0:De.transaction_id),ye(!0),z(!1))})}}},qn=async()=>{var v,f,Q,he,ce,Ye,ge,nt,ht,Pt,Qt,g,d,ee,Ae,te,Pe,rt,xe,pe,De,it,Ce;ft();try{let at={fractalpayPublicKey:ke,customer_id:e==null?void 0:e.customerId,pass_fee:e==null?void 0:e.pass_fee,isReader:e==null?void 0:e.isReader},ve=await gi.post(`${et}get-payment-details`,at);if(_e((v=ve==null?void 0:ve.data)==null?void 0:v.data),(Q=(f=ve==null?void 0:ve.data)==null?void 0:f.data)!=null&&Q.paymentGateway||(A(),W("Something went wrong.")),(ce=(he=ve==null?void 0:ve.data)==null?void 0:he.data)!=null&&ce.card_list&&((nt=(ge=(Ye=ve==null?void 0:ve.data)==null?void 0:Ye.data)==null?void 0:ge.card_list)==null?void 0:nt.length)>0){let yt=(Qt=(Pt=(ht=ve==null?void 0:ve.data)==null?void 0:ht.data)==null?void 0:Pt.card_list)==null?void 0:Qt.filter(Xt=>(Xt==null?void 0:Xt.card_type)=="Bank"),ot=(ee=(d=(g=ve==null?void 0:ve.data)==null?void 0:g.data)==null?void 0:d.card_list)==null?void 0:ee.filter(Xt=>(Xt==null?void 0:Xt.card_type)!=="Bank");console.log(yt,"hohgohoo",ot),(ot==null?void 0:ot.length)>0&&O("list"),(yt==null?void 0:yt.length)>0&&Fe("list"),F(ot),Se(yt)}else ie("card");(te=(Ae=ve==null?void 0:ve.data)==null?void 0:Ae.data)!=null&&te.paymentDeviceList&&((xe=(rt=(Pe=ve==null?void 0:ve.data)==null?void 0:Pe.data)==null?void 0:rt.paymentDeviceList)==null?void 0:xe.length)>0&&mt((De=(pe=ve==null?void 0:ve.data)==null?void 0:pe.data)==null?void 0:De.paymentDeviceList[0]),ut()}catch(at){console.log(at),ut(),W(((Ce=(it=at==null?void 0:at.response)==null?void 0:it.data)==null?void 0:Ce.message)||(at==null?void 0:at.message)||"Something went wrong")}},An=async()=>{let v=e==null?void 0:e.customerId,f=String(e==null?void 0:e.discount),Q=String(e==null?void 0:e.surcharge),he=String(e==null?void 0:e.tax),ce=e==null?void 0:e.merchantPublicKey,Ye=e==null?void 0:e.orderID,ge=String(e==null?void 0:e.amount),nt=Nt==null?void 0:Nt.id,ht=Nt==null?void 0:Nt.card_type;if(ce&&Ye&&ge&&Be)if(v)if(nt){let Qt=C({amount:ht==="Bank"?`${Be}`:ge,order_id:Ye,customer_id:v,card_id:nt,fractalpayPublicKey:ce,isCardSave:Me,discount:f,surcharge:Q,tax:he,pass_fee:e==null?void 0:e.pass_fee,require3ds:!1},(e==null?void 0:e.sessionToken)&&{sessionToken:e.sessionToken}),Pt=Qt,{isCardSave:g,pass_fee:d,require3ds:ee}=Pt,Ae=ii(Pt,["isCardSave","pass_fee","require3ds"]),Pe=et+(ht==="Bank"?"charge-ach":"charge-by-card"),rt={"Content-Type":"application/json"};z(!0),Bt.emit("sendMessage",{url:Pe,body:ht=="Bank"?Ae:Qt,isChargebycard:!0}),Bt.on("charge-by-card",xe=>{var pe;(xe==null?void 0:xe.result)==!0||(xe==null?void 0:xe.status)==!0?(ae((pe=xe.data)==null?void 0:pe.transaction_id),ye(!0),z(!1)):W((xe==null?void 0:xe.message)||"Something went wrong.")})}else W("Please Select A Card/ACH");else W("Please Select Customer");else W("Something went wrong.")},zn=async()=>{var ce,Ye,ge,nt,ht,Pt;let v=e==null?void 0:e.merchantPublicKey,f=e==null?void 0:e.orderID,Q=String(e==null?void 0:e.amount),he=e==null?void 0:e.customerId;if(!(St!=null&&St.device_id)){W("Please Select A Payment Device");return}if(v&&f&&Q){z(!0);let Qt={amount:Q,fractalpayPublicKey:v,customer_order_id:f,device_id:St==null?void 0:St.device_id,customer_id:he||""};try{let g=await gi.post(`${et}charge-with-reader`,Qt);((ce=g==null?void 0:g.data)==null?void 0:ce.result)==!0?(ae((ge=(Ye=g==null?void 0:g.data)==null?void 0:Ye.data)==null?void 0:ge.transaction_id),ye(!0),z(!1)):(W(((nt=g==null?void 0:g.data)==null?void 0:nt.message)||"Something went wrong."),z(!1))}catch(g){W(((Pt=(ht=g==null?void 0:g.response)==null?void 0:ht.data)==null?void 0:Pt.message)||"Something went wrong."),z(!1)}}else W("Something went wrong.")},J=()=>{N==="card"?An():N==="reader"&&zn()};ba(()=>{E&&ke&&qn()},[ke,E]);let j=async v=>{_i.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 f=>{if(f.isConfirmed){z(!0);try{let Q={card_id:v,customer_id:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey},he=await gi.post(`${et}delete-customer-card`,Q);z(!1),qn(),_i.fire({icon:"success",title:"Deleted!",text:"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})}catch(Q){z(!1),_i.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else f.dismiss===_i.DismissReason.cancel&&_i.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},Xe=v=>{switch(v==null?void 0:v.toLowerCase()){case"visa":return se;case"mastercard":case"mc":case"m/c":return Te;case"amex":case"american express":case"ae":return Ee;case"discover":case"dcvr":return Ue;case"bank":return h;default:return v}},Yt=()=>{let v=Be||0;return(Number(e.amount)-v).toFixed(0)};return console.log(D,"activeinCard","activeinBank",b),i.createElement(i.Fragment,null,i.createElement(Fn,null),i.createElement(oi,null),i.createElement(Dn,null),i.createElement(i.Fragment,null,i.createElement("button",{className:"paymentBtn",onClick:It},"Pay"),i.createElement(Sn,{open:E,onClose:A},q&&i.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},i.createElement(Tn,{error:q,onClose:A})),G&&i.createElement(si,{onClose:A,tranId:qe}),!q&&!G&&i.createElement(i.Fragment,null,(t||I)&&i.createElement(mn,{loading:t||I}),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:A},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:T==null?void 0:T.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:T==null?void 0:T.logo,id:"pay-logos"})),(p==null?void 0:p.length)>0&&Z!=="cardList"&&i.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>ie("cardList")}," ",i.createElement(Oi,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(Ln,{label:"Card",amount:(Je=Number(e==null?void 0:e.amount))==null?void 0:Je.toFixed(2),value:"card",onChange:xt,activetab:Z}),(T==null?void 0:T.isSkyFiAccount)&&i.createElement(Ln,{label:"Bank",amount:(gt=Number(Be))==null?void 0:gt.toFixed(2),value:"ach",onChange:xt,activetab:Z}),(e==null?void 0:e.isReader)&&(T==null?void 0:T.paymentDeviceList)&&((vt=T==null?void 0:T.paymentDeviceList)==null?void 0:vt.length)>0&&i.createElement(Ln,{label:"Reader",amount:($t=Number(e==null?void 0:e.amount))==null?void 0:$t.toFixed(2),value:"reader",onChange:xt,activetab:Z})),!t&&(En(T==null?void 0:T.showSurcharge)?Be&&Be>0&&(e!=null&&e.pass_fee)?i.createElement("div",{className:"frac-cash-discount-fee"},i.createElement("small",null,Z==="card"||Z==="reader"?"Cash Discount":"Cash Discount Savings"," "),i.createElement("p",null,fe((Number(e.amount)-Be).toFixed(2)))):null:Be&&Be>0&&(e!=null&&e.pass_fee)&&(Z==="card"||Z==="reader")?i.createElement("div",{className:"frac-cash-discount-fee"},i.createElement("small",null,Z==="card"||Z==="reader"?"Surcharge":null," "),i.createElement("p",null,fe((Number(e.amount)-Be).toFixed(2)))):null))),i.createElement("div",{className:"pay-conatiner-one-last"},i.createElement("img",{src:S,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"},Z!=="cardList"?i.createElement("div",{className:"frac-charge-payment-back-btn-wrap "},(p==null?void 0:p.length)>0&&i.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>ie("cardList")}," ",i.createElement(Oi,null)," Back"),(T==null?void 0:T.isSkyFiAccount)&&i.createElement("div",{className:"tab"},i.createElement("button",{className:"tablinks",onClick:v=>{xt("card")},style:{border:Z==="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:v=>{xt("ach")},style:{border:Z==="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"},"$",(At=Number(e==null?void 0:e.amount))==null?void 0:At.toFixed(2))),Z!="ach"&&i.createElement("div",null,i.createElement("div",null,i.createElement("img",{src:se,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Te,width:35,alt:""})),i.createElement("div",null,i.createElement("img",{src:Ee,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Ue,width:35,alt:""}))))):i.createElement("div",null,i.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",T==null?void 0:T.customer_name),i.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," ",N==="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"},"$",(Ht=Number(e==null?void 0:e.amount))==null?void 0:Ht.toFixed(2))),i.createElement("div",null,i.createElement("div",null,i.createElement("img",{src:se,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Te,width:35,alt:""})),i.createElement("div",null,i.createElement("img",{src:Ee,alt:"",width:35,style:{paddingRight:"5px"}}),i.createElement("img",{src:Ue,width:35,alt:""}))))),i.createElement("div",{id:"card",style:{display:Z==="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"},(p==null?void 0:p.length)>0&&D==="form"&&i.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>O("list")}," ",i.createElement(Oi,null))),i.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),Z!="ach"&&i.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},i.createElement("img",{src:se,alt:"",width:33}),i.createElement("img",{src:Te,width:33,alt:""}),i.createElement("img",{src:Ee,alt:"",width:33}),i.createElement("img",{src:Ue,width:33,alt:""}))),D==="list"?i.createElement(i.Fragment,null,i.createElement(Kn,{listHeading:"Cards",paymentGateway:T==null?void 0:T.paymentGateway,ListItems:p,selectedCard:Nt,setSelectedCard:zt,handleDeleteCard:j,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{O("form")}}),i.createElement("div",{className:"form-group",style:{padding:"0"}},i.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:J},fe((Jt=Number(e==null?void 0:e.amount))==null?void 0:Jt.toFixed(2))))):i.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:vn,onKeyDown:v=>{v.key==="Enter"&&I&&(v.preventDefault(),v.stopPropagation())}},i.createElement("div",{className:"ach-scrl",style:{minHeight:T!=null&&T.isSkyFiAccount&&(p==null?void 0:p.length)>0?"444px":T!=null&&T.isSkyFiAccount&&(p==null?void 0:p.length)==0?"456px":(p==null?void 0:p.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:(o==null?void 0:o.cardName)||"",onChange:v=>{let f=v.target.value;/^[a-zA-Z\s]*$/.test(f)&&je("cardName",f)}}),(a==null?void 0:a.cardName)&&i.createElement("span",{className:"error-span"},a==null?void 0:a.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:(o==null?void 0:o.cardNumber)||"",onChange:v=>Lt(v),"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:(o==null?void 0:o.expiryMonth)||"",onChange:v=>je("expiryMonth",v.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:(o==null?void 0:o.expiryYear)||"",onChange:v=>je("expiryYear",v.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:(o==null?void 0:o.cvv)||"",onChange:v=>je("cvv",v.target.value)})))),(a==null?void 0:a.cardNumber)&&i.createElement("span",{className:"error-span"},a==null?void 0:a.cardNumber),i.createElement("p",{style:{margin:"0"}},a!=null&&a.expiryMonth||a!=null&&a.expiryYear?i.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},a==null?void 0:a.expiryMonth):"",(a==null?void 0:a.cvv)&&i.createElement("span",{className:"error-span"},a==null?void 0:a.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:(be=e==null?void 0:e.orderID)!=null?be:"",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:(Ot=o==null?void 0:o.zipCode)!=null?Ot:"",onChange:v=>je("zipCode",v.target.value)}),(a==null?void 0:a.zipCode)&&i.createElement("span",{className:"error-span"},a==null?void 0:a.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:Me,onChange:v=>oe(v.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"},fe((Et=Number(e==null?void 0:e.amount))==null?void 0:Et.toFixed(2)))))),i.createElement("div",{id:"ach",style:{display:Z==="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"},(Ke==null?void 0:Ke.length)>0&&b==="form"&&i.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Fe("list")}," ",i.createElement(Oi,null))),i.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment"))),b==="list"?i.createElement(i.Fragment,null,i.createElement(Kn,{listHeading:"Banks",paymentGateway:T==null?void 0:T.paymentGateway,ListItems:Ke,selectedCard:Nt,setSelectedCard:zt,handleDeleteCard:j,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{Fe("form")}}),i.createElement("div",{className:"form-group",style:{padding:"0"}},i.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:J},fe((jt=Number(Be))==null?void 0:jt.toFixed(2))))):i.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:vn,autoComplete:"off",onKeyDown:v=>{v.key==="Enter"&&I&&(v.preventDefault(),v.stopPropagation())}},i.createElement("div",{className:"ach-scrl",style:{minHeight:T!=null&&T.isSkyFiAccount&&(p==null?void 0:p.length)>0?"444px":T!=null&&T.isSkyFiAccount&&(p==null?void 0:p.length)==0?"436px":(p==null?void 0:p.length)>0?"462px":"520px",maxHeight:T!=null&&T.isSkyFiAccount&&(p==null?void 0:p.length)>0?"444px":((p==null?void 0:p.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:(on=k==null?void 0:k.name)!=null?on:"",onChange:rn}),(H==null?void 0:H.name)&&i.createElement("span",{className:"error-span"},H==null?void 0:H.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:(sn=k==null?void 0:k.routingNumber)!=null?sn:"",onChange:rn}),(H==null?void 0:H.routingNumber)&&i.createElement("span",{className:"error-span"},H==null?void 0:H.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:(ln=k==null?void 0:k.accountNumber)!=null?ln:"",onChange:rn}),(H==null?void 0:H.accountNumber)&&i.createElement("span",{className:"error-span"},H==null?void 0:H.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:(dn=k==null?void 0:k.confirmAccountNumber)!=null?dn:"",onChange:rn}),(H==null?void 0:H.confirmAccountNumber)&&i.createElement("span",{className:"error-span"},H==null?void 0:H.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:(yn=k==null?void 0:k.bankName)!=null?yn:"",onChange:rn}),(H==null?void 0:H.bankName)&&i.createElement("span",{className:"error-span"},H==null?void 0:H.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:(Cn=k==null?void 0:k.companyName)!=null?Cn:"",onChange:rn}),(H==null?void 0:H.companyName)&&i.createElement("span",{className:"error-span"},H==null?void 0:H.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:(Zt=k==null?void 0:k.accountType)!=null?Zt:"",onChange:rn},i.createElement("option",{value:""},"Select account"),ui.map(v=>i.createElement("option",{key:v.value,value:v.value},v.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:Le,onChange:v=>bt(v.target.checked)}),i.createElement("label",{htmlFor:"saveACH"},"Save ACH")),Le&&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"},fe((Ze=Number(Be))==null?void 0:Ze.toFixed(2)))))),i.createElement("div",{id:"reader",style:{display:Z==="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(Vi,{listHeading:"Reader",ListItems:T==null?void 0:T.paymentDeviceList,selectedPax:St,setSlectedPax:mt}),i.createElement("button",{onClick:zn,className:"pay-button"},"$",(Wt=Number(e==null?void 0:e.amount))==null?void 0:Wt.toFixed(2)))))))))))))}import m,{useEffect as Qi,useState as gn}from"react";import pi from"axios";import Xi from"sweetalert2";import{IoArrowBack as sr}from"react-icons/io5";function lr($){var I=$,{showButton:e=!0}=I,t=ii(I,["showButton"]);var je,Lt,rn,Gn,Vt,vn,qn,An,zn;let[z,q]=gn(!1),[W,G]=gn(!1),[ye,E]=gn(""),[L,Z]=gn(!1),[ie,N]=gn(!1),[y,D]=gn("card"),[O,b]=gn(!1),[Fe,_]=gn("card"),[tt,Me]=gn("form"),oe=t.merchantPublicKey,[Le,bt]=gn(void 0);Qi(()=>{t.onTriggerPay&&t.onTriggerPay(()=>{Be()})},[t]);let ke=R+"widget/mc-img.svg",Te=R+"widget/visa-img.svg",se=R+"widget/ae-img.svg",Ee=R+"widget/discover-img.svg",Ue=R+"widget/card.svg",hn=R+"widget/Trash.svg",an=R+"widget/bank.svg",h=R+"widget/secure-img.png",S=R+"widget/pov-by.png",[u,me]=gn(),[o,r]=gn({}),[a,w]=gn([]),[k,P]=gn(),[H,x]=gn(void 0),[p,F]=gn(),[Ke,Se]=gn(""),Nt=(J,j)=>{let Xe=(parseFloat(j)||0)/100,Yt=J/(1+Xe);return Math.round(Yt*100)/100};Qi(()=>{if(t!=null&&t.pass_fee){let J=Nt(t==null?void 0:t.amount,t==null?void 0:t.surcharge);x(J)}},[t==null?void 0:t.pass_fee]);let zt=()=>q(!0),St=()=>q(!1),mt=()=>{N(!1),D("card"),G(!1),E(""),Z(!1),Se(""),me({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),r({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),b(!1),P({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""})},Be=()=>N(!0),re=(J,j)=>{let Xe=J;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(Xe)){(j===""||/^[0-9]+$/.test(j))&&(r(Je=>M(C({},Je),{[Xe]:""})),me(Je=>M(C({},Je),{[Xe]:j})));return}r(Je=>M(C({},Je),{[Xe]:""})),me(Je=>M(C({},Je),{[Xe]:j}))},T=J=>{var gt;let j=J.target,Xe=j.value.replace(/\D/g,""),{formatted:Yt,cursor:Je}=In(j.value,(gt=j.selectionStart)!=null?gt:0);r(vt=>M(C({},vt),{cardNumber:""})),me(vt=>M(C({},vt),{cardNumber:Yt})),requestAnimationFrame(()=>{j.setSelectionRange(Je,Je)})},_e=()=>{var Je,gt,vt,$t,At,Ht;let J={},j=u,Xe=parseInt((j==null?void 0:j.expiryMonth)||"",10),Yt=(j==null?void 0:j.expiryYear)||"";if((Je=j==null?void 0:j.cardName)!=null&&Je.trim()||(J.cardName="Card name is required"),(gt=j==null?void 0:j.cardNumber)!=null&>.trim()||(J.cardNumber="Card number is required"),(!((vt=j==null?void 0:j.expiryMonth)!=null&&vt.trim())||!(($t=j==null?void 0:j.expiryYear)!=null&&$t.trim())||isNaN(Xe)||Xe<1||Xe>12||Yt.length!==4)&&(J.expiryMonth="Invalid Expiration Date."),(At=j==null?void 0:j.cvv)!=null&&At.trim()||(J.cvv="CVV is required"),(Ht=j==null?void 0:j.zipCode)!=null&&Ht.trim()||(J.zipCode="ZIP code is required"),j!=null&&j.expiryMonth&&(j!=null&&j.expiryYear)&&j.expiryMonth.length<=2&&j.expiryYear.length===4){let Jt=parseInt(j.expiryMonth,10),be=parseInt(j.expiryYear,10),Ot=new Date,Et=Ot.getMonth()+1,jt=Ot.getFullYear();(be<jt||be===jt&&Jt<Et)&&(J.expiryMonth="Card is expired")}return r(J),Object.keys(J).length>0},qe=async J=>{var j,Xe,Yt,Je,gt,vt,$t,At,Ht,Jt,be,Ot,Et,jt,on,sn,ln,dn,yn;if(J.preventDefault(),y=="card"){if(_e())return;{let Zt=DatacapWebToken.validateCardNumber(u==null?void 0:u.cardNumber.replaceAll(" ","")),Ze=DatacapWebToken.validateExpirationDate(u==null?void 0:u.expiryMonth,u==null?void 0:u.expiryYear),Wt=DatacapWebToken.validateCVV(u==null?void 0:u.cvv),v={};if(Zt||(v.cardNumber="Invalid card Number"),Ze||(v.expiryMonth="Invalid Expiration Date."),Wt||(v.cvv="Invalid CVV"),r(v),Zt&&Wt&&Ze){G(!0);try{let f=async function(Q){if(Q.Error)E(Q.Error),G(!1);else{let he=u==null?void 0:u.cardName,ce=u==null?void 0:u.zipCode;Q.name=he,Q.postal_code=ce,Q.fractalpayPublicKey=t==null?void 0:t.merchantPublicKey,Q.amount=t==null?void 0:t.amount,Q.order_id=t==null?void 0:t.orderID,Q.preAuth_id=(t==null?void 0:t.preauthId)||"",Q.isCardSave=O,Q.customer_id=t==null?void 0:t.customerId,Q.link_token="",Q.gateway_id=p==null?void 0:p.paymentGateway,Q.discount=t==null?void 0:t.discount,Q.tax=t==null?void 0:t.tax,Q.surcharge=t==null?void 0:t.surcharge,Q.pass_fee=t==null?void 0:t.pass_fee,new Headers().append("Content-Type","application/json");let ge={method:"POST",body:JSON.stringify(Q),redirect:"follow"};Bt.emit("sendMessage",C(M(C({},ge),{isChargePreauth:!0}),(t==null?void 0:t.sessionToken)&&{sessionToken:t.sessionToken})),Bt.on("charge-preauth",nt=>{var ht;(nt==null?void 0:nt.status)=="Failed"?(G(!1),E((nt==null?void 0:nt.message)||"Something went wrong. Please try again later.")):(Z(!0),Se((ht=nt==null?void 0:nt.data)==null?void 0:ht.transaction_id),G(!1),me({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}))})}};if((p==null?void 0:p.paymentGateway)===32){let Q={method:"POST",redirect:"follow"};try{let he=await pi.post(`${Ie}api/v1/widget/generate-session`,Q),ce=Number(u==null?void 0:u.expiryYear)%100,Ye=u==null?void 0:u.cardNumber;Ye=Ye==null?void 0:Ye.replace(/\s+/g,"");let ge=`${Ye}=${ce}${u==null?void 0:u.expiryMonth} ${u==null?void 0:u.cvv}`,ht=forge.pki.publicKeyFromPem((Xe=(j=he==null?void 0:he.data)==null?void 0:j.data)==null?void 0:Xe.publicKeyPem).encrypt(ge,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Pt=forge.util.encode64(ht),Qt={"Content-Type":"application/json","x-app-session-key":(Je=(Yt=he.data)==null?void 0:Yt.data)==null?void 0:Je.session_key},g=JSON.stringify({enc_track2_data:`${Pt}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(vt=(gt=he==null?void 0:he.data)==null?void 0:gt.data)==null?void 0:vt.session_key}`});try{let d=await pi.post(`${cn}tokenizer/tokenize`,g,{headers:Qt}),ee=JSON.stringify(M(C({},($t=d==null?void 0:d.data)==null?void 0:$t.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:`${(Ht=(At=d==null?void 0:d.data)==null?void 0:At.data)==null?void 0:Ht.token}`,fractalpayPublicKey:oe,order_id:t==null?void 0:t.orderID,preAuth_id:(t==null?void 0:t.preauthId)||"",isCardSave:O,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:(be=(Jt=d==null?void 0:d.data)==null?void 0:Jt.data)==null?void 0:be.last4,Brand:(Et=(Ot=d==null?void 0:d.data)==null?void 0:Ot.data)==null?void 0:Et.brand,gateway_id:p==null?void 0:p.paymentGateway,pass_fee:t==null?void 0:t.pass_fee})),te={method:"POST",headers:{"Content-Type":"application/json"},body:ee,redirect:"follow"};Bt.emit("sendMessage",C(M(C({},te),{isFractalPreauth:!0}),(t==null?void 0:t.sessionToken)&&{sessionToken:t.sessionToken})),Bt.on("fractal-charge-preauth",Pe=>{var rt;(Pe==null?void 0:Pe.status)=="Failed"?(G(!1),E((Pe==null?void 0:Pe.message)||"Something went wrong , Try again later")):(Se((rt=Pe==null?void 0:Pe.data)==null?void 0:rt.transaction_id),Z(!0),G(!1))})}catch(d){console.log(d),G(!1),E(((on=(jt=d==null?void 0:d.response)==null?void 0:jt.data)==null?void 0:on.message)||(d==null?void 0:d.message)||"Something went wrong , Try again later")}}catch(he){G(!1),E(((ln=(sn=he==null?void 0:he.response)==null?void 0:sn.data)==null?void 0:ln.message)||(he==null?void 0:he.message)||"Something went wrong , Try again later")}}else DatacapWebToken.requestToken(p==null?void 0:p.dctoken,"PaymentForm",f)}catch(f){G(!1),E(((yn=(dn=f==null?void 0:f.response)==null?void 0:dn.data)==null?void 0:yn.message)||(f==null?void 0:f.message)||"Something went wrong.")}}}}},ae=async()=>{var J,j,Xe,Yt,Je,gt,vt,$t,At,Ht,Jt,be,Ot,Et,jt,on,sn,ln,dn,yn,Cn;zt();try{let Zt={fractalpayPublicKey:oe,customer_id:t==null?void 0:t.customerId,preauth:!0,isReader:!!(t!=null&&t.isReader)},Ze=await pi.post(`${et}get-payment-details`,Zt);if(F((J=Ze==null?void 0:Ze.data)==null?void 0:J.data),(Xe=(j=Ze==null?void 0:Ze.data)==null?void 0:j.data)!=null&&Xe.paymentGateway||(mt(),E("Something went wrong.")),(Je=(Yt=Ze==null?void 0:Ze.data)==null?void 0:Yt.data)!=null&&Je.card_list&&(($t=(vt=(gt=Ze==null?void 0:Ze.data)==null?void 0:gt.data)==null?void 0:vt.card_list)==null?void 0:$t.length)>0){D("card"),w((Ht=(At=Ze==null?void 0:Ze.data)==null?void 0:At.data)==null?void 0:Ht.card_list),((Ot=(be=(Jt=Ze==null?void 0:Ze.data)==null?void 0:Jt.data)==null?void 0:be.card_list)==null?void 0:Ot.length)>0&&Me("list");let Wt=(on=(jt=(Et=Ze==null?void 0:Ze.data)==null?void 0:Et.data)==null?void 0:jt.card_list)==null?void 0:on.filter(v=>(v==null?void 0:v.primary_card)==1);Wt!=null&&Wt[0]&&((sn=Wt==null?void 0:Wt[0])==null?void 0:sn.payment_method_type)==((dn=(ln=Ze==null?void 0:Ze.data)==null?void 0:ln.data)==null?void 0:dn.paymentGateway)&&P(Wt[0])}else D("card");St()}catch(Zt){console.log(Zt),St(),E(((Cn=(yn=Zt==null?void 0:Zt.response)==null?void 0:yn.data)==null?void 0:Cn.message)||(Zt==null?void 0:Zt.message)||"Something went wrong")}},ft=async()=>{var be,Ot,Et,jt,on,sn,ln;let J=t==null?void 0:t.customerId,j=t==null?void 0:t.discount,Xe=t==null?void 0:t.surcharge,Yt=t==null?void 0:t.tax,Je=t==null?void 0:t.merchantPublicKey,gt=t==null?void 0:t.orderID,vt=t==null?void 0:t.amount,$t=k==null?void 0:k.id,At=k==null?void 0:k.card_type,Ht=(t==null?void 0:t.preauthId)||"";if(Je&>&&vt)if(J)if($t){let dn={amount:vt,order_id:gt,customer_id:J,card_id:$t,fractalpayPublicKey:Je,isCardSave:At!="Bank",discount:j,surcharge:Xe,tax:Yt,preAuth_id:Ht},Jt=dn,{isCardSave:yn}=Jt,Cn=ii(Jt,["isCardSave"]),Ze=et+"authorize-by-card",Wt=C({"Content-Type":"application/json"},(t==null?void 0:t.sessionToken)&&{"X-Session-Token":t.sessionToken});G(!0);try{let v=await pi.post(Ze,At=="Bank"?Cn:dn,{headers:Wt});(be=v==null?void 0:v.data)!=null&&be.result&&(Se((Et=(Ot=v==null?void 0:v.data)==null?void 0:Ot.data)==null?void 0:Et.transaction_id),Z(!0),G(!1))}catch(v){G(!1),console.log(v),E(((on=(jt=v==null?void 0:v.response)==null?void 0:jt.data)==null?void 0:on.message)||((ln=(sn=v==null?void 0:v.response)==null?void 0:sn.data)==null?void 0:ln.status)||"Something went erong")}}else E("Please Select A Card/ACH");else E("Please Select Customer");else E("Something went wrong.")};Qi(()=>{ie&&oe&&ae()},[oe,ie]);let ut=async J=>{Xi.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async j=>{if(j.isConfirmed){G(!0);try{let Xe={card_id:J,customer_id:t==null?void 0:t.customerId,fractalpayPublicKey:t==null?void 0:t.merchantPublicKey},Yt=await pi.post(`${et}delete-customer-card`,Xe);G(!1),ae(),Xi.fire({icon:"success",title:"Deleted!",text:"The card has been deleted.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}catch(Xe){G(!1),Xi.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}})},_t=J=>{switch(J==null?void 0:J.toLowerCase()){case"visa":return Te;case"mastercard":case"mc":case"m/c":return ke;case"amex":case"american express":case"ae":return se;case"discover":case"dcvr":return Ee;case"bank":return an;default:return J}},A=J=>{D(J)},It=async()=>{var Je,gt,vt,$t,At,Ht;let J=t==null?void 0:t.merchantPublicKey,j=t==null?void 0:t.orderID,Xe=String(t==null?void 0:t.amount),Yt=t==null?void 0:t.customerId;if(!(Le!=null&&Le.device_id)){E("Please Select A Payment Device");return}if(J&&j&&Xe){G(!0);let Jt={amount:Xe,fractalpayPublicKey:J,customer_order_id:j,device_id:Le==null?void 0:Le.device_id,customer_id:Yt||"",is_auth:!0};try{let be=await pi.post(`${et}charge-with-reader`,Jt);((Je=be==null?void 0:be.data)==null?void 0:Je.result)==!0?(Se((vt=(gt=be==null?void 0:be.data)==null?void 0:gt.data)==null?void 0:vt.transaction_id),Z(!0),G(!1)):(E((($t=be==null?void 0:be.data)==null?void 0:$t.message)||"Something went wrong."),G(!1))}catch(be){E(((Ht=(At=be==null?void 0:be.response)==null?void 0:At.data)==null?void 0:Ht.message)||"Something went wrong."),G(!1)}}else E("Something went wrong.")},xt=()=>{Fe==="card"?ft():Fe==="reader"&&It()};return m.createElement(m.Fragment,null,m.createElement(Fn,null),m.createElement(oi,null),m.createElement(Dn,null),m.createElement(m.Fragment,null,e&&m.createElement("button",{className:"paymentBtn",onClick:Be},"PreAuth Payment"),m.createElement(Sn,{open:ie,onClose:mt},ye&&m.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},m.createElement(Tn,{error:ye,onClose:mt})),L&&m.createElement(si,{onClose:mt,tranId:Ke}),!ye&&!L&&m.createElement(m.Fragment,null,(z||W)&&m.createElement(mn,{loading:z||W}),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:mt},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:p==null?void 0:p.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(Ln,{label:"Card",amount:(je=Number(t==null?void 0:t.amount))==null?void 0:je.toFixed(2),value:"card",onChange:A,activetab:y}),(t==null?void 0:t.isReader)&&(p==null?void 0:p.paymentDeviceList)&&((Lt=p==null?void 0:p.paymentDeviceList)==null?void 0:Lt.length)>0&&m.createElement(Ln,{label:"Reader",amount:(rn=Number(t==null?void 0:t.amount))==null?void 0:rn.toFixed(2),value:"reader",onChange:A,activetab:y})))),m.createElement("div",{className:"pay-conatiner-one-last"},m.createElement("img",{src:h,alt:""}),m.createElement("img",{src:S,alt:""}),"Secure payments powered by Fractal"),m.createElement("div",null)),!z&&m.createElement("div",{className:"pay-tab pay-conatiner-two"},m.createElement("div",{className:"col-md-12"},m.createElement("div",{id:"payment-form-div"},y!=="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"},fe((Gn=Number(t==null?void 0:t.amount))==null?void 0:Gn.toFixed(2)))),m.createElement("div",null,m.createElement("div",null,m.createElement("img",{src:Te,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:ke,width:35,alt:""})),m.createElement("div",null,m.createElement("img",{src:se,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Ee,width:35,alt:""})))),H&&H>0&&m.createElement("div",{className:"res-pay-con frac-cash-discount"},m.createElement("div",{className:"frac-cashlabel"},En(p==null?void 0:p.showSurcharge)?"Surcharge":"Cash Discount"),m.createElement("div",null,fe(H.toFixed(2)))))):m.createElement("div",null,m.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",p==null?void 0:p.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"},fe((Vt=Number(t==null?void 0:t.amount))==null?void 0:Vt.toFixed(2)))),m.createElement("div",null,m.createElement("div",null,m.createElement("img",{src:Te,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:ke,width:35,alt:""})),m.createElement("div",null,m.createElement("img",{src:se,alt:"",width:35,style:{paddingRight:"5px"}}),m.createElement("img",{src:Ee,width:35,alt:""})))),m.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," Cards")),m.createElement("div",{id:"card",style:{display:y==="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"},(a==null?void 0:a.length)>0&&tt==="form"&&m.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Me("list")}," ",m.createElement(sr,null)),H&&H>0&&m.createElement("div",{className:"res-pay-con frac-cash-discount"},m.createElement("div",{className:"frac-cashlabel"},En(p==null?void 0:p.showSurcharge)?"Surcharge":"Cash Discount"),m.createElement("div",null,fe(H.toFixed(2))))),m.createElement("h6",{className:"frac-card-payment-heading"},"Card Authorization")),y!="ach"&&m.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},m.createElement("img",{src:Te,alt:"",width:33}),m.createElement("img",{src:ke,width:33,alt:""}),m.createElement("img",{src:se,alt:"",width:33}),m.createElement("img",{src:Ee,width:33,alt:""}))),tt==="list"?m.createElement(m.Fragment,null,m.createElement(Kn,{listHeading:"Cards",paymentGateway:p==null?void 0:p.paymentGateway,ListItems:a,selectedCard:k,setSelectedCard:P,handleDeleteCard:ut,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{Me("form")}}),m.createElement("div",{className:"form-group",style:{padding:"0"}},m.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:xt},fe((vn=Number(t==null?void 0:t.amount))==null?void 0:vn.toFixed(2))))):m.createElement("div",{id:"card",style:{display:y==="card"?"block":"none"},className:"tabcontent"},m.createElement("form",{id:"PaymentForm",onSubmit:qe,onKeyDown:J=>{J.key==="Enter"&&z&&(J.preventDefault(),J.stopPropagation())}},m.createElement("div",{className:"ach-scrl",style:{minHeight:(a==null?void 0:a.length)>0?"462px":"520px",overflow:"auto",marginRight:"5px"}},m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"cardHolderName"},"Name on Card"),m.createElement("input",{type:"text",className:"form-control",placeholder:"John Doe",value:(u==null?void 0:u.cardName)||"",onChange:J=>{let j=J.target.value;/^[a-zA-Z\s]*$/.test(j)&&re("cardName",j)}}),(o==null?void 0:o.cardName)&&m.createElement("span",{className:"error-span"},o==null?void 0:o.cardName)),m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"cardNumber"},"Card Number"),m.createElement("div",{className:"toggle-num-wrapper"},m.createElement("input",{className:"form-control card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(u==null?void 0:u.cardNumber)||"",onChange:J=>T(J),"data-token":"card_number"}),m.createElement("div",{className:"card-crdi card-expiry-new"},m.createElement("div",{className:"exp-date-year-container"},m.createElement("div",{className:"exp-date form-group"},m.createElement("input",{"data-token":"exp_month",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(u==null?void 0:u.expiryMonth)||"",onChange:J=>re("expiryMonth",J.target.value)})),m.createElement("div",{className:"exp-year form-group"},m.createElement("input",{"data-token":"exp_year",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(u==null?void 0:u.expiryYear)||"",onChange:J=>re("expiryYear",J.target.value)})),m.createElement("div",{className:"security-digit form-group"},m.createElement("input",{"data-token":"cvv",className:"form-control required card-cvv-in",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(u==null?void 0:u.cvv)||"",onChange:J=>re("cvv",J.target.value)})))),(o==null?void 0:o.cardNumber)&&m.createElement("span",{className:"error-span"},o==null?void 0:o.cardNumber),m.createElement("p",{style:{margin:"0"}},o!=null&&o.expiryMonth||o!=null&&o.expiryYear?m.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},o==null?void 0:o.expiryMonth):"",(o==null?void 0:o.cvv)&&m.createElement("span",{className:"error-span"},o==null?void 0:o.cvv)))),m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"OrderId"},"Order ID / Description"),m.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"Enter Order id",disabled:!0,value:t==null?void 0:t.orderID,onChange:J=>re("orderId",J.target.value),style:{background:"#F6F6F7",color:"#727272"}})),m.createElement("div",{className:"form-group"},m.createElement("label",{htmlFor:"zip"},"ZIP"),m.createElement("input",{type:"text",className:"form-control",maxLength:100,placeholder:"000000",value:(qn=u==null?void 0:u.zipCode)!=null?qn:"",onChange:J=>re("zipCode",J.target.value)}),(o==null?void 0:o.zipCode)&&m.createElement("span",{className:"error-span"},o==null?void 0:o.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:O,onChange:J=>b(J.target.checked)}),m.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),m.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),m.createElement("div",{className:"frac-tooltip-wrapper"},m.createElement("div",{className:"frac-tooltip-icon"},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},m.createElement("g",{clipPath:"url(#clip0_12420_50192)"},m.createElement("rect",{width:"20",height:"20",fill:"white"}),m.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),m.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"})),m.createElement("defs",null,m.createElement("clipPath",{id:"clip0_12420_50192"},m.createElement("rect",{width:"20",height:"20",fill:"white"}))))),m.createElement("div",{className:"frac-tooltip-text"},m.createElement("p",null,"If checked, I agree to give the ",m.createElement("b",null,(p==null?void 0:p.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"},fe((An=Number(t==null?void 0:t.amount))==null?void 0:An.toFixed(2))))))),m.createElement("div",{id:"reader",style:{display:y==="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"},H&&H>0&&m.createElement("div",{className:"res-pay-con frac-cash-discount"},m.createElement("div",{className:"frac-cashlabel"},En(p==null?void 0:p.showSurcharge)?"Surcharge":"Cash Discount"),m.createElement("div",null,fe(H.toFixed(2))))),m.createElement("h6",{className:"frac-card-payment-heading"},"Reader Authorization"))),m.createElement(Vi,{listHeading:"Reader",ListItems:p==null?void 0:p.paymentDeviceList,selectedPax:Le,setSlectedPax:bt}),m.createElement("button",{onClick:It,className:"pay-button"},"$",(zn=Number(t==null?void 0:t.amount))==null?void 0:zn.toFixed(2))))))))))))))}import Ne,{useEffect as ur,useRef as Pi,useState as li}from"react";import gr from"sweetalert2";import fi from"axios";import dr from"react";function Di(){let e="#000",t="#fff",$="#212529",I="#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 Zn from"react";import mr from"react";function Ri(){return mr.createElement("style",null,`
|
|
1993
|
-
.card-success .logo-container {
|
|
1994
|
-
display: flex;
|
|
1995
|
-
justify-content: center;
|
|
1996
|
-
align-items: center;
|
|
1997
|
-
margin-bottom: -50px; /* Adjust this to overlap the content */
|
|
1998
|
-
z-index: 10;
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
.card-success .client-logo {
|
|
2002
|
-
max-width: 100px;
|
|
2003
|
-
height: auto;
|
|
2004
|
-
object-fit: contain;
|
|
2005
|
-
display: block;
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
.card-success .payment-success-container {
|
|
2009
|
-
display: flex;
|
|
2010
|
-
flex-direction: column;
|
|
2011
|
-
align-items: center;
|
|
2012
|
-
padding: 18px 20px 24px;
|
|
2013
|
-
width: 335px;
|
|
2014
|
-
height: 400px; /* Fixed height */
|
|
2015
|
-
background: #FFFFFF;
|
|
2016
|
-
border-radius: 12px;
|
|
2017
|
-
position: relative;
|
|
2018
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
2019
|
-
border: 1px solid #e3e3e3;
|
|
2020
|
-
justify-content: center;
|
|
2021
|
-
text-align: center;
|
|
2022
|
-
// margin-top: 50px; /* Adjust this to move the content down */
|
|
2023
|
-
margin: 50px auto 0 auto !important;
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
.card-success .success-icon {
|
|
2027
|
-
display: flex;
|
|
2028
|
-
flex-direction: column;
|
|
2029
|
-
align-items: center;
|
|
2030
|
-
gap: 12px;
|
|
2031
|
-
width: 227px;
|
|
2032
|
-
height: 116px;
|
|
2033
|
-
z-index: 2;
|
|
2034
|
-
}
|
|
2035
|
-
|
|
2036
|
-
.card-success .circle {
|
|
2037
|
-
width: 40px;
|
|
2038
|
-
height: 40px;
|
|
2039
|
-
border: 1px solid #49B182;
|
|
2040
|
-
border-radius: 50%;
|
|
2041
|
-
display: flex;
|
|
2042
|
-
justify-content: center;
|
|
2043
|
-
align-items: center;
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
.card-success .circle .fa-check-circle {
|
|
2047
|
-
font-size: 20px;
|
|
2048
|
-
color: #49B182;
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
.card-success .success-text {
|
|
2052
|
-
display: flex;
|
|
2053
|
-
flex-direction: column;
|
|
2054
|
-
justify-content: center;
|
|
2055
|
-
align-items: center;
|
|
2056
|
-
gap: 4px;
|
|
2057
|
-
width: 227px;
|
|
2058
|
-
}
|
|
2059
|
-
|
|
2060
|
-
.card-success .payment-success-text {
|
|
2061
|
-
font-family: 'Inter', sans-serif;
|
|
2062
|
-
font-weight: 500;
|
|
2063
|
-
font-size: 18px;
|
|
2064
|
-
line-height: 21px;
|
|
2065
|
-
text-align: center;
|
|
2066
|
-
letter-spacing: -0.02em;
|
|
2067
|
-
color: #161616;
|
|
2068
|
-
}
|
|
2069
|
-
|
|
2070
|
-
.card-success .thank-you-text {
|
|
2071
|
-
font-family: 'Inter', sans-serif;
|
|
2072
|
-
font-weight: 500;
|
|
2073
|
-
font-size: 14px;
|
|
2074
|
-
line-height: 18px;
|
|
2075
|
-
text-align: center;
|
|
2076
|
-
letter-spacing: -0.02em;
|
|
2077
|
-
color: #161616;
|
|
2078
|
-
opacity: 0.5;
|
|
2079
|
-
}
|
|
2080
|
-
`)}var cr=({onClose:e})=>Zn.createElement(Zn.Fragment,null,Zn.createElement(Ri,null),Zn.createElement("div",{className:"card-success"},Zn.createElement("div",{className:"payment-success-container"},Zn.createElement("div",{className:"success-icon"},Zn.createElement("div",{className:"circle"},Zn.createElement("i",{className:"fa fa-check-circle","aria-hidden":"true"})),Zn.createElement("div",{className:"success-text"},Zn.createElement("div",{className:"payment-success-text"},"Your card was added successfully."),Zn.createElement("div",{className:"thank-you-text"},"Thank you ")))))),xa=cr;function pr(e){var an;let[t,$]=li(!1),[I,z]=li(!1),[q,W]=li(""),[G,ye]=li(!1),E=Pi(null),L=Pi(null),Z=Pi(null),ie=Pi(null),N=Pi(null),[y,D]=li(),[O,b]=li({}),[Fe,_]=li(),tt=()=>$(!0),Me=()=>$(!1),oe=h=>{gr.fire({icon:"error",text:h,customClass:{popup:"custom-z-index"}})},Le=()=>{ye(!1),z(!1),W(""),D({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""})},bt=()=>ye(!0),ke=()=>{Le()},Te=(h,S)=>{var o,r,a;let u=h,me=["expiryMonth","expiryYear","zipCode","cvv"];if(console.log(u,S==null?void 0:S.length,"dfih",u==="expiryMonth"&&(S==null?void 0:S.length)===2),u==="expiryMonth"&&(S==null?void 0:S.length)===2&&((o=Z==null?void 0:Z.current)==null||o.focus()),u==="expiryYear"&&(S==null?void 0:S.length)===4&&((r=ie==null?void 0:ie.current)==null||r.focus()),u==="cvv"&&(S==null?void 0:S.length)===3&&((a=N==null?void 0:N.current)==null||a.focus()),me.includes(u)){(S===""||/^[0-9]+$/.test(S))&&(b(w=>M(C({},w),{[u]:""})),D(w=>M(C({},w),{[u]:S})));return}b(w=>M(C({},w),{[u]:""})),console.log(S,u),D(w=>M(C({},w),{[u]:S}))},se=h=>{var r,a;let S=h.target,u=S.value.replace(/\D/g,""),{formatted:me,cursor:o}=In(S.value,(r=S.selectionStart)!=null?r:0);b(w=>M(C({},w),{cardNumber:""})),D(w=>M(C({},w),{cardNumber:me})),console.log(u==null?void 0:u.length,"length"),(u==null?void 0:u.length)===16&&((a=L==null?void 0:L.current)==null||a.focus()),requestAnimationFrame(()=>{S.setSelectionRange(o,o)})},Ee=()=>{var o,r,a,w,k,P;let h={},S=y,u=parseInt((S==null?void 0:S.expiryMonth)||"",10),me=(S==null?void 0:S.expiryYear)||"";if((o=S==null?void 0:S.cardName)!=null&&o.trim()||(h.cardName="Card name is required"),(r=S==null?void 0:S.cardNumber)!=null&&r.trim()||(h.cardNumber="Card number is required"),(a=S==null?void 0:S.expiryMonth)!=null&&a.trim()?(Number(S==null?void 0:S.expiryMonth)>12||Number(S==null?void 0:S.expiryMonth)<1)&&(h.expiryMonth="Invalid Expiration Month."):h.expiryMonth="Expiration month is required",(w=S==null?void 0:S.expiryYear)!=null&&w.trim()?((k=S==null?void 0:S.expiryYear)==null?void 0:k.trim().length)!==4||Number(S==null?void 0:S.expiryYear)<2025?h.expiryYear="Invalid Expiration Year.":(isNaN(u)||u<1||u>12||me.length!==4)&&(h.expiryMonth="Invalid Expiration Date."):h.expiryYear="Expiration year is required",(P=S==null?void 0:S.cvv)!=null&&P.trim()||(h.cvv="CVC is required"),S!=null&&S.expiryMonth&&(S!=null&&S.expiryYear)&&S.expiryMonth.length<=2&&S.expiryYear.length===4){let H=parseInt(S.expiryMonth,10),x=parseInt(S.expiryYear,10),p=new Date,F=p.getMonth()+1,Ke=p.getFullYear();(x<Ke||x===Ke&&H<F)&&(h.expiryMonth="Card is expired")}return b(h),Object.keys(h).length>0},Ue=async()=>{var h,S,u;tt();try{let me={fractalpayPublicKey:e==null?void 0:e.merchantPublicKey,customer_id:e==null?void 0:e.customerId,addcard:!0},o=await fi.post(`${et}get-payment-details`,me);console.log(o),_((h=o==null?void 0:o.data)==null?void 0:h.data),(u=(S=o==null?void 0:o.data)==null?void 0:S.data)!=null&&u.paymentGateway||(Le(),W("Something went wrong.")),Me()}catch(me){console.log(me),Me(),Le(),W("Something went wrong.")}};return ur(()=>{e!=null&&e.merchantPublicKey&&Ue()},[e==null?void 0:e.merchantPublicKey]),Ne.createElement(Ne.Fragment,null,Ne.createElement(Fn,null),Ne.createElement(Di,null),Ne.createElement(mn,{loading:t}),q&&Ne.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},Ne.createElement(Tn,{error:q,onClose:Le})),I&&Ne.createElement(xa,{onClose:ke}),!q&&!I&&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 u,me,o,r,a,w,k,P,H,x,p,F,Ke,Se,Nt,zt;h.preventDefault();let S=Ee();if(console.log(y),!S){let St=DatacapWebToken.validateCardNumber(y==null?void 0:y.cardNumber.replaceAll(" ","")),mt=DatacapWebToken.validateExpirationDate(y==null?void 0:y.expiryMonth,y==null?void 0:y.expiryYear),Be=DatacapWebToken.validateCVV(y==null?void 0:y.cvv),re={};if(St||(re.cardNumber="Invalid card Number"),mt||(re.expiryMonth="Invalid Expiration Date."),Be||(re.cvv="Invalid CVV"),b(re),St&&Be&&mt){tt();try{let T=async function(_e){var qe,ae,ft,ut,_t;if(console.log(_e),_e.Error)console.log(_e==null?void 0:_e.Error),W(_e.Error),Me();else{let A={userId:e==null?void 0:e.customerId,cardName:y==null?void 0:y.cardName,zip:y==null?void 0:y.zipCode,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey,token:_e};try{let It=await fi.post(`${et}add-card`,A);console.log(It);let xt={fractalpayPublicKey:e==null?void 0:e.merchantPublicKey,wallet_id:"",card_number:y==null?void 0:y.cardNumber.replaceAll(" ",""),exp_month:y==null?void 0:y.expiryMonth,exp_year:(qe=y==null?void 0:y.expiryYear)==null?void 0:qe.slice(-2),cvv:y==null?void 0:y.cvv};try{let je=await fi.post(`${et}link-wallet`,xt);console.log(je),z(!0),Me(),D({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),ei(h,"close","")}catch(je){console.log(je),Me(),W(((ft=(ae=je==null?void 0:je.response)==null?void 0:ae.data)==null?void 0:ft.message)||(je==null?void 0:je.message)||"Something went wrong.")}}catch(It){console.log(It),Me(),W(((_t=(ut=It==null?void 0:It.response)==null?void 0:ut.data)==null?void 0:_t.message)||(It==null?void 0:It.message)||"Something went wrong.")}}};if((Fe==null?void 0:Fe.paymentGateway)===32){let _e={method:"POST",redirect:"follow"};try{let qe=await fi.post(`${Ie}api/v1/widget/generate-session`,_e),ae=Number(y==null?void 0:y.expiryYear)%100,ft=y==null?void 0:y.cardNumber;ft=ft==null?void 0:ft.replace(/\s+/g,"");let ut=`${ft}=${ae}${y==null?void 0:y.expiryMonth} ${y==null?void 0:y.cvv}`,A=forge.pki.publicKeyFromPem((me=(u=qe==null?void 0:qe.data)==null?void 0:u.data)==null?void 0:me.publicKeyPem).encrypt(ut,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),It=forge.util.encode64(A),xt={"Content-Type":"application/json","x-app-session-key":(r=(o=qe.data)==null?void 0:o.data)==null?void 0:r.session_key},je=JSON.stringify({enc_track2_data:`${It}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(w=(a=qe==null?void 0:qe.data)==null?void 0:a.data)==null?void 0:w.session_key}`});try{let Lt=await fi.post(`${cn}tokenizer/tokenize`,je,{headers:xt}),rn=JSON.stringify(M(C({},(k=Lt==null?void 0:Lt.data)==null?void 0:k.data),{cvv:y==null?void 0:y.cvv,cardName:y==null?void 0:y.cardName,zip:y==null?void 0:y.zipCode,userId:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey})),Gn={"Content-Type":"application/json"};try{let Vt=await fi.post(`${et}add-card`,rn,{headers:Gn});console.log(Vt),(P=Vt==null?void 0:Vt.data)!=null&&P.result&&(z(!0),Me(),ei(h,"close",""))}catch(Vt){Me(),W(((x=(H=Vt==null?void 0:Vt.response)==null?void 0:H.data)==null?void 0:x.message)||(Vt==null?void 0:Vt.message)||"Something went wrong.")}}catch(Lt){Me(),W(((F=(p=Lt==null?void 0:Lt.response)==null?void 0:p.data)==null?void 0:F.message)||(Lt==null?void 0:Lt.message)||"Something went wrong.")}}catch(qe){Me(),W(((Se=(Ke=qe==null?void 0:qe.response)==null?void 0:Ke.data)==null?void 0:Se.message)||(qe==null?void 0:qe.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(Fe==null?void 0:Fe.dctoken,"creditCardForm",T)}catch(T){Me(),W(((zt=(Nt=T==null?void 0:T.response)==null?void 0:Nt.data)==null?void 0:zt.message)||(T==null?void 0:T.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:(y==null?void 0:y.cardNumber)||"",onChange:h=>se(h),ref:E}),(O==null?void 0:O.cardNumber)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},O==null?void 0:O.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:(y==null?void 0:y.expiryMonth)||"",onChange:h=>Te("expiryMonth",h.target.value),ref:L}),(O==null?void 0:O.expiryMonth)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},O==null?void 0:O.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:(y==null?void 0:y.expiryYear)||"",onChange:h=>Te("expiryYear",h.target.value),ref:Z}),(O==null?void 0:O.expiryYear)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},O==null?void 0:O.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:(y==null?void 0:y.cvv)||"",onChange:h=>Te("cvv",h.target.value),ref:ie}),(O==null?void 0:O.cvv)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},O==null?void 0:O.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:(y==null?void 0:y.cardName)||"",onChange:h=>{let S=h.target.value;/^[a-zA-Z\s]*$/.test(S)&&Te("cardName",S)},ref:N}),(O==null?void 0:O.cardName)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},O==null?void 0:O.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:(an=y==null?void 0:y.zipCode)!=null?an:"",onChange:h=>Te("zipCode",h.target.value)}),(O==null?void 0:O.zipCode)&&Ne.createElement("span",{className:"error-span",style:{color:"red",fontSize:"12px"}},O==null?void 0:O.zipCode))),Ne.createElement("input",{type:"submit",className:"idle-green-btn w-100",defaultValue:"Submit"})))))}import Y,{useState as hi}from"react";import Fi from"axios";var Ei={PROPAYKEY:"25",PAYARCKEY:"26",STRIPEKEYCC:"27",PAYRIXKEY:"28",SKYFIACHKEY:"29",JUSTIFIKEY:"30",INFINICEPTKEY:"31",FRACTALKEY:"32"};import fr from"react";function ea({}){return fr.createElement("style",null,`
|
|
2081
|
-
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap");
|
|
2082
|
-
|
|
2083
|
-
.creditformbox {
|
|
2084
|
-
// max-width: 550px;
|
|
2085
|
-
margin: 0 auto;
|
|
2086
|
-
font-family: Poppins !important;
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
.name-row {
|
|
2090
|
-
display: grid;
|
|
2091
|
-
grid-gap: 10px;
|
|
2092
|
-
grid-template-columns:1fr 1fr;
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
label {
|
|
2096
|
-
display: block;
|
|
2097
|
-
color: #383838;
|
|
2098
|
-
font-size: 16px;
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
.form-group span.text-danger{
|
|
2102
|
-
color:red;
|
|
2103
|
-
}
|
|
2104
|
-
.form-group small.error{
|
|
2105
|
-
color:red;
|
|
2106
|
-
font-size:11px;
|
|
2107
|
-
}
|
|
2108
|
-
.name-row .form-group {
|
|
2109
|
-
display: block;
|
|
2110
|
-
width: 100%;
|
|
2111
|
-
margin-bottom: 15px;
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
|
-
.creditformbox input, .creditformbox select {
|
|
2115
|
-
border: 1.25px solid rgba(234, 236, 239, 1);
|
|
2116
|
-
color: rgba(94, 94, 94, 0.75);
|
|
2117
|
-
border-radius: 10px;
|
|
2118
|
-
width: -webkit-fill-available;
|
|
2119
|
-
padding: 10px 12px;
|
|
2120
|
-
font-size: .875rem;
|
|
2121
|
-
min-height: 20px;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
.form-pay-row {
|
|
2125
|
-
display: block;
|
|
2126
|
-
width: 100%;
|
|
2127
|
-
}
|
|
2128
|
-
|
|
2129
|
-
.form-pay-row .form-group {
|
|
2130
|
-
display: block;
|
|
2131
|
-
width: 100%;
|
|
2132
|
-
margin-bottom: 15px;
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
.card-pay-row {
|
|
2136
|
-
display: flex;
|
|
2137
|
-
width: 100%;
|
|
2138
|
-
gap: 10px;
|
|
2139
|
-
flex-wrap: wrap;
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
.card-pay-row .form-group {
|
|
2143
|
-
flex: 1;
|
|
2144
|
-
margin-bottom: 15px;
|
|
2145
|
-
min-width: 100px;
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
.creditformbox input:focus {
|
|
2149
|
-
color: #212529;
|
|
2150
|
-
background-color: #fff;
|
|
2151
|
-
border-color: #86b7fe;
|
|
2152
|
-
outline: 0;
|
|
2153
|
-
box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
.checks-row{
|
|
2157
|
-
display:flex;
|
|
2158
|
-
align-items:start;
|
|
2159
|
-
gap:10px
|
|
2160
|
-
}
|
|
2161
|
-
.checks-row input {
|
|
2162
|
-
border: 1.25px solid rgba(234, 236, 239, 1);
|
|
2163
|
-
color: rgba(94, 94, 94, 0.75);
|
|
2164
|
-
border-radius: 10px;
|
|
2165
|
-
min-width: 16px !important;
|
|
2166
|
-
width:16px !important;
|
|
2167
|
-
padding: 10px 12px;
|
|
2168
|
-
font-size: .875rem;
|
|
2169
|
-
max-height: 16px !important;
|
|
2170
|
-
height: 16px !important;
|
|
2171
|
-
}
|
|
2172
|
-
// .checks-row input.is-valid:checked{
|
|
2173
|
-
// background-color: #198754;
|
|
2174
|
-
// border-color: #198754;
|
|
2175
|
-
// background-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e);
|
|
2176
|
-
// }
|
|
2177
|
-
.check-error{
|
|
2178
|
-
color:red;
|
|
2179
|
-
font-size:11px;
|
|
2180
|
-
padding-left:25px
|
|
2181
|
-
}
|
|
2182
|
-
.button-row{
|
|
2183
|
-
display: flex;
|
|
2184
|
-
width: 100%;
|
|
2185
|
-
gap: 10px;
|
|
2186
|
-
flex-wrap: wrap;
|
|
2187
|
-
margin-top: 20px !important
|
|
2188
|
-
}
|
|
2189
|
-
.button-row .btn{
|
|
2190
|
-
flex: 1;
|
|
2191
|
-
margin-top:20px;
|
|
2192
|
-
}
|
|
2193
|
-
|
|
2194
|
-
.cancelbtn {
|
|
2195
|
-
font-size:15px;
|
|
2196
|
-
color: #000000 !important;
|
|
2197
|
-
background-color: transparent !important;
|
|
2198
|
-
background: transparent !important;
|
|
2199
|
-
border:1px solid #000000 !important;
|
|
2200
|
-
border-radius: 10px !important;
|
|
2201
|
-
padding: 10px 25px !important;
|
|
2202
|
-
cursor:pointer;
|
|
2203
|
-
font-size: 16px;
|
|
2204
|
-
}
|
|
2205
|
-
.cancelbtn:hover {
|
|
2206
|
-
background:#000000 !important;
|
|
2207
|
-
color:#ffffff !important;
|
|
2208
|
-
}
|
|
2209
|
-
|
|
2210
|
-
.savebtn {
|
|
2211
|
-
font-size:15px;
|
|
2212
|
-
color: #2979FF;
|
|
2213
|
-
background-color: transparent;
|
|
2214
|
-
background: transparent;
|
|
2215
|
-
border:1px solid #2979FF;
|
|
2216
|
-
border-radius: 10px;
|
|
2217
|
-
padding: 10px 25px;
|
|
2218
|
-
cursor:pointer;
|
|
2219
|
-
font-size: 16px;
|
|
2220
|
-
}
|
|
2221
|
-
.savebtn:hover {
|
|
2222
|
-
background:#2979FF;
|
|
2223
|
-
color:#ffffff;
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
|
-
.toggle-label {
|
|
2227
|
-
position: relative;
|
|
2228
|
-
display: inline-block;
|
|
2229
|
-
width: 40px;
|
|
2230
|
-
height: 24px;
|
|
2231
|
-
background-color: #ccc;
|
|
2232
|
-
border-radius: 12px;
|
|
2233
|
-
cursor: pointer;
|
|
2234
|
-
transition: background-color 0.3s;
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
.toggle-label::before {
|
|
2238
|
-
content: "";
|
|
2239
|
-
position: absolute;
|
|
2240
|
-
top: 2px;
|
|
2241
|
-
left: 2px;
|
|
2242
|
-
width: 20px;
|
|
2243
|
-
height: 20px;
|
|
2244
|
-
background: #ffffff;
|
|
2245
|
-
border-radius: 50%;
|
|
2246
|
-
transition: left 300ms linear;
|
|
2247
|
-
}
|
|
2248
|
-
|
|
2249
|
-
.toggle-checkbox {
|
|
2250
|
-
display: none;
|
|
2251
|
-
}
|
|
2252
|
-
|
|
2253
|
-
.toggle-checkbox:checked + .toggle-label {
|
|
2254
|
-
background-color: #4caf50;
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
|
-
.toggle-checkbox:checked + .toggle-label::before {
|
|
2258
|
-
left: 18px;
|
|
2259
|
-
}
|
|
2260
|
-
.pass-fee-toggle-div {
|
|
2261
|
-
display: flex;
|
|
2262
|
-
align-items: center;
|
|
2263
|
-
gap: 10px;
|
|
2264
|
-
padding-top: 10px;
|
|
2265
|
-
}
|
|
2266
|
-
`)}function hr({session_token:e,callback:t,isloading:$,onCancel:I,showChecks:z,merchantName:q,signCheckbox:W,checkedSignCheckbox:G,onCheckSign:ye,cancelbtnClass:E,savebtnClass:L,inputClass:Z,isDual:ie}){var o;let[N,y]=hi(!1),[D,O]=hi(!1),[b,Fe]=hi(),[_,tt]=hi({}),[Me,oe]=hi(""),Le=()=>y(!0),bt=()=>y(!1),[ke,Te]=hi(!1),se=()=>{var P,H,x,p,F,Ke,Se,Nt;let r={},a=b,w=parseInt((a==null?void 0:a.expiryMonth)||"",10),k=(a==null?void 0:a.expiryYear)||"";return(P=a==null?void 0:a.firstName)!=null&&P.trim()||(r.firstName="Please enter a first name."),(H=a==null?void 0:a.lastName)!=null&&H.trim()||(r.lastName="Please enter a last name."),(x=a==null?void 0:a.cardNumber)!=null&&x.trim()||(r.cardNumber="Please enter a card number."),(p=a==null?void 0:a.expiryMonth)!=null&&p.trim()?(Number(a==null?void 0:a.expiryMonth)>12||Number(a==null?void 0:a.expiryMonth)<1)&&(r.expiryMonth="Invalid Expiration Month."):r.expiryMonth="Please enter an expiry month.",(F=a==null?void 0:a.expiryYear)!=null&&F.trim()?((Ke=a==null?void 0:a.expiryYear)==null?void 0:Ke.trim().length)!==4||Number(a==null?void 0:a.expiryYear)<2025?r.expiryYear="Invalid Expiration Year.":(isNaN(w)||w<1||w>12||k.length!==4)&&(r.expiryMonth="Invalid Expiration Date."):r.expiryYear="Please enter an expiry year.",(Se=a==null?void 0:a.cvv)!=null&&Se.trim()||(r.cvv="Please enter a CVV."),(Nt=a==null?void 0:a.zipCode)!=null&&Nt.trim()||(r.zipCode="Please enter a zip code."),W&&!G&&(r.checkSign="You must authorize this before proceeding."),z&&!(a!=null&&a.authHold)&&(r.authHold="You must authorize this before proceeding."),z&&!(a!=null&&a.authorise)&&(r.authorise="Please confirm your authorization to continue."),tt(r),Object.keys(r).length>0},Ee=r=>{var H;let a=r.target,w=a.value.replace(/\D/g,""),{formatted:k,cursor:P}=In(a.value,(H=a.selectionStart)!=null?H:0);tt(x=>M(C({},x),{cardNumber:""})),Fe(x=>M(C({},x),{cardNumber:k})),requestAnimationFrame(()=>{a.setSelectionRange(P,P)})},Ue=(r,a)=>{let w=r;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(w)){(a===""||/^[0-9]+$/.test(a))&&(tt(P=>M(C({},P),{[w]:""})),Fe(P=>M(C({},P),{[w]:a})));return}tt(P=>M(C({},P),{[w]:""})),Fe(P=>M(C({},P),{[w]:a}))},hn=()=>{let r=DatacapWebToken.validateCardNumber(b==null?void 0:b.cardNumber.replaceAll(" ","")),a=DatacapWebToken.validateExpirationDate(b==null?void 0:b.expiryMonth,b==null?void 0:b.expiryYear),w=DatacapWebToken.validateCVV(b==null?void 0:b.cvv),k={};return r||(k.cardNumber="Invalid card Number"),a||(k.expiryMonth="Invalid Expiration Date."),w||(k.cvv="Invalid CVV"),tt(k),r&&w&&a},an=async r=>{var a,w;if(r.Error)oe(r.Error),bt();else{let k={token:r.Token,resp:r},P=await Fi.post(`${Ie}api/v1/gateway/update/token/${e}`,k);if((P==null?void 0:P.status)==200){let H=C(C({Token:(w=(a=P==null?void 0:P.data)==null?void 0:a.data)==null?void 0:w.gateway_token,Brand:r.Brand,ExpirationMonth:r.ExpirationMonth,ExpirationYear:r.ExpirationYear,Last4:r.Last4,Bin:r.Bin,CVV:r.CVV,postalCode:b==null?void 0:b.zipCode},z&&{authHold:b==null?void 0:b.authHold}),z&&{authorise:b==null?void 0:b.authorise});bt(),t(H)}}},h=async()=>{var r,a,w,k,P,H,x,p,F,Ke,Se,Nt,zt,St;try{let mt={method:"POST",redirect:"follow"},Be=await Fi.post(`${Ie}api/v1/widget/generate-session`,mt),re=Number(b==null?void 0:b.expiryYear)%100,_e=`${(r=b==null?void 0:b.cardNumber)==null?void 0:r.replace(/\s+/g,"")}=${re}${b==null?void 0:b.expiryMonth} ${b==null?void 0:b.cvv}`,ae=forge.pki.publicKeyFromPem((w=(a=Be==null?void 0:Be.data)==null?void 0:a.data)==null?void 0:w.publicKeyPem).encrypt(_e,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),ft=forge.util.encode64(ae),ut={"Content-Type":"application/json","x-app-session-key":(P=(k=Be.data)==null?void 0:k.data)==null?void 0:P.session_key},_t=JSON.stringify({enc_track2_data:ft,algorithm:"RSAES_OAEP_SHA_1",session_key:(x=(H=Be==null?void 0:Be.data)==null?void 0:H.data)==null?void 0:x.session_key}),A=await Fi.post(`${cn}tokenizer/tokenize`,_t,{headers:ut});if((A==null?void 0:A.status)==200){let It=(F=(p=A==null?void 0:A.data)==null?void 0:p.data)==null?void 0:F.token;try{let xt=await Fi.post(`${Ie}api/v1/gateway/verify-and-save/${e}`,{token:It});if((xt==null?void 0:xt.status)==200){let je=(Ke=xt==null?void 0:xt.data)==null?void 0:Ke.data,Lt={Token:je.gateway_token,Brand:je.card_data.brand,ExpirationMonth:je.card_data.expire_mm,ExpirationYear:je.card_data.expire_yy,Last4:je.card_data.last4,Bin:je.card_data.bin,postalCode:b==null?void 0:b.zipCode};bt(),t(Lt)}}catch(xt){console.log(xt,"error"),bt()}}}catch(mt){let Be="Something went wrong!";try{let re=((Se=mt==null?void 0:mt.response)==null?void 0:Se.data)||(mt==null?void 0:mt.message)||"",T=typeof re=="string"?re:JSON.stringify(re),qe=(((zt=(Nt=T.split)==null?void 0:Nt.call(T,`
|
|
2267
|
-
`))==null?void 0:zt.filter(Boolean))||[]).at(-1)||"",ae=(St=qe.split)==null?void 0:St.call(qe,": ");Be=(ae==null?void 0:ae.length)>1?ae.pop().trim():qe.trim()||Be}catch(re){Be="Something went wrong!"}bt(),oe(Be)}},S=async r=>{var k,P,H,x,p,F,Ke;if(r.preventDefault(),!(se()||!hn())){Le();try{let Se=await Fi.get(`${Ie}api/v1/gateway/token/${e}`,{params:{pass_fee:ke}});if((Se==null?void 0:Se.status)==200){let Nt=(P=(k=Se==null?void 0:Se.data)==null?void 0:k.data)==null?void 0:P.gateway_token;((x=(H=Se==null?void 0:Se.data)==null?void 0:H.data)==null?void 0:x.paymentGateway)==((p=Ei)==null?void 0:p.FRACTALKEY)?await h():DatacapWebToken.requestToken(Nt,"creditCardForm",an)}}catch(Se){bt(),oe(((Ke=(F=Se==null?void 0:Se.response)==null?void 0:F.data)==null?void 0:Ke.message)||"Something went wrong!")}}},u=()=>{oe("")},me=()=>{oe(""),Fe({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:"",authHold:!1,authorise:!1,checkSign:!1}),I()};return console.log(ke,"aoapoaa"),Y.createElement(Y.Fragment,null,Y.createElement(Fn,null),Y.createElement(ea,null),Y.createElement(mn,{loading:N||$}),Me&&Y.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},Y.createElement(Tn,{error:Me,onClose:u})),!Me&&Y.createElement("div",{className:"creditformbox"},Y.createElement("form",{id:"creditCardForm",onSubmit:S,onKeyDown:r=>{r.key==="Enter"&&N&&(r.preventDefault(),r.stopPropagation())}},Y.createElement("div",{className:"name-row"},Y.createElement("div",{className:"form-group"},Y.createElement("label",null," First Name ",Y.createElement("span",{className:"text-danger"},"*")),Y.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(b==null?void 0:b.firstName)||"",onChange:r=>{let a=r.target.value;/^[a-zA-Z\s]*$/.test(a)&&Ue("firstName",a)},className:Z}),(_==null?void 0:_.firstName)&&Y.createElement("small",{className:"error"},_==null?void 0:_.firstName)),Y.createElement("div",{className:"form-group"},Y.createElement("label",null," Last Name ",Y.createElement("span",{className:"text-danger"},"*")),Y.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(b==null?void 0:b.lastName)||"",onChange:r=>{let a=r.target.value;/^[a-zA-Z\s]*$/.test(a)&&Ue("lastName",a)},className:Z}),(_==null?void 0:_.lastName)&&Y.createElement("small",{className:"error"},_==null?void 0:_.lastName))),Y.createElement("div",{className:"form-pay-row"},Y.createElement("div",{className:"form-group"},Y.createElement("label",null," Card Number ",Y.createElement("span",{className:"text-danger"},"*")),Y.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(b==null?void 0:b.cardNumber)||"",onChange:r=>Ee(r),className:Z}),(_==null?void 0:_.cardNumber)&&Y.createElement("small",{className:"error"},_==null?void 0:_.cardNumber))),Y.createElement("div",{className:"card-pay-row"},Y.createElement("div",{className:"form-group"},Y.createElement("label",null," Exp Month ",Y.createElement("span",{className:"text-danger"},"*")),Y.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(b==null?void 0:b.expiryMonth)||"",onChange:r=>Ue("expiryMonth",r.target.value),className:Z}),(_==null?void 0:_.expiryMonth)&&Y.createElement("small",{className:"error"},_==null?void 0:_.expiryMonth)),Y.createElement("div",{className:"form-group"},Y.createElement("label",null," Exp Year ",Y.createElement("span",{className:"text-danger"},"*")),Y.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(b==null?void 0:b.expiryYear)||"",onChange:r=>Ue("expiryYear",r.target.value),className:Z}),(_==null?void 0:_.expiryYear)&&Y.createElement("small",{className:"error"},_==null?void 0:_.expiryYear)),Y.createElement("div",{className:"form-group"},Y.createElement("label",null," CVV ",Y.createElement("span",{className:"text-danger"},"*")),Y.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(b==null?void 0:b.cvv)||"",onChange:r=>Ue("cvv",r.target.value),className:Z}),(_==null?void 0:_.cvv)&&Y.createElement("small",{className:"error"},_==null?void 0:_.cvv)),Y.createElement("div",{className:"form-group"},Y.createElement("label",null," Zip ",Y.createElement("span",{className:"text-danger"},"*")),Y.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(o=b==null?void 0:b.zipCode)!=null?o:"",onChange:r=>Ue("zipCode",r.target.value),className:Z}),(_==null?void 0:_.zipCode)&&Y.createElement("small",{className:"error"},_==null?void 0:_.zipCode))),ie&&Y.createElement("div",{className:"pass-fee-toggle-div"},Y.createElement("input",{type:"checkbox",id:"pass_fee",className:"toggle-checkbox",checked:ke,onChange:r=>{Te(r.target.checked)}}),Y.createElement("label",{htmlFor:"pass_fee",className:"toggle-label"}),Y.createElement("label",{htmlFor:"save_card"},"Cash Discount")),W&&Y.createElement("div",{className:"checks-row"},Y.createElement("input",{name:"discalosure",type:"checkbox",id:"disclosureCheck",checked:G,onChange:r=>ye(r.target.checked)}),Y.createElement("label",{htmlFor:"disclosureCheck",className:"form-check-label"},"Please agree to the following in order to add Payment method.")),W&&(_==null?void 0:_.checkSign)&&Y.createElement("small",{className:"check-error"},_==null?void 0:_.checkSign),z&&Y.createElement(Y.Fragment,null,Y.createElement("div",{className:"checks-row"},Y.createElement("input",{name:"authHold",type:"checkbox",id:"authHold",checked:!!(b!=null&&b.authHold),onChange:r=>Ue("authHold",r.target.checked)}),Y.createElement("label",{htmlFor:"authHold",className:"form-check-label"},"To securely save your card on file, we will place a temporary authorization hold of $1.00. This is not a charge and will be released by your card issuer shortly after verification.")),(_==null?void 0:_.authHold)&&Y.createElement("small",{className:"check-error"},_==null?void 0:_.authHold),Y.createElement("div",{className:"checks-row "},Y.createElement("input",{name:"authorise",type:"checkbox",id:"authorise",checked:!!(b!=null&&b.authorise),onChange:r=>Ue("authorise",r.target.checked)}),Y.createElement("label",{htmlFor:"authorise",className:"form-check-label see-more"},D?Y.createElement(Y.Fragment,null,Y.createElement("span",null,"By providing your payment information, you authorize"," ",Y.createElement("strong",null,q),", a Sky Systemz merchant, to securely store your card on file for future payments. Your card information will be encrypted and stored in compliance with PCI-DSS (Payment Card Industry Data Security Standard) regulations using Sky Systemz\u2019s secure payment technology. This information will be used solely for transactions you authorize with"," ",Y.createElement("strong",null,q),". You may request the removal of your stored payment information at any time by contacting"," ",Y.createElement("strong",null,q)," directly. By signing or proceeding with this transaction, you acknowledge and agree to this card on file authorization.",Y.createElement("a",{href:"#",onClick:r=>{r.preventDefault(),O(!1)}},"See less ..."))):Y.createElement(Y.Fragment,null,Y.createElement("span",null,"By providing your payment information, you authorize ",q,", a Sky Systemz merchant, to securely store your card on file for future pay..."," "),Y.createElement("a",{href:"#",onClick:r=>{r.preventDefault(),O(!0)}},"See more ...")))),(_==null?void 0:_.authorise)&&Y.createElement("small",{className:"check-error"},_==null?void 0:_.authorise)),Y.createElement("div",{className:"button-row"},Y.createElement("button",{className:`cancelbtn ${E} `,type:"button",onClick:me},"Cancel"),Y.createElement("button",{className:`savebtn ${L} `,type:"submit"},"Save")))))}import n,{useEffect as Ki,useRef as yr,useState as kt}from"react";import Mi from"axios";import Li from"sweetalert2";import{IoArrowBack as Zi}from"react-icons/io5";import{NumericFormat as br}from"react-number-format";function xr(e){var Et,jt,on,sn,ln,dn,yn,Cn,Zt,Ze,Wt,v,f,Q,he,ce,Ye,ge,nt,ht,Pt,Qt;let t=yr(null);Ki(()=>{e.onTriggerPay&&e.onTriggerPay(()=>{qn()})},[e]);let $=R+"widget/mc-img.svg",I=R+"widget/visa-img.svg",z=R+"widget/ae-img.svg",q=R+"widget/discover-img.svg",W=R+"widget/card.svg",G=R+"widget/Trash.svg",ye=R+"widget/bank.svg",E=R+"widget/secure-img.png",L=R+"widget/pov-by.png",Z=R+"widget/pax.svg",[ie,N]=kt(!1),[y,D]=kt(!1),[O,b]=kt(""),[Fe,_]=kt(!1),[tt,Me]=kt(!1),[oe,Le]=kt("card"),[bt,ke]=kt("card"),[Te,se]=kt("form"),[Ee,Ue]=kt("form"),[hn,an]=kt(!0),[h,S]=kt(!1),[u,me]=kt(!1),o=e.merchantPublicKey,[r,a]=kt(),[w,k]=kt({}),[P,H]=kt(),[x,p]=kt({}),[F,Ke]=kt([]),[Se,Nt]=kt([]),[zt,St]=kt(),[mt,Be]=kt(),[re,T]=kt(Number(e==null?void 0:e.amount)),[_e,qe]=kt(Number(e==null?void 0:e.amount)),[ae,ft]=kt(""),[ut,_t]=kt("");console.log(ae,"partialAmount");let[A,It]=kt(),[xt,je]=kt(""),Lt=()=>N(!0),rn=()=>N(!1),Gn=(g,d)=>{let ee=(parseFloat(d)||0)/100;return g-g*ee},Vt=(g,d)=>{let ee=(Number(d)||0)/100;return+g+ +(g*ee)};Ki(()=>{tt&&(e!=null&&e.pass_fee?(qe(Number(e==null?void 0:e.amount)),T(Number(e==null?void 0:e.cashDiscount))):(qe(Number(e==null?void 0:e.amount)),T(Number(e==null?void 0:e.amount))))},[tt,e==null?void 0:e.pass_fee,e==null?void 0:e.amount,e==null?void 0:e.surcharge]);let vn=()=>{Me(!1),Le("card"),b(""),_(!1),je(""),H({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),p({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),a({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),k({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),me(!1),S(!1),St({card_type:"",cardlastfourdigit:"",expmonth:1,expyear:2025,primary_card:0,firstname:"",id:"",lastname:""}),Be({}),T(0),ke("card"),an(!0),Ue("form"),se("form"),D(!1),N(!1),Nt([]),Ke([]),ft(""),_t("")},qn=()=>Me(!0),An=g=>{Le(g)},zn=(g,d)=>{let ee=g;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(ee)){(d===""||/^[0-9]+$/.test(d))&&(k(te=>M(C({},te),{[ee]:""})),a(te=>M(C({},te),{[ee]:d})));return}k(te=>M(C({},te),{[ee]:""})),a(te=>M(C({},te),{[ee]:d}))},J=g=>{var Pe;let d=g.target,ee=d.value.replace(/\D/g,""),{formatted:Ae,cursor:te}=In(d.value,(Pe=d.selectionStart)!=null?Pe:0);k(rt=>M(C({},rt),{cardNumber:""})),a(rt=>M(C({},rt),{cardNumber:Ae})),requestAnimationFrame(()=>{d.setSelectionRange(te,te)})},j=g=>{let{name:d,value:ee}=g.target,Ae=["routingNumber","accountNumber","confirmAccountNumber"];if(d=="name"){/^[a-zA-Z\s]*$/.test(ee)&&(p(te=>M(C({},te),{[d]:""})),H(te=>M(C({},te),{[d]:ee})));return}if(Ae.includes(d)){(ee===""||/^[0-9]+$/.test(ee))&&(p(te=>M(C({},te),{[d]:""})),H(te=>M(C({},te),{[d]:ee})));return}p(te=>M(C({},te),{[d]:""})),H(te=>M(C({},te),{[d]:ee}))},Xe=()=>{var te,Pe,rt,xe,pe,De;let g={},d=r,ee=parseInt((d==null?void 0:d.expiryMonth)||"",10),Ae=(d==null?void 0:d.expiryYear)||"";if((te=d==null?void 0:d.cardName)!=null&&te.trim()||(g.cardName="Card name is required"),(Pe=d==null?void 0:d.cardNumber)!=null&&Pe.trim()||(g.cardNumber="Card number is required"),(!((rt=d==null?void 0:d.expiryMonth)!=null&&rt.trim())||!((xe=d==null?void 0:d.expiryYear)!=null&&xe.trim())||isNaN(ee)||ee<1||ee>12||Ae.length!==4)&&(g.expiryMonth="Invalid Expiration Date."),(pe=d==null?void 0:d.cvv)!=null&&pe.trim()||(g.cvv="CVV is required"),(De=d==null?void 0:d.zipCode)!=null&&De.trim()||(g.zipCode="ZIP code is required"),d!=null&&d.expiryMonth&&(d!=null&&d.expiryYear)&&d.expiryMonth.length<=2&&d.expiryYear.length===4){let it=parseInt(d.expiryMonth,10),Ce=parseInt(d.expiryYear,10),at=new Date,ve=at.getMonth()+1,yt=at.getFullYear();(Ce<yt||Ce===yt&&it<ve)&&(g.expiryMonth="Card is expired")}return k(g),Object.keys(g).length>0},Yt=()=>{var ee,Ae,te,Pe,rt,xe,pe,De;let g={},d=P;return(ee=d==null?void 0:d.name)!=null&&ee.trim()||(g.name="Name is required"),(Ae=d==null?void 0:d.accountNumber)!=null&&Ae.trim()||(g.accountNumber="Account number is required"),(te=d==null?void 0:d.accountNumber)!=null&&te.trim()&&((Pe=d==null?void 0:d.accountNumber)==null?void 0:Pe.trim())!==((rt=d==null?void 0:d.confirmAccountNumber)==null?void 0:rt.trim())&&(g.confirmAccountNumber="Account numbers must match"),(xe=d==null?void 0:d.bankName)!=null&&xe.trim()||(g.bankName="Bank name is required"),(pe=d==null?void 0:d.routingNumber)!=null&&pe.trim()||(g.routingNumber="Routing Number is required"),d!=null&&d.routingNumber&&((De=d==null?void 0:d.routingNumber)==null?void 0:De.length)!==9&&(g.routingNumber="Routing number must be 9 digits"),((d==null?void 0:d.accountType)==="business saving"||(d==null?void 0:d.accountType)==="business checking")&&(!(d!=null&&d.companyName)||(d==null?void 0:d.companyName)==="")&&(g.companyName="Company Name is required for business accounts"),p(g),Object.keys(g).length>0},Je=async g=>{var d,ee,Ae,te,Pe,rt,xe,pe,De,it,Ce,at,ve,yt,ot;if(g.preventDefault(),!ut)if(oe!=="ach"){if(Xe())return;{let pt=DatacapWebToken.validateCardNumber(r==null?void 0:r.cardNumber.replaceAll(" ","")),Ve=DatacapWebToken.validateExpirationDate(r==null?void 0:r.expiryMonth,r==null?void 0:r.expiryYear),Yn=DatacapWebToken.validateCVV(r==null?void 0:r.cvv),_n={};if(pt||(_n.cardNumber="Invalid card Number"),Ve||(_n.expiryMonth="Invalid Expiration Date."),Yn||(_n.cvv="Invalid CVV"),k(_n),pt&&Yn&&Ve){D(!0);try{let bn=async function(Rt){var st,le;if(Rt.Error)b(Rt.Error),D(!1);else{let en=r==null?void 0:r.cardName,wn=r==null?void 0:r.zipCode;Rt.name=en,Rt.postal_code=wn,Rt.isCardSave=`${h}`,Rt.isCharge=!0,Rt.posSalesIdEncode=(st=A==null?void 0:A.orderDetails)==null?void 0:st.orderId,Rt.partial_amount=ae&&!ut?ae:_e,Bt.emit("sendMessage",Rt);let Nn=(le=A==null?void 0:A.orderDetails)==null?void 0:le.orderId;Bt.on(Nn,$n=>{if(ci($n==null?void 0:$n.data)){let Kt=JSON.parse($n.data);Kt!=null&&Kt.result?(a({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),S(!1),je(Kt==null?void 0:Kt.transactionId),_(!0),D(!1)):(D(!1),b((Kt==null?void 0:Kt.message)||"Something went wrong."))}else b("Something went wrong.")})}};if((A==null?void 0:A.paymentGateway)===32){let Rt={method:"POST",redirect:"follow"};try{let st=await Mi.post(`${Ie}api/v1/widget/generate-session`,Rt),le=Number(r==null?void 0:r.expiryYear)%100,en=r==null?void 0:r.cardNumber;en=en==null?void 0:en.replace(/\s+/g,"");let wn=`${en}=${le}${r==null?void 0:r.expiryMonth} ${r==null?void 0:r.cvv}`,$n=forge.pki.publicKeyFromPem((ee=(d=st==null?void 0:st.data)==null?void 0:d.data)==null?void 0:ee.publicKeyPem).encrypt(wn,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Kt=forge.util.encode64($n),ti={"Content-Type":"application/json","x-app-session-key":(te=(Ae=st.data)==null?void 0:Ae.data)==null?void 0:te.session_key},kn=JSON.stringify({enc_track2_data:`${Kt}`,algorithm:"RSAES_OAEP_SHA_1",session_key:`${(rt=(Pe=st==null?void 0:st.data)==null?void 0:Pe.data)==null?void 0:rt.session_key}`});try{let pn=await Mi.post(`${cn}tokenizer/tokenize`,kn,{headers:ti}),Ai=JSON.stringify(M(C({},(xe=pn==null?void 0:pn.data)==null?void 0:xe.data),{isSaveCardChecked:h,name:r==null?void 0:r.cardName,postal_code:r==null?void 0:r.zipCode,customer_id:e==null?void 0:e.customerId,partial_amount:ae&&!ut?ae:_e})),zi=JSON.stringify({pre_sales_id:`${(pe=A==null?void 0:A.orderDetails)==null?void 0:pe.orderId}`,token:`${(De=pn==null?void 0:pn.data)==null?void 0:De.data.token}`,json_response:`${Ai}`}),Ii={method:"POST",headers:JSON.stringify({"Content-Type":"application/json"}),body:zi,redirect:"follow",isChargeviafractal:!0};Bt.emit("sendMessage",Ii),Bt.on("chargeviafractalgateway",Qn=>{var xi;if(ci(Qn==null?void 0:Qn.data)){let s=JSON.parse(Qn==null?void 0:Qn.data);s!=null&&s.result?(je((xi=s==null?void 0:s.data)==null?void 0:xi.transactionId),_(!0),D(!1)):(D(!1),b((s==null?void 0:s.message)||"Something went wrong."))}else b("Something went wrong.")})}catch(pn){D(!1),b(((Ce=(it=pn==null?void 0:pn.response)==null?void 0:it.data)==null?void 0:Ce.message)||(pn==null?void 0:pn.message)||"Something went wrong.")}}catch(st){D(!1),b(((ve=(at=st==null?void 0:st.response)==null?void 0:at.data)==null?void 0:ve.message)||(st==null?void 0:st.message)||"Something went wrong.")}}else typeof DatacapWebToken!="undefined"&&DatacapWebToken.requestToken(A==null?void 0:A.dctoken,"PaymentForm",bn)}catch(bn){D(!1),b(((ot=(yt=bn==null?void 0:bn.response)==null?void 0:yt.data)==null?void 0:ot.message)||(bn==null?void 0:bn.message)||"Something went wrong.")}}}}else{if(Yt())return;{D(!0);let pt={fractalpayPublicKey:o,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:ae&&!ut?ae:String(re||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};Bt.emit("sendMessage",pt),Bt.on("ach-incoming",Ve=>{var Yn;(Ve==null?void 0:Ve.status)=="Failed"?typeof(Ve==null?void 0:Ve.message)=="object"?Object.values(Ve==null?void 0:Ve.message).forEach(_n=>{b(_n||"Something went wrong")}):b((Ve==null?void 0:Ve.message)||"Something went wrong"):(je((Yn=Ve==null?void 0:Ve.data)==null?void 0:Yn.transaction_id),_(!0),D(!1))})}}},gt=async()=>{var g,d,ee,Ae,te,Pe,rt,xe,pe,De,it,Ce,at,ve,yt,ot,Xt,pt,Ve,Yn,_n,bn,Rt;Lt();try{let st={fractalpayPublicKey:o,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 Mi.post(`${et}get-payment-details`,st);if(It((g=le==null?void 0:le.data)==null?void 0:g.data),(ee=(d=le==null?void 0:le.data)==null?void 0:d.data)!=null&&ee.paymentGateway||(vn(),b("Something went wrong.")),(te=(Ae=le==null?void 0:le.data)==null?void 0:Ae.data)!=null&&te.card_list&&((xe=(rt=(Pe=le==null?void 0:le.data)==null?void 0:Pe.data)==null?void 0:rt.card_list)==null?void 0:xe.length)>0){let en=(it=(De=(pe=le==null?void 0:le.data)==null?void 0:pe.data)==null?void 0:De.card_list)==null?void 0:it.filter(Nn=>(Nn==null?void 0:Nn.card_type)=="Bank"),wn=(ve=(at=(Ce=le==null?void 0:le.data)==null?void 0:Ce.data)==null?void 0:at.card_list)==null?void 0:ve.filter(Nn=>(Nn==null?void 0:Nn.card_type)!=="Bank");console.log(en,"hohgohoo",wn),(wn==null?void 0:wn.length)>0&&se("list"),(en==null?void 0:en.length)>0&&Ue("list"),Ke(wn),Nt(en)}else Le("card");(ot=(yt=le==null?void 0:le.data)==null?void 0:yt.data)!=null&&ot.paymentDeviceList&&((Ve=(pt=(Xt=le==null?void 0:le.data)==null?void 0:Xt.data)==null?void 0:pt.paymentDeviceList)==null?void 0:Ve.length)>0&&Be((_n=(Yn=le==null?void 0:le.data)==null?void 0:Yn.data)==null?void 0:_n.paymentDeviceList[0]),rn()}catch(st){console.log(st),rn(),b(((Rt=(bn=st==null?void 0:st.response)==null?void 0:bn.data)==null?void 0:Rt.message)||(st==null?void 0:st.message)||"Something went wrong")}},vt=async()=>{let g=e==null?void 0:e.customerId,d=String(e==null?void 0:e.discount),ee=String(e==null?void 0:e.surcharge),Ae=String(e==null?void 0:e.tax),te=e==null?void 0:e.merchantPublicKey,Pe=e==null?void 0:e.orderID,rt=ae&&!ut?ae:String(_e),xe=zt==null?void 0:zt.id,pe=zt==null?void 0:zt.card_type;if(!ut)if(te&&Pe&&rt&&re)if(g)if(xe){let it;ae&&!ut?it=ae:pe==="Bank"?it=re:it=_e;let Ce={amount:it,order_id:Pe,customer_id:g,card_id:xe,fractalpayPublicKey:te,isCardSave:h,discount:d,surcharge:ee,tax:Ae,orderGuid:e==null?void 0:e.orderGuid,pass_fee:e==null?void 0:e.pass_fee,require3ds:!1};ae&&!ut&&pe!=="Bank"&&(Ce.ispartialPayment=!0);let De=Ce,{isCardSave:at}=De,ve=ii(De,["isCardSave"]),ot=et+(pe==="Bank"?"charge-ach":"charge-by-card"),Xt={"Content-Type":"application/json"};D(!0),Bt.emit("sendMessage",{url:ot,body:pe=="Bank"?ve:Ce,isChargebycard:!0}),Bt.on("charge-by-card",pt=>{var Ve;(pt==null?void 0:pt.result)==!0||(pt==null?void 0:pt.status)==!0?(je((Ve=pt.data)==null?void 0:Ve.transaction_id),_(!0),D(!1)):b((pt==null?void 0:pt.message)||"Something went wrong.")})}else b("Please Select A Card/ACH");else b("Please Select Customer");else b("Something went wrong.")},$t=async()=>{var te,Pe,rt,xe,pe,De;let g=e==null?void 0:e.merchantPublicKey,d=e==null?void 0:e.orderID,ee=ae&&!ut?ae:String(_e),Ae=e==null?void 0:e.customerId;if(!(mt!=null&&mt.device_id)){b("Please Select A Payment Device");return}if(g&&d&&ee){D(!0);let it={amount:ee,fractalpayPublicKey:g,customer_order_id:d,device_id:mt==null?void 0:mt.device_id,customer_id:Ae||""};try{let Ce=await Mi.post(`${et}charge-with-reader`,it);((te=Ce==null?void 0:Ce.data)==null?void 0:te.result)==!0?(je((rt=(Pe=Ce==null?void 0:Ce.data)==null?void 0:Pe.data)==null?void 0:rt.transaction_id),_(!0),D(!1)):(b(((xe=Ce==null?void 0:Ce.data)==null?void 0:xe.message)||"Something went wrong."),D(!1))}catch(Ce){b(((De=(pe=Ce==null?void 0:Ce.response)==null?void 0:pe.data)==null?void 0:De.message)||"Something went wrong."),D(!1)}}else b("Something went wrong.")},At=()=>{bt==="card"?vt():bt==="reader"&&$t()};Ki(()=>{tt&&o&>()},[o,tt]);let Ht=async g=>{Li.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async d=>{if(d.isConfirmed){D(!0);try{let ee={card_id:g,customer_id:e==null?void 0:e.customerId,fractalpayPublicKey:e==null?void 0:e.merchantPublicKey},Ae=await Mi.post(`${et}delete-customer-card`,ee);D(!1),gt(),Li.fire({icon:"success",title:"Deleted!",text:"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})}catch(ee){D(!1),Li.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else d.dismiss===Li.DismissReason.cancel&&Li.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},Jt=g=>{switch(g==null?void 0:g.toLowerCase()){case"visa":return I;case"mastercard":case"mc":case"m/c":return $;case"amex":case"american express":case"ae":return z;case"discover":case"dcvr":return q;case"bank":return ye;default:return g}},be=()=>{let g=re||0;return(Number(_e)-g).toFixed(0)};console.log(Te,"activeinCard","activeinBank",Ee);let Ot=g=>{var d,ee,Ae,te;console.log(g,"values"),oe==="ach"?((d=Number(re))==null?void 0:d.toFixed(2))<(g==null?void 0:g.floatValue)||(g==null?void 0:g.floatValue)<=0?(ft(g==null?void 0:g.value),_t(`Partial amount cannot exceed ${fe((ee=Number(re))==null?void 0:ee.toFixed(2))}`)):(ft(g==null?void 0:g.value),_t("")):((Ae=Number(_e))==null?void 0:Ae.toFixed(2))<(g==null?void 0:g.floatValue)||(g==null?void 0:g.floatValue)<=0?(ft(g==null?void 0:g.value),_t(`Partial amount cannot exceed ${fe((te=Number(_e))==null?void 0:te.toFixed(2))}`)):(ft(g==null?void 0:g.value),_t(""))};return Ki(()=>{let g=Number(oe==="ach"?re:_e),d=Number(ae);ae&&(d<=0||d>g)?_t(`Partial amount cannot exceed ${fe(g.toFixed(2))}`):_t("")},[oe,ae,re,_e]),console.log(oe,"activetab"),n.createElement(n.Fragment,null,n.createElement(Fn,null),n.createElement(oi,null),n.createElement(Dn,null),n.createElement(n.Fragment,null,n.createElement("button",{ref:t,style:{display:"none"},className:"paymentBtn",onClick:qn},"Pay"),n.createElement(Sn,{open:tt,onClose:vn},O&&n.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},n.createElement(Tn,{error:O,onClose:vn})),Fe&&n.createElement(si,{onClose:vn,tranId:xt}),!O&&!Fe&&n.createElement(n.Fragment,null,(ie||y)&&n.createElement(mn,{loading:ie||y}),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:vn},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:A==null?void 0:A.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:A==null?void 0:A.logo,id:"pay-logos"})),(F==null?void 0:F.length)>0&&oe!=="cardList"&&n.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>Le("cardList")}," ",n.createElement(Zi,null)," Back")),n.createElement("div",{className:"amt-pay-con"},n.createElement("div",{className:"pay-amount-conatiner"},n.createElement("small",{className:"pay-payment-amount"},"Select payment type")),n.createElement("div",{className:"frac-card-bank-radio-main"},n.createElement(Ln,{label:"Card",amount:(Et=Number(_e))==null?void 0:Et.toFixed(2),value:"card",onChange:An,activetab:oe}),(A==null?void 0:A.isSkyFiAccount)&&n.createElement(Ln,{label:"Bank",amount:(jt=Number(re))==null?void 0:jt.toFixed(2),value:"ach",onChange:An,activetab:oe})),En(A==null?void 0:A.showSurcharge)?re&&re>0&&(e!=null&&e.pass_fee)?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,oe==="card"?"Cash Discount":"Cash Discount Savings"," "),n.createElement("p",null,fe((Number(_e)-re).toFixed(2)))):null:re&&re>0&&(e!=null&&e.pass_fee)&&oe==="card"?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,oe==="card"?"Surcharge":null," "),n.createElement("p",null,fe((Number(_e)-re).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:ae,onValueChange:g=>{Ot(g)},thousandSeparator:!0,placeholder:"Enter partial amount",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0}),ut&&n.createElement("span",{className:"error-span"},ut)))),n.createElement("div",{className:"pay-conatiner-one-last"},n.createElement("img",{src:E,alt:""}),n.createElement("img",{src:L,alt:""}),"Secure payments powered by Fractal")),n.createElement("div",{className:"pay-tab pay-conatiner-two"},!ie&&n.createElement("div",{className:"col-md-12"},n.createElement("div",{id:"payment-form-div"},oe!=="cardList"?n.createElement("div",{className:"frac-charge-payment-back-btn-wrap "},(F==null?void 0:F.length)>0&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Le("cardList")}," ",n.createElement(Zi,null)," Back"),(A==null?void 0:A.isSkyFiAccount)&&n.createElement("div",{className:"tab"},n.createElement("button",{className:"tablinks",onClick:g=>{An("card")},style:{border:oe==="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:g=>{An("ach")},style:{border:oe==="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"},"$",(on=Number(_e))==null?void 0:on.toFixed(2))),oe!="ach"&&n.createElement("div",null,n.createElement("div",null,n.createElement("img",{src:I,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:$,width:35,alt:""})),n.createElement("div",null,n.createElement("img",{src:z,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:q,width:35,alt:""})))),!ie&&En(A==null?void 0:A.showSurcharge)?re&&re>0&&(e!=null&&e.pass_fee)?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,oe==="card"?"Cash Discount":"Cash Discount Savings"," "),n.createElement("p",null,fe((Number(_e)-re).toFixed(2)))):null:re&&re>0&&(e!=null&&e.pass_fee)&&oe==="card"?n.createElement("div",{className:"frac-cash-discount-fee"},n.createElement("small",null,oe==="card"?"Surcharge":null," "),n.createElement("p",null,fe((Number(_e)-re).toFixed(2)))):null):n.createElement("div",null,n.createElement("h6",{className:"charge-customer-name",style:{marginBottom:"16px !important"}}," Charge ",A==null?void 0:A.customer_name),n.createElement("h6",{className:"card-ach-heading",style:{marginBottom:"10px !important"}}," ",bt==="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"},"$",(sn=Number(_e))==null?void 0:sn.toFixed(2))),n.createElement("div",null,n.createElement("div",null,n.createElement("img",{src:I,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:$,width:35,alt:""})),n.createElement("div",null,n.createElement("img",{src:z,alt:"",width:35,style:{paddingRight:"5px"}}),n.createElement("img",{src:q,width:35,alt:""}))))),n.createElement("div",{id:"card",style:{display:oe==="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"},(F==null?void 0:F.length)>0&&Te==="form"&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>se("list")}," ",n.createElement(Zi,null))),n.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),oe!="ach"&&n.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},n.createElement("img",{src:I,alt:"",width:33}),n.createElement("img",{src:$,width:33,alt:""}),n.createElement("img",{src:z,alt:"",width:33}),n.createElement("img",{src:q,width:33,alt:""}))),Te==="list"?n.createElement(n.Fragment,null,n.createElement(Kn,{listHeading:"Cards",paymentGateway:A==null?void 0:A.paymentGateway,ListItems:F,selectedCard:zt,setSelectedCard:St,handleDeleteCard:Ht,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{se("form")}}),n.createElement("div",{className:"form-group",style:{padding:"0"}},n.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:At},ae&&!ut?fe((ln=Number(ae))==null?void 0:ln.toFixed(2)):fe((dn=Number(_e))==null?void 0:dn.toFixed(2))))):n.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:Je,onKeyDown:g=>{g.key==="Enter"&&y&&(g.preventDefault(),g.stopPropagation())}},n.createElement("div",{className:"ach-scrl",style:{minHeight:A!=null&&A.isSkyFiAccount&&(F==null?void 0:F.length)>0?"444px":A!=null&&A.isSkyFiAccount&&(F==null?void 0:F.length)==0?"456px":(F==null?void 0:F.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:(r==null?void 0:r.cardName)||"",onChange:g=>{let d=g.target.value;/^[a-zA-Z\s]*$/.test(d)&&zn("cardName",d)}}),(w==null?void 0:w.cardName)&&n.createElement("span",{className:"error-span"},w==null?void 0:w.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:(r==null?void 0:r.cardNumber)||"",onChange:g=>J(g),"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:(r==null?void 0:r.expiryMonth)||"",onChange:g=>zn("expiryMonth",g.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:(r==null?void 0:r.expiryYear)||"",onChange:g=>zn("expiryYear",g.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:(r==null?void 0:r.cvv)||"",onChange:g=>zn("cvv",g.target.value)})))),(w==null?void 0:w.cardNumber)&&n.createElement("span",{className:"error-span"},w==null?void 0:w.cardNumber),n.createElement("p",{style:{margin:"0"}},w!=null&&w.expiryMonth||w!=null&&w.expiryYear?n.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},w==null?void 0:w.expiryMonth):"",(w==null?void 0:w.cvv)&&n.createElement("span",{className:"error-span"},w==null?void 0:w.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:(yn=e==null?void 0:e.orderID)!=null?yn:"",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:(Cn=r==null?void 0:r.zipCode)!=null?Cn:"",onChange:g=>zn("zipCode",g.target.value)}),(w==null?void 0:w.zipCode)&&n.createElement("span",{className:"error-span"},w==null?void 0:w.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:g=>S(g.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"}},(A==null?void 0:A.paymentDeviceList)&&((Zt=A==null?void 0:A.paymentDeviceList)==null?void 0:Zt.length)>0&&n.createElement("button",{type:"button",style:{marginBottom:"10px"},className:"pay-button",onClick:()=>an(!hn)},hn?"Pay With Reader":"Pay With Card"),n.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},ae&&!ut?fe((Ze=Number(ae))==null?void 0:Ze.toFixed(2)):fe((Wt=Number(_e))==null?void 0:Wt.toFixed(2)))))),n.createElement("div",{id:"ach",style:{display:oe==="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"},(Se==null?void 0:Se.length)>0&&Ee==="form"&&n.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Ue("list")}," ",n.createElement(Zi,null))),n.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment"))),Ee==="list"?n.createElement(n.Fragment,null,n.createElement(Kn,{listHeading:"Banks",paymentGateway:A==null?void 0:A.paymentGateway,ListItems:Se,selectedCard:zt,setSelectedCard:St,handleDeleteCard:Ht,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{Ue("form")}}),n.createElement("div",{className:"form-group",style:{padding:"0"}},n.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:At},ae&&!ut?fe((v=Number(ae))==null?void 0:v.toFixed(2)):fe((f=Number(re))==null?void 0:f.toFixed(2))))):n.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:Je,autoComplete:"off",onKeyDown:g=>{g.key==="Enter"&&y&&(g.preventDefault(),g.stopPropagation())}},n.createElement("div",{className:"ach-scrl",style:{minHeight:A!=null&&A.isSkyFiAccount&&(F==null?void 0:F.length)>0?"444px":A!=null&&A.isSkyFiAccount&&(F==null?void 0:F.length)==0?"436px":(F==null?void 0:F.length)>0?"462px":"520px",maxHeight:A!=null&&A.isSkyFiAccount&&(F==null?void 0:F.length)>0?"444px":((F==null?void 0:F.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:(Q=P==null?void 0:P.name)!=null?Q:"",onChange:j}),(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:(he=P==null?void 0:P.routingNumber)!=null?he:"",onChange:j}),(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:(ce=P==null?void 0:P.accountNumber)!=null?ce:"",onChange:j}),(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:(Ye=P==null?void 0:P.confirmAccountNumber)!=null?Ye:"",onChange:j}),(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:(ge=P==null?void 0:P.bankName)!=null?ge:"",onChange:j}),(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:(nt=P==null?void 0:P.companyName)!=null?nt:"",onChange:j}),(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:(ht=P==null?void 0:P.accountType)!=null?ht:"",onChange:j},n.createElement("option",{value:""},"Select account"),ui.map(g=>n.createElement("option",{key:g.value,value:g.value},g.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:g=>me(g.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"},ae&&!ut?fe((Pt=Number(ae))==null?void 0:Pt.toFixed(2)):fe((Qt=Number(re))==null?void 0:Qt.toFixed(2))))))))))))))))}import Wn,{useEffect as ka,useState as bi,useMemo as zr}from"react";import vr from"react";function ta(){let e="#000",t="#fff",$="#212529",I="#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: ${$};
|
|
2501
|
-
-webkit-appearance: none;
|
|
2502
|
-
-moz-appearance: none;
|
|
2503
|
-
appearance: none;
|
|
2504
|
-
background-color: ${t};
|
|
2505
|
-
background-clip: padding-box;
|
|
2506
|
-
border: 1px solid ${I};
|
|
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 ${I};
|
|
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 ${I};
|
|
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 ${I};
|
|
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 l,{useCallback as Mr,useEffect as Wi,useRef as ia,useState as ct}from"react";import fn from"axios";import yi from"sweetalert2";import{useEffect as Cr,useRef as wr}from"react";function va({challengeUrl:e,fractalToken:t,stripeIntentId:$,onSuccess:I,onError:z,containerRef:q}){let W=wr(null);return Cr(()=>{if(!e||typeof window=="undefined")return;let G=q.current;if(!G)return;W.current&&G.contains(W.current)&&G.removeChild(W.current);let ye=document.createElement("iframe");ye.className="challengeUrlclass-frac",ye.src=e,W.current=ye,G.appendChild(ye);let E=L=>{var Z;((Z=L.data)==null?void 0:Z.type)==="3ds-authentication-challenge-complete"&&(G.innerHTML="",L.data.status==="succeeded"?I(t,$):z(L.data.status))};return window.addEventListener("message",E),()=>{window.removeEventListener("message",E),W.current&&G.contains(W.current)&&G.removeChild(W.current)}},[e,q,t,$,I,z]),null}import{Elements as _r}from"@stripe/react-stripe-js";import{loadStripe as Pr}from"@stripe/stripe-js";import{PaymentElement as Ca,useElements as Nr,useStripe as kr}from"@stripe/react-stripe-js";import Sr from"axios";import{useState as wa}from"react";var Na=({onSuccess:e,showLoader:t,setError:$,session_token:I,callback:z,hideLoader:q,handleClose:W,amount:G,isPreAuth:ye})=>{var O;let E=kr(),L=Nr(),[Z,ie]=wa(!1),[N,y]=wa(null);return React.createElement("form",{onSubmit:async b=>{var Fe,_,tt,Me,oe,Le,bt;if(b.preventDefault(),!E||!L){console.warn("stripe nopt loaded");return}console.log("Stripe:",E),console.log("Elements:",L),console.log("PaymentElement:",L.getElement(Ca)),t(),ie(!0);try{let{error:ke,paymentIntent:Te}=await E.confirmPayment({elements:L,confirmParams:{},redirect:"if_required"});if(ie(!1),ke)console.log(ke,"paymentIntent error"),$(ke.message||"Payment failed.");else if((Te==null?void 0:Te.status)==="succeeded"){if(y("\u2705 Payment successful!"),e){console.log(Te,"paymentIntent");try{let se=await Sr.post(`${Ie}api/v1/gateway/secure-charge/${I}`,{stripe_id:Te==null?void 0:Te.id});if(console.log(se,"chargeDetails"),(Fe=se==null?void 0:se.data)!=null&&Fe.result){let Ee=(_=se==null?void 0:se.data)==null?void 0:_.data;console.log(Ee,"callbackdata"),z(M(C({},Ee),{isPreAuth:ye})),W(),q()}console.log((tt=se==null?void 0:se.data)==null?void 0:tt.data,"chargeDetails")}catch(se){console.log(se==null?void 0:se.response,"error"),$(((oe=(Me=se==null?void 0:se.response)==null?void 0:Me.data)==null?void 0:oe.message)||"Something went wrong"),q()}}setTimeout(()=>window.close(),1500)}else y("Processing payment...")}catch(ke){console.log(ke==null?void 0:ke.response,"error"),$(((bt=(Le=ke==null?void 0:ke.response)==null?void 0:Le.data)==null?void 0:bt.message)||"Something went wrong"),q()}}},React.createElement(Ca,null),React.createElement("button",{className:"pay-button",disabled:Z||!E},Z?"Processing...":`${fe((O=Number(G))==null?void 0:O.toFixed(2))}`))};var Fr=Pr(ri);function na({clientSecret:e,onSuccess:t,showLoader:$,setError:I,session_token:z,callback:q,hideLoader:W,handleClose:G,amount:ye,isPreAuth:E}){return e?React.createElement(_r,{stripe:Fr,options:{clientSecret:e}},React.createElement(Na,{onSuccess:t,showLoader:$,hideLoader:W,setError:I,session_token:z,callback:q,handleClose:G,amount:ye,isPreAuth:E})):null}import{IoArrowBack as aa}from"react-icons/io5";import{NumericFormat as Lr}from"react-number-format";var Ar=({amount:e,bankAmount:t,submitBtnText:$="Pay",session_token:I,customerId:z,callback:q,merchantName:W="merchant",isPreAuth:G,surcharge:ye="0",submitBtnClass:E,submitBtnIcon:L,isRequest:Z,pass_fee:ie,pass_fee_amount:N,require3ds:y=!1,autoTrigger:D=!1,show:O,setShow:b,setHandleCloseRef:Fe,isPartial:_,bankSurcharge:tt,partialRef:Me,loadingPrev:oe=!1,orderGuid:Le,remainingAmount:bt})=>{var st,le,en,wn,Nn,$n,Kt,ti,kn,pn,Ai,zi,Gi,Ii,Qn,xi;let ke=ia(!1),Te=ia(!1),se=ia(null),[Ee,Ue]=ct("card"),[hn,an]=ct("card"),[h,S]=ct(),[u,me]=ct({}),[o,r]=ct(),[a,w]=ct({}),[k,P]=ct(!1),[H,x]=ct(!1),[p,F]=ct(""),[Ke,Se]=ct(!1),[Nt,zt]=ct(""),[St,mt]=ct(!1),[Be,re]=ct(!1),[T,_e]=ct([]),[qe,ae]=ct([]),[ft,ut]=ct(),[_t,A]=ct(Number(e)),[It,xt]=ct("form"),[je,Lt]=ct("form"),[rn,Gn]=ct(!1),[Vt,vn]=ct(0),[qn,An]=ct(""),[zn,J]=ct(null),[j,Xe]=ct(!1),[Yt,Je]=ct(!1),[gt,vt]=ct(null),[$t,At]=ct(!1),[Ht,Jt]=ct(Le||null),[be,Ot]=ct(""),[Et,jt]=ct(""),[on,sn]=ct(""),ln=R+"widget/mc-img.svg",dn=R+"widget/visa-img.svg",yn=R+"widget/ae-img.svg",Cn=R+"widget/discover-img.svg",Zt=R+"widget/card.svg",Ze=R+"widget/Trash.svg",Wt=R+"widget/bank.svg",v=R+"widget/secure-img.png",f=R+"widget/pov-by.png",Q=R+"widget/pax.svg",he=R+"widget/cardicon.svg",ce=R+"widget/bankicon.svg",Ye=()=>mt(!0),ge=()=>mt(!1),nt=(s,c)=>{let U=(parseFloat(c)||0)/100,de=s/(1+U);return Math.round(de*100)/100},ht=async s=>{var c,U,de,X,ne,We,lt,dt,ue,we,K,Qe,Ft,Tt,Re,Hn,jn,Vn;try{let Ge={pass_fee_amount:Number(e)-_t,pass_fee:ie,Token:s==null?void 0:s.Token,amount:be||e,postal_code:s==null?void 0:s.postalCode,require3ds:y,isPartial:_,orderGuid:Ht||Le};y&&(s!=null&&s.stripe_3ds_auth_id)&&(Ge.stripe_3ds_auth_id=s==null?void 0:s.stripe_3ds_auth_id);let Dt=await fn.post(`${Ie}api/v1/gateway/charge/${I}`,Ge);if((c=Dt==null?void 0:Dt.data)!=null&&c.result){let Mt;if(H&&z)try{let Oe={postal_code:h==null?void 0:h.zipCode,customer_id:z,gateway_token:(s==null?void 0:s.gateway_token)||(s==null?void 0:s.Token)};Mt=await fn.post(`${Ie}api/v1/gateway/add-card/${I}`,Oe),(U=Mt==null?void 0:Mt.data)!=null&&U.result&&(Mt=(de=Mt==null?void 0:Mt.data)==null?void 0:de.data)}catch(Oe){console.log(Oe,"error"),ge(),q({error:((ne=(X=Oe==null?void 0:Oe.response)==null?void 0:X.data)==null?void 0:ne.message)||"Something went wrong!",result:(lt=(We=Oe==null?void 0:Oe.response)==null?void 0:We.data)==null?void 0:lt.result,statusCode:(dt=Oe==null?void 0:Oe.response)==null?void 0:dt.status}),F(((we=(ue=Oe==null?void 0:Oe.response)==null?void 0:ue.data)==null?void 0:we.message)||"Something went wrong!")}let On={cardDetails:C(C({},Mt),s),callback:M(C({},(K=Dt==null?void 0:Dt.data)==null?void 0:K.data),{name:h==null?void 0:h.cardName,isPreAuth:G})};H||delete On.cardDetails,q(On),ge(),it()}}catch(Ge){F(((Ft=(Qe=Ge==null?void 0:Ge.response)==null?void 0:Qe.data)==null?void 0:Ft.message)||"Something went wrong!"),q({error:((Re=(Tt=Ge==null?void 0:Ge.response)==null?void 0:Tt.data)==null?void 0:Re.message)||"Something went wrong!",result:(jn=(Hn=Ge==null?void 0:Ge.response)==null?void 0:Hn.data)==null?void 0:jn.result,statusCode:(Vn=Ge==null?void 0:Ge.response)==null?void 0:Vn.status}),ge()}},Pt=async s=>{var c,U,de,X,ne,We,lt,dt,ue,we,K,Qe,Ft,Tt,Re,Hn,jn,Vn;try{let Ge={Token:s==null?void 0:s.Token,amount:e,postal_code:s==null?void 0:s.postalCode},Dt=await fn.post(`${Ie}api/v1/gateway/preauth/${I}`,Ge);if((c=Dt==null?void 0:Dt.data)!=null&&c.result){let Mt;if(H&&z)try{let Oe={postal_code:h==null?void 0:h.zipCode,customer_id:z,gateway_token:(s==null?void 0:s.Token)||(s==null?void 0:s.gateway_token)};Mt=await fn.post(`${Ie}api/v1/gateway/add-card/${I}`,Oe),(U=Mt==null?void 0:Mt.data)!=null&&U.result&&(Mt=(de=Mt==null?void 0:Mt.data)==null?void 0:de.data)}catch(Oe){console.log(Oe,"error"),ge(),F(((ne=(X=Oe==null?void 0:Oe.response)==null?void 0:X.data)==null?void 0:ne.message)||"Something went wrong!"),q({error:((lt=(We=Oe==null?void 0:Oe.response)==null?void 0:We.data)==null?void 0:lt.message)||"Something went wrong!",result:(ue=(dt=Oe==null?void 0:Oe.response)==null?void 0:dt.data)==null?void 0:ue.result,statusCode:(we=Oe==null?void 0:Oe.response)==null?void 0:we.status})}let On={cardDetails:C(C({},Mt),s),callback:M(C({},(K=Dt==null?void 0:Dt.data)==null?void 0:K.data),{name:h==null?void 0:h.cardName,isPreAuth:G})};H||delete On.cardDetails,q(On),ge(),it()}}catch(Ge){F(((Ft=(Qe=Ge==null?void 0:Ge.response)==null?void 0:Qe.data)==null?void 0:Ft.message)||"Something went wrong!"),q({error:((Re=(Tt=Ge==null?void 0:Ge.response)==null?void 0:Tt.data)==null?void 0:Re.message)||"Something went wrong!",result:(jn=(Hn=Ge==null?void 0:Ge.response)==null?void 0:Hn.data)==null?void 0:jn.result,statusCode:(Vn=Ge==null?void 0:Ge.response)==null?void 0:Vn.status}),ge()}},Qt=async s=>{var c,U,de,X,ne,We,lt,dt,ue;if(s.Error)F(s.Error),q({error:s.Error||"Something went wrong!"}),ge();else{let we={token:s.Token,resp:s};try{let K=await fn.post(`${Ie}api/v1/gateway/update/token/${I}`,we);if((K==null?void 0:K.status)==200){let Qe={Token:(U=(c=K==null?void 0:K.data)==null?void 0:c.data)==null?void 0:U.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},Ft;G?Pt(Qe):ht(Qe)}}catch(K){console.log(K,"error"),ge(),F(((X=(de=K==null?void 0:K.response)==null?void 0:de.data)==null?void 0:X.message)||"Something went wrong!"),q({error:((We=(ne=K==null?void 0:K.response)==null?void 0:ne.data)==null?void 0:We.message)||"Something went wrong!",result:(dt=(lt=K==null?void 0:K.response)==null?void 0:lt.data)==null?void 0:dt.result,statusCode:(ue=K==null?void 0:K.response)==null?void 0:ue.status})}}},g=s=>{Ue(s)},d=()=>{var U,de,X,ne,We,lt,dt,ue;let s={},c=o;return(U=c==null?void 0:c.name)!=null&&U.trim()||(s.name="Name is required"),(de=c==null?void 0:c.accountNumber)!=null&&de.trim()||(s.accountNumber="Account number is required"),(X=c==null?void 0:c.accountNumber)!=null&&X.trim()&&((ne=c==null?void 0:c.accountNumber)==null?void 0:ne.trim())!==((We=c==null?void 0:c.confirmAccountNumber)==null?void 0:We.trim())&&(s.confirmAccountNumber="Account numbers must match"),(lt=c==null?void 0:c.bankName)!=null&<.trim()||(s.bankName="Bank name is required"),(dt=c==null?void 0:c.routingNumber)!=null&&dt.trim()||(s.routingNumber="Routing Number is required"),c!=null&&c.routingNumber&&((ue=c==null?void 0:c.routingNumber)==null?void 0:ue.length)!==9&&(s.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)==="")&&(s.companyName="Company Name is required for business accounts"),w(s),Object.keys(s).length>0},ee=async(s,c)=>{var U,de,X,ne,We,lt,dt,ue;try{let we=s,K=await fn.post(`${Ie}api/v1/gateway/verify-and-save/${I}`,{token:we,require3ds:y,pass_fee:ie});if((K==null?void 0:K.status)==200){let Qe=(U=K==null?void 0:K.data)==null?void 0:U.data,Ft={Token:Qe.gateway_token,Brand:Qe.card_data.brand,ExpirationMonth:Qe.card_data.expire_mm,ExpirationYear:Qe.card_data.expire_yy,Last4:Qe.card_data.last4,Bin:Qe.card_data.bin,postalCode:h==null?void 0:h.zipCode,stripe_3ds_auth_id:c};G?Pt(Ft):ht(Ft)}}catch(we){console.log(we,"error"),F(((X=(de=we==null?void 0:we.response)==null?void 0:de.data)==null?void 0:X.message)||"Something went wrong!"),q({error:((We=(ne=we==null?void 0:we.response)==null?void 0:ne.data)==null?void 0:We.message)||"Something went wrong!",result:(dt=(lt=we==null?void 0:we.response)==null?void 0:lt.data)==null?void 0:dt.result,statusCode:(ue=we==null?void 0:we.response)==null?void 0:ue.status}),ge()}},Ae=async()=>{var s,c,U,de,X,ne,We,lt,dt,ue,we,K,Qe,Ft,Tt,Re,Hn,jn,Vn,Ge,Dt,Mt,On,Oe,vi,Ct,Ci,Ti,ni,Gt,ze,wi;try{let tn={method:"POST",redirect:"follow"},Pn=await fn.post(`${Ie}api/v1/widget/generate-session`,tn),di=Number(h==null?void 0:h.expiryYear)%100,oa=`${(s=h==null?void 0:h.cardNumber)==null?void 0:s.replace(/\s+/g,"")}=${di}${h==null?void 0:h.expiryMonth} ${h==null?void 0:h.cvv}`,mi=forge.pki.publicKeyFromPem((U=(c=Pn==null?void 0:Pn.data)==null?void 0:c.data)==null?void 0:U.publicKeyPem).encrypt(oa,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Sa=forge.util.encode64(mi),_a={"Content-Type":"application/json","x-app-session-key":(X=(de=Pn.data)==null?void 0:de.data)==null?void 0:X.session_key},sa={enc_track2_data:Sa,algorithm:"RSAES_OAEP_SHA_1",session_key:(We=(ne=Pn==null?void 0:Pn.data)==null?void 0:ne.data)==null?void 0:We.session_key};if(y&&typeof window!="undefined"&&typeof navigator!="undefined"){let nn=(lt=navigator.languages)!=null?lt:[navigator.language],la=Array.isArray(nn)?nn[0]:nn;sa.three_ds_data={amount:Math.round(be?parseFloat(be)*100:parseFloat(e)*100),currency:"usd",channel:{type:"browser",browser:{language:typeof la=="string"?la:null,color_depth:(ue=(dt=window.screen)==null?void 0:dt.colorDepth)!=null?ue:null,java_enabled:typeof navigator.javaEnabled=="function"?navigator.javaEnabled():!1,screen_height:(K=(we=window.screen)==null?void 0:we.height)!=null?K:null,screen_width:(Ft=(Qe=window.screen)==null?void 0:Qe.width)!=null?Ft:null,timezoneOffset:new Date().getTimezoneOffset()}}}}let Pa=JSON.stringify(sa),xn=await fn.post(`${cn}tokenizer/tokenize`,Pa,{headers:_a});if((xn==null?void 0:xn.status)==200){let nn=(Re=(Tt=xn==null?void 0:xn.data)==null?void 0:Tt.data)==null?void 0:Re.stripe_three_ds_response;y&&!nn&&nn.status==="200 OK"&&((Hn=nn==null?void 0:nn.data)!=null&&Hn.challenge_url)&&F("Something went wrong. Please try again later."),y?(jn=nn==null?void 0:nn.data)!=null&&jn.challenge_url?(ge(),vt(M(C({},nn==null?void 0:nn.data),{fractalToken:(On=(Mt=xn==null?void 0:xn.data)==null?void 0:Mt.data)==null?void 0:On.token}))):ee((Ge=(Vn=xn==null?void 0:xn.data)==null?void 0:Vn.data)==null?void 0:Ge.token,(Dt=nn==null?void 0:nn.data)==null?void 0:Dt.id):ee((vi=(Oe=xn==null?void 0:xn.data)==null?void 0:Oe.data)==null?void 0:vi.token,null)}}catch(tn){ge(),console.log(tn,"error");let Pn="Something went wrong!";try{let di=((Ct=tn==null?void 0:tn.response)==null?void 0:Ct.data)||(tn==null?void 0:tn.message)||"",Bi=typeof di=="string"?di:JSON.stringify(di),Ni=(((Ti=(Ci=Bi.split)==null?void 0:Ci.call(Bi,`
|
|
3013
|
-
`))==null?void 0:Ti.filter(Boolean))||[]).at(-1)||"",mi=(ni=Ni.split)==null?void 0:ni.call(Ni,": ");Pn=(mi==null?void 0:mi.length)>1?mi.pop().trim():Ni.trim()||Pn}catch(di){Pn="Something went wrong!"}F(Pn),q({error:Pn,result:(ze=(Gt=tn==null?void 0:tn.response)==null?void 0:Gt.data)==null?void 0:ze.result,statusCode:(wi=tn==null?void 0:tn.response)==null?void 0:wi.status})}},te=()=>{var X,ne,We,lt,dt,ue;let s={},c=h,U=parseInt((c==null?void 0:c.expiryMonth)||"",10),de=(c==null?void 0:c.expiryYear)||"";if((X=c==null?void 0:c.cardName)!=null&&X.trim()||(s.cardName="Card name is required"),(ne=c==null?void 0:c.cardNumber)!=null&&ne.trim()||(s.cardNumber="Card number is required"),(!((We=c==null?void 0:c.expiryMonth)!=null&&We.trim())||!((lt=c==null?void 0:c.expiryYear)!=null&<.trim())||isNaN(U)||U<1||U>12||de.length!==4)&&(s.expiryMonth="Invalid Expiration Date."),(dt=c==null?void 0:c.cvv)!=null&&dt.trim()||(s.cvv="CVV is required"),(ue=c==null?void 0:c.zipCode)!=null&&ue.trim()||(s.zipCode="ZIP code is required"),c!=null&&c.expiryMonth&&(c!=null&&c.expiryYear)&&c.expiryMonth.length<=2&&c.expiryYear.length===4){let we=parseInt(c.expiryMonth,10),K=parseInt(c.expiryYear,10),Qe=new Date,Ft=Qe.getMonth()+1,Tt=Qe.getFullYear();(K<Tt||K===Tt&&we<Ft)&&(s.expiryMonth="Card is expired")}return me(s),Object.keys(s).length>0},Pe=()=>{let s=DatacapWebToken.validateCardNumber(h==null?void 0:h.cardNumber.replaceAll(" ","")),c=DatacapWebToken.validateExpirationDate(h==null?void 0:h.expiryMonth,h==null?void 0:h.expiryYear),U=DatacapWebToken.validateCVV(h==null?void 0:h.cvv),de={};return s||(de.cardNumber="Invalid card Number"),c||(de.expiryMonth="Invalid Expiration Date."),U||(de.cvv="Invalid CVV"),me(de),s&&U&&c},rt=async s=>{var c,U,de,X,ne,We,lt,dt,ue,we,K,Qe,Ft,Tt,Re,Hn,jn,Vn,Ge,Dt,Mt,On,Oe,vi;if(s.preventDefault(),!Et){if(Ee!=="ach"){if(te()||!Pe())return}else if(d())return;try{Ye();let Ct=await fn.get(`${Ie}api/v1/gateway/token/${I}`,{params:{require3ds:y,pass_fee:ie}});if((Ct==null?void 0:Ct.status)==200){let Ci=(U=(c=Ct==null?void 0:Ct.data)==null?void 0:c.data)==null?void 0:U.gateway_token,Ti=(X=(de=Ct==null?void 0:Ct.data)==null?void 0:de.data)==null?void 0:X.paymentGateway;if(Ee!=="ach")Ti==((ne=Ei)==null?void 0:ne.FRACTALKEY)?await Ae():DatacapWebToken.requestToken(Ci,"PaymentForm",Qt);else{let ni;try{let Gt=await fn.post(`${Ie}api/v1/gateway/bank-charge/${I}`,{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:`${t}`,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((We=Gt==null?void 0:Gt.data)!=null&&We.result){if(k&&z)try{let ze=await fn.post(`${Ie}api/v1/gateway/add-bank/${I}`,{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:z||"",company_name:(o==null?void 0:o.companyName)||""});ze.data.result&&(ni={bankDetails:M(C({},(lt=ze==null?void 0:ze.data)==null?void 0:lt.data),{account_type:o==null?void 0:o.accountType})})}catch(ze){ge(),F(((ue=(dt=ze==null?void 0:ze.response)==null?void 0:dt.data)==null?void 0:ue.message)||"Something went wrong!"),q({error:((K=(we=ze==null?void 0:ze.response)==null?void 0:we.data)==null?void 0:K.message)||"Something went wrong!",result:(Ft=(Qe=ze==null?void 0:ze.response)==null?void 0:Qe.data)==null?void 0:Ft.result,statusCode:(Tt=ze==null?void 0:ze.response)==null?void 0:Tt.status})}ni=M(C({},ni),{callback:M(C({},(Re=Gt==null?void 0:Gt.data)==null?void 0:Re.data),{name:o==null?void 0:o.name,isPreAuth:G})}),q(ni),it(),ge()}}catch(Gt){console.log(Gt,"errororor");let ze=(Hn=Gt==null?void 0:Gt.response)==null?void 0:Hn.data;typeof(ze==null?void 0:ze.message)=="object"?Object.values(ze==null?void 0:ze.message).forEach(wi=>{var tn;F(wi||"Something went wrong"),q({error:wi||"Something went wrong!",result:(ze==null?void 0:ze.result)||!1,statusCode:(tn=Gt==null?void 0:Gt.response)==null?void 0:tn.status})}):(F((ze==null?void 0:ze.message)||"Something went wrong"),q({error:(ze==null?void 0:ze.message)||"Something went wrong!",result:(ze==null?void 0:ze.result)||!1,statusCode:(jn=Gt==null?void 0:Gt.response)==null?void 0:jn.status})),ge()}}}}catch(Ct){ge(),q({error:((Ge=(Vn=Ct==null?void 0:Ct.response)==null?void 0:Vn.data)==null?void 0:Ge.message)||"Something went wrong!",result:(Mt=(Dt=Ct==null?void 0:Ct.response)==null?void 0:Dt.data)==null?void 0:Mt.result,statusCode:(On=Ct==null?void 0:Ct.response)==null?void 0:On.status}),F(((vi=(Oe=Ct==null?void 0:Ct.response)==null?void 0:Oe.data)==null?void 0:vi.message)||"Something went wrong!")}}},xe=(s,c)=>{let U=s;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(U)){(c===""||/^[0-9]+$/.test(c))&&(me(X=>M(C({},X),{[U]:""})),S(X=>M(C({},X),{[U]:c})));return}me(X=>M(C({},X),{[U]:""})),S(X=>M(C({},X),{[U]:c}))},pe=s=>{var ne;let c=s.target,U=c.value.replace(/\D/g,""),{formatted:de,cursor:X}=In(c.value,(ne=c.selectionStart)!=null?ne:0);me(We=>M(C({},We),{cardNumber:""})),S(We=>M(C({},We),{cardNumber:de})),requestAnimationFrame(()=>{c.setSelectionRange(X,X)})},De=s=>{let{name:c,value:U}=s.target,de=["routingNumber","accountNumber","confirmAccountNumber"];if(c=="name"){/^[a-zA-Z\s]*$/.test(U)&&(w(X=>M(C({},X),{[c]:""})),r(X=>M(C({},X),{[c]:U})));return}if(de.includes(c)){(U===""||/^[0-9]+$/.test(U))&&(w(X=>M(C({},X),{[c]:""})),r(X=>M(C({},X),{[c]:U})));return}w(X=>M(C({},X),{[c]:""})),r(X=>M(C({},X),{[c]:U}))},it=()=>{b(!1),Ue("card"),F(""),Se(!1),zt(""),r({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),w({name:"",routingNumber:"",accountNumber:"",confirmAccountNumber:"",bankName:"",accountType:""}),S({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),me({cardName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",orderId:"",zipCode:""}),P(!1),x(!1),Lt("form"),xt("form"),Gn(!1),vn(0),A(0),_e([]),J(null),An(null),Xe(!1),Je(!1),vt(null),Jt(null),Ot(""),jt(""),sn("")},Ce=async()=>{var s,c,U,de,X,ne,We,lt,dt;Ye();try{let ue={isPreAuth:G,customerId:z},we=await fn.post(`${Ie}api/v1/gateway/card-list/${I}`,ue),K=((c=(s=we==null?void 0:we.data)==null?void 0:s.data)==null?void 0:c.cardList)||[],Qe=K==null?void 0:K.filter(Tt=>(Tt==null?void 0:Tt.card_type)=="Bank"),Ft=K==null?void 0:K.filter(Tt=>(Tt==null?void 0:Tt.card_type)!=="Bank");Ft&&(Ft==null?void 0:Ft.length)>0?(Ue("card"),xt("list"),_e(Ft)):(Ue("card"),_e([])),Qe&&(Qe==null?void 0:Qe.length)>0?(Lt("list"),ae(Qe)):ae([]),ge()}catch(ue){console.log(ue),ge(),q({error:((de=(U=ue==null?void 0:ue.response)==null?void 0:U.data)==null?void 0:de.message)||"Something went wrong!",result:(ne=(X=ue==null?void 0:ue.response)==null?void 0:X.data)==null?void 0:ne.result,statusCode:(We=ue==null?void 0:ue.response)==null?void 0:We.status}),F(((dt=(lt=ue==null?void 0:ue.response)==null?void 0:lt.data)==null?void 0:dt.message)||(ue==null?void 0:ue.message)||"Something went wrong")}},at=s=>{switch(s==null?void 0:s.toLowerCase()){case"visa":return dn;case"mastercard":case"mc":case"m/c":return ln;case"amex":case"american express":case"ae":return yn;case"discover":case"dcvr":return Cn;case"bank":return Wt;default:return s}},ve=async s=>{yi.fire({icon:"warning",text:"Do you want to delete the card?",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",reverseButtons:!0,buttonsStyling:!1,customClass:{confirmButton:"swal2-confirm btn btn-dark",cancelButton:"swal2-cancel btn btn-dark",popup:"custom-swal-popup",icon:"custom-swal-icon"}}).then(async c=>{var U,de;if(c.isConfirmed){re(!0);try{let X={card_id:s,customer_id:z},ne=await fn.patch(`${Ie}api/v1/gateway/delete-card/${I}`,X);(U=ne==null?void 0:ne.data)!=null&&U.result?(re(!1),Ce(),yi.fire({icon:"success",title:"Deleted!",text:((de=ne==null?void 0:ne.data)==null?void 0:de.message)||"Card deleted.",confirmButtonText:"OK",showConfirmButton:!0,timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}})):(re(!1),yi.fire({icon:"error",title:"Failure!",text:"Card not deleted.",timer:1e3,timerProgressBar:!0,customClass:{confirmButton:"btn btn-dark"}}))}catch(X){re(!1),yi.fire({icon:"error",title:"Error!",text:"Failed to delete the card.",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-dark"}})}}else c.dismiss===yi.DismissReason.cancel&&yi.fire({icon:"info",text:"Card not deleted",confirmButtonText:"OK",buttonsStyling:!1,customClass:{confirmButton:"btn btn-dark float-end",actions:"swal2-actions-end"}})})},yt=async()=>{var de,X,ne,We,lt,dt,ue,we,K;let s=z,c=ft==null?void 0:ft.id,U=ft==null?void 0:ft.card_type;if(!Et)if(e)if(s)if(c){let Qe={amount:(U==null?void 0:U.toLowerCase())==="bank"?`${t}`:be||e,customer_id:s,card_id:c,pass_fee:ie,pass_fee_amount:Number(e)-_t};_&&(Qe.orderGuid=Ht||Le,be&&(Qe.ispartialPayment=!0)),G&&(Qe.isPreauth=!0);let Ft=Ie+"api/v1/gateway/charge-by-saved-details/"+I,Tt={"Content-Type":"application/json"};try{Ye();let Re=await fn.post(Ft,Qe);(de=Re==null?void 0:Re.data)!=null&&de.result&&(q({callback:M(C({},(X=Re==null?void 0:Re.data)==null?void 0:X.data),{isPreAuth:G})}),ge(),it())}catch(Re){console.log(Re==null?void 0:Re.response,"error by saved details"),q({error:((We=(ne=Re==null?void 0:Re.response)==null?void 0:ne.data)==null?void 0:We.message)||"Something went wrong!",result:(dt=(lt=Re==null?void 0:Re.response)==null?void 0:lt.data)==null?void 0:dt.result,statusCode:(ue=Re==null?void 0:Re.response)==null?void 0:ue.status}),ge(),F(((K=(we=Re==null?void 0:Re.response)==null?void 0:we.data)==null?void 0:K.message)||"Something went wrong!")}}else F("Please Select A Card/Bank"),q({error:"Please Select A Card/Bank"});else F("Please Select Customer"),q({error:"Please Select Customer"});else F("Something went wrong."),q({error:"Something went wrong."})},ot=async()=>{var s,c,U,de,X,ne,We,lt,dt,ue,we;try{Ye();let K=await fn.get(`${Ie}api/v1/gateway/get-payment-details/${I}`);(K==null?void 0:K.status)==200&&(Gn((c=(s=K==null?void 0:K.data)==null?void 0:s.data)==null?void 0:c.isBankActive),vn(Number((de=(U=K==null?void 0:K.data)==null?void 0:U.data)==null?void 0:de.fee)||0),ge())}catch(K){console.log((ne=(X=K==null?void 0:K.response)==null?void 0:X.data)==null?void 0:ne.result,"error while getting payment details"),q({error:((lt=(We=K==null?void 0:K.response)==null?void 0:We.data)==null?void 0:lt.message)||"Something went wrong!",result:(ue=(dt=K==null?void 0:K.response)==null?void 0:dt.data)==null?void 0:ue.result,statusCode:(we=K==null?void 0:K.response)==null?void 0:we.status}),ge()}},Xt=async()=>{var s,c,U,de,X;if(!$t){At(!0);try{let ne=await fn.post(`${Ie}api/v1/gateway/create-pay-order/${I}`,{amount:e,cashDiscount:_t,bankAmount:t,bankSurcharge:tt,customerId:z,passFee:ie,passFeeAmount:N||Number(e)-_t,require3ds:y,isPartial:_});(s=ne==null?void 0:ne.data)!=null&&s.result&&(At(!1),Jt((U=(c=ne==null?void 0:ne.data)==null?void 0:c.data)==null?void 0:U.orderGuid),sn((X=(de=ne==null?void 0:ne.data)==null?void 0:de.data)==null?void 0:X.remainingAmount),ke.current=!0)}catch(ne){console.log("error in creating order",ne),At(!1)}}};Wi(()=>{!O&&!D&&(ke.current=!1,Te.current=!1)},[O,D]),Wi(()=>{!ke.current&&(O||D)&&(ot(),_&&!Me&&Xt())},[O,D,_]),Wi(()=>{if((O||D)&&N){let s=Number(e)-Number(N);s&&!isNaN(s)&&A(s)}else if((O||D)&&ie&&Vt){let s=nt(e,Vt);s&&!isNaN(s)&&A(s)}else A(Number(e));!Te.current&&z&&(O||D)&&!Z&&(Te.current=!0,Ce())},[z,O,e,Vt,D]);let pt=()=>G?"Cards":"Cards/Bank",Ve=Mr(async()=>{try{Xe(!0);let c=await(await fetch(`${Ie}api/v1/gateway/create-payment-intent/${I}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:e,require3ds:y,pass_fee:ie})})).json();c.is3dEnable?(Xe(!1),An(c.clientSecret),Je(c.is3dEnable)):(Xe(!1),Je(c.is3dEnable)),c.result||F(c.error||(c==null?void 0:c.message)||"Failed to get client secret")}catch(s){console.log(s.response,"err.response"),F(s.message)}},[e]),Yn=()=>{},_n=(s,c)=>{Ye(),ee(s,c),vt(null)},bn=s=>{console.error("3DS Auth failed \u274C",s),F(`3DS Authentication ${s}`)};Wi(()=>{Fe&&Fe(()=>it)},[]);let Rt=s=>{var c,U;((c=Number(on||bt))==null?void 0:c.toFixed(2))<(s==null?void 0:s.floatValue)||(s==null?void 0:s.floatValue)<0?(Ot(s==null?void 0:s.value),jt(`Partial amount cannot exceed ${fe((U=Number(on||bt))==null?void 0:U.toFixed(2))}`)):(s==null?void 0:s.floatValue)==0?(Ot(s==null?void 0:s.value),jt("Partial amount must be greater than 0")):(Ot(s==null?void 0:s.value),jt(""))};return l.createElement(l.Fragment,null,j&&l.createElement(mn,{loading:j}),p&&l.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},l.createElement(Tn,{error:p,onClose:it})),!p&&l.createElement(l.Fragment,null,(St||Be)&&l.createElement(mn,{loading:St||Be||oe||$t}),l.createElement("div",{className:"frac-card-payment-page frac-form frac-new-form"},l.createElement("div",{ref:se,style:{width:"100%",height:"100%"}}),gt!=null&>.challenge_url?l.createElement(va,{containerRef:se,challengeUrl:gt.challenge_url,fractalToken:gt.fractalToken,stripeIntentId:gt.id,onSuccess:_n,onError:bn}):l.createElement("div",{className:"parent-pay-container"},l.createElement("span",{style:{display:D?"none":"block"},className:"request-payment-close-popup",onClick:it},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("g",{clipPath:"url(#clip0_12425_52336)"},l.createElement("path",{d:"M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z",fill:"#727272"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_12425_52336"},l.createElement("rect",{width:"16",height:"16",fill:"white"}))))),l.createElement("div",{className:"pay-main-logo-res"}),l.createElement("div",{className:"pay-container"},l.createElement("div",{className:"pay-header pay-conatiner-one"},l.createElement("div",{className:"pay-conatiner-one-first"},l.createElement("div",{className:"pay-logo-container"},l.createElement("div",{className:"pay-main-logo"}),l.createElement("h1",{className:"pay-heading"},"Pay"),(T==null?void 0:T.length)>0&&Ee!=="cardList"&&l.createElement("button",{className:"res-charge-payment-back-btn ",onClick:()=>Ue("cardList")}," ",l.createElement(aa,null)," Back")),l.createElement("div",{className:"amt-pay-con"},l.createElement("div",{className:"pay-amount-conatiner"},l.createElement("small",{className:"pay-payment-amount"},"Select payment type"),l.createElement("div",{className:"frac-card-bank-radio-main"},l.createElement(Ln,{label:"Card",amount:(st=Number(e))==null?void 0:st.toFixed(2),value:"card",onChange:g,activetab:Ee}),!G&&rn&&!_&&l.createElement(Ln,{label:"Bank",amount:(le=Number(t))==null?void 0:le.toFixed(2),value:"ach",onChange:g,activetab:Ee})),ie&&Ee==="card"&&_t&&Number(e)-Number(_t)>0?l.createElement("div",{className:"frac-cash-discount-fee"},l.createElement("small",null,Ee==="card"?"Cash Discount":"Cash Discount Savings"," "),l.createElement("p",null,fe((Number(e)-Number(_t)).toFixed(2)))):null,_&&l.createElement("div",{className:"frac-partial-payment-input"},l.createElement("label",{htmlFor:"partialpayment"},"Partial Payment"),l.createElement(Lr,{prefix:"$",className:"form-control-frac",value:be,onValueChange:s=>{Rt(s)},thousandSeparator:!0,placeholder:"Enter partial amount",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,isAllowed:s=>{let{floatValue:c=0,value:U}=s;return U===""||U==="0"||U.startsWith("0.")?!0:c===0?!1:c>0}}),Et&&l.createElement("span",{className:"error-span"},Et))))),l.createElement("div",{className:"pay-conatiner-one-last"},l.createElement("img",{src:v,alt:""}),l.createElement("img",{src:f,alt:""}),"Secure payments powered by Fractal")),l.createElement("div",{className:"pay-tab pay-conatiner-two"},l.createElement("div",{className:"col-md-12"},l.createElement("div",{id:"payment-form-div"},Yt?qn&&l.createElement(na,{onSuccess:Yn,clientSecret:qn,amount:e,showLoader:Ye,hideLoader:ge,callback:q,session_token:I,handleClose:it,setError:F,isPreAuth:G}):l.createElement(l.Fragment,null,l.createElement("div",{id:"ach",style:{display:Ee==="card"?"block":"none"},className:"tabcontent"},l.createElement("div",{className:"frac-heading-card-wrap"},l.createElement("div",{className:"frac-backarrow"},(T==null?void 0:T.length)>0&&It==="form"&&l.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>xt("list")}," ",l.createElement(aa,null))),l.createElement("h6",{className:"frac-card-payment-heading"},"Card Payment")),l.createElement("div",{style:{display:"flex",gap:"8px",margin:"8px 0px 19px 0px"}},l.createElement("img",{src:dn,alt:"",width:33}),l.createElement("img",{src:ln,width:33,alt:""}),l.createElement("img",{src:yn,alt:"",width:33}),l.createElement("img",{src:Cn,width:33,alt:""})),It==="list"&&(T==null?void 0:T.length)>0?l.createElement(l.Fragment,null,l.createElement(Kn,{headingClass:"card-ach-heading-frac",listHeading:"Card",ListItems:T,selectedCard:ft,setSelectedCard:ut,handleDeleteCard:ve,otherButtonLabel:"Pay With Other Card",otherButtonAction:()=>{xt("form")}}),l.createElement("div",{className:"form-group-frac",style:{padding:"0"}},l.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:yt},be?fe((en=Number(be))==null?void 0:en.toFixed(2)):fe((wn=Number(e))==null?void 0:wn.toFixed(2))))):l.createElement("form",{id:"PaymentForm",style:{textAlign:"start"},onSubmit:rt,onKeyDown:s=>{s.key==="Enter"&&St&&(s.preventDefault(),s.stopPropagation())}},l.createElement("div",{className:"ach-scrl",style:{minHeight:"398px",maxHeight:"398px",overflow:"auto",marginRight:"5px"}},l.createElement("div",{className:"form-group-frac"},l.createElement("label",{htmlFor:"cardHolderName"},"NAME ON CARD "),l.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"John Doe",value:(h==null?void 0:h.cardName)||"",onChange:s=>{let c=s.target.value;/^[a-zA-Z\s]*$/.test(c)&&xe("cardName",c)}}),(u==null?void 0:u.cardName)&&l.createElement("span",{className:"error-span"},u==null?void 0:u.cardName)),l.createElement("div",{className:"form-group-frac"},l.createElement("label",{htmlFor:"cardNumber"},"CARD NUMBER"),l.createElement("div",{className:"toggle-num-wrapper"},l.createElement("input",{className:"form-control-frac card-number-new",type:"text",maxLength:19,inputMode:"numeric",placeholder:"0000 0000 0000 0000",value:(h==null?void 0:h.cardNumber)||"",onChange:s=>pe(s),"data-token":"card_number"}),l.createElement("div",{className:"card-crdi card-expiry-new"},l.createElement("div",{className:"exp-date-year-container"},l.createElement("div",{className:"exp-date form-group-frac"},l.createElement("input",{"data-token":"exp_month",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"MM",maxLength:2,value:(h==null?void 0:h.expiryMonth)||"",onChange:s=>xe("expiryMonth",s.target.value)})),l.createElement("div",{className:"exp-year form-group-frac"},l.createElement("input",{"data-token":"exp_year",className:"form-control-frac required card-cvv-in",type:"text",style:{maxHeight:"36px"},placeholder:"YYYY",maxLength:4,value:(h==null?void 0:h.expiryYear)||"",onChange:s=>xe("expiryYear",s.target.value)})),l.createElement("div",{className:"security-digit form-group-frac"},l.createElement("input",{"data-token":"cvv",className:"form-control-frac card-cvv-in required",type:"text",style:{maxHeight:"36px"},maxLength:4,placeholder:"CVC",value:(h==null?void 0:h.cvv)||"",onChange:s=>xe("cvv",s.target.value)})))),(u==null?void 0:u.cardNumber)&&l.createElement("span",{className:"error-span"},u==null?void 0:u.cardNumber),l.createElement("p",{style:{margin:"0"}},u!=null&&u.expiryMonth||u!=null&&u.expiryYear?l.createElement("span",{className:"error-span",style:{paddingRight:"4px"}},u==null?void 0:u.expiryMonth):"",(u==null?void 0:u.cvv)&&l.createElement("span",{className:"error-span"},u==null?void 0:u.cvv)))),l.createElement("div",{className:"form-group-frac"},l.createElement("label",{htmlFor:"zip"},"ZIP"),l.createElement("input",{type:"text",className:"form-control-frac",maxLength:100,placeholder:"000000",value:(Nn=h==null?void 0:h.zipCode)!=null?Nn:"",onChange:s=>xe("zipCode",s.target.value)}),(u==null?void 0:u.zipCode)&&l.createElement("span",{className:"error-span"},u==null?void 0:u.zipCode)),z&&l.createElement("div",{className:"form-group-frac"},l.createElement("div",{className:"frac-tooltip-mn",style:{display:"flex",alignItems:"center",gap:"10px",paddingTop:"10px"}},l.createElement("input",{type:"checkbox",id:"save_card",className:"toggle-checkbox",checked:H,onChange:s=>x(s.target.checked)}),l.createElement("label",{htmlFor:"save_card",className:"toggle-label"}),l.createElement("label",{htmlFor:"save_card"},"Save card for future payments "),l.createElement("div",{className:"frac-tooltip-wrapper"},l.createElement("div",{className:"frac-tooltip-icon"},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},l.createElement("circle",{cx:"10",cy:"10",r:"10",fill:"#E0DFE2"}),l.createElement("path",{d:"M9.03406 12.0979V12.0072C9.04055 11.4153 9.10057 10.9443 9.21411 10.5943C9.3309 10.2442 9.49635 9.96102 9.71046 9.74463C9.92457 9.52824 10.1825 9.33095 10.4842 9.15274C10.6788 9.03182 10.854 8.89658 11.0097 8.74702C11.1655 8.59745 11.2887 8.42562 11.3796 8.2315C11.4704 8.03739 11.5158 7.82259 11.5158 7.58711C11.5158 7.3039 11.4477 7.05887 11.3114 6.85203C11.1752 6.64519 10.9935 6.48608 10.7664 6.3747C10.5426 6.26014 10.2928 6.20286 10.017 6.20286C9.76723 6.20286 9.52879 6.25378 9.3017 6.35561C9.07461 6.45744 8.88646 6.61655 8.73723 6.83294C8.588 7.04614 8.50203 7.3214 8.47932 7.65871H7C7.02271 7.08592 7.17032 6.60223 7.44282 6.20764C7.71533 5.80986 8.07543 5.50915 8.52311 5.30549C8.97405 5.10183 9.47202 5 10.017 5C10.6139 5 11.1363 5.10979 11.5839 5.32936C12.0316 5.54574 12.3788 5.84964 12.6253 6.24105C12.8751 6.62928 13 7.08274 13 7.60143C13 7.95784 12.9432 8.27924 12.8297 8.56563C12.7161 8.84885 12.5539 9.10183 12.3431 9.32458C12.1354 9.54733 11.8856 9.74463 11.5937 9.91647C11.3179 10.0851 11.0941 10.2601 10.9221 10.4415C10.7534 10.6229 10.6302 10.8377 10.5523 11.0859C10.4745 11.3341 10.4323 11.6412 10.4258 12.0072V12.0979H9.03406ZM9.76886 15C9.50284 15 9.27413 14.9077 9.08273 14.7232C8.89132 14.5354 8.79562 14.3095 8.79562 14.0453C8.79562 13.7844 8.89132 13.5617 9.08273 13.3771C9.27413 13.1893 9.50284 13.0955 9.76886 13.0955C10.0316 13.0955 10.2587 13.1893 10.4501 13.3771C10.6448 13.5617 10.7421 13.7844 10.7421 14.0453C10.7421 14.2204 10.6967 14.3811 10.6058 14.5274C10.5182 14.6706 10.4015 14.7852 10.2555 14.8711C10.1095 14.957 9.94728 15 9.76886 15Z",fill:"#161616"}))),l.createElement("div",{className:"frac-tooltip-text"},l.createElement("p",null,"If checked, I agree to give the ",l.createElement("b",null,W||"merchant")," permission to charge this credit card for agreed-upon purchases in the future.")))))),l.createElement("div",{className:"form-group-frac",style:{marginTop:"20px",padding:"0"}},l.createElement("button",{type:"submit",style:{margin:0},className:"pay-button"},be?fe(($n=Number(be))==null?void 0:$n.toFixed(2)):fe((Kt=Number(e))==null?void 0:Kt.toFixed(2)))))),l.createElement("div",{id:"ach",style:{display:Ee==="ach"?"block":"none"},className:"tabcontent"},l.createElement(l.Fragment,null,l.createElement("div",{className:"frac-heading-card-wrap"},l.createElement("div",{className:"frac-backarrow"},(qe==null?void 0:qe.length)>0&&je==="form"&&l.createElement("button",{className:"charge-payment-back-btn ",onClick:()=>Lt("list")}," ",l.createElement(aa,null))),l.createElement("h6",{className:"frac-card-payment-heading"},"Bank Payment")),je==="list"&&(qe==null?void 0:qe.length)>0?l.createElement(l.Fragment,null,l.createElement(Kn,{headingClass:"card-ach-heading-frac",listHeading:"Banks",ListItems:qe,selectedCard:ft,setSelectedCard:ut,handleDeleteCard:ve,otherButtonLabel:"Pay With Other Bank",otherButtonAction:()=>{Lt("form")}}),l.createElement("div",{className:"form-group-frac",style:{padding:"0"}},l.createElement("button",{className:"pay-button",style:{margin:"0px"},type:"submit",onClick:yt},fe((ti=Number(t))==null?void 0:ti.toFixed(2))))):l.createElement("form",{id:"ACHPaymentForm",style:{textAlign:"start"},onSubmit:rt,autoComplete:"off",onKeyDown:s=>{s.key==="Enter"&&St&&(s.preventDefault(),s.stopPropagation())}},l.createElement("div",{className:"ach-scrl",style:{minHeight:"444px",maxHeight:"444px"}},l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"nameonaccount"},"Name on account"),l.createElement("input",{type:"text",id:"nameonaccount",className:"form-control-frac",maxLength:100,placeholder:"John Doe",name:"name",value:(kn=o==null?void 0:o.name)!=null?kn:"",onChange:De}),(a==null?void 0:a.name)&&l.createElement("span",{className:"error-span"},a==null?void 0:a.name)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"routingnumber"},"Routing number"),l.createElement("input",{type:"text",id:"routingnumber",className:"form-control-frac",maxLength:9,placeholder:"000000000",name:"routingNumber",value:(pn=o==null?void 0:o.routingNumber)!=null?pn:"",onChange:De}),(a==null?void 0:a.routingNumber)&&l.createElement("span",{className:"error-span"},a==null?void 0:a.routingNumber)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"accountnumber"},"Account number"),l.createElement("input",{type:"text",id:"accountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"accountNumber",value:(Ai=o==null?void 0:o.accountNumber)!=null?Ai:"",onChange:De}),(a==null?void 0:a.accountNumber)&&l.createElement("span",{className:"error-span"},a==null?void 0:a.accountNumber)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"confirmaccountnumber"},"Confirm account number"),l.createElement("input",{type:"text",id:"confirmaccountnumber",className:"form-control-frac",maxLength:16,placeholder:"0000000000",name:"confirmAccountNumber",value:(zi=o==null?void 0:o.confirmAccountNumber)!=null?zi:"",onChange:De}),(a==null?void 0:a.confirmAccountNumber)&&l.createElement("span",{className:"error-span"},a==null?void 0:a.confirmAccountNumber)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"bankname"},"Bank name"),l.createElement("input",{type:"text",id:"bankname",className:"form-control-frac",maxLength:100,placeholder:"My Bank",name:"bankName",value:(Gi=o==null?void 0:o.bankName)!=null?Gi:"",onChange:De}),(a==null?void 0:a.bankName)&&l.createElement("span",{className:"error-span"},a==null?void 0:a.bankName)),((o==null?void 0:o.accountType)==="business saving"||(o==null?void 0:o.accountType)==="business checking")&&l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"companyName"},"Company name"),l.createElement("input",{type:"text",id:"companyName",className:"form-control-frac",maxLength:100,placeholder:"My Company",name:"companyName",value:(Ii=o==null?void 0:o.companyName)!=null?Ii:"",onChange:De}),(a==null?void 0:a.companyName)&&l.createElement("span",{className:"error-span"},a==null?void 0:a.companyName)),l.createElement("div",{className:"form-group-frac mb-4"},l.createElement("label",{htmlFor:"accounttype"},"Select account type"),l.createElement("select",{name:"accountType",id:"accounttype",className:"form-control-frac",value:(Qn=o==null?void 0:o.accountType)!=null?Qn:"",onChange:De},l.createElement("option",{value:""},"Select account"),ui.map(s=>l.createElement("option",{key:s.value,value:s.value},s.label)))),z&&l.createElement("div",{className:"form-group-frac mb-4 save-ach-div",style:{paddingTop:"5px"}},l.createElement("input",{type:"checkbox",id:"saveACH",className:"",maxLength:100,placeholder:"My Bank",checked:k,onChange:s=>P(s.target.checked)}),l.createElement("label",{className:"saveachlabel",htmlFor:"saveACH"},"Save ACH")),k&&l.createElement("div",{className:"form-group-frac mb-4 saveachtext"},l.createElement("p",null,"If checked, I agree to give the ",l.createElement("b",null,W||"merchant")," permission to charge this bank account for agreed-upon purchases in the future."))),l.createElement("div",{className:"form-group-frac "},l.createElement("button",{className:"pay-button",style:{margin:"20px 0 0"},type:"submit"},fe((xi=Number(t))==null?void 0:xi.toFixed(2))))))))))))))))},ra=Ar;import Ir from"axios";var Tr=({amount:e,bankAmount:t,submitBtnText:$="Pay",session_token:I,customerId:z,callback:q,merchantName:W="merchant",isPreAuth:G,surcharge:ye="0",submitBtnClass:E,submitBtnIcon:L,isRequest:Z,pass_fee:ie,pass_fee_amount:N,require3ds:y=!1,autoTrigger:D=!1,isPartial:O,bankSurcharge:b,partialRef:Fe})=>{let[_,tt]=bi(!1),[Me,oe]=bi(!1),[Le,bt]=bi(()=>()=>{}),[ke,Te]=bi(null),[se,Ee]=bi(null),Ue=zr(()=>({amount:e,bankAmount:t,submitBtnText:$,session_token:I,customerId:z,callback:q,merchantName:W,isPreAuth:G,surcharge:ye,submitBtnClass:E,submitBtnIcon:L,isRequest:Z,pass_fee:ie,pass_fee_amount:N,require3ds:y,autoTrigger:D,setShow:tt,setHandleCloseRef:bt,isPartial:O,bankSurcharge:b,partialRef:Fe}),[e,t,$,I,z,q,W,G,ye,E,L,Z,ie,N,y,D,O,b,Fe]),[hn,an]=bi(Ue);ka(()=>{_&&an(Ue)},[_,Ue]);let h=async()=>{var S;oe(!0);try{let u=await Ir.get(`${Ie}api/v1/gateway/get-order-details/${I}`,{params:{isPartial:O,partialRef:Fe}});if((S=u==null?void 0:u.data)!=null&&S.result){let me=u.data.data;me!=null&&me.orderGuid&&(Te(me==null?void 0:me.orderGuid),Ee(me==null?void 0:me.remainingAmount)),an(o=>M(C({},o),{amount:me.amount,pass_fee_amount:me.pass_fee_amount,pass_fee:me.pass_fee}))}}catch(u){console.log("error while getting skyosorderdeatils",u)}finally{oe(!1)}};return ka(()=>{_&&O&&Fe&&h()},[_,O,Fe]),Wn.createElement(Wn.Fragment,null,Wn.createElement("link",{href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"}),Wn.createElement(Fn,null),Wn.createElement(ta,null),Wn.createElement(Dn,null),Wn.createElement($i,null),!D&&Wn.createElement("button",{className:E||"paymentBtn",onClick:()=>tt(!0)},$,L),D?Wn.createElement(ra,M(C({show:_,loadingPrev:Me},hn),{orderGuid:ke,remainingAmount:se})):Wn.createElement(Sn,{open:_,onClose:Le},Wn.createElement(ra,M(C({show:_,loadingPrev:Me},hn),{orderGuid:ke,remainingAmount:se}))))};export{pr as AddCard,hr as CardOnFile,or as GetPaymentPage,xr as PartialPayment,Tr as PaymentWidget,lr as PreAuthPayment,Ua as RequestPayment,Da as RequestPreAuthPayment};
|