internal async Task<ArchiHandler.PurchaseResponseCallback.EPurchaseResult> RedeemWalletKey(string key) {
if (string.IsNullOrEmpty(key)) {
Bot.ArchiLogger.LogNullError(nameof(key));
return ArchiHandler.PurchaseResponseCallback.EPurchaseResult.Unknown;
}
if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) {
return ArchiHandler.PurchaseResponseCallback.EPurchaseResult.Timeout;
}
string request = SteamStoreURL + "/account/validatewalletcode";
Dictionary<string, string> data = new Dictionary<string, string>(1) {
{ "wallet_code", key }
};
Steam.RedeemWalletResponse response = await WebBrowser.UrlPostToJsonResultRetry<Steam.RedeemWalletResponse>(request, data).ConfigureAwait(false);
return response?.PurchaseResult ?? ArchiHandler.PurchaseResponseCallback.EPurchaseResult.Timeout;
}