void AuthTransaction() { string steamId = web.Param("steamId"); int priceInCents = web.GetInt("price"); if (priceInCents <= 0) { throw new ApiExitException("bad price"); } int GP = priceInCents * api_GPConvert.GetGPConversionRateFromPrice(priceInCents, true) / 100; // get user wallet currency SteamApi api = new SteamApi(); SteamXML.MicroTnxResponse resp = api.GetUserInfo(steamId); if (!ParseResponse(resp)) { return; } if (resp.params_.currency == null) { throw new ApiExitException("can't get wallet currency"); } if (resp.params_.country == null) { throw new ApiExitException("can't get country"); } // start order SqlCommand sqcmd = new SqlCommand(); sqcmd.CommandType = CommandType.StoredProcedure; sqcmd.CommandText = "WZ_SteamStartOrder"; sqcmd.Parameters.AddWithValue("@in_CustomerID", web.CustomerID()); sqcmd.Parameters.AddWithValue("@in_SteamID", steamId); sqcmd.Parameters.AddWithValue("@in_Price", priceInCents / 100.0); sqcmd.Parameters.AddWithValue("@in_GP", GP); sqcmd.Parameters.AddWithValue("@in_Currency", resp.params_.currency); sqcmd.Parameters.AddWithValue("@in_Country", resp.params_.country); if (!CallWOApi(sqcmd)) { return; } reader.Read(); string OrderID = getString("OrderID"); string WalletCurrency = getString("Currency"); int WalletPriceCents = getInt("PriceCents"); if (WalletPriceCents == 0) { // we wasn't able to convert price Response.Write("WO_7can't convert"); return; } // init steam transaction resp = api.InitTxn( OrderID, steamId, WalletCurrency, WalletPriceCents.ToString(), "1", string.Format("{0} Gold Credits", GP), "EN"); //System.Diagnostics.Debug.WriteLine("@@@InitTxn: " + api.lastData_); if (resp.error != null && resp.error.errorcode == 8) { // 8 Transaction currency does not match user's Steam Wallet currency Response.Write("WO_7Steam8"); return; } if (!ParseResponse(resp)) { return; } Response.Write("WO_0"); }