public CheckoutDto CalculateTotals(string cartId, CouponDto couponDto) { var coupon = _mapper.Map <Coupon>(couponDto); var cart = GetCartFromDb(cartId); return(_checkOutEngine.CalculateTotals(cart, coupon)); }
public CheckoutDto CalculateTotals(string cartId, string couponId) { var cart = GetCartFromDb(cartId); var checkoutDto = _checkOutEngine.CalculateTotals(cart); var coupon = _couponRepository.FindById(couponId); var couponDiscount = _couponEngine.CalculateDiscount(checkoutDto, coupon); checkoutDto.CouponDiscount = couponDiscount; return(checkoutDto); }
public CheckoutDto CalculateTotals(string cartId) { var cart = GetCartFromDb(cartId); return(_checkOutEngine.CalculateTotals(cart)); }