예제 #1
0
        public async Task <string> SellPlayer(string playerId, string accessToken, int startPrice, int binPrice)
        {
            var url       = _urlBuilder.GetAuctionUrl();
            var sellModel = new SellPlayerModel
            {
                StartPrice = startPrice,
                BinPrice   = binPrice,
                Duration   = 3600,
                ItemData   = new SellItemDataModel
                {
                    playerId = playerId
                }
            };

            var statusCode = await _postRequestMaker.SellPlayer(url, accessToken, sellModel);

            var sellMessage = _statusCodeHandler.HandleSellingStatusCode(statusCode);

            return(sellMessage);
        }
예제 #2
0
        public async Task <HttpStatusCode> SellPlayer(string url, string accessToken, SellPlayerModel sellPlayerModel)
        {
            _wrapper.SetAccessToken(accessToken);
            var body     = new StringContent(JsonConvert.SerializeObject(sellPlayerModel));
            var response = await _wrapper.PostAsync(url, body);

            return(response.StatusCode);
        }