Ejemplo n.º 1
0
 public Commerce2(IBillingProcessLocator billingProcessorLocator, ICustomerSuffixID customer, INotifierSuffixID notifier, ILoggerSuffixID logger)
 {
     _BillingProcessorLocator = billingProcessorLocator;
     _Customer = customer;
     _Notifier = notifier;
     _Logger   = logger;
 }
Ejemplo n.º 2
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessSuffixID billingProcessor  = _processorLocatorGeneric.GetProcessor <IBillingProcessSuffixID>();
            ICustomerSuffixID       customerProcessor = _processorLocatorGeneric.GetProcessor <ICustomerSuffixID>();
            INotifierSuffixID       notifierProcessor = _processorLocatorGeneric.GetProcessor <INotifierSuffixID>();
            ILoggerSuffixID         loggerProcessor   = _processorLocatorGeneric.GetProcessor <ILoggerSuffixID>();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            loggerProcessor.Log("Billing Processed");
            customerProcessor.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            loggerProcessor.Log("Customer Updated");
            notifierProcessor.SendReceipt(orderInfo);
            loggerProcessor.Log("Receipt Sent");
        }