cancel
Showing results for 
Search instead for 
Did you mean: 

Google Pay for the web integration with Authorize.net problem

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!

abbatweb
Member
12 REPLIES 12

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

matchbx
Member

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.  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OliverM
Member

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

Me too. I goi same the issue. Look like authorizenet not support google pay

lenguyenitc91
Member

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.

farel354
Member

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.  

https://www.dumpsleader.com/PT0-001-exam-dumps.html

I have the same issue. Any tips for solution?

paulmicky57
Member

any update on the issue ? 

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

And from the transaction, you need to get the paymentToken and base64 encode it:
var paymentToken = paymentData.paymentMethodData.tokenizationData.token;
var encodedToken = btoa(paymentToken);

and send the encodedToken to the API.

I hope this helps!

kr1skyyy
Member