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); }
/// <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}.")); }
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); }