public async Task <ProductsForPlayerResponse> PostAsync(ProductsForPlayerRequest request) { var lobbyId = GetLobbyId(ActionContext); var playerId = _tokenProvider.Decrypt(request.authtoken); var playerInfo = await GetLobbyPlayerAsync(playerId); var productsInfo = await GetProductsDataAsync(lobbyId, playerInfo); return(new ProductsForPlayerResponse() { products = productsInfo, player = playerInfo }); }
public async Task <ProductsForPlayerResponse> GetProductsForPlayerAsync(Guid lobbyId, Guid playerId, string lobbyUrl, string playerIpAddress, string userAgent) { var lobby = _gameRepository.Lobbies.Single(x => x.Id == lobbyId); var playerToken = _brandOperations.GetPlayerAuthToken(playerId, playerIpAddress, lobby.PlatformType); var request = new ProductsForPlayerRequest() { authtoken = playerToken, useragent = userAgent, lobbyurl = lobbyUrl.ToLower(), ipaddress = playerIpAddress, }; var lobbyToken = await GetLobbyTokenAsync(lobbyId); var response = await GetApiClient().GetProductsForPlayerAsync(request, lobbyToken); return(response); }
public async Task <ProductsForPlayerResponse> PostAsync(ProductsForPlayerRequest request) { return(await _localProductApiClient.GetProductsForPlayerAsync(request, Request.Headers.Authorization.Parameter)); }