Multiple javascript errors when integrating GPay

Hi there

I’m trying to implement the GPay payment method using Web Payments Sdk in my web site.
I followed the corresponding guide and the button shows up, on click it also opens the GPay pop-up and everything seems fine (didn’t tried to pay actually).
However in my javascript console I get multiple errors that seems to happen inside the pay.js google module (please see the screenshot).

Any ideas whats going on ? do I miss something like enabling GPay somewhere or what ? also have problems running this on IPhone 13 mini, the button just not renders.

Thanks

Code snippet:
const payments = Square.payments(“@Model.ApplicationId”, “@Model.LocationId”);

const paymentRequest = payments.paymentRequest({
countryCode: ‘US’,
currencyCode: ‘USD’,
total: {
amount: ‘@amount’,
label: ‘Total’,
},
});

const googlePay = await payments.googlePay(paymentRequest);
await googlePay.attach(‘#google-pay-button’);

async function gpayEventHandler(event) {
await eventHandler(event, googlePay);
};

const googlePayButtonTarget = document.getElementById(‘google-pay-button’);
googlePayButtonTarget.addEventListener(‘click’, gpayEventHandler);

I’m not sure what’s going on there since thats happening in the Google popup. If you actually make a payment does it work or does it throw an error? :slightly_smiling_face: