I set up my microtransactions system with Steam integration. Everything works, the item is added to the inventory, and the funds are withdrawn (using sandbox mode, the Value To Date in my player profile updates accordingly). I'm just concerned because it also throws an error. Usually, I wouldn't care since it appears to work, but I want to be thorough since we're dealing with people's money here. When the purchase goes through, these are the two console entries that pop up in this order:
Purchase error:Invalid input parameters Purchase confirmed
Here is (all the relevant code in) my script:
protected Callback<MicroTxnAuthorizationResponse_t> m_MicroTxnAuthorizationResponse; string transientOrderID; void Start() { if (SteamManager.Initialized) m_MicroTxnAuthorizationResponse = Callback<MicroTxnAuthorizationResponse_t>.Create(OnMicroTxnAuthorizationResponse); } public void StartPurchase() { PlayFabClientAPI.StartPurchase(new StartPurchaseRequest() { CatalogVersion = "CloutCoinBundles", Items = new List<ItemPurchaseRequest>() { new ItemPurchaseRequest() { ItemId = "1000CC", Quantity = 1, Annotation = "Purchased via in-game store" } } }, result => { PayForPurchase(result); }, error => { Debug.Log("Start purchase error" + error.ErrorMessage); }); } void PayForPurchase(StartPurchaseResult purchase) { PlayFabClientAPI.PayForPurchase(new PayForPurchaseRequest() { OrderId = purchase.OrderId, ProviderName = "Steam", Currency = "RM" }, result => { transientOrderID = purchase.OrderId; }, error => { Debug.Log("Pay for purchase error:" + error.ErrorMessage); }); } void OnMicroTxnAuthorizationResponse(MicroTxnAuthorizationResponse_t callback) { if (callback.m_bAuthorized == 1) ConfirmPurchase(transientOrderID); else Debug.Log("Not authorized"); } void ConfirmPurchase(string purchase) { PlayFabClientAPI.ConfirmPurchase(new ConfirmPurchaseRequest() { OrderId = purchase }, result => { Debug.Log("Purchase confirmed"); }, error => { Debug.Log("Purchase error:" + error.ErrorMessage); }); transientOrderID = ""; }