public void Pay() { try { PaymentCard paymentCard = new PaymentCard(); paymentCard.ExecutePayment(); } catch (Exception) { throw; } }
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(); } }