Cash must be accepted. It is the only form of payment (besides cryptocurrencies) where the individual does the payment. Other forms are merely large corporations/institutions using their financial clout to signal that they will pay for something in the future. Those corporations always have perverse incentives to both sell your purchasing history to anyone that wants it as well and to enact financial embargoes against arbitrary people/companies whenever even slight political or social pressure is applied.
Additionally, work-arounds for the law of having to accept cash for all debts should be addressed. Many retail or food service companies will only take your business initially if you present a credit card.