Read the PIG. You build an 0100 message, to identify the card (block 3) and pin (14). An 0110 response from the card system will let you know if the card should be retained or not; the ATM protocol just relies on the server telling it to retain card or not. I can't remember the blocks, but you have to check both the return code and the message. Hope this helps.
Panic, Chaos, Destruction. My work here is done.