It used to be a big thing in the US at gas stations where they advertised the 2 different prices. I don't know the details, but at some point that stopped happening. I was under the impression some rule change, but it is making a come back. I don't know if some consumer protection laws were made the revoked or whatnot, but it is possible to not have to automatically be charged for credit card fees if you're not using credit.
Hah, as a European that lived in California for a while this always seemed so odd to me. I just dug up a picture of my car that I took at a gas station, and there's prices in the background: Cash $2.94, Credit $3.11, for regular gas, and the date on the picture is the 4th of July, 2017. That's quite the difference but roughly in line with credit card fees.
It makes sense that gas stations would do this, it's a pretty slim margin business.
From what I've seen it turns into a compliance mess outside of in-person retail, because many states have regulations and gimmicks on top of it, and the system will end up kicking out a rejection code if you ask for the wrong amount, or on the wrong customer. It's obviously intended that you just bake the cost in for everyone because that avoids people blaming the card networks for higher prices.
The only time I've seen it in person was when I went to make the initial payment on an auto lease; the dealer had a sign up saying that there would be a 3% credit surcharge, which exceeded the 2% cash back I expected from Citibank, so I used a debit card instead.