public void TestDetails_Pagination_NoInfo() { OpenpayAPI api = new OpenpayAPI(Constants.API_KEY, Constants.MERCHANT_ID, false); PaginationParams pagination = new PaginationParams(); pagination.Limit = 5; pagination.Offset = 5; List<Transaction> list = api.OpenpayFeesService.Details(2012, 03, "charged", pagination); Assert.AreEqual(0, list.Count); }
internal string BuildParams(int year, int month, string fee_type, PaginationParams paginationParams) { string url_params = string.Empty; url_params = ParameterBuilder.ApplyParameterToUrl(url_params, "year", year.ToString()); url_params = ParameterBuilder.ApplyParameterToUrl(url_params, "month", month.ToString()); if (fee_type != null) { url_params = ParameterBuilder.ApplyParameterToUrl(url_params, "fee_type", fee_type); } if (paginationParams != null) { if (paginationParams.Offset < 0) throw new ArgumentOutOfRangeException("offset"); if (paginationParams.Limit < 1 || paginationParams.Limit > 100) throw new ArgumentOutOfRangeException("limit"); url_params = ParameterBuilder.ApplyParameterToUrl(url_params, "limit", paginationParams.Limit.ToString()); url_params = ParameterBuilder.ApplyParameterToUrl(url_params, "offset", paginationParams.Offset.ToString()); } return url_params; }
public List<Transaction> Details(int year, int month, string fee_type, PaginationParams paginationParams) { string url = GetEndPoint() + "/detail"; url = url + BuildParams(year, month, fee_type, paginationParams); return this.httpClient.Get<List<Transaction>>(url); }