Back in the 60's, I worked for a vending machine company in R&D. Our coin mechanisms would check for magnetism, diameter, thickness,hardness by bouncing off of a small anvil, and finally a string cutter. There were people who would actually try to cleverly fasten a string to a coin and let it try to validate a purchase, and then pull it back out! They would do the same thing with dollar bill machines by attaching a piece of scotch tape to the bill and feed it in then pull it back out.
The machines of today are much more discriminating and secure with modern electronlcs.