In many cases, the Idine transaction is going to pay off a loan the restaurant has from Idine. They are in the loan business, giving you and I miles is just a way for them to get people in the door to eat in the restaurant so they can pay off the loan.
The matching is done at the credit card end of it, be it Mastercard, Visa etc. My guess would be the system scans the merchant number to see if the merchant is participating in Idine, and if it is, then scans the credit card number to see if the person using the card is a member. If that is the case, then idine probably gets a report with date, time, amount, merchant number, card number, etc and issues the mileage credit, and pays off a bit more of the loan.