question

kosar avatar image
kosar asked

Purchase Item - Potentioal Bug?

So Im calling the Purchase Item api within my game and I have provided all the necessary information for the request. Now, when I state a price same as store price, it goes through. However, when I reduce the price within the Game manager, the call fails and I can not make the purchase.

I have provided a store ID and it should just fetch the price from the store and not fail the operation. Any idea why this is occurring? could this be a bug?

apisIn-Game Economypricinggame manager
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.

Seth Du avatar image Seth Du ♦ commented ·

What is the error message?

0 Likes 0 ·
kosar avatar image kosar Seth Du ♦ commented ·

It will show the failed message I have set for it.

0 Likes 0 ·

1 Answer

·
Andy avatar image
Andy answered

The price you provide on the client must be identical to the price in the store. If the two differ, you'll get back a WrongPrice error with a code of 1053. This is done to ensure your client and your back end agree on the amount of virtual currency that will be removed from the player in exchange for the item.

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

kosar avatar image kosar commented ·

So what if we want to do a sale for instance and want to decrease the price on some items? Updating the client for such purpose everytime is not a variable option.

0 Likes 0 ·
brendan avatar image brendan kosar commented ·

That's specifically what the stores and the store overrides are for. You can create multiple stores, with different prices for items, and let the players use them based upon which segments they're in (https://api.playfab.com/docs/tutorials/landing-analytics/ab-store).

If the client could specify any price, completely separately from the prices in the stores you have defined, hackers could easily cheat the game by specifying prices far lower than you would allow.

0 Likes 0 ·
kosar avatar image kosar brendan commented ·

Couldn't this be alot simpler if prices were decided in game manager only and not from the client side? If we were to simply wanted to drop price of everything at some point without segmentation then im assuming the client still has to be updated to reflect those changes. Whereas if it was decided in game manager, it will sync seamlessly without any additional work.

0 Likes 0 ·
Show more comments
Seth Du avatar image Seth Du ♦ kosar commented ·

I did a quick test. Hopefully it can help you. I try to retrieve the "GM" price of items in a Store.

the output log:

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.