Partial fix for #167
Created by: h-c-c
Part of the problem is that the function that consumes a code is run when $discountParams is empty. Bad because $discountParams is an arg for that function.
This still doesn't track the autodiscount code properly, but at least were not consuming discount codes arbitrarily. The latter is bad news!