Google is changing their IAP policy to allow refunds on bought items without time limitations, and therefore added a server-side API to check voided purchases https://developers.google.com/android-publisher/voided-purchases.
that API should be integrated to the platform, and bought virtual goods should be claimed back from the user if the purchase is voided (eventually with configurable options or a callback script to let the developer decide what should be done if the item is already consumed, e.g. give him a negative balance, disconnect/ban him directly, or other strategies)
Unity, but given that both our logic and the API is server-side, we'd like to interact through cloud code.
Could you also tell me which sdk you are using?
Thanks - Patrick.
the API uses OAuth 2.0, so a way to obtain the token is needed (you already have a Google integration in the configurator, but I don't know if those credential are the same - in case you should add them).
then, you need to keep which player has done each transaction (I assume you already do it for GooglePlayBuyGoodsRequest) and the status of the transaction (i.e active or voided).
when a transaction becomes voided, there should be either:
- a configurable action on the portal that defines what to do with it (by default it should be to reclaim the item, but if the player already spent/used it, another action may be necessary - e.g. allow the player balance for that currency to become negative, send a message, etc), or
- a callback on the cloud code in which we could take a custom action, dependent on the game (e.g. subtract an "equivalent" amount of another currency, or ban the player if he abuses of it by repeatedly purchasing, use the bought item in-game and then undo the purchase)
finally, you should poll that API at a reasonable frequency (there is a limit of 100 requests per day, per app)
(I tried to see if I could implement with a cloud code script, but we'd have to implement the whole OAuth protocol and cryptography by hand using JS)
Have you an idea of what would be necessary at our end to tie into that functionality?
Best Regards, Patrick.
I'll pass this on to the dev team for you. When I've an update I'll let you know.