What is the process if a client buys an item and if I need to do additional stuff (validation controls and/or other post processing updates) ?
The PurchaseItem API on only available from the client, so it does not seem possible to add some verification controls before buying.
The client could call a CloudScript that makes the job (controls, decrement VC, grant item, post-updates) but what happens if there is an error on the grant item step ? The VC will already have been decremented ; i.e. it's not part of a whole transaction isn't it ?
I think I missed something somewhere for this basic task...
Answer by Brendan · Jan 26, 2016 at 01:20 AM
The idea of using Cloud Script is correct, but the way to do this is not bypassing the purchase operation (in particular, that would mean that the purchases aren't tracked as actual purchases), but rather to make the Cloud Script call a post-purchase operation. So, you would have the client call the Cloud Script to complete the configuration of the item once it has been purchased. It would be important (for scenarios where the player loses connection right after the purchase) to also double-check that items have completed configuration on startup, so that you can call the configuration Cloud Script again for any items that haven't been finished as yet.