public override void Checkout(bool shouldNotifyCustomer)
 {
     if (_paymentDetails.PaymentMethod == PaymentMethod.CreditCard)
     {
         _paymentProcessor.ChargeCard(_paymentDetails, _cart.TotalAmount);
     }
 }
Exemplo n.º 2
0
 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");
     }
 }
Exemplo n.º 3
0
        public void Checkout(bool notifyCustomer)
        {
            if (_paymentDetails.PaymentMethod == PaymentMethod.CreditCard)
            {
                _paymentProcessor.ChargeCard(_paymentDetails, _cart.TotalAmount);
            }

            _reserveInventory.ReserveInventory(_cart);

            if (notifyCustomer)
            {
                _notifyCustomer.NotifyCustomer(_cart);
            }
        }
Exemplo n.º 4
0
        /// <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");
            }
        }