1. He only loses to other shops in the case where customers dan't or won't pay with cash (this is a subset, and probably a minority, of customers). In return he saves money on a computer kiosk and the merchant fees on his transactions.
2. If he does not take plastic, then people who only pay with plastic are not his customers. Their needs are consequently irrelevant.
3. the $.25 donut is a loss-leader to sell the $4 cup of coffee. Or you could look at it as a bonus of sorts. Compare: "Buy a $4.25 cup of coffee" with "Buy a $4.25 cup of coffee, get a free donut."