/// <summary> /// The get pre order summary. /// </summary> /// <param name="salesPreparation"> /// The sales preparation. /// </param> /// <returns> /// The <see cref="PreOrderSummary"/>. /// </returns> private static PreOrderSummary GetPreOrderSummary(BasketSalePreparation salesPreparation) { var summary = new PreOrderSummary(); if (!salesPreparation.IsReadyToInvoice()) { return(summary); } var invoice = salesPreparation.PrepareInvoice(); // item total summary.ItemTotal = invoice.TotalItemPrice(); // shipping total summary.ShippingTotal = invoice.TotalShipping(); // tax total summary.TaxTotal = invoice.TotalTax(); // invoice total summary.InvoiceTotal = invoice.Total; return(summary); }
/// <summary> /// Gets the <see cref="IBasketSalePreparation"/> /// </summary> /// <param name="basket">The basket with items use in the checkout</param> /// <param name="merchelloContext">The <see cref="IMerchelloContext"/></param> /// <returns>A <see cref="IBasketSalePreparation"/></returns> internal static BasketSalePreparation SalePreparation(this IBasket basket, IMerchelloContext merchelloContext) { return(BasketSalePreparation.GetBasketCheckoutPreparation(merchelloContext, basket)); }