Ejemplo n.º 1
0
        private bool CanOrderFromSite(Customer customer)
        {
            var isValidAge = customer.Age > 18;

            var isApproved = CheckWithPaymentGateway(customer);

            return isApproved && isValidAge;
        }
Ejemplo n.º 2
0
        private bool CheckWithPaymentGateway(Customer customer)
        {
            if (_paymentGateways.ContainsKey(customer.CCType))
            {
                return _paymentGateways[customer.CCType].Approve(customer);
            }

            return false;
        }
Ejemplo n.º 3
0
        private void SendOverseasPackage(Customer customer)
        {
            if (customer.Address.Country == "US")
            {
                // Shouldn't get here
                Debugger.Break();
            }

            // Send package
        }
Ejemplo n.º 4
0
 // <---- Use QuickAction Here.
 public void SendInvoice(Customer customer)
 {
     _queue.Add(new Tuple<string, int>(customer.EmailAddress, customer.PendingInvoiceID));
 }
Ejemplo n.º 5
0
 public bool Approve(Customer customer)
 {
     return _random.Next(1, 100) > 15;
 }