I take it the CC is a credit card. I can see that a CC fee would be charged as the CC comapanies charge a few percent. My state lets you pay by CC and the local tax office does too, but they charge for that. The credit union I have does a direct electronic transfer without a fee for most of my bills I pay.
The way I understand it, the CC companies made the stores sell it to you for the same pirce, cash or CC or they would pull your ability to do any CC with them. I think the Feds made it so the sotres could charge a CC fee several years ago.
When I am buying something, I ask how much it is for cash and not a CC. If they say it is the same, I use the CC as I get a percentage back. If they want more, I decide if I get back more on the CC or a bigger discount.
One gas station had the electronic sign that said something like Cash $
2.00 per gallon and $ 2.10 credit.