Botnet of 20,000 point-of-sale machines

I wonder if you could write the virus and encode it on a credit card? Person installing the virus swipes his first card with the virus on it when buying something, infecting the machine/system. Then when that card shows up as unreadable or rejected, completes the purchase with cash or a different real card. I’m pretty sure I remember reading about some security types writing a virus that can be stored on a RFID chip, so it’s got to be possible…