Example #1
0
 private void OnTransactionAuthorizationReceived(ref MicroTxnAuthorizationResponse_t callbackData)
 {
     foreach (InGamePurchase purchase in this._outstandingPurchases)
     {
         if ((long)purchase.OrderID == (long)callbackData.m_ulOrderID)
         {
             if ((int)callbackData.m_bAuthorized == 1)
             {
                 SteamWebAPIRequest steamWebApiRequest = CommunityExpress.Instance.SteamWebAPI.NewRequest(this.GetWebInterface(purchase.UseTestMode), "FinalizeTxn", "v0001");
                 steamWebApiRequest.AddPostValue("key", purchase.WebAPIKey);
                 steamWebApiRequest.AddPostValue("orderid", callbackData.m_ulOrderID.ToString());
                 steamWebApiRequest.AddPostValue("appid", InGamePurchasing.SteamUnityAPI_SteamUtils_GetAppID().ToString());
                 steamWebApiRequest.Execute(new OnRequestComplete(this.OnTransactionFinalized));
                 break;
             }
             else
             {
                 purchase.InGamePurchaseCompleteCallback(purchase, false);
                 this._outstandingPurchases.Remove(purchase);
                 break;
             }
         }
     }
 }
Example #2
0
 private void OnTransactionAuthorizationReceived(ref MicroTxnAuthorizationResponse_t callbackData)
 {
   foreach (InGamePurchase purchase in this._outstandingPurchases)
   {
     if ((long) purchase.OrderID == (long) callbackData.m_ulOrderID)
     {
       if ((int) callbackData.m_bAuthorized == 1)
       {
         SteamWebAPIRequest steamWebApiRequest = CommunityExpress.Instance.SteamWebAPI.NewRequest(this.GetWebInterface(purchase.UseTestMode), "FinalizeTxn", "v0001");
         steamWebApiRequest.AddPostValue("key", purchase.WebAPIKey);
         steamWebApiRequest.AddPostValue("orderid", callbackData.m_ulOrderID.ToString());
         steamWebApiRequest.AddPostValue("appid", InGamePurchasing.SteamUnityAPI_SteamUtils_GetAppID().ToString());
         steamWebApiRequest.Execute(new OnRequestComplete(this.OnTransactionFinalized));
         break;
       }
       else
       {
         purchase.InGamePurchaseCompleteCallback(purchase, false);
         this._outstandingPurchases.Remove(purchase);
         break;
       }
     }
   }
 }