question

duartedd avatar image
duartedd asked

store overrides not allowing purchase unless item exists in overriden store

Hi I have an additional item in my the store i am overriding the other store with and it appears the store id and all that is correct but appears as though it cannot purchase the item unless that item exists in the store that was overridden. Is this by design?

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.

duartedd avatar image duartedd commented ·

note: I am getting the item not found error from PF

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ commented ·

Could you please describe how you set up the store and how you did the purchase in detail? Here is a test I have done:

  • Create 2 stores A and B, store A has items a and b, store B has items b and c.
  • Add a segment override to store A, overridden by store B for players in Segment S.
  • Login as a player in Segment S
  • Use the PurchaseItem API to make a purchase with request body as below
{
    “StoreId”: A,
  “ItemId”: c,
  “VirtualCurrency”: …, //VC in store B
  “Price”: … //Price in store B


}

  • The purchase was successful.

You could use the GetStoreItems API to check the available items and check if the store is overridden by other store for the player.

0 Likes 0 ·
duartedd avatar image
duartedd answered

I recreated the legenddustshop - i must have had something up with that

10 |1200

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

duartedd avatar image
duartedd answered

Hey rick

thanks for checking in - that is good that your testing shows successful - the process is pretty similiar to yours -
I see the store items appropriately

itemA, ItemB, ItemC


the store that will override the other store has
itemA,ItemB,ItemC,ItemD

i see the store id - the amount and the currency type all good on the debug output

side note: ItemD and ItemB actually have the same name but different IDs - shouldnt really matter since things are done by ID though (i figure)

i use the same api

PlayFabClientAPI.PurchaseItem(request, OnBuyStoreItemSuccess, PF_Bridge.PlayFabErrorCallback);

I will try again though - i know i have run into the error in the past with it not having a VC on the actual item but i updated that but perhaps made my client never got the update to make the purchase but then i figured it was an error i was getting from the API on the playfab server side

in any case I will let you know after i test again - thanks again!

10 |1200

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

duartedd avatar image
duartedd answered

ya strange i just keep getting back the generic item not found - here is my tshooting:

confirmed that it wasn't an issue with the name - changed the name of the item to a different name

confirmed the StoreID is the LegendDustShop via debug console output which is the same variable of the storeID put in the request that is going into the purchaseitem method.

added the item to the original store - > same amount of gold and all - play on unity editor and hit purchase - this time it worked and the same information shows up - same currency and StoreID (the store that is overriding the orignal store ) and itemid just this time it worked - am i missing something?

using unity 2020.2 with the PF sdk

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.

Rick Chen avatar image Rick Chen ♦ commented ·

I understand your case as below:

  • there is an original store with itemA, itemB, itemC and a new store with itemA, itemB, itemC, itemD in your title.
  • New store override the original store (For some segment).
  • You made request of PurchaseItem with the following request body.

{

“StoreId”: original store,

“ItemId”: itemD,

“VirtualCurrency”: …, //VC in New store

“Price”: … //Price in New store

}

  • You received item not found error.
  • Then you added the itemD to the original store and made the request again.
  • This time it worked.

Is this correct? If so, could you please check if the player you logged in is actually within the segment that involved in this override? You could use the GetPlayerSegments API to check the segments that the player is in.

0 Likes 0 ·
duartedd avatar image duartedd Rick Chen ♦ commented ·

used the call and i confirmed it has all players and legendstatusplayers which is the store override segment

0 Likes 0 ·
duartedd avatar image
duartedd answered

thanks Rick - I will try to use that API call but i would not see the store item to be able to attempt to purchase it if I (being that player) was not part of the segment

10 |1200

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

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.