voltrue2 / in-app-purchase

A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
http://iap.gracenode.org
Other
1.04k stars 287 forks source link

Getting 'Failed to validate purchase' on all my receipt data for Android #347

Open famictech2000 opened 2 years ago

famictech2000 commented 2 years ago

I am able to get the proper validation for Apple IAP but I can not get a single one for Android.

I get the following

Screen Shot 2021-07-13 at 9 21 11 PM

Can anyone please let me know if I am doing something wrong!!

lelzd3 commented 2 years ago

Hello, @famictech2000,

Have you found any solution yet, currently I am facing the same issue?

famictech2000 commented 2 years ago

@lelzd3 I have not... I am looking to possibly do other receipt validation, which is a shame cause it works for iOS. I will keep you posted on any progress, please do the same if you find a solution.

lexmihaylov commented 2 years ago

@famictech2000 @lelzd3 This is an issue with google play services. Resetting the client secret and tokens should fix the issue.

famictech2000 commented 2 years ago

@lexmihaylov sorry im new to Android and their Play store, how does one reset the secret and token?

lexmihaylov commented 2 years ago

@famictech2000 you can follow this guide https://developers.google.com/android-publisher/authorization, but instead of creating a new project you should select your project from the Google Play Console. You will be redirected to the Google Cloud Console where you should find the clientID that you are using it and click on it. A management page will popup for this clientID. At the very top you should see a "Reset Key" button. After resetting the key follow the steps from the guide listed under "Generating a refresh token" to get a new refresh token and access token. Lastly just update the client secret (client key), refresh token and access token in your application's configurations.