So this would apply to for example, a postpaid sit-down restaurant meal -- when the bill comes, you offer cash and if it's turned down your debt is settled. That's the law.
There is generally no requirement to agree to accept cash prior to making the transaction though, as at a counter service place where you pay as you get the food. They would be in their rights to refuse to hand over the food and ask you to leave.
And that's why you see a lot of cash free counter places now, but not sit down postpaid. It would be impractical to refuse to take cash once the food has already been eaten.
Hope this helps.