I have an issue with api request for checking purchase in my app (my own script on server).
packageName is 100% correct
productId is 100% correct
purchaseToken is auto-generated and always different, so it can’t be “checked”
I use test-purchase from unity.
https://support.google.com/googleplay/android-developer/thread/237869465/service-account-issues-in-verifying-in-app-purchases-via-android-developer-api-and-rtdn?hl=en
same topic in which all points of “answer” is done and checked, but problem is still relevant
I use this:
var request = _service.Purchases.Products.Get(packageName, productId, purchaseToken);
var response = await request.ExecuteAsync();
return response.PurchaseState == 0;
with:
using Google.Apis.AndroidPublisher.v3;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
and i always get:
Package Name: com.---.---
Product ID: 1
Purchase Token: c239303e-2a2e-42ec-9a23-510bef038c67
Error verifying purchase: The service androidpublisher has thrown an exception. HttpStatusCode is BadRequest. Invalid Value Error details: Google.Apis.Requests.RequestError Invalid Value [400] Errors [ Message[Invalid Value] Location[ - ] Reason[invalid] Domain[global] ]
Changed purchase token to “Payload” inside of receipt (as it seems correct by documentation) but it is just a clear string in testing, so i cannot check (“”)
Also while checking on real device, i received error as follows: “This version of app does not work with google play pay services” (IAP for unity as service is initiated and activated)
Richard Triald is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.