PagedResult - PaySimple/PaySimpleSDK GitHub Wiki

Home | Account Service | Customer Service | Payment Service | Payment Schedule Service | PagedResult | Exceptions

PagedResult<T>

Every method that returns multiple items will return an instance of PagedResult<T>.
The PagedResult is a construct that allows for interrogation of response metadata for PagingDetails and the result of the request.

PagedResult<T> Topology

The PagedResult<T> class is made up of the following members:

  • int Page - The current page of results
  • int ItemsPerPage - The number of items returned per page
  • int TotalItems - The total number of items
  • int TotalPages - The total number of pages
  • T Items - The items returned with this page

PagedResult<T> Usage

var settings = new PaySimpleSettings("AoOtRylA63570WmH3eqChyFRqwhTnA2g0dnsV7zzQko4s4yKWdBorA1WiT7dK2H2xz06P562Hqv0heYBdfNamfQyxX50drtpL8s7", "AUserName");
var customerService = new CustomerService(settings);

var result = await customerService.GetAllAccountsAsync(123456);

// In this case the T is AccountList
foreach (var a in result.AchAccounts)
{
	... Do something interesting with the ACH Accounts ...
}

foreach (var c in result.CreditCardAccounts)
{
	... Do something interesting with the Credit Card Accounts ...
}