Card only payment isn't illegal. Loads of businesses were doing it pre-covid. I work in town and several coffee shops/bars have been card/contactless only for a while.
I get the argument that refusing cash alienates some people at the bottom of society and for that reason I do think cash should be accepted, but personally I use Apple Pay for 99%+ of purchases. The only time I ever used to carry cash was going to the Etihad before they installed the better card machines / bothered to train the staff.