Ejemplo n.º 1
0
        protected override PaymentResult ExecutePaymentProcess(PaymentDataBase paymentData)
        {
            EftPaymentData eftPaymentData = paymentData as EftPaymentData;

            EftAuthorization eftResult = this.eftProcessor.AuthorizeEftPayment(eftPaymentData.RoutingNumber,
                                                                               eftPaymentData.BankAccountNumber, eftPaymentData.AccountType, eftPaymentData.Amount);

            if (eftResult.Authorized)
            {
                int referenceNumber = paymentsDao.SaveSuccessfulEftPayment(eftPaymentData, eftResult);

                PaymentResult paymentResult = new PaymentResult()
                {
                    CustomerAccountNumber = eftPaymentData.CustomerAccountNumber,
                    PaymentDate           = eftPaymentData.PaymentDate,
                    Success         = eftResult.Authorized,
                    ReferenceNumber = referenceNumber
                };

                return(paymentResult);
            }
            else
            {
                int referenceNumber = paymentsDao.SaveFailedEftPayment(eftPaymentData, eftResult);

                PaymentResult paymentResult = new PaymentResult()
                {
                    CustomerAccountNumber = eftPaymentData.CustomerAccountNumber,
                    PaymentDate           = eftPaymentData.PaymentDate,
                    Success         = eftResult.Authorized,
                    ReferenceNumber = referenceNumber
                };
                return(paymentResult);
            }
        }
Ejemplo n.º 2
0
 public int SaveFailedEftPayment(EftPaymentData eftData, EftAuthorization result)
 {
     // This would save to a database
     return(25);
 }
Ejemplo n.º 3
0
        public int SaveSuccessfulEftPayment(EftPaymentData eftData, EftAuthorization result)
        {
            // This would save to a database

            return(20);
        }