<script async
srce="https://pay.google.com/gp/p/js/pay.js"
onload="onGooglePayLoaded()">
  </script>

function onGooglePayLoaded()  {
  const googlePayClient =
    new google.payments.api.PaymentsClient({
      environment: 'TEST'
        });
}

//IsReadyToPay//

const Client Configuration = {
  apiVersion: 2,
  apiVersionMinor: 0,
  allowedPaymentMethods: {cardPaymentMethod]
                         };

googlePayClient.isReadyToPay(clientConfiguration)
.then(function(response) {
  if(response.result) {
    // add a Google Pay Button
  }
}).catch(function(err) {
  //log error in developer console
});

//--CreateButton---//

googlePayClient.createButton({
  // defaults to black if default or omitted
buttonColor:'default',
  //defaults to long if omitted
buttonType:'long',
  onClick: onGooglePaymentsButtonClicked });

// --- LoadPaymentDate ---//

const paymentDataRequest = Object.assign({},
                                         clientConfiguration);

paymentDataREquest.transactionInfo = {
  totalPriceStatus:'FINAL',
  totalPrice:'123.45',
  currencyCode:'USD',
};
paymentDataRequest.merchantInfo = {
  merchantID:'0123456789'
  merchantName'Cody Abrahahamson Coaching LLC'
};