question

Raul' avatar image
Raul' asked

Error when using "RedeemGooglePlayInventoryItems" method.

I've problems with redeem purchase after iap.

Error: Error Unity Failed to redeem purchase: GetInAppPurchasesFailure: Failed to get purchases from GooglePlay; Error Unity Reason:Error deserializing JSON credential data.

I found a person on the forum with the same problem: https://community.playfab.com/questions/79700/error-when-using-redeemgoogleplayinventoryitems.html, but I have all the data filled in correctly. (such as the key to the service account, etc.)

In-Game Economy
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Simon Cui avatar image
Simon Cui answered

The error message “Error deserializing JSON credential data.” indicates that you set a malformed service account key. Please follow Use a service account to create a service account. Then follow Create and delete service account keys to add a Service Account Key. In this process, you can create a private key. The private key is downloaded to your machine and is the only copy of this key. This private key is what we need. Please enter the whole JSON into Service Account Key section. When it is saved successfully, you should be able to see the private key id in Game Manager.

Besides, you can also use this key with Google Play Developer API to see if it’s valid.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Raul' avatar image Raul' commented ·

Thanks! I installed a new secret key and now i have another error:

2023.05.12 13:42:33.260 14827 14917 Error Unity Failed to redeem purchase: GetInAppPurchasesFailure: Failed to get purchases from GooglePlay 2023.05.12 13:42:33.260 14827 14917 Error Unity Reason:Google.Apis.Requests.RequestError 2023.05.12 13:42:33.260 14827 14917 Error Unity Invalid Value [400] 2023.05.12 13:42:33.260 14827 14917 Error Unity Errors [ 2023.05.12 13:42:33.260 14827 14917 Error Unity Message[Invalid Value] Location[ - ] Reason[invalid] Domain[global] 2023.05.12 13:42:33.260 14827 14917 Error Unity ] 2023.05.12 13:42:33.260 14827 14917 Error Unity PlayFab.Internal.PlayFabUnityHttp:OnResponse(String, CallRequestContainer) 2023.05.12 13:42:33.260 14827 14917 Error Unity PlayFab.Internal.d__12:MoveNext() 2023.05.12 13:42:33.260 14827 14917 Error Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) 2023.05.12 13:42:33.260 14827 14917 Error Unity

0 Likes 0 ·
Simon Cui avatar image Simon Cui Raul' commented ·

Hello Raul, the error message of "Error Unity Reason:Google.Apis.Requests.RequestError" indicates that the issue maybe caused by google API. I am sorry to say that but it is out of our scope. I'd suggest you seeking support from Google side.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.