Ionic React Google Pay issue

Hey everyone,

I’ve been using a square react plugin for some time now without any issues.

However, I’m trying to implement the same plugin into a Ionic Hybrid app and I can get the credit card to function as expected, but the Google Pay button doesn’t work as expected.

When I click the “Pay with Google Pay” button, it opens a new browser (outside of the webview app) and asks me to login. Once I confirm the card I get a “Unknown Developer error” and when I click retry it tries to redirect to a localhost url.

I’m assuming the issue lies within the app opening a new browser instead of opening a window within the webview (‘like my functioning webview app does’) but i’m unsure of how to prevent the Google Pay button from opening a new window.

I understand this is not really a Square issue but maybe someone has come across this before or might know a fix…

Thanks!

Thanks for bringing this to our attention. The team is looking into this. :slightly_smiling_face:

Hello! Just wondering if there is any update on this? Thanks :slight_smile:

At this time there isn’t any additional updates on this however the team is working on this. :slightly_smiling_face:

Finally had some time to look into this issue again, I don’t have a resolution but maybe some more info that may help.

This is the redirect url after clicking “Ok” when the Developer error appears.

To me it looks like a capacitor issue that doesn’t allow the google pay window to open as a popup hence not being able to read or atleast return data.

https://localhost/home#__WA_RES__=%7B%22requestId%22%3A%22GPAY%22%2C%22origin%22%3A%22https%3A%2F%2Fpay.google.com%22%2C%22code%22%3A%22failed%22%2C%22data%22%3A%22%7B%5C%22statusCode%5C%22%3A%5C%22DEVELOPER_ERROR%5C%22%2C%5C%22errorCode%5C%22%3A2%2C%5C%22statusMessage%5C%22%3A%5C%22Popup%20blocker%20detected%2C%20you%20must%20handle%20the%20clickEvent%20synchronously!%5C%22%7D%22%7D

Hello,

I’ve created a CapacitorJs plugin which uses Square’s native card entry form and GooglePay and Apple pay. It basically just returns cardDetails after the forms have completed

Maybe someone wants to contribute to refactor and finalize, since I built this in 2 days with minimal java/swift knowledge

Thanks for sharing with the community. :slightly_smiling_face: