I am implementing new Unity IAP system on dedicated server (also using new Unity Networking feature). Quick overview: Client side is responsible only for connecting to server, sending buy requests and receiving updates on number of items player has. Server side maintains connections and is main hub of IAP, from here requests are made to Stores (Apple and Google, atm), and purchases are validated.
Question is: How do I know for which client purchase is done?
We have unique connections, but it seems there is no way to send connection ID to correct ProcessPurchase method execution. And by "correct" I mean method run for one distinct buyer. When I initialise purchase I can supply "payload" as second parameter, with seemingly any input, but in ProcessPurchase I can't get this value back. I tried researching how to save transactionID, but also to no avail.
Any help would be appreciated!
I went other way around.
IAP system works now on client device and only sends receipt data to dedicated server. Server then checks receipt and sends data over SAME connection message was received on, thus, I don't need any way to save or differentiate users.
Hope this helps to anyone who stumbled across this problem.