I never knew that stores cannot charge more. I would assume more stores will already set the price with credit card charges in mind. Some restaurants give you 5% discount for paying in cash.
It's a loophole of sorts. They cannot legally post a sign saying "Credit card transactions will have a 5% fee added" but it's perfectly fine to say "Cash purchases receive 5% discount."