Esempio n. 1
0
        public BatchResponse GetBatchDetails(DateTime start, DateTime end)
        {
            var batchTransactions = new List <BatchTransaction>();

            foreach (var batch in ReportingGateway.GetSettledBatchList(start, end, includeStats: true))
            {
                foreach (var transaction in ReportingGateway.GetTransactionList(batch.ID))
                {
                    var batchTransaction = new BatchTransaction
                    {
                        TransactionId   = transaction.InvoiceNumber.ToInt(),
                        Reference       = transaction.TransactionID,
                        BatchReference  = batch.ID,
                        TransactionType = GetTransactionType(transaction.Status),
                        BatchType       = GetBatchType(batch.PaymentMethod),
                        Name            = $"{transaction.FirstName} {transaction.LastName}",
                        Amount          = transaction.SettleAmount,
                        Approved        = IsApproved(batch.State),
                        Message         = batch.State.ToUpper(),
                        TransactionDate = transaction.DateSubmitted,
                        SettledDate     = batch.SettledOn,
                        LastDigits      = transaction.CardNumber.Last(4)
                    };

                    if (!string.IsNullOrWhiteSpace(transaction.eCheckBankAccount?.accountNumber))
                    {
                        batchTransaction.LastDigits = transaction.eCheckBankAccount.accountNumber.Last(4);
                    }

                    batchTransactions.Add(batchTransaction);
                }
            }

            return(new BatchResponse(batchTransactions));
        }
Esempio n. 2
0
        public BatchResponse GetBatchDetails(DateTime start, DateTime end)
        {
            var batchTransactions = new List <BatchTransaction>();

            var gateway = createGateway();

            gateway.getTransactionSettledReport(start, end, true, false, false);
            gateway.Process();

            var report = new BluePayReport(gateway.getBatchListResponse());

            foreach (var transaction in report.GetTransactionList())
            {
                var batchTransaction = new BatchTransaction
                {
                    TransactionId   = transaction.invoice_id.ToInt(),
                    Reference       = transaction.id,
                    BatchReference  = transaction.settlement_id,
                    TransactionType = GetTransactionType(transaction.trans_type),
                    BatchType       = GetBatchType(transaction.payment_type),
                    Name            = $"{transaction.name1} {transaction.name2}",
                    Amount          = transaction.amount,
                    Approved        = IsApproved(transaction.status),
                    Message         = transaction.message,
                    TransactionDate = transaction.issue_date,
                    SettledDate     = transaction.settle_date,
                    LastDigits      = transaction.payment_account.Last(4)
                };
                batchTransactions.Add(batchTransaction);
            }


            return(new BatchResponse(batchTransactions));
        }
Esempio n. 3
0
        public BatchResponse GetBatchDetails(DateTime start, DateTime end)
        {
            var batchTransactions = new List<BatchTransaction>();

            var gateway = createGateway();
            gateway.getTransactionSettledReport(start, end, true, false, false);
            gateway.Process();

            var report = new BluePayReport(gateway.getBatchListResponse());

            foreach (var transaction in report.GetTransactionList())
            {
                var batchTransaction = new BatchTransaction
                {
                    TransactionId = transaction.invoice_id.ToInt(),
                    Reference = transaction.id,
                    BatchReference = transaction.settlement_id,
                    TransactionType = GetTransactionType(transaction.trans_type),
                    BatchType = GetBatchType(transaction.payment_type),
                    Name = $"{transaction.name1} {transaction.name2}",
                    Amount = transaction.amount,
                    Approved = IsApproved(transaction.status),
                    Message = transaction.message,
                    TransactionDate = transaction.issue_date,
                    SettledDate = transaction.settle_date,
                    LastDigits = transaction.payment_account.Last(4)
                };
                batchTransactions.Add(batchTransaction);
            }


            return new BatchResponse(batchTransactions);
        }
Esempio n. 4
0
        public BatchResponse GetBatchDetails(DateTime start, DateTime end)
        {
            var batchTransactions = new List<BatchTransaction>();

            foreach (var batch in ReportingGateway.GetSettledBatchList(start, end, includeStats: true))
            {
                foreach (var transaction in ReportingGateway.GetTransactionList(batch.ID))
                {
                    var batchTransaction = new BatchTransaction
                    {
                        TransactionId = transaction.InvoiceNumber.ToInt(),
                        Reference = transaction.TransactionID,
                        BatchReference = batch.ID,
                        TransactionType = GetTransactionType(transaction.Status),
                        BatchType = GetBatchType(batch.PaymentMethod),
                        Name = $"{transaction.FirstName} {transaction.LastName}",
                        Amount = transaction.SettleAmount,
                        Approved = IsApproved(batch.State),
                        Message = batch.State.ToUpper(),
                        TransactionDate = transaction.DateSubmitted,
                        SettledDate = batch.SettledOn,
                        LastDigits = transaction.CardNumber.Last(4)
                    };

                    if (!string.IsNullOrWhiteSpace(transaction.eCheckBankAccount?.accountNumber))
                        batchTransaction.LastDigits = transaction.eCheckBankAccount.accountNumber.Last(4);

                    batchTransactions.Add(batchTransaction);
                }
            }

            return new BatchResponse(batchTransactions);
        }