There are vending machines specifically for selling electronics. You can pay by card.
More easy for countries where it is supported everywhere, rather than regionally. But also possible to target vending machines in transit areas, since a lot of public transport has moved over to smart cards.