question

elephrates avatar image
elephrates asked

Store is not purchasing playfab items

I set the store upa few months back and it worked. But now it seems to not be working; its passing the product id but not initiaing any requests and its not returning errors either

From the code below; I get the debug log "purchasing x product id; then nothing happens. Im sure this code worked before too

 async public Task<bool> PlayFabPurchaseItemByID(string itemID, PlayFabEconomyAPIAsyncResult result)
     {
         if (!IsInitialized) throw new Exception("IAP Service is not initialized!");
    
         Debug.Log("Player buying product " + itemID);
    
         if (string.IsNullOrEmpty(purchaseIdempotencyId))
         {
             purchaseIdempotencyId = Guid.NewGuid().ToString();
         }
    
         GetItemRequest getSpringStoreRequest = new GetItemRequest()
         {
             AlternateId = new CatalogAlternateId()
             {
                 Type = "FriendlyId",
                 Value = "SpringStorePF"
             },
         };
         GetItemResponse getStoreResponse = await economyAPI.getItemAsync(getSpringStoreRequest);
         if (getStoreResponse == null || string.IsNullOrEmpty(getStoreResponse?.Item?.Id))
         {
             result.error = "Unable to contact the store. Check your internet connection and try again in a few minutes.";
             return false;
         }
    
         CatalogPriceAmount price = StorefrontCatalog.FirstOrDefault(item => item.Key == itemID).Value.PriceOptions.Prices.FirstOrDefault().Amounts.FirstOrDefault();
         PurchaseInventoryItemsRequest purchaseInventoryItemsRequest = new PurchaseInventoryItemsRequest()
         {
             Amount = 1,
             Item = new InventoryItemReference()
             {
                 Id = itemID
             },
             PriceAmounts = new List<PurchasePriceAmount>
             {
                 new PurchasePriceAmount()
                 {
                     Amount = price.Amount,
                     ItemId = price.ItemId
                 }
             },
             IdempotencyId = purchaseIdempotencyId,
             StoreId = getStoreResponse.Item.Id
         };
         PurchaseInventoryItemsResponse purchaseInventoryItemsResponse = await economyAPI.purchaseInventoryItemsAsync(purchaseInventoryItemsRequest);
         if (purchaseInventoryItemsResponse == null || purchaseInventoryItemsResponse?.TransactionIds.Count < 1)
         {
             result.error = "Unable to purchase. Try again in a few minutes.";
             return false;
         }
    
         purchaseIdempotencyId = "";
         result.message = "Purchasing!";
         return true;
     }
CloudScriptPlayer Inventory
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.

elephrates avatar image elephrates commented ·

..........

0 Likes 0 ·

1 Answer

·
Neils Shi avatar image
Neils Shi answered

This issue could be related to the recent incidents : https://status.playfab.com/incidents/dpzk7lndr9k6 . Currently, this issue has been resolved, you can try again to see if problem persists. If the problem persists, please let us know.

8 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.

elephrates avatar image elephrates commented ·

Still have exactly same errors

0 Likes 0 ·
elephrates avatar image elephrates elephrates commented ·

To confirm we actually have two issues

First one above; it says buying of the playfab catalog then doesnt do anything

Second is witht he appstore linked bundle products; they debug log without product ids and get validation failure

0 Likes 0 ·
Neils Shi avatar image Neils Shi elephrates commented ·

Could you tell use more details about your scenario? Do you mean that after the player calls the API PurchaseInventoryItems, no error message is received, but the items are not given to the player? In my testing, the API PurchaseInventoryItems works fine in my title. In addition, could you provide more information about the “the appstore linked bundle products; they debug log without product ids and get validation failure" you mentioned? Do you use the Economy v2 Redeem API?

0 Likes 0 ·
Show more comments

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.