Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • Bugs /
avatar image
Question by k-krrs · Nov 03, 2017 at 02:12 AM · In-Game EconomyPlayer Inventory

PlayFab.PurchaseItem purchases multiple instances of bought item

Hello!

I'm having an issue with purchasing items, where PlayFab.PurchaseItem actually purchases several instances of an item and spends the player's currency for no reason whatsoever. My code is simple and should work perfectly according to the logic. I really need some help, as I'm releasing my game in a week, and this is the only thing left to fix.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Nov 03, 2017 at 02:16 AM

Testing in my own sample title, I can't reproduce what you describe. One call to PurchaseItem results in one purchase of the item, for the correct price from the catalog. Can you please provide us the following specifics, so that we can review the logs:

  • Title ID of the game
  • PlayFab ID of the user in the test
  • Item ID purchased
  • Time of the test
Comment

People who like this

0 Show 4 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image k-krrs · Nov 03, 2017 at 04:06 PM 0
Share

TitleID is 1F03

PlayFab ID of the test user:

D60763CF4B01D060

ItemID: TrailColorOrange

Time: 4:41 PM

avatar image Brendan ♦♦ k-krrs · Nov 04, 2017 at 12:43 AM 0
Share

Reviewing the logs, I'm seeing two distinct calls from the client to PurchaseItem at that time - one at 2017-11-03 15:41:09.358 UTC and the next at 2017-11-03 15:41:09.375 UTC. How specifically is the call being made in your code? Either the call is being sent twice in a row, or there's a retry that is firing immediately.

avatar image k-krrs Brendan ♦♦ · Nov 04, 2017 at 12:23 PM 0
Share

I have a function called BuyItem that gets called if the item you're buying is not in your inventory. Attached are images of both the switch function for the buttons and the BuyItem function.

First picture is one of the cases of the button function, in this case, for the Dark Red color for Skis.

Second picture is the BuyItem function I've made. The button in one of the arguments was just my logic that the second purchaseitem was happening because the button stays pressed, so I made its onclick listener disappear, but it did not fix the problem.

switch.png (28.9 kB)
buyitem.png (10.7 kB)
Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Steam microtransactions bug. 0 Answers

    Restoring Purchases via PlayFab's Receipt Verification Does Not Work - Apple's App Receipt (iOS7+) 1 Answer

    Noticed Odd Inventory behaviour 1 Answer

    The rules don't work 0 Answers

    Catalog Versions in inventory 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges