private ValidateTokenResponse ValidateToken(string token) { if (String.IsNullOrWhiteSpace(token)) { throw new WebServiceException("Access denied (missing token)"); } EnsureAccessToken(); var response = GameApiUtil.CallGameApiPost <ValidateToken, ValidateTokenResponse>( FormatEndpointPath("token/validate"), new ValidateToken() { AuthToken = token, PlayerIpAddress = Request.UserHostAddress }, OAuthHeaderDecoration); if (response.ErrorCode != 0) { throw new WebServiceException( $"Access denied (invalid token), Error Code: {response.ErrorCode}, description: {response.ErrorDescription}"); } return(response); }
List <RoundHistoryData> GetBets(string token) { var betsHistoryResponse = GameApiUtil.CallGameApiGet <BetsHistoryResponse>("api/secure/bets/history?authtoken=" + token, OAuthHeaderDecoration); return(betsHistoryResponse.Rounds.OrderByDescending(a => a.CreatedOn).ToList()); }
private ValidateTokenResponse ValidateToken(string token) { return(GameApiUtil.CallGameApiPost <ValidateToken, ValidateTokenResponse>( "api/secure/token/validate", new ValidateToken() { AuthToken = token, PlayerIpAddress = Request.UserHostAddress }, OAuthHeaderDecoration)); }
private CancelTransactionResponse CallCancelTransaction(string token, List <BetCommandTransactionRequest> txList) { return(GameApiUtil.CallGameApiPost <CancelTransaction, CancelTransactionResponse>( FormatEndpointPath("transactions/cancel"), new CancelTransaction { AuthToken = token, PlayerIpAddress = Request.UserHostAddress, Transactions = txList }, OAuthHeaderDecoration)); }
private FreeBetResponse CallFreeBet(string token, string betLimitId, List <BetCommandTransactionRequest> txList) { return(GameApiUtil.CallGameApiPost <FreeBet, FreeBetResponse>( FormatEndpointPath("bets/freebet"), new FreeBet { AuthToken = token, PlayerIpAddress = Request.UserHostAddress, Transactions = txList }, OAuthHeaderDecoration)); }
private LoseBetResponse CallLoseBet(string token, List <BetCommandTransactionRequest> txList) { return(GameApiUtil.CallGameApiPost <LoseBet, LoseBetResponse>( FormatEndpointPath("bets/lose"), new LoseBet { AuthToken = token, PlayerIpAddress = Request.UserHostAddress, Transactions = txList }, OAuthHeaderDecoration)); }
private PlaceBetResponse CallPlaceBet(string token, string betLimitId, List <BetCommandTransactionRequest> txList) { ValidateBetLimits(betLimitId, txList); return(GameApiUtil.CallGameApiPost <PlaceBet, PlaceBetResponse>( FormatEndpointPath("bets/place"), new PlaceBet { AuthToken = token, PlayerIpAddress = Request.UserHostAddress, Transactions = txList }, OAuthHeaderDecoration)); }
List <RoundHistoryData> GetRounds(string token) { EnsureAccessToken(); var roundsHistoryResponse = GameApiUtil.CallGameApiGet <BetsHistoryResponse>( FormatEndpointPath("bets/history?authtoken=" + token + "&ipaddress = " + Request.UserHostAddress + " &gameid=" + GameId), OAuthHeaderDecoration); if (roundsHistoryResponse.ErrorCode != GameApiErrorCode.NoError) { throw new GameApiException(roundsHistoryResponse.ErrorDescription); } return(roundsHistoryResponse.Rounds.OrderByDescending(a => a.CreatedOn).ToList()); }