@tonder.io/ionic-full-sdk 0.0.46-beta.9 → 0.0.47-beta.DEV1406.a897fdd

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.
@@ -64,14 +64,14 @@ export const cardTemplate = (external: boolean, collectorIds: CollectorIds, isEn
64
64
  <div id="apmsListContainer" class="apms-list-container"></div>
65
65
  `:``}
66
66
  <div class="container-pay-button">
67
- <button id="${collectorIds.tonderPayButton}" class="pay-button">Pagar</button>
67
+ <button id="${collectorIds.tonderPayButton}" class="pay-button hidden">Pagar</button>
68
68
  ${isEnrollmentCard ? `
69
69
  <button id="${collectorIds.tonderSaveCardButton ? collectorIds.tonderSaveCardButton:''}" class="save-card-button">Guardar</button>
70
70
  `:``} </div>
71
71
  <iframe class="tds-iframe" allowtransparency="true" id="${collectorIds.tdsIframe}"></iframe>
72
72
  </div>
73
73
 
74
- ${external ? `` : `<style>
74
+ <style>
75
75
 
76
76
  @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap");
77
77
 
@@ -188,10 +188,11 @@ ${external ? `` : `<style>
188
188
  background-color: #000;
189
189
  color: #fff;
190
190
  margin-bottom: 10px;
191
- display: none;
192
191
  font-family: "Inter", sans-serif !important;
193
192
  }
194
-
193
+ .hidden{
194
+ display: none;
195
+ }
195
196
  .pay-button:disabled, pay-button[disabled] {
196
197
  background-color: #B9B9B9;
197
198
  }
@@ -403,34 +404,174 @@ ${external ? `` : `<style>
403
404
  }
404
405
 
405
406
  </style>
406
- `}`
407
+ `
407
408
 
408
- export const cardItemsTemplate = (external: boolean, cards: Card[]) => {
409
+ export const cardItemsTemplate = (external: boolean, cards: Card[], data: {collectorIds:CollectorIds; renderPaymentButton: boolean; acId: string}) => {
409
410
 
410
411
  const cardItemsHTML = cards.reduce((total: string, card: Card) => {
411
412
  return `${total}
412
- <div class="card-item" id="card_container-${card.skyflow_id}">
413
- <input id="${card.skyflow_id}" class="card_selected" name="card_selected" type="radio"/>
414
- <label class="card-item-label" for="${card.skyflow_id}">
415
- <img class="card-image" src="${getCardType(card.card_scheme)}" />
416
- <div class="card-number">${card.card_number}</div>
417
- <div class="card-expiration">Exp. ${card.expiration_month}/${card.expiration_year}</div>
418
- <div class="card-delete-icon">
419
- <button id="delete_button_${card.skyflow_id}" class="card-delete-button">
420
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">
421
- <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"/>
422
- </svg>
423
- </button>
424
- </div>
425
- </label>
413
+ <div class="ac" id="card_container-${card.skyflow_id}">
414
+ <div class="card-item">
415
+ <input id="${card.skyflow_id}" class="card_selected" name="card_selected" type="radio"/>
416
+ <label class="card-item-label" for="${card.skyflow_id}">
417
+ <img class="card-image" src="${getCardType(card.card_scheme)}" />
418
+ <div class="card-number">${card.card_number}</div>
419
+ <div class="card-expiration">Exp. ${card.expiration_month}/${card.expiration_year}</div>
420
+ <div class="card-delete-icon">
421
+ <button id="delete_button_${card.skyflow_id}" class="card-delete-button">
422
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">
423
+ <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"/>
424
+ </svg>
425
+ </button>
426
+ </div>
427
+ </label>
428
+ </div>
429
+ <div class="ac-panel">
430
+ <div class="ac-card-panel-container" id="acContainer${card.skyflow_id}">
431
+ <div class="cvvContainer" id="cvvContainer${card.skyflow_id}">
432
+ <div id="${data.collectorIds.cvv}${card.skyflow_id}" class="empty-div"></div>
433
+ <svg class="cvvIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="24" viewBox="0 0 270 178">
434
+ <defs>
435
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
436
+ <stop offset="0" stop-color="#386bbf"/>
437
+ <stop offset="1" stop-color="#032ea3"/>
438
+ </linearGradient>
439
+ <linearGradient id="linear-gradient-2" x1="0.5" y1="0.115" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
440
+ <stop offset="0" stop-color="#1c1c1c"/>
441
+ <stop offset="1" stop-color="#151515"/>
442
+ </linearGradient>
443
+ </defs>
444
+ <g id="Grupo_3" data-name="Grupo 3" transform="translate(-69 -312)">
445
+ <g id="Grupo_2" data-name="Grupo 2">
446
+ <rect id="Rectángulo_58" data-name="Rectángulo 58" width="253" height="165" rx="25" transform="translate(69 312)" fill="url(#linear-gradient)"/>
447
+ <rect id="Rectángulo_61" data-name="Rectángulo 61" width="68" height="8" rx="4" transform="translate(86 437)" fill="#fff" opacity="0.877"/>
448
+ <rect id="Rectángulo_66" data-name="Rectángulo 66" width="253" height="24" transform="translate(69 347)" fill="url(#linear-gradient-2)"/>
449
+ <g id="Elipse_4" data-name="Elipse 4" transform="translate(221 374)" fill="#fff" stroke="#191919" stroke-width="1">
450
+ <ellipse cx="59" cy="58" rx="59" ry="58" stroke="none"/>
451
+ <ellipse cx="59" cy="58" rx="58.5" ry="57.5" fill="none"/>
452
+ </g>
453
+ </g>
454
+ <text id="_123" data-name="123" transform="translate(240 448)" font-size="45" font-family="Menlo-Regular, Menlo"><tspan x="0" y="0">123</tspan></text>
455
+ </g>
456
+ </svg>
457
+ </div>
458
+ ${ data?.renderPaymentButton ?
459
+ `<div class="container-card-pay-button">
460
+ <button id="${data.collectorIds.tonderPayButton ? data.collectorIds.tonderPayButton:''}${card.skyflow_id}" class="card-pay-button pay-button">Pagar</button>
461
+ </div> `
462
+ :``
463
+ }
464
+ </div>
465
+ </div>
426
466
  </div>`
427
467
  }, ``);
428
468
 
429
- const cardItemStyle = external ? '' : `
469
+ const cardItemStyle = `
430
470
  <style>
431
-
432
471
  @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap");
433
-
472
+ .ac {
473
+ border: none;
474
+ background-color: transparent;
475
+ box-sizing: border-box;
476
+ margin-bottom: 0;
477
+ border-bottom: 1px solid #e2e8f0;
478
+ }
479
+ .ac-card-panel-container{
480
+ padding: ${data?.renderPaymentButton ? '20px 32px 0px 32px':'20px 32px 20px 32px'};
481
+ }
482
+ .cvvContainer{
483
+ max-width: 60%;
484
+ position: relative;
485
+ padding: 0px 19px 0px 19px;
486
+ }
487
+ .cvvIcon {
488
+ position: absolute;
489
+ right: 12%;
490
+ top: 43%;
491
+ opacity: 0;
492
+ transform: translateY(10px);
493
+ transition: opacity 0.3s ease, transform 0.3s ease;
494
+ }
495
+ .cvvContainer.show .cvvIcon,
496
+ .ac-card-panel-container.show .card-pay-button {
497
+ opacity: 1;
498
+ transform: translateY(0);
499
+ transition-delay: 0.3s;
500
+ }
501
+ .container-card-pay-button{
502
+ margin: 20px 0px;
503
+ }
504
+ .card-pay-button{
505
+ display: block;
506
+ opacity: 0;
507
+ transform: translateY(10px);
508
+ transition: opacity 0.3s ease, transform 0.3s ease;
509
+ }
510
+
511
+ .ac .ac-header {
512
+ margin: 0;
513
+ padding: 0;
514
+ }
515
+
516
+ .ac .ac-trigger {
517
+ font:
518
+ bold 16px "Arial",
519
+ sans-serif;
520
+ color: var(--color-black);
521
+ text-align: left;
522
+ width: 100%;
523
+ padding: 8px 32px 8px 8px;
524
+ display: block;
525
+ cursor: pointer;
526
+ background-color: transparent;
527
+ transition: color 0.25s ease;
528
+ position: relative;
529
+ text-decoration: none;
530
+ margin: 0;
531
+ border: 0;
532
+ }
533
+
534
+ .ac .ac-trigger::after {
535
+ content: "+";
536
+ text-align: center;
537
+ width: 15px;
538
+ transform: translate(0, -50%);
539
+ position: absolute;
540
+ right: 10px;
541
+ top: 50%;
542
+ }
543
+
544
+ .ac .ac-trigger:focus {
545
+ color: var(--color-grey);
546
+ }
547
+
548
+ .ac .ac-panel {
549
+ overflow: hidden;
550
+ transition-property: height, visibility;
551
+ transition-timing-function: ease;
552
+ }
553
+
554
+ .ac .ac-panel .ac-text {
555
+ font:
556
+ 15px/24px "Arial",
557
+ sans-serif;
558
+ color: var(--color-black);
559
+ padding: 8px;
560
+ margin: 0;
561
+ }
562
+
563
+ .ac.js-enabled .ac-panel {
564
+ visibility: hidden;
565
+ }
566
+
567
+ .ac.is-active .ac-panel {
568
+ visibility: visible;
569
+ }
570
+
571
+ .ac.is-active > .ac-header .ac-trigger::after {
572
+ content: "\\2013";
573
+ }
574
+
434
575
  .card-item-label {
435
576
  display: flex;
436
577
  justify-content: space-between;
@@ -448,7 +589,6 @@ export const cardItemsTemplate = (external: boolean, cards: Card[]) => {
448
589
  justify-content: start;
449
590
  align-items: center;
450
591
  gap: 33% 15px;
451
- border-bottom: 1px solid #e2e8f0;
452
592
  padding: 0px 30px;
453
593
  }
454
594
 
@@ -557,11 +697,23 @@ export const cardItemsTemplate = (external: boolean, cards: Card[]) => {
557
697
  transition-duration: 150ms;
558
698
  opacity: 10;
559
699
  }
560
-
700
+ @media screen and (max-width: 768px) {
701
+ .cvvContainer {
702
+ max-width: 70%;
703
+ }
704
+ }
705
+
706
+ @media screen and (max-width: 480px) {
707
+ .cvvContainer {
708
+ max-width: 100%;
709
+ }
710
+ }
561
711
  </style>
562
712
  `
563
713
  const cardItem = `
564
- ${cardItemsHTML}
714
+ <div class="accordion-container${data.acId}">
715
+ ${cardItemsHTML}
716
+ </div>
565
717
  ${cardItemStyle}
566
718
  `
567
719
  return cardItem;
@@ -584,7 +736,7 @@ export const apmItemsTemplate = (external: boolean, apms: ITonderPaymentMethod[]
584
736
  </div>`
585
737
  }, ``);
586
738
 
587
- const apmItemStyle = external ? '' :`
739
+ const apmItemStyle = `
588
740
  <style>
589
741
  .apm-item-label {
590
742
  display: flex;
@@ -400,4 +400,16 @@ export const getPaymentMethodDetails = (scheme_data: string): {icon: string; lab
400
400
 
401
401
  const clearSpace = (text: string) => {
402
402
  return text.trim().replace(/\s+/g, '');
403
+ }
404
+
405
+ export function generateRandomString(length: number) {
406
+ const characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; // Letras en minúscula y mayúscula
407
+ let result = "";
408
+
409
+ for (let i = 0; i < length; i++) {
410
+ const randomIndex = Math.floor(Math.random() * characters.length);
411
+ result += characters[randomIndex];
412
+ }
413
+
414
+ return result;
403
415
  }
@@ -63,6 +63,8 @@ export interface IInlineCheckout {
63
63
  removeCheckout(): void;
64
64
 
65
65
  /**
66
+ * @deprecated This method is deprecated and will be removed in a future release.
67
+ * It is no longer necessary to use this method; you can now pass all payment data directly in the configureCheckout function.
66
68
  * Set the payment data, such as customer, cart, and metadata. This is useful when using the default Tonder payment button.
67
69
  * @returns {void}
68
70
  * @public