private decimal ApplyCoupon(Coupon applicableCoupon, decimal total) { applicableCoupon.HasBeenApplied = true; string adjustmentItem = string.Format( "Coupon ${0} off when the bill total (${1}) exceeds ${2}", applicableCoupon.AmountOff, total, applicableCoupon.Threshold); this.AddItem(adjustmentItem).Quantity(1) .PricePerUnit(-applicableCoupon.AmountOff); return total - applicableCoupon.AmountOff; }
public void AddCoupon(Coupon coupon) { _coupons.Add(coupon); }