public/js/gpay.js
/**
     * Initialize Google PaymentsClient after Google-hosted JavaScript has loaded
     *
     * Display a Google Pay payment button after confirmation of the viewer's
     * ability to pay.
     */
Initialize Google PaymentsClient after Google-hosted JavaScript has loaded
Display a Google Pay payment button after confirmation of the viewer's
ability to pay.
Initialize Google PaymentsClient after Google - hosted JavaScript has loaded Display a Google Pay payment button after confirmation of the viewer ' s ability to pay .
function onGooglePayLoaded() {
      const paymentsClient = getGooglePaymentsClient();
      paymentsClient.isReadyToPay(getGoogleIsReadyToPayRequest())
        .then(function(response) {
          if (response.result) {
            addGooglePayButton();
          }
        })
        .catch(function(err) {
          console.error(err);
        });
    }
function onGooglePayLoaded ( ) { onst  aymentsClient  etGooglePaymentsClient( ) ; aymentsClient. i sReadyToPay( g etGoogleIsReadyToPayRequest( ) ) . then ( function ( response ) { if ( response . result ) { addGooglePayButton ( ) ; } } ) . catch ( function ( err ) { console . error ( err ) ; } ) ; }
Initialize Google PaymentsClient after Google-hosted JavaScript has loaded
 Display a Google Pay payment button after confirmation of the viewer's
 ability to pay.
Initialize Google PaymentsClient after Google - hosted JavaScript has loaded Display a Google Pay payment button after confirmation of the viewer ' s ability to pay .
// show error in developer console for debugging