In Germany and Budapest, and certainly Sweden, drivers are required by their dispatchers to accept credit cards. "Cash only" drivers will be a thing of the past soon. Look at what happened with the London black cabs: they all accept credit cards these days.
Not everywhere in Germany and even in places where they are required to, for many drivers the card reader is somehow always "broken" when you try to use it. I now use taxi-calling apps with built-in payment as those are really convenient.