"Can't charge extra for using a credit card" is a contractual condition imposed by the credit card companies. If anything there should be a law voiding such conditions as contrary to sound public policy. Why should cash or debit card users in a competitive market be charged extra to subsidize rewards for credit card users, for example?
It is always convenient for businesses to have the legislature enforce their preferred contract conditions in statutory law, but this particular statute sounds like it is unenforceable.