Both Apple Pay and Google Pay (formerly Android Pay) use NFC to talk to the credit card machine at the retailer. They transmit the card number (which is generated specifically for this transaction) on the fly, so if the credit card machine has been tampered with only one transaction is affected (instead of canceling your payment card, you just tell your bank about that specific transaction from that retailer and you're done).
No cost for this, but your bank/credit union/... must support Apple Pay/Google Pay ... it's a game changer.