public override void Checkout(bool shouldNotifyCustomer) { if (_paymentDetails.PaymentMethod == PaymentMethod.CreditCard) { _paymentProcessor.ChargeCard(_paymentDetails, _cart.TotalAmount); } }
public void Charge(PaymentDetails paymentDetails, double totalAmount) { if (paymentDetails.PaymentMethod == PaymentMethod.ContactCreditCard) { paymentProcessor.ChargeCard(paymentDetails, totalAmount); } else if (paymentDetails.PaymentMethod == PaymentMethod.ContactLessCreditCard) { AuthorizePayment(totalAmount); paymentProcessor.ChargeCard(paymentDetails, totalAmount); } else { throw new NotValidPaymentException("Can not charge customer"); } }
public void Checkout(bool notifyCustomer) { if (_paymentDetails.PaymentMethod == PaymentMethod.CreditCard) { _paymentProcessor.ChargeCard(_paymentDetails, _cart.TotalAmount); } _reserveInventory.ReserveInventory(_cart); if (notifyCustomer) { _notifyCustomer.NotifyCustomer(_cart); } }
/// <summary> /// Charge /// </summary> /// <param name="paymentDetails"></param> /// <param name="totalAmount"></param> /// <param name="Message"></param> /// <returns></returns> public void Charge(PaymentDetails paymentDetails, decimal totalAmount, ref string Message) { if (paymentDetails.PaymentMethod == PaymentMethod.Debitcard) { paymentProcessor.ChargeCard(paymentDetails, totalAmount); } else if (paymentDetails.PaymentMethod == PaymentMethod.Cash) { Message = AuthorizeCashPayment(totalAmount); } else { throw new NotValidPaymentException("Can not charge customer"); } }