string BuildUpdateRequestUrl(string key, string productName, string status, string owner) { UpdateProductKeyRequest request = new UpdateProductKeyRequest(); request.StoreName = "Steam"; request.ProductName = productName; request.Key = key; request.Owner = owner; request.Status = status; request.HmacToken = updateRequestEncoder.GenerateToken(request, settings.SharedSecretKey); string endpoint = $"{settings.ApiUrl}" + $"?store={request.StoreName}" + $"&product={request.StoreName}" + $"&key={request.Key}"; if (!(request.Owner is null)) { endpoint += $"&owner={request.Owner}"; } endpoint += $"&status={request.Status}" + $"&hmac={request.HmacToken}"; return(endpoint); }
SteamAccountResponse CreateResponse(User user, SteamAccount steamAccount) { SteamAccountResponse response = new SteamAccountResponse(); response.Username = steamAccount.Username; response.Password = steamAccount.Password; response.HmacToken = responseHmacEncoder.GenerateToken(response, user.SharedSecretKey); return(response); }
string BuildGetRequestUrl(string status) { GetProductKeyRequest request = new GetProductKeyRequest(); request.StoreName = "Steam"; request.Status = status; request.HmacToken = getRequestEncoder.GenerateToken(request, settings.SharedSecretKey); string endpoint = $"{settings.ApiUrl}" + $"?store={request.StoreName}" + $"&status={request.Status}" + $"&hmac={request.HmacToken}"; return(endpoint); }