public void CreateTreansaction() { _payment = new Payment() { Amount = _amount, Payer = _from, Recipient = _to }; _paymentStrategy.VerifyPayment(_payment); _paymentStrategy.MakePayment(_payment); }
public void MakePayment() { if (paymentStrategy == null) { Console.WriteLine("Please set a payment strategy before making payment."); } else { double total = 0; Console.WriteLine("Shopping List:"); foreach (Product p in shoppingList) { Console.WriteLine($" {p.GetName()} £{p.GetPrice()}"); total += p.GetPrice(); } paymentStrategy.MakePayment(total); } }