Page History
...
The connected Google Pay API JS script launches a handler that checks the device and displays a button:
Code Block | ||
---|---|---|
| ||
function onGooglePayLoaded() {
const paymentsClient = getGooglePaymentsClient()
paymentsClient.isReadyToPay(getGoogleIsReadyToPayRequest()) //device check
.then(funtion(response) {
If (response.result) {
addGooglePayButton(); //button display
prefetchGooglePaymentData();
}
})
.catch(function(err) { //error processing
console.error(err); //error output to the console
})
} |