I am trying to integrate apple pay with my website but since i m not hosting it over https(running on localhost) i used ngrok to host it over https. but i dont have made any sandbox or any itunes connect account.
<script type="text/javascript">
function showApplePayButton()
{
document.getElementsByClassName("apple-pay-button").style.visibility = "visible";
}
document.addEventListener('DOMContentLoaded', () => {
if (window.ApplePaySession) {
if (ApplePaySession.canMakePayments) {
alert("going to show button")
showApplePayButton();
}
}
});
function applePayButtonClicked()
{
alert("apple pay begins")
var request = {
countryCode: 'US',
currencyCode: 'USD',
supportedNetworks: ['visa', 'masterCard'],
merchantCapabilities: ['supports3DS'],
total: { label: 'Your Label', amount: '10.00' },
}
debugger
var session = new ApplePaySession(2, request);
debugger
session.begin();
}
</script>
i am trying this code and no error is coming but payment sheet does not appear. Am i skipping any step here.