//Search Transaction with pagination public async Task <dynamic> SearchTransactionWithPagination(TransactionDetailModel model) { List <TransactionReturnModel> transactionReturnModels = new List <TransactionReturnModel>(); SecurityToken token = await GetSecurityToken(); var client = new PaymentGateway.IeBizServiceClient(); int strt = (model.pageno - 1) * model.pagesize; int lmt = model.pagesize; var data = await client.SearchTransactionsAsync(token, model.searchFilters, model.matchAll, model.countOnly, strt.ToString(), lmt.ToString(), model.sort); return(data); }
//Search All Transaction public async Task <dynamic> SearchAllTransactionDetails(TransactionDetailModel model) { List <TransactionReturnModel> transactionReturnModels = new List <TransactionReturnModel>(); SecurityToken token = await GetSecurityToken(); var client = new PaymentGateway.IeBizServiceClient(); int length = 0; int lengthnode = 0; do { lengthnode++; var data = await client.SearchTransactionsAsync(token, model.searchFilters, model.matchAll, model.countOnly, model.start, model.limit, model.sort); length = Int32.Parse(data.TransactionsReturned); TransactionReturnModel transactionReturn = new TransactionReturnModel(); transactionReturn.transactionObjects = data.Transactions.ToList(); transactionReturn.TransactionsMatched = data.TransactionsMatched; transactionReturn.TransactionsReturned = data.TransactionsReturned; transactionReturn.AuthOnlyAmount = data.AuthOnlyAmount.ToString(); transactionReturn.AuthOnlyCounts = data.AuthOnlyCount.ToString(); transactionReturn.CreditsAmount = data.CreditsAmount.ToString(); transactionReturn.CreditsCount = data.CreditsCount; transactionReturn.DeclinesAmount = data.DeclinesAmount.ToString(); transactionReturn.DeclinesCount = data.DeclinesCount; transactionReturn.ErrorsAmount = data.ErrorsAmount.ToString(); transactionReturn.ErrorsCount = data.ErrorsCount; transactionReturn.SalesAmount = data.SalesAmount.ToString(); transactionReturn.SalesCount = data.SalesCount; transactionReturn.VoidsAmount = data.VoidsAmount.ToString(); transactionReturn.VoidsCount = data.VoidsCount; transactionReturn.StartIndex = data.StartIndex; transactionReturn.Limit = data.Limit; transactionReturnModels.Add(transactionReturn); model.start = lengthnode + "000"; model.limit = lengthnode + "999"; } while (length >= 1000); return(transactionReturnModels); }