question

yogev avatar image
yogev asked

Question about iap

Hey, if the player turns off his internet and playfab still processing the transaction or google

what should I do in this case? what do I need to save in order to restore the purchase without a loss of items

another thing if player bought a bundle how can I get the amount of coins that he got from the bundle? is there a way to get it from the result from ValidateGooglePlayPurchase?

thank you

apis
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

·
Xiao Zha avatar image
Xiao Zha answered

>>if the player turns off his internet and playfab still processing the transaction or google, what should I do in this case? what do I need to save in order to restore the purchase without a loss of items.

During the entire IAP process, PlayFab is responsible for verifying the Google receipt obtained by the player and automatically issuing the items to the player after successful verification. After calling the ValidateGooglePlayPurchase API, the process of validating the receipt and granting the item occurs on the server and will not be affected by the client.

If the network is cut off after obtaining the Google receipt and calling the validation API, you can save the receipt and then re-verify the receipt after the network is restored (If the receipt was successfully verified, retries of this API call will return a ReceiptAlreadyUsed error). And if the network disconnection occurred before getting the Google receipt, since we are not experts in Google purchases, you may need to seek professional help from the Google support team.

>>Another thing if player bought a bundle how can I get the amount of coins that he got from the bundle? is there a way to get it from the result from ValidateGooglePlayPurchase?

After the receipt verification is successful, the return result of the ValidateGooglePlayPurchase API includes the Bundle and the Items in the Bundle. However, the currency in the Bundle will not appear in the returned results. As a workaround, you can create a separate bundle for a currency, and set the Bundle's ItemId to the currency name and its amount. Then you can use the ItemId in the result returned by ValidateGooglePlayPurchase to know the amount of currency in the Bundle.

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.

yogev avatar image yogev commented ·

Thank you so much !! and last thing with azure functions should I use MasterPlayerAccountId or TitlePlayerAccountId for updating/deleting data from the player? is there any difference?

thank you

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha yogev commented ·

If you want to update/delete data that is specific to a player in a title, you should use TitlePlayerAccountId. If you want to update/delete data that is shared across all title under a studio for a particular player, you should use MasterPlayerAccountId. For more information about player entity, you could refer to Available Built-In Entity Types - PlayFab | Microsoft Learn.

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.