question

lucasnogueira avatar image
lucasnogueira asked

How to use RedeemGooglePlayInventoryItemsRequest EconomyV2

I'm trying to use EconomyV2 to create an in-game store with google play integration.

This is the item registered in the Play Console:

6193-captura-de-tela-2023-07-20-141533.png

This is the item registered at Playfab (it's a bundle) which, when purchased, must apply diamonds to the player.

6183-captura-de-tela-2023-07-20-141733.png

I'm implementing the IDtailedStoreListener interface and in the ProcessPurchase method I'm writing the following code, based on PlayFab's documentation.

 GooglePurchase googleReceipt = GooglePurchase.FromJson(purchaseEvent.purchasedProduct.receipt);

I always get feedback that the purchase was successful, but the response has an error and the diamonds are not added to the inventory.

The game is published as an internal test only for testing purposes and the google addon is connected to playfab with all the data.

I would like to know if I'm doing something wrong and how I could debug the error that comes from the response since I can't see the log. I tried looking in PlayFab's data area, but no event fires.

         RedeemGooglePlayInventoryItemsRequest request = new RedeemGooglePlayInventoryItemsRequest()
         {
             Purchases = new List<GooglePlayProductPurchase>
             {
                 new GooglePlayProductPurchase
                 {
                     Token = googleReceipt.PayloadData.signature,
                     ProductId = googleReceipt.PayloadData.JsonData.productId
                 }
             }
         };
    
 PlayFabResult<RedeemGooglePlayInventoryItemsResponse> response = await PlayFabEconomyAPI.RedeemGooglePlayInventoryItemsAsync(request);
    
         if (response.Error != null)
         {
             Debug.Log(response.Error.ErrorMessage);
                
             PopupPurchaseFailed.Instance.Open();
             return;
         }
            
         PopupPurchaseSuccess.Instance.Open();

I always get feedback that the purchase was successful, but the response has an error and the diamonds are not added to the inventory.

The game is published as an internal test only for testing purposes and the google addon is connected to playfab with all the data.

I would like to know if I'm doing something wrong and how I could debug the error that comes from the response since I can't see the log. I tried looking in PlayFab's data area, but no event fires.

Player DatasdksIn-Game Economy
1 comment
10 |1200

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

Neils Shi avatar image Neils Shi commented ·

Could you provide us with the detailed error information about the response so that we can do some research?

0 Likes 0 ·

0 Answers

·

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.