That’s not a tax. It’s a credit card surcharge meant to cover the fee retailers have to pay to credit card companies.
A lot of places post it publicly, usually it is 3%. I would expect it becomes far more common for places to add a surcharge. Business who don’t do it have to pay that out of their revenue.