public PaymentResult ProcessPayment(BasePaymentData 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); } }
public PaymentResult ProcessPayment(BasePaymentData paymentData) { CheckPaymentData checkPaymentData = paymentData as CheckPaymentData; int referenceNumber = this.paymentsDao.SaveCheckPayment(checkPaymentData); PaymentResult paymentResult = new PaymentResult() { CustomerAccountNumber = checkPaymentData.CustomerAccountNumber, PaymentDate = checkPaymentData.PaymentDate, Success = true, ReferenceNumber = referenceNumber }; return(paymentResult); }