Manually call Google Pay


I want to do some database work between the user Clicking the Google Pay button or Main CC Button and the processing.

Is there any way I can call Google Pay manually rather than the callback.

My routine will do an Ajax request and get a response saying that the database insert was successful and then I want to proceed to popup the Google Pay window or get the card nonce on the standard form.

So I think on the normal form I can call getCardNonce() but on Google Pay how do I do this ??



There is no way to call Google Pay directly, unfortunately. I’ll update this to be a feature request for now.

1 Like

Ha, thanks for that. Glad I’m not going mad and there is indeed no easy solution. :slight_smile: In the meantime I will work on some absolute hack then :smirk:
Look forward to a version with this as I feel its something quite useful for anyone.

I did manage to get the functionality I required by hiding the real google pay button, making a duplicate and then invoking .click() on the hidden real one after I had completed my processing.

It would be nice to get this feature added though, so I can code it nicely :slight_smile:

1 Like

In the end we had to turn off this approach as doing a programmatic click is not the same as doing a real click in the eyes of the browsers. So, a programmatic click requires the user to authorize popups for the site, which was more than our users could handle. So we split the procssing into two pages, with Continue To Payment on the first step, and just the pure buttons on the second page. Works great, but the perfect solution would be the Non Button, pure javascript call, so still would be a great feature to have.