Example #1
0
        private bool CanOrderFromSite(Customer customer)
        {
            var isValidAge = customer.Age > 18;

            var isApproved = CheckWithPaymentGateway(customer);

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

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

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