Two things need to happen:
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:
Tim v Steenbergen
Hi Swamy Nandikam,
Can you please refer this link which will helps you definitely in addition I think