private PaginatedResult <Dispute> FetchDisputes(int page) { DisputeSearchRequest request = DisputeSearch; XmlNode disputeXML = Service.Post(Service.MerchantPath() + "/disputes/advanced_search?page=" + page, request); var nodeWrapper = new NodeWrapper(disputeXML); var totalItems = nodeWrapper.GetInteger("total-items").Value; var pageSize = nodeWrapper.GetInteger("page-size").Value; var disputes = new List <Dispute>(); foreach (var node in nodeWrapper.GetList("dispute")) { disputes.Add(new Dispute(node)); } return(new PaginatedResult <Dispute>(totalItems, pageSize, disputes)); }
public virtual PaginatedCollection <Dispute> Search(DisputeSearchRequest request) { DisputeSearch = request; return(new PaginatedCollection <Dispute>(FetchDisputes)); }