예제 #1
0
 public void FinalizeOrder(OrderDetails details)
 {
     inventory.Update(details.ProductNo);
     costing.ApplyDiscounts(details.Price, details.DiscountPercent);
     logistic.ShipProduct(details.ProductName, details.AddressLine1);
     orderVerify.VerifyShippingAddress(details.PinCode);
     payment.ProcessPayment(details.CardNo, details.Price);
 }
예제 #2
0
 /// <summary>
 /// making the order
 /// </summary>
 /// <param name="orderDetails"></param>
 public void FinalizeOrder(OrderDetails orderDetails)
 {
     inventory.Update(orderDetails.ProductNo);
     orderVerify.VerifyShippingAddress(orderDetails.PinCode);
     orderDetails.Price = costManger.ApplyDiscounts(orderDetails.Price, orderDetails.DiscountPercent);
     paymentGateWay.VerifyCardDetails(orderDetails.CardNo);
     paymentGateWay.ProcessPayment(orderDetails.CardNo, orderDetails.Price);
     logistics.ShipProduct(orderDetails.ProductName, string.Format($"{orderDetails.AddressLine1}, {orderDetails.AddressLine2} - {orderDetails.PinCode}."));
 }
예제 #3
0
        private void SimpleFinalize(Order order)
        {
            //Apparently poor logic, just for fun!

            var isUpdated = _inventory.Update(order);

            if (!isUpdated)
            {
                return;
            }

            var isVerified = _orderVerify.VerifyShippingAddress(order);

            if (!isVerified)
            {
                return;
            }

            _logistics.ShipProduct(order);
        }