question

brendan avatar image
brendan asked

How do I set up a virtual currency which can be purchased by the player

Brendan Vanous
started a topic on Thu, 04 September 2014 at 2:29 PM

I have a virtual currency defined in the PlayFab Game Manager, and I have it defined in the Google Play or Apple Marketplace. Now, how do I use the verify receipt API (ValidateGooglePlayPurchase or ValidateIOSReceipt) to actually get that currency into the user account, once it has been purchased?

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Thu, 04 September 2014 at 2:29 PM

Once the player has made the purchase, the marketplace in question will have returned a receipt which can then be passed back to the PlayFab service to complete the transaction. In each case, the token returned has encoded the information concerning the purchase, which we validate in a server-to-server call, for security (after we first verify that the receipt has not already been used). The key is that the Product ID in the relevant marketplace (defined as part of submitting the item) must match the Item ID in the PlayFab virtual goods catalog for the item. For virtual currencies specifically, they can be added to the player inventory as part of an inventory item defined as a Bundle in the BundledVirtualCurrencies property.


1 Comment
Brendan Vanous said on Thu, 04 September 2014 at 2:29 PM

Once the player has made the purchase, the marketplace in question will have returned a receipt which can then be passed back to the PlayFab service to complete the transaction. In each case, the token returned has encoded the information concerning the purchase, which we validate in a server-to-server call, for security (after we first verify that the receipt has not already been used). The key is that the Product ID in the relevant marketplace (defined as part of submitting the item) must match the Item ID in the PlayFab virtual goods catalog for the item. For virtual currencies specifically, they can be added to the player inventory as part of an inventory item defined as a Bundle in the BundledVirtualCurrencies property.

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.