Apple pay button on mendix page.

Hi All,   I need to implement apple pay in my project. The very first requirement is I should show the apple pay button on safari browser but not in other browser after checking apple pay JS availability. as first thing, I could do it using simple HTML+JS in a simple html file. below is the reference. How can I integrate the same on my mendix page. I tried with html snippets and JS snippets but did not work. Please help me if any one knows.   <!DOCTYPE html> <html>     <head>         <script src=""></script>         <style>             apple-pay-button {               --apple-pay-button-width: 140px;               --apple-pay-button-height: 30px;               --apple-pay-button-border-radius: 5px;               --apple-pay-button-padding: 5px 0px;               display: initial;             }             </style>     </head>     <body>         <apple-pay-button id="applebtn" buttonstyle="black" type="continue" locale="en-US"></apple-pay-button>         <script type="text/javascript">             const btn = document.getElementById('applebtn');         if (window.ApplePaySession) {    'block';                  }          else          {    'none';                            }         </script>     </body> </html>
2 answers

Two things need to happen:

  • the scripts needs to trigger; The html-javascript snippet can certainly do this.
  • the style.display needs to change for the button. const btn will probably be ok. Maybe ApplePaySession is false. You can check this using the Inspector (F12) and debug that script. 

Do they both not work, or just (part of) one of them?



The html-snippet, added to any part of a page, having this settings, should trigger the alert ‘hi’ on page-load, and trigger the script to show or hide your button:



Hi Swamy Nandikam,


Can you please refer this link which will helps you definitely in addition I think