But with everywhere else cash is legal tender and cannot legally refused
31 U.S.C. § 5103
United States coins and currency (including Federal reserve notes and circulating notes of Federal reserve banks and national banks) are legal tender for all debts, public charges, taxes and dues.
But for commerce, legal tender can be refused. A business can legally say that they only accept credit cards as payment
in advance. The "in advance" part is crucial. It is not the payment of a debt but a simple business transaction, and the terms can be dictated by either party. It the other party refuses those terms then you simply don't do business. However if you enter into a contract with a business, then I believe they must accept legal tender because you are contractually obligated to pay, making it in effect a debt.
Doctor bills, utility bills, gym dues, etc. fall under the legal tender law.
So, for example, if you go into a restaurant, order food and eat it, you now owe a debt to the restaurant, and they must accept legal tender as payment. But if you go into a restaurant that requires you to pay
before you eat, they can dictate what form of payment they will accept and refuse legal tender.
Similarly, if you pump gas into your car and then pay, you are paying a debt and the gas station must accept any legal tender. But if the gas station requires prepayment, they can refuse legal tender. Some gas stations will not accept anything larger than a $20 bill, but they can only do that legally if they require prepayment. Once you have pumped the gas, they
MUST by law accept any legal tender.