Hello guys,
Recently (well not really recently) Android Pay has been replaced with Google Pay,
and its documentation AND javascript API has changed (and previous doumentation is not available anywhere).
I am trying to implement Google Pay "for the web" integration, meaning I will not use any Android SDKs, but a simple Google Pay integration for my ecommerce online store.
I followed up everything written on this page:
https://developer.authorize.net/api/reference/features/in-app.html#Google_Pay
and it all works fine until the last step:
let token = paymentData.paymentMethodToken.token; var enc = window.btoa(token);
Currently, there is no paymentMethodToken at all in Google Pay. I guess the reference is to API v1 and recent API is v2. So instead, they changed it to be
paymentToken = paymentData.paymentMethodData.tokenizationData.token;
which also seem to work, and even returns some kind of a valid token (a json object with lots of data and keys).
Finally, when I try to
var enc = window.btoa(paymentToken);
and send it to Authorize.net createTransactionRequest, it fails with the error:
Payment failed: [153] There was an error processing the payment data. Unable to decrypt data.
Apparently, it seems that the token itself has changed (or maybe I am wrong), but the Authorize is not capable to decrypt this kind of token from the V2 API of Google Pay.
Lastly, there is no example from Authorize on how to properly use the token for the web (example is only available for Android), while it is available for Apple Pay for the web which works great.
Any help would be much appreciated!
Has anyone tried to integrate Google Pay for the web with Authorize?
Has anyone succeeded in accepting payments via Google Pay using Authorize on a simple website?
Thanks!
10-22-2019 08:43 AM
I agree.
let token = paymentData.paymentMethodToken.token; var enc = window.btoa(token);
This section of code is very confusing.
did you ever manage to get this working?
Thanks,
matchbx
04-07-2020 05:26 PM
Hi, I have always used Google pay via app and not tried anthing else so I wont be able to help ypu but I would suggest you to do the payment thru app itself, it is much easire. Hope your issue is solved by now also I am Oliver, just joined the community, I am working on a project related to frieght management solution.
We don't have an App. We have a web site our CEO wants us to integrate Google Pay into. To keep confusion down with canceling transactions, we'd perfer to push everything through Auth.Net.
Thanks,
matchbx
04-08-2020 06:11 AM
Me too. I goi same the issue. Look like authorizenet not support google pay
02-25-2021 08:13 PM
yes in these days so many people are facing the similar type of issue that you shared in the post but you know about the right things like takingguide from the websites that are servicing for this solution.
Apparently, it seems that the token itself has changed (or maybe I am wrong), but the Authorize is not capable to decrypt this kind of token from the V2 API of Google Pay.
07-16-2021 11:41 PM
I have the same issue. Any tips for solution?
07-17-2021 12:57 AM
any update on the issue ?
07-24-2021 05:54 AM - last edited on 08-11-2022 08:14 AM by Kh-SabW
I managed to submit a successful transaction.
You need the specification to look like this:
var tokenizationSpecification = { type: 'PAYMENT_GATEWAY', parameters: { 'gateway': 'authorizenet', 'gatewayMerchantId': '[GatewayID from AuthNET]' } };
The gateway ID can be obtained from here:
https://developer.authorize.net/api/reference/index.html#transaction-reporting-get-merchant-details
var paymentToken = paymentData.paymentMethodData.tokenizationData.token; var encodedToken = btoa(paymentToken);
and send the encodedToken to the API.
I hope this helps!
12-08-2023 08:02 AM