<!-- Amazon Pay / App Shop Issue: Hide payment option if channel is not website. -->

<script async>
async function amazonPayGatewayCheck() {
let amazonPayGatewayCheckDelay = await resolveAfterTimeout(2500);
try {
document.querySelectorAll("[data-gateway-name=amazon_pay]")[0].remove();
console.log('Amazon Pay gateway option removed')
}
catch(err) {
console.log('Amazon Pay gateway option not found')
}
}

if (Shopify.Checkout.step == 'payment_method' && AmazonPayments) {
document.addEventListener('DOMContentLoaded', (event) => {
amazonPayGatewayCheck()
});
}
</script>