@tonder.io/ionic-full-sdk 0.0.24-beta → 0.0.26-beta
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/.gitlab-ci.yml +18 -18
- package/README.md +448 -448
- package/cypress.config.js +9 -9
- package/dist/classes/inlineCheckout.d.ts +6 -1
- package/dist/helpers/template.d.ts +2 -1
- package/dist/index.js +1 -1
- package/index.js.example +49 -49
- package/package.json +27 -27
- package/rollup.config.js +14 -14
- package/src/classes/3dsHandler.ts +237 -237
- package/src/classes/checkout.ts +147 -147
- package/src/classes/inlineCheckout.ts +734 -623
- package/src/helpers/skyflow.ts +358 -358
- package/src/helpers/styles.ts +60 -60
- package/src/helpers/template.ts +520 -492
- package/src/helpers/utils.ts +148 -148
- package/src/index-dev.js +120 -120
- package/src/index.html +57 -57
- package/src/index.ts +6 -6
- package/src/types/commons.ts +42 -42
- package/src/types/skyflow.ts +40 -40
- package/tsconfig.json +22 -22
- package/dist/data/api.d.ts +0 -18
- package/dist/types/commons-ds.d.ts +0 -40
- package/dist/types/skyflow.ds.d.ts +0 -39
package/src/helpers/template.ts
CHANGED
|
@@ -1,493 +1,521 @@
|
|
|
1
|
-
import { getCardType } from './utils';
|
|
2
|
-
|
|
3
|
-
export type CollectorIds = {
|
|
4
|
-
holderName: string,
|
|
5
|
-
cardNumber: string,
|
|
6
|
-
expirationMonth: string,
|
|
7
|
-
expirationYear: string,
|
|
8
|
-
cvv: string,
|
|
9
|
-
tonderPayButton: string,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<div class="
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
${
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
color:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
color:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.collect-row
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
margin-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
padding
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.
|
|
228
|
-
|
|
229
|
-
font-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
content:
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.card-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
background-color:
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
1
|
+
import { getCardType } from './utils';
|
|
2
|
+
|
|
3
|
+
export type CollectorIds = {
|
|
4
|
+
holderName: string,
|
|
5
|
+
cardNumber: string,
|
|
6
|
+
expirationMonth: string,
|
|
7
|
+
expirationYear: string,
|
|
8
|
+
cvv: string,
|
|
9
|
+
tonderPayButton: string,
|
|
10
|
+
tonderSaveCardButton: string,
|
|
11
|
+
msgError: string,
|
|
12
|
+
msgNotification: string,
|
|
13
|
+
cardsListContainer: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type Card = {
|
|
17
|
+
card_scheme: string,
|
|
18
|
+
cardholder_name: string,
|
|
19
|
+
card_number: string,
|
|
20
|
+
expiration_month: string,
|
|
21
|
+
expiration_year: string,
|
|
22
|
+
skyflow_id: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const cardTemplate = (external: boolean, collectorIds: CollectorIds, isEnrollmentCard: boolean = false) => `
|
|
26
|
+
<div class="container-tonder">
|
|
27
|
+
<div id="${collectorIds.cardsListContainer}" class="cards-list-container"></div>
|
|
28
|
+
${!isEnrollmentCard ? `
|
|
29
|
+
<div class="pay-new-card">
|
|
30
|
+
<input checked id="new" class="card_selected" name="card_selected" type="radio"/>
|
|
31
|
+
<label class="card-item-label-new" for="new">
|
|
32
|
+
<img class="card-image" src="${getCardType("XXXX")}" />
|
|
33
|
+
<div class="card-number">Pagar con tarjeta</div>
|
|
34
|
+
</label>
|
|
35
|
+
</div>
|
|
36
|
+
`:``}
|
|
37
|
+
<div class="container-form">
|
|
38
|
+
<div id="${collectorIds.holderName}" class="empty-div"></div>
|
|
39
|
+
<div id="${collectorIds.cardNumber}" class="empty-div"></div>
|
|
40
|
+
<div class="collect-row">
|
|
41
|
+
<div id="${collectorIds.expirationMonth}" class="empty-div"></div>
|
|
42
|
+
<div id="${collectorIds.expirationYear}" class="expiration-year"></div>
|
|
43
|
+
<div id="${collectorIds.cvv}" class="empty-div"></div>
|
|
44
|
+
</div>
|
|
45
|
+
${!isEnrollmentCard ? `
|
|
46
|
+
<div class="checkbox">
|
|
47
|
+
<input id="save-checkout-card" type="checkbox">
|
|
48
|
+
<label for="save-checkout-card">
|
|
49
|
+
Guardar tarjeta para futuros pagos
|
|
50
|
+
</label>
|
|
51
|
+
</div>
|
|
52
|
+
`:``}
|
|
53
|
+
<div id="${collectorIds.msgError}"></div>
|
|
54
|
+
<div id="${collectorIds.msgNotification}"></div>
|
|
55
|
+
</div>
|
|
56
|
+
<button id="${collectorIds.tonderPayButton}" class="pay-button">Pagar</button>
|
|
57
|
+
<button id="${collectorIds.tonderSaveCardButton}" class="save-card-button">Guardar</button>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
${external ? `` : `<style>
|
|
61
|
+
|
|
62
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap");
|
|
63
|
+
|
|
64
|
+
.error-custom-inputs-tonder {
|
|
65
|
+
background-color: white;
|
|
66
|
+
position: absolute;
|
|
67
|
+
left: 0px;
|
|
68
|
+
bottom: -1px;
|
|
69
|
+
width: 100%;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
color: red;
|
|
72
|
+
font-family: "Inter", sans-serif !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.expiration-year .error-custom-inputs-tonder {
|
|
76
|
+
background-color: white;
|
|
77
|
+
position: absolute;
|
|
78
|
+
left: 0px;
|
|
79
|
+
bottom: 3px;
|
|
80
|
+
width: 100%;
|
|
81
|
+
font-size: 12px;
|
|
82
|
+
color: red;
|
|
83
|
+
font-family: "Inter", sans-serif !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.container-tonder {
|
|
87
|
+
background-color: #F9F9F9;
|
|
88
|
+
margin: 0 auto !important;
|
|
89
|
+
padding: 30px 10px 30px 10px;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
transition: max-height 0.5s ease-out;
|
|
92
|
+
max-width: 600px;
|
|
93
|
+
border: solid 1px #e3e3e3;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.collect-row {
|
|
97
|
+
display: flex !important;
|
|
98
|
+
justify-content: space-between !important;
|
|
99
|
+
width: 100% !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.collect-row > :first-child {
|
|
103
|
+
min-width: 120px; !important
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.expiration-year {
|
|
107
|
+
position: relative !important;
|
|
108
|
+
padding-top: 24px !important;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.empty-div {
|
|
112
|
+
position: relative;
|
|
113
|
+
height: 80px !important;
|
|
114
|
+
margin-top: 2px;
|
|
115
|
+
margin-bottom: 4px;
|
|
116
|
+
margin-left: 10px !important;
|
|
117
|
+
margin-right: 10px !important;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.error-container{
|
|
121
|
+
color: red !important;
|
|
122
|
+
background-color: #FFDBDB !important;
|
|
123
|
+
margin-bottom: 13px !important;
|
|
124
|
+
font-size: 80% !important;
|
|
125
|
+
padding: 8px 10px !important;
|
|
126
|
+
border-radius: 10px !important;
|
|
127
|
+
text-align: left !important;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.message-container{
|
|
131
|
+
color: #3bc635 !important;
|
|
132
|
+
background-color: #DAFCE4 !important;
|
|
133
|
+
margin-bottom: 13px !important;
|
|
134
|
+
font-size: 80% !important;
|
|
135
|
+
padding: 8px 10px !important;
|
|
136
|
+
border-radius: 10px !important;
|
|
137
|
+
text-align: left !important;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.pay-button {
|
|
141
|
+
font-size: 16px;
|
|
142
|
+
font-weight: bold;
|
|
143
|
+
min-height: 2.3rem;
|
|
144
|
+
border-radius: 0.5rem;
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
width: 100%;
|
|
147
|
+
padding: 1rem;
|
|
148
|
+
text-align: center;
|
|
149
|
+
border: none;
|
|
150
|
+
background-color: #000;
|
|
151
|
+
color: #fff;
|
|
152
|
+
margin-bottom: 10px;
|
|
153
|
+
display: none;
|
|
154
|
+
font-family: "Inter", sans-serif !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.pay-button:disabled, pay-button[disabled] {
|
|
158
|
+
background-color: #B9B9B9;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.save-card-button {
|
|
162
|
+
font-size: 16px;
|
|
163
|
+
font-weight: bold;
|
|
164
|
+
min-height: 2.3rem;
|
|
165
|
+
border-radius: 0.5rem;
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
width: 100%;
|
|
168
|
+
padding: 1rem;
|
|
169
|
+
text-align: center;
|
|
170
|
+
border: none;
|
|
171
|
+
background-color: #000;
|
|
172
|
+
color: #fff;
|
|
173
|
+
margin-bottom: 10px;
|
|
174
|
+
margin-top: 25px;
|
|
175
|
+
display: none;
|
|
176
|
+
font-family: "Inter", sans-serif !important;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.save-card-button:disabled, save-card-button[disabled] {
|
|
180
|
+
background-color: #B9B9B9;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.lds-dual-ring {
|
|
184
|
+
display: inline-block;
|
|
185
|
+
width: 14px;
|
|
186
|
+
height: 14px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.lds-dual-ring:after {
|
|
190
|
+
content: " ";
|
|
191
|
+
display: block;
|
|
192
|
+
width: 14px;
|
|
193
|
+
height: 14px;
|
|
194
|
+
border-radius: 50%;
|
|
195
|
+
border: 6px solid #fff;
|
|
196
|
+
border-color: #fff transparent #fff transparent;
|
|
197
|
+
animation: lds-dual-ring 1.2s linear infinite;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@keyframes lds-dual-ring {
|
|
201
|
+
0% {
|
|
202
|
+
transform: rotate(0deg);
|
|
203
|
+
}
|
|
204
|
+
100% {
|
|
205
|
+
transform: rotate(360deg);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@media screen and (max-width: 600px) {
|
|
210
|
+
.payment_method_zplit {
|
|
211
|
+
font-size: 16px !important;
|
|
212
|
+
width: 100% !important;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.payment_method_zplit label img {
|
|
216
|
+
display: none !important;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.cards-list-container {
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
padding: 0px 10px 0px 10px;
|
|
224
|
+
gap: 33% 20px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.checkbox label {
|
|
228
|
+
margin-left: 10px;
|
|
229
|
+
font-size: '12px';
|
|
230
|
+
font-weight: '500';
|
|
231
|
+
color: #1D1D1D;
|
|
232
|
+
font-family: "Inter", sans-serif !important;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.checkbox {
|
|
236
|
+
margin-top: 10px;
|
|
237
|
+
margin-bottom: 20px;
|
|
238
|
+
width: 100%;
|
|
239
|
+
text-align: left;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.pay-new-card {
|
|
243
|
+
display: flex;
|
|
244
|
+
justify-content: start;
|
|
245
|
+
align-items: center;
|
|
246
|
+
color: #1D1D1D;
|
|
247
|
+
gap: 33% 20px;
|
|
248
|
+
margin-top: 10px;
|
|
249
|
+
margin-bottom: 10px;
|
|
250
|
+
padding-left: 10px;
|
|
251
|
+
padding-right: 10px;
|
|
252
|
+
width: 90%;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.pay-new-card .card-number {
|
|
256
|
+
font-size: 16px;
|
|
257
|
+
font-family: "Inter", sans-serif !important;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.card-image {
|
|
261
|
+
width: 39px;
|
|
262
|
+
height: 24px;
|
|
263
|
+
text-align: left;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.card-item-label-new {
|
|
267
|
+
display: flex;
|
|
268
|
+
justify-content: start;
|
|
269
|
+
align-items: center;
|
|
270
|
+
color: #1D1D1D;
|
|
271
|
+
gap: 33% 20px;
|
|
272
|
+
margin-top: 10px;
|
|
273
|
+
margin-bottom: 10px;
|
|
274
|
+
padding-left: 10px;
|
|
275
|
+
padding-right: 10px;
|
|
276
|
+
width: 90%;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.card_selected {
|
|
280
|
+
position: relative;
|
|
281
|
+
width: 16px;
|
|
282
|
+
height: 16px;
|
|
283
|
+
appearance: none;
|
|
284
|
+
cursor: pointer;
|
|
285
|
+
border-radius: 100%;
|
|
286
|
+
border: 1px #3bc635 solid;
|
|
287
|
+
color: #3bc635;
|
|
288
|
+
transition-property: all;
|
|
289
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
290
|
+
transition-duration: 150ms;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.card_selected:before {
|
|
294
|
+
width: 8px;
|
|
295
|
+
height: 8px;
|
|
296
|
+
content: "";
|
|
297
|
+
position: absolute;
|
|
298
|
+
top: 50%;
|
|
299
|
+
left: 50%;
|
|
300
|
+
display: block;
|
|
301
|
+
transform: translate(-50%, -50%);
|
|
302
|
+
border-radius: 100%;
|
|
303
|
+
background-color: #3bc635;
|
|
304
|
+
opacity: 0;
|
|
305
|
+
transition-property: opacity;
|
|
306
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
307
|
+
transition-duration: 150ms;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.card_selected:checked {
|
|
311
|
+
border: 1px #3bc635 solid;
|
|
312
|
+
position: relative;
|
|
313
|
+
width: 16px;
|
|
314
|
+
height: 16px;
|
|
315
|
+
appearance: none;
|
|
316
|
+
cursor: pointer;
|
|
317
|
+
border-radius: 100%;
|
|
318
|
+
color: #3bc635;
|
|
319
|
+
transition-property: all;
|
|
320
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
321
|
+
transition-duration: 150ms;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.card_selected:checked:before {
|
|
325
|
+
content: "";
|
|
326
|
+
border: 1px #3bc635 solid;
|
|
327
|
+
width: 8px;
|
|
328
|
+
height: 8px;
|
|
329
|
+
position: absolute;
|
|
330
|
+
top: 50%;
|
|
331
|
+
left: 50%;
|
|
332
|
+
display: block;
|
|
333
|
+
transform: translate(-50%, -50%);
|
|
334
|
+
border-radius: 100%;
|
|
335
|
+
background-color: #3bc635;
|
|
336
|
+
opacity: 50;
|
|
337
|
+
transition-property: opacity;
|
|
338
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
339
|
+
transition-duration: 150ms;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.card_selected:hover:before {
|
|
343
|
+
width: 8px;
|
|
344
|
+
height: 8px;
|
|
345
|
+
content: "";
|
|
346
|
+
position: absolute;
|
|
347
|
+
top: 50%;
|
|
348
|
+
left: 50%;
|
|
349
|
+
display: block;
|
|
350
|
+
transform: translate(-50%, -50%);
|
|
351
|
+
border-radius: 100%;
|
|
352
|
+
background-color: #3bc635;
|
|
353
|
+
transition-property: opacity;
|
|
354
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
355
|
+
transition-duration: 150ms;
|
|
356
|
+
opacity: 10;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
</style>
|
|
360
|
+
`}`
|
|
361
|
+
|
|
362
|
+
export const cardItemsTemplate = (external: boolean, cards: Card[]) => {
|
|
363
|
+
|
|
364
|
+
const cardItemsHTML = cards.reduce((total: string, card: Card) => {
|
|
365
|
+
return `${total}
|
|
366
|
+
<div class="card-item" id="card_container-${card.skyflow_id}">
|
|
367
|
+
<input id="${card.skyflow_id}" class="card_selected" name="card_selected" type="radio"/>
|
|
368
|
+
<label class="card-item-label" for="${card.skyflow_id}">
|
|
369
|
+
<img class="card-image" src="${getCardType(card.card_scheme)}" />
|
|
370
|
+
<div class="card-number">${card.card_number}</div>
|
|
371
|
+
<div class="card-expiration">Exp. ${card.expiration_month}/${card.expiration_year}</div>
|
|
372
|
+
<div class="card-delete-icon">
|
|
373
|
+
<button id="delete_button_${card.skyflow_id}" class="card-delete-button">
|
|
374
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">
|
|
375
|
+
<path fill="currentColor" d="M292.309-140.001q-30.308 0-51.308-21t-21-51.308V-720h-40v-59.999H360v-35.384h240v35.384h179.999V-720h-40v507.691q0 30.308-21 51.308t-51.308 21H292.309ZM376.155-280h59.999v-360h-59.999v360Zm147.691 0h59.999v-360h-59.999v360Z"/>
|
|
376
|
+
</svg>
|
|
377
|
+
</button>
|
|
378
|
+
</div>
|
|
379
|
+
</label>
|
|
380
|
+
</div>`
|
|
381
|
+
}, ``);
|
|
382
|
+
|
|
383
|
+
const cardItemStyle = external ? '' : `
|
|
384
|
+
<style>
|
|
385
|
+
|
|
386
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap");
|
|
387
|
+
|
|
388
|
+
.card-item-label {
|
|
389
|
+
display: flex;
|
|
390
|
+
justify-content: space-between;
|
|
391
|
+
align-items: center;
|
|
392
|
+
color: #1D1D1D;
|
|
393
|
+
gap: 33% 20px;
|
|
394
|
+
margin-top: 10px;
|
|
395
|
+
margin-bottom: 10px;
|
|
396
|
+
padding-left: 10px;
|
|
397
|
+
padding-right: 10px;
|
|
398
|
+
width: 90%;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.card-item {
|
|
402
|
+
display: flex;
|
|
403
|
+
justify-content: start;
|
|
404
|
+
align-items: center;
|
|
405
|
+
gap: 33% 20px;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.card-item .card-number {
|
|
409
|
+
font-size: 16px;
|
|
410
|
+
font-family: "Inter", sans-serif !important;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.card-item .card-expiration {
|
|
414
|
+
font-size: 16px;
|
|
415
|
+
font-family: "Inter", sans-serif !important;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.card-image {
|
|
419
|
+
width: 39px;
|
|
420
|
+
height: 24px;
|
|
421
|
+
text-align: left;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.card-delete-button {
|
|
425
|
+
background-color: transparent !important;
|
|
426
|
+
color: #000000 !important;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.card-delete-button:hover {
|
|
430
|
+
background-color: transparent !important;
|
|
431
|
+
color: #D91C1C !important;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.card_selected {
|
|
435
|
+
position: relative;
|
|
436
|
+
width: 16px;
|
|
437
|
+
height: 16px;
|
|
438
|
+
appearance: none;
|
|
439
|
+
cursor: pointer;
|
|
440
|
+
border-radius: 100%;
|
|
441
|
+
border: 1px #3bc635 solid;
|
|
442
|
+
color: #3bc635;
|
|
443
|
+
transition-property: all;
|
|
444
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
445
|
+
transition-duration: 150ms;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.card_selected:before {
|
|
449
|
+
width: 8px;
|
|
450
|
+
height: 8px;
|
|
451
|
+
content: "";
|
|
452
|
+
position: absolute;
|
|
453
|
+
top: 50%;
|
|
454
|
+
left: 50%;
|
|
455
|
+
display: block;
|
|
456
|
+
transform: translate(-50%, -50%);
|
|
457
|
+
border-radius: 100%;
|
|
458
|
+
background-color: #3bc635;
|
|
459
|
+
opacity: 0;
|
|
460
|
+
transition-property: opacity;
|
|
461
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
462
|
+
transition-duration: 150ms;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.card_selected:checked {
|
|
466
|
+
border: 1px #3bc635 solid;
|
|
467
|
+
position: relative;
|
|
468
|
+
width: 16px;
|
|
469
|
+
height: 16px;
|
|
470
|
+
appearance: none;
|
|
471
|
+
cursor: pointer;
|
|
472
|
+
border-radius: 100%;
|
|
473
|
+
color: #3bc635;
|
|
474
|
+
transition-property: all;
|
|
475
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
476
|
+
transition-duration: 150ms;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.card_selected:checked:before {
|
|
480
|
+
content: "";
|
|
481
|
+
border: 1px #3bc635 solid;
|
|
482
|
+
width: 8px;
|
|
483
|
+
height: 8px;
|
|
484
|
+
position: absolute;
|
|
485
|
+
top: 50%;
|
|
486
|
+
left: 50%;
|
|
487
|
+
display: block;
|
|
488
|
+
transform: translate(-50%, -50%);
|
|
489
|
+
border-radius: 100%;
|
|
490
|
+
background-color: #3bc635;
|
|
491
|
+
opacity: 50;
|
|
492
|
+
transition-property: opacity;
|
|
493
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
494
|
+
transition-duration: 150ms;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.card_selected:hover:before {
|
|
498
|
+
width: 8px;
|
|
499
|
+
height: 8px;
|
|
500
|
+
content: "";
|
|
501
|
+
position: absolute;
|
|
502
|
+
top: 50%;
|
|
503
|
+
left: 50%;
|
|
504
|
+
display: block;
|
|
505
|
+
transform: translate(-50%, -50%);
|
|
506
|
+
border-radius: 100%;
|
|
507
|
+
background-color: #3bc635;
|
|
508
|
+
transition-property: opacity;
|
|
509
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
510
|
+
transition-duration: 150ms;
|
|
511
|
+
opacity: 10;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
</style>
|
|
515
|
+
`
|
|
516
|
+
const cardItem = `
|
|
517
|
+
${cardItemsHTML}
|
|
518
|
+
${cardItemStyle}
|
|
519
|
+
`
|
|
520
|
+
return cardItem;
|
|
493
521
|
}
|