Skip to content

Imposible colocar contenido debajo de botón de pago en webpage usando HTML y CSS #31

Open

Description

@educadisllc

The

statement always places de payment button as the last statement on the webpage. I found it impossible to put any text or graphics below the button. As it is it is V4 is useless for me. V3 has served me well up to this point.

Activity

  1. osquiabro commented on Sep 24, 2024

    @osquiabro
    Collaborator

    lograstes hacer que funciona la version 4?

  2. educadisllc commented on Sep 24, 2024

    @educadisllc
    CollaboratorAuthor
  3. osquiabro commented on Sep 24, 2024

    @osquiabro
    Collaborator

    no se ven las imágenes.

  4. educadisllc commented on Sep 24, 2024

    @educadisllc
    CollaboratorAuthor
  5. lopezjorgel commented on Sep 24, 2024

    @lopezjorgel
    Collaborator
  6. osquiabro commented on Sep 24, 2024

    @osquiabro
    Collaborator

    creo que me esta ocurriendo lo mismo, no me sale el botón en la versión 4, pero el problema es que nadie de Evertec entra a ver los problemas reportados y en diciembre según un comunicado van a eliminar la versión 3

  7. fjcolonrodz commented on Sep 24, 2024

    @fjcolonrodz
    Collaborator

    Saludos, el 4 de septiembre envié un email a support con esta misma situación. De hecho, hice referencia a este Issue. Abajo screenshot del email enviado:


    Screenshot 2024-09-24 at 6 16 23 PM

    La única respuesta que he recibido fue el 5 de septiembre diciendo:

    Referiremos su consulta al grupo de programación. Tan pronto tengamos una respuesta nos comunicaremos con usted.

  8. osquiabro commented on Sep 25, 2024

    @osquiabro
    Collaborator

    por lo menos logras ver el boton, yo no logro verlo, ahora bien cree un html en mi web server con el script tal cual el ejemplo y logre ver el boton, solo si en env es produccion " env: 'production' " si es sandbox no aparece. Pero cuendo inserto dentro de mi app el codigo no aparece y no tengo ningun error en la consola

    <title>Payment</title>
    <script src="https://payments.athmovil.com/api/js/athmovil_base.js"></script> <script type="text/javascript"> const ATHM_Checkout = { env: 'production', publicToken: '6228cef95748aa08f282a94b2435dce99bdd5987', timeout: 600, theme: 'btn', lang: 'en', total: 1, subtotal: 1, tax: 1, metadata1: 'Prueba1.1', metadata2: 'Prueba2.2'
          }
          async function authorizationATHM(){
            const responseAuth = await authorization();
            console.log(responseAuth);
          }
          async function cancelATHM(){
            const responseCancel = await findPaymentATHM();
            console.log(responseCancel);
          }
          async function expiredATHM(){
            const responseExpired = await findPaymentATHM();
            console.log(responseExpired);
          }
    </script>
    
  9. educadisllc commented on Sep 25, 2024

    @educadisllc
    CollaboratorAuthor
  10. osquiabro commented on Sep 25, 2024

    @osquiabro
    Collaborator

    en adiccion en ambiente de sandbox no funciona el boton

  11. fjcolonrodz commented on Sep 25, 2024

    @fjcolonrodz
    Collaborator

    @osquiabro entiendo que el entorno sandbox lo deshabilitaron en la nueva versión. Según la documentación:

    Disclaimer: We currently do not have a Testing environment. You need to have an active ATH Business account and a active ATH Móvil account.

  12. osquiabro commented on Sep 25, 2024

    @osquiabro
    Collaborator

    @fjcolonrodz, lei el Disclaimer pero es confuso ya que entiendo que se debe tener una ATH Business activa para poder obtener los tokens, pero para uno hacer pruebas del flujo debe de haber un ambiente de prueba, imagina que todas las pruebas se tenga que estar enviando dinero y luego que te lo devuelvan.

  13. osquiabro commented on Sep 26, 2024

    @osquiabro
    Collaborator

    Saludos, logre que aparezca el botón pero en efecto lo pone en la parte izquierda del footer, sin posibilidad de poder ponerlo donde uno quiere.

    En adicción es importante que se cuente con un ambiente de prueba, todos los engines de pagos que he trabajado lo tienen.
    @educadisllc @fjcolonrodz

  14. educadisllc commented on Sep 26, 2024

    @educadisllc
    CollaboratorAuthor
  15. gissimo commented on Sep 26, 2024

    @gissimo
    Collaborator

    Hola, yo estoy usando V3 y tengo claro que dentro de poco habrá que pasar a V4. Aún no me he podido poner con ello, en cuanto pueda compartiré experiencia. Vistos los problemas, se agradecería soporte de la parte de Evertec (@joel27martinez, @duhamel-rosado, @diegomevertec, @atomicalsoftwares). Gracias y saludos, Giorgio

  16. 3 remaining items

  17. lopezjorgel commented on Oct 24, 2024

    @lopezjorgel
    Collaborator
  18. gustavoelizalde commented on Oct 24, 2024

    @gustavoelizalde
    Collaborator

    Muchas gracias por el update @lopezjorgel

  19. osquiabro commented on Oct 27, 2024

    @osquiabro
    Collaborator

    curiosamente el 25 de Octubre volvieron a enviar el mensaje que la versión 4 entra en vigor el 1 de diciembre

  20. jossphCoro commented on Nov 19, 2024

    @jossphCoro

    por lo menos logras ver el boton, yo no logro verlo, ahora bien cree un html en mi web server con el script tal cual el ejemplo y logre ver el boton, solo si en env es produccion " env: 'production' " si es sandbox no aparece. Pero cuendo inserto dentro de mi app el código no aparece y no tengo ningún error en la consola

    <title>Pago</title> <script src="https://pagos.athmovil.com/api/js/athmovil_base.js"></script> <script type="text/javascript"> const ATHM_Checkout = { env: 'production', publicToken: '6228cef95748aa08f282a94b2435dce99bdd5987', timeout: 600, theme: 'btn', lang: 'es', total: 1, subtotal: 1, tax: 1, metadata1: 'Prueba1.1', metadata2: 'Prueba2.2' ``` } async function authorizationATHM(){ const responseAuth = await authorization(); console.log(responseAuth); } async function cancelATHM(){ const responseCancel = await findPaymentATHM(); console.log(responseCancel); } async function expiredATHM(){ const responseExpired = await findPaymentATHM(); console.log(responseExpired); } </script> ```

    Hola. @osquiabro como pudiste resolver esto?

  21. osquiabro commented on Nov 19, 2024

    @osquiabro
    Collaborator

    usando le token de producción, en prueba no funciona el botón lo cual es algo que deben corregir, pero el problema del botón en el footer persiste..

  22. jossphCoro commented on Nov 19, 2024

    @jossphCoro

    en efecto estoy utilizando el token en producción, pero si creo un html si funciona pero dentro de la app donde funcionaba la v3 no se muestra... , se debe de activar algo en la cuenta previamente?

  23. osquiabro commented on Nov 19, 2024

    @osquiabro
    Collaborator

    verifica que no este en la parte izquierda de abajo en el footer, ahi es donde se genera..

  24. atomicalsoftwares commented on Nov 19, 2024

    @atomicalsoftwares
    Collaborator

    Tienen un environment donde pueda verlo?

  25. gustavoelizalde commented on Dec 20, 2024

    @gustavoelizalde
    Collaborator

    Hola a todos, solo haciendo seguimiento a este issue. ¿Seguimos sin noticias de Evertec al respecto?

  26. osquiabro commented on Jan 28, 2025

    @osquiabro
    Collaborator

    utilice la solución de esta pagina https://eventivate.com/ donde el botón de pago que se encuentra en el footer se oculta y se crea otro botón tipo hyperlink donde ese hyperlink al hacer click ejecuta el botón que esta en el footer oculto, y todo queda donde uno quiere.

  27. gustavoelizalde commented on Jan 29, 2026

    @gustavoelizalde
    Collaborator

    Hoy recibí un correo de Evertec mencionando la obligatoriedad de migrar a la versión 4 antes del 31 de Mayo... pero alguien sabe si estos errores fueron solucionados?

  28. joel27martinez commented on Jan 29, 2026

    @joel27martinez
    Contributor

    Hola @gustavoelizalde, se hicieron mejoras en ultimo release. Pueden intentar nuevamente y si enfrentan algún inconveniente pueden dejarnos un comment para que el equipo de Evertec lo pueda revisar.

  29. osquiabro commented on Jan 29, 2026

    @osquiabro
    Collaborator

    ahora si aparece donde uno quiere posicionarlo, podrían eliminar este div "div style="width: 150px">" o parametrizarlo limita el tamaño del botón y por otro lado porque no habilitan un sandbox como lo tenia antes, estar haciendo pruebas en un ambiente de producción no es la regla.

  30. gissimo commented on Mar 7, 2026

    @gissimo
    Collaborator

    Logré hacer una integración funcional de V4 en un entorno basado en Bootstrap y encontré varios problemas en el proceso. Comparto lo que encontré por si le sirve a alguien.

    Para quien tenga el mismo problema de ubicación del botón que reporta este issue: según tengo entendido, el equipo de ATH Móvil ya corrigió eso en una versión reciente. Les recomiendo verificar que estén usando la última versión de la librería.

    Tres problemas adicionales que encontré:

    1. Bootstrap sobreescribe los estilos del label de ATH Móvil -- en particular font-weight: 700, lo que rompe la animación de foco (transición de color y tamaño de gris a naranja).
    2. Safari muestra un ícono de autocompletado de contraseña en el campo de teléfono, porque el atributo id="usernameATHM" activa la heurística de credenciales del navegador, independientemente de autocomplete="off".
    3. Violaciones de CSP -- ATH Móvil inyecta el botón vía innerHTML con un atributo onclick="sendATHMPayment()" en línea, lo cual es bloqueado por políticas de seguridad de contenido estrictas.

    El CSS incluye además algunas correcciones de layout y presentación: #ATHMovil_Checkout_Button_payment necesita que su primer hijo ocupe el ancho completo del contenedor, ya que de lo contrario el botón queda truncado en ciertos layouts. #buttonATHMBP requiere sobrescribir dimensiones, padding y sombras que entran en conflicto con Bootstrap, con un breakpoint adicional para pantallas pequeñas. Finalmente, #athmOpenModal necesita un z-index elevado para que el modal de pago quede por encima de otros elementos de la página, como navbars fijas o sidebars.

    Correcciones CSS:

    /* Bootstrap sets label { font-weight: 700 }, overriding ATH Móvil's label.
       Only fix font-weight; leave color and font-size to ATH Móvil's own CSS
       so the focus transition (grey→orange, 14px→0.74rem) still works. */
    #athmOpenModal .athm-waiting-input-label-with-mark-color {
      font-size: 0.9rem !important;
      font-weight: normal !important;
      margin-bottom: 0 !important;
    }
    /* Hide Safari's Password AutoFill key icon — id="usernameATHM" triggers it
       regardless of autocomplete="off" or form-level settings. */
    #usernameATHM::-webkit-contacts-auto-fill-button,
    #usernameATHM::-webkit-credentials-auto-fill-button {
      visibility: hidden !important;
      pointer-events: none !important;
    }
    #ATHMovil_Checkout_Button_payment > div:first-child {
      width: 100% !important;
    }
    #buttonATHMBP {
      width: 100% !important;
      min-width: 0 !important;
      height: 55px !important;
      min-height: 55px !important;
      padding: 0 !important;
      box-shadow: none !important;
      background-size: auto 21px !important;
    }
    @media (max-width: 579px) {
      #buttonATHMBP {
        height: 45px !important;
        min-height: 45px !important;
      }
    }
    #athmOpenModal {
      z-index: 100000 !important;
    }

    Corrección JS (CSP + autocompletado de Safari):

    // ATH Móvil's script (athmovil_base.js, served from payments.athmovil.com) injects
    // inline onclick handlers into the DOM. CSP allows them via 'unsafe-hashes' in
    // script-src (CSP_ATHMOVIL in deploy.py) with the sha256 of each handler string:
    //   sendATHMPayment()    sha256-tkm5rus5ZS+64NxAT6iFbC1GXweLvod76wu+U0O7wM8=  "Pay" button (#buttonATHMBP)
    //   validatePhoneATHM() sha256-XvqD1g8JFJlvMuOHeQKWcbfoxyN1PRxMaxYRGN0L0Bk=  phone confirmation button (in modal)
    //   cancelPaymentATHM() sha256-xxOMyV6ZsVA51pnGoPeNrjTppkxuVy7MWq2VUv8aE04=  cancel button (in modal)
    //
    // MAINTENANCE NOTE: if ATH Móvil updates their script and a new script-src-attr
    // violation appears, Firefox includes the sha256 of the offending handler string
    // in the violation report. Verify with:
    //   echo -n 'handlerString()' | openssl dgst -sha256 -binary | base64
    // then add the hash to CSP_ATHMOVIL['script-src'] in deploy.py.
    //
    // The MutationObserver below is unrelated to onclick; it fixes the phone input
    // field (#usernameATHM) injected by ATH Móvil's modal UI.
    
    // Patch Document.prototype lookup methods so ATH Móvil's script can still find
    // the phone input after we rename id="usernameATHM" below.
    // Must run before athmovil_base.js loads. Applies to all documents (main + popup)
    // because it patches the prototype, not the instance.
    (function() {
      var _origGetById = Document.prototype.getElementById;
      var _origQS = Document.prototype.querySelector;
      var _origQSA = Document.prototype.querySelectorAll;
      Document.prototype.getElementById = function(id) {
        if (id === 'usernameATHM') {
          return _origQS.call(this, '[data-athm-phone]') || _origGetById.call(this, id);
        }
        return _origGetById.call(this, id);
      };
      Document.prototype.querySelector = function(sel) {
        if (sel === '#usernameATHM') {
          return _origQS.call(this, '[data-athm-phone]') || _origQS.call(this, sel);
        }
        return _origQS.call(this, sel);
      };
      Document.prototype.querySelectorAll = function(sel) {
        if (sel === '#usernameATHM') {
          var r = _origQSA.call(this, '[data-athm-phone]');
          return r.length ? r : _origQSA.call(this, sel);
        }
        return _origQSA.call(this, sel);
      };
    }());
    
    // Intercept window.open for Firefox/Chrome: ATH Móvil renders its phone-number
    // UI inside a window.open('') popup on those browsers (not Safari, which uses
    // an inline overlay in the main document instead).
    (function() {
      var _origOpen = window.open;
      window.open = function() {
        var popup = _origOpen.apply(this, arguments);
        if (!popup) { return popup; }
        var poll = setInterval(function() {
          if (!popup || popup.closed) { clearInterval(poll); return; }
          try {
            var input = popup.document && popup.document.getElementById('usernameATHM');
            if (input) { clearInterval(poll); _athmFixPhoneInput(input); }
          } catch (e) { clearInterval(poll); }
        }, 50);
        return popup;
      };
    }());
    
    function _athmFixPhoneInput(phoneInput) {
      if (!phoneInput) { return; }
      phoneInput.setAttribute('type', 'tel');
      phoneInput.setAttribute('autocomplete', 'off');
      phoneInput.setAttribute('name', 'tel');
      // Rename id to remove the word "username", which Safari treats as a strong
      // credential-field signal and uses to offer Password AutoFill regardless of
      // the autocomplete attribute value. The Document.prototype patches above
      // ensure ATH Móvil's script still finds the element by the old id.
      phoneInput.setAttribute('data-athm-phone', '');
      phoneInput.id = 'athm-phone';
      // Wrap the input group in a <form autocomplete="off"> as an additional layer.
      // Wrap the group ancestor, not the input itself, to preserve
      // ATH Móvil's ">.athm-waiting-input-underlined > input" CSS selectors.
      // Use ownerDocument: the input may be in a popup with its own document.
      var inputGroup = phoneInput.closest('.athm-login-form-input-group');
      if (inputGroup && inputGroup.parentNode && inputGroup.parentNode.tagName !== 'FORM') {
        var form = phoneInput.ownerDocument.createElement('form');
        form.setAttribute('autocomplete', 'off');
        form.addEventListener('submit', function(e) { e.preventDefault(); });
        inputGroup.parentNode.insertBefore(form, inputGroup);
        form.appendChild(inputGroup);
      }
    }
    
    new MutationObserver(function(mutations) {
      for (var i = 0; i < mutations.length; i++) {
        var mutation = mutations[i];
        for (var j = 0; j < mutation.addedNodes.length; j++) {
          var node = mutation.addedNodes[j];
          _athmFixPhoneInput(node.nodeType === 1 && (node.id === 'usernameATHM' ? node : node.querySelector && node.querySelector('#usernameATHM')));
        }
      }
    }).observe(document.documentElement, { childList: true, subtree: true });

    El enfoque con MutationObserver es necesario porque ATH Móvil construye el botón y el modal de forma dinámica; no es posible parchear estos elementos antes de que corra la librería. Espero que le ahorre tiempo a alguien.

  31. lopezjorgel commented on Apr 16, 2026

    @lopezjorgel
    Collaborator

    Logré integrar el botón luego de bastante tiempo identificando los conflictos que el botón crea con mis definiciones de CSS. Una vez resuelto los conflictos, el botón funciona como esperado. Añadí las correcciones sugeridas por Gissimo y funcionan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions