Beispiel #1
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}."));
 }
        public bool Update(Order order)
        {
            if (_paymentGateWay.VerifyCardDetails(order))
            {
                _costManger.ApplyDiscounts(order);
                _paymentGateWay.ProcessPayment(order);
                return(InternalUpdate(order));
            }

            return(false);
        }