One question is whether this would be legal in the US. The answer is yes. Below is Q&A text copied from a Federal Reserve Board webpage that Daniel Reck pointed me to on the Facebook page for this post:
Is it legal for a business in the United States to refuse cash as a form of payment?
Section 31 U.S.C. 5103, entitled "Legal tender," states: "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."
This statute means that all United States money as identified above is a valid and legal offer of payment for debts when tendered to a creditor. There is, however, no Federal statute mandating that a private business, a person, or an organization must accept currency or coins as payment for goods or services. Private businesses are free to develop their own policies on whether to accept cash unless there is a state law which says otherwise.
What this means is that there is no Federal law that businesses must accept cash. My question then is this: Which states require businesses to accept cash?
Also on the Facebook page for this post, my nephew Peter Kimball points out that the salad restaurant Sweetgreens in Washington D.C. does not accept cash.