question

endragor avatar image
endragor asked

Protection from IAP cancellations

Game users may ask the platform (e.g. Google Play or App Store) to refund their in-app purchases. Usually, such requests are approved in favor of the user, and the money gets returned. However, if there was no real problem with the purchase, the in-game goods are still left in the user's inventory, so that may work like a cheat to get items for free.

In their past projects devs from our team experienced that to be a problem. Whole in-game alliances discovered that "cheat", and each alliance member made the most expensive in-app purchase (~$100) available, then refunded it, leaving the goods to themselves. It was significant, especially for a game that was just starting out. To mitigate that, they implemented a script that checks recent in-app purchases for cancellation and, if a purchase was cancelled, the goods were taken away from the user.

Does PlayFab provide a way to implement something like that?

In-Game Economy
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

Yes, the issue of refunds and how the various payment providers handle them is definitely an issue developers face. Because each payment provider has a different implementation, there's no "silver bullet" solution to this, but you can indeed use the PlayFab Game Manager and Server/Admin API calls to remove VC and items from players when purchases are refunded.

One thing that's important to note is that payment providers, in general, do not notify us in any way when a refund occurs - as the owner of the account, they send that information directly to you. To match that up to the purchase in PlayFab, you'll use the provider's purchase/order ID, which will also be logged in PlayFab. Depending on the information they send you, it may be possible for you to find the purchase using the information posted in the purchase event in the PlayStream Event Archive, if you're collecting that data locally. Otherwise, an additional query may be needed.

For example, Google announced less than two weeks ago that they were updating their refund policy. As part of that, they introduced the Voided Purchases API (https://developers.google.com/android-publisher/voided-purchases). Since this API call they've added requires a developer auth token, it's not something we can call on your behalf - you would need to make the call to get the list of refunded purchases. And since there was no forewarning of this change, we do not currently provide a lookup call that takes the purchaseToken and returns to you the information on the purchase in question. However, we have always stored the purchaseToken for all Google Play purchases, and so we will be adding an Admin API that will allow you to look up the purchases in question (PlayFab ID, ItemId, etc.) as soon as we can.

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

huhund avatar image huhund commented ·

We have seen this cheat popping up a lot in our title on iOS as well.

As far as I understand. On iOS you have to periodically refresh the receipt validation and check if the “cancellation_date” field has added. This is the only way of knowing if a refund has been granted by Apple.

My question is that is this something that I as a developer should handle client side or is there already something inside PlayFab to detect this?

0 Likes 0 ·
brendan avatar image brendan huhund commented ·

Unfortunately, Apple doesn't send notifications to us, and we can't query it directly, so it is something you have to initiate via the client.

0 Likes 0 ·
Tommy Li avatar image Tommy Li brendan commented ·

Hi Brendan, not sure if anyone has mentioned, but it seems that App Store Server now sends back a REFUND notification to listener server: https://developer.apple.com/documentation/storekit/in-app_purchase/handling_refund_notifications

Is this something your team is working on, is in backlog, or is waiting for feature request?

0 Likes 0 ·
Show more comments
huhund avatar image huhund commented ·

Apologies for having follow up question on this. I can see that for some purchases the item has been changed to "Items archived", instead of the name of the gem pack. The pic below has purchase from two different iOS users. I have checked a few users and this pattern would match to the behaviour of the "cheaters". Could I be so lucky that PlayFab from some reason changes the items to archived if the purchase has been refunded? Or is this tag totally unrelated to refunds?

0 Likes 0 ·
brendan avatar image brendan huhund commented ·

Can you provide the specifics of the Title ID of the game, PlayFab ID of the user, and Item Instance ID of the item in question?

0 Likes 0 ·
teemosoft avatar image teemosoft commented ·

Is it updated new Admin API for check Google Play purchases?

0 Likes 0 ·
Andy avatar image Andy ♦♦ teemosoft commented ·

No the API that Brendan mentioned has not been added. I don't currently have an ETA to share either. I'd encourage you to continue to check for purchase cancellations on the client.

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.