public DwollaResponse <DwollaTransactionStats> GetTransactionStats(TransactionStatsOptions options)
        {
            var url = Urls.Transactions + "/stats";

            var parameters = new Dictionary <string, object>()
            {
                { "oauth_token", options.OAuthToken },
                { "types", options.StatTypes },
                { "startDate", options.StartDate },
                { "endDate", options.EndDate }
            };

            string encodedUrl = HttpHelper.BuildUrl(url, parameters);

            var rawResponse = Requestor.GetString(encodedUrl);

            return(Mapper <DwollaResponse <DwollaTransactionStats> > .MapFromJson(rawResponse));
        }
        public DwollaResponse<DwollaTransactionStats> GetTransactionStats(TransactionStatsOptions options)
        {
            var url = Urls.Transactions + "/stats";

            var parameters = new Dictionary<string, object>()
                {
                    {"oauth_token", options.OAuthToken},
                    {"types", options.StatTypes},
                    {"startDate", options.StartDate},
                    {"endDate", options.EndDate}
                };

            string encodedUrl = HttpHelper.BuildUrl(url, parameters);

            var rawResponse = Requestor.GetString(encodedUrl);

            return Mapper<DwollaResponse<DwollaTransactionStats>>.MapFromJson(rawResponse);
        }
        public void It_should_retrieve_transaction_stats_by_oauth()
        {
            // arrange
            var transactionService = new DwollaTransactionService();

            var options = new TransactionStatsOptions {

                // OAuth token required
                OAuthToken = TestOAuthToken,

                // get transactions from the previous month
                StartDate = DateTime.Now.AddMonths(-1).ToString()
            };

            // act
            DwollaResponse<DwollaTransactionStats> response = transactionService
                .GetTransactionStats(options);

            // assert
            response.Success.ShouldBeTrue();
        }