Example #1
0
        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);
        }
Example #2
0
 private ValidateTokenResponse ValidateToken(string token)
 {
     return(GameApiUtil.CallGameApiPost <ValidateToken, ValidateTokenResponse>(
                "api/secure/token/validate",
                new ValidateToken()
     {
         AuthToken = token,
         PlayerIpAddress = Request.UserHostAddress
     }, OAuthHeaderDecoration));
 }
Example #3
0
 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));
 }
Example #4
0
 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));
 }
Example #5
0
 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));
 }
Example #6
0
        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));
        }