public async Task<Cart> IsValidCartAsync(long steamId, long cartId)
{
List<WebRequestParameter> requestParameters = new List<WebRequestParameter>();
WebRequestParameter steamIdParameter = new WebRequestParameter("steamid", steamId.ToString());
requestParameters.Add(steamIdParameter);
WebRequestParameter cartIdParameter = new WebRequestParameter("gid", cartId.ToString());
requestParameters.Add(cartIdParameter);
// send the request and wait for the response
JObject data = await PerformSteamRequestAsync("ISteamMicroTxn", "IsValidCart", 1, requestParameters);
try
{
Cart cart = new Cart();
bool isFound = TypeHelper.CreateBoolean(data["result"]["found"]);
cart.ID = cartId;
cart.IsValid = isFound;
if (isFound)
cart.OwnerSteamID = TypeHelper.CreateLong(data["result"]["steamidowner"]);
return cart;
}
catch
{
throw new Exception(E_JSON_DESERIALIZATION_FAILED);
}
}
}