So I started looking into this, because it's interesting.
So, merchants can reject cash for purchases[1] because cash is legal tender for all debts, public charges, taxes, and dues, and a purchase is not one of these.
The Wikipedia page [2] for dining and dashing states that ordering a meal is a contract debt, since you are given the food before the transaction occurs, with the understanding that you'll pay for it afterwards. Thus, if the merchant, after giving you the food, informed you that they only accept credit card, that would not be allowed.
So, merchants can reject cash for purchases[1] because cash is legal tender for all debts, public charges, taxes, and dues, and a purchase is not one of these.
The Wikipedia page [2] for dining and dashing states that ordering a meal is a contract debt, since you are given the food before the transaction occurs, with the understanding that you'll pay for it afterwards. Thus, if the merchant, after giving you the food, informed you that they only accept credit card, that would not be allowed.
Also some good discussion on this SE post [3]
1. https://www.federalreserve.gov/faqs/currency_12772.htm 2. https://en.wikipedia.org/wiki/Dine_and_dash 3. http://skeptics.stackexchange.com/questions/7701/is-it-illeg...