I'm trying to get some contextual data sent from the client passed up to the playstream handler for purchasing an item with VC. This is to support currency spend attribution in our application.
Since PurchaseItem doesn't seem to have any parameters for sending data that would be attached to an item instance (because it would be untrusted data), how would it be best to get information into a place where we could generate a player event that contained how much VC was spent, and in what context (level, fight, story, etc.)?
I've read up on these:
https://community.playfab.com/questions/4918/customdata-in-catalog-and-iteminstances-questions.html
https://community.playfab.com/content/idea/895/210537287-Atomically-Creating-Items.html
and checked out:
https://api.playfab.com/documentation/Server/method/GrantItemsToUsers
But I can't seem to find the magic combination to do what I am looking for without resorting to the following task:
1) Setup Items in the store with no price
2) Map items to prices in a bit of Title Data
3) Have clients initiate a Cloud Script request with item_id and contextual info
4) Cloud script would look up pricing data from Title Data
5) Cloud script would deduct prices
6) Cloud script would grant item
7) Cloud script would collect the information and send the event
8) Cloud script would return success / failure of "purchase" of the item
Ideally, we would rather send a chunk of contextual info from the client to the PurchaseItem event and have access to it from the 'player_vc_item_purchased' playstream event so that we can utilize existing APIs but send appropriate data in a customized analytics event after validating the data.