Esempio n. 1
0
        public virtual SearchResults <Transaction> Transactions(
            int page           = 1,
            int pageSize       = 20,
            string q           = null,
            string qf          = null,
            DateTime?startDate = null,
            DateTime?endDate   = null,
            string accountId   = null,
            string orderBy     = null)
        {
            var url = Urls.Transactions;

            url = ParameterBuilder.ApplyParameterToUrl(url, "page", page.ToString());
            url = ParameterBuilder.ApplyParameterToUrl(url, "page_size", pageSize.ToString());

            if (!string.IsNullOrEmpty(q))
            {
                url = ParameterBuilder.ApplyParameterToUrl(url, "q", q);
            }

            if (!string.IsNullOrEmpty(qf))
            {
                url = ParameterBuilder.ApplyParameterToUrl(url, "qf", qf);
            }

            if (startDate != null)
            {
                url = ParameterBuilder.ApplyParameterToUrl(url, "start_date", ((DateTime)startDate).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffZ"));
            }

            if (endDate != null)
            {
                url = ParameterBuilder.ApplyParameterToUrl(url, "end_date", ((DateTime)endDate).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffZ"));
            }

            if (!string.IsNullOrEmpty(accountId))
            {
                url = ParameterBuilder.ApplyParameterToUrl(url, "account_id", accountId);
            }

            if (!string.IsNullOrEmpty(orderBy))
            {
                url = ParameterBuilder.ApplyParameterToUrl(url, "order_by", orderBy);
            }

            var response = Requestor.GetString(url, SecretKey);

            return(TransactionMapper.MapCollectionFromJson(response));
        }
Esempio n. 2
0
        public virtual SearchResults <Transaction> Holds(
            int page         = 1,
            int pageSize     = 20,
            string accountId = null)
        {
            var url = Urls.Holds;

            url = ParameterBuilder.ApplyParameterToUrl(url, "page", page.ToString());
            url = ParameterBuilder.ApplyParameterToUrl(url, "page_size", pageSize.ToString());

            if (!string.IsNullOrEmpty(accountId))
            {
                url = ParameterBuilder.ApplyParameterToUrl(url, "account_id", accountId);
            }

            var response = Requestor.GetString(url, SecretKey);

            return(TransactionMapper.MapCollectionFromJson(response));
        }