This is essentially what happens. Cash customers essentially subsidize people that pay via credit card.
In my home country there is a significant fee to deposit cash into a bank account, as well as a significant risk of theft/robbery, so merchants prefer debit/credit cards as handling cash is too risky. I guess this all depends on where in the world you are.