Exemple #1
0
 private void DoPayment(Payment pay, float price)
 {
     pay.Connect();
     pay.StartPayment(price);
     pay.EndPayment();
     pay.Disconnect();
 }
Exemple #2
0
 public Ticket(string from, string to, UIClass cls, int way, float discount, Payment payment)
 {
     this.from = from;
     this.to = to;
     this.cls = cls;
     this.way = way;
     this.discount = discount;
     this.payment = payment;
 }
Exemple #3
0
 private void handlePayment(UIInfo info)
 {
     // *************************************
     // This is the code you need to refactor
     // *************************************
     StandardTicket ticket = new StandardTicket(info);
     Payment payment = new Payment(ticket, info);
     printer = new Printer();
     printer.CreateTicket(info, ticket);
 }
Exemple #4
0
        public bool MakePayment(UIPayment uiPayment, float price)
        {
            switch (uiPayment)
            {
                case UIPayment.CreditCard:
                    payment = new CreditCard();
                    break;
                case UIPayment.DebitCard:
                    payment = new DebitCard();
                    break;
                case UIPayment.Chipknip:
                    payment = new Chipknip();
                    break;
                case UIPayment.Cash:
                    payment = new Cash();
                    break;
            }

            return payment.HandlePayment(price);
        }