Which country do you have experience with?
International rail and bus lines have this problem. They have price X for online tickets, and price X+Y (where Y>0 and often Y>X) for cash payers. Flixbus (Germany) and OUIGO (France) both do this.
Some countries force payments by bank transfer. The only way to make such a payment with cash is to hire the post office, who charges a fee. Indeed you cannot even pay your tax in cash in some countries without paying an extra fee.
The cheapest Internet subscription offer often mandates electronic payment -- even if the ISP has a physical presence. In that case you can only pay cash via the post office, which adds their fee.