You don't even need a loyalty card. Match up the amount and time of the charge to the in-store inventory system, and you can be about 99% sure that you are correctly matching the person's card to their purchase. If the store scans a UPC, then that UPC is in their system. Sure, the receipt may just print 'candy bar' but the UPC says 'Butterfinger 2oz classic bar'.