Created
July 16, 2018 07:21
-
-
Save martinschierle/fc7716d6fcf8aba7a6ca3b96ffd0b040 to your computer and use it in GitHub Desktop.
Small JS snippet to use via console to check gpay availability
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e = document.createElement("script"); | |
e.src = "https://pay.google.com/gp/p/js/pay.js"; | |
document.head.appendChild(e); | |
e.onload = function(){ | |
var paymentsClient = new google.payments.api.PaymentsClient({environment: 'TEST'}); | |
var allowedPaymentMethods = ['CARD', 'TOKENIZED_CARD']; | |
paymentsClient.isReadyToPay({allowedPaymentMethods: allowedPaymentMethods}) | |
.then(function(response) { | |
if (response.result) { | |
console.log("isReadyToPay: " + response.result); | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment