예제 #1
0
 public void Pay()
 {
     try
     {
         PaymentCard paymentCard = new PaymentCard();
         paymentCard.ExecutePayment();
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #2
0
        public void Order(Payment payment)
        {
            Console.WriteLine("Verify order");

            if (payment == Payment.Card)
            {
                PaymentCard paymentCard = new PaymentCard();
                paymentCard.ExecutePayment();
            }
            else if (payment == Payment.PayPal)
            {
                PaymentPayPal paymentPayPal = new PaymentPayPal();
                paymentPayPal.Pay();
            }
        }