Did I miss part of the conversation? How did the customer pay $5.15?
Bill is $25. Tip of 20% is $5. Customer pays $30. Credit card fee is 3%. Restaurant actually gets $29.10. Waitress actually gets $4.85 from the $29.10, leaving the restaurant $24.25, which is 97% of the $25 it charged.
He said they charged the 3% on the tip as well. That’s where the 5.15 comes from.
And again, charging your workers for the cost of taking payments is a dick move at best and illegal in some states.
So the charge to the card is 30.90 in your example, 25.75 for the food (and tax if any) restaurant and 5.15 for the tip. At the very worst the server should get 5.00, but even that would be illegal in Massachusetts.
Try deducting the credit card fees from meals tax on your return. See how that goes. To modify your example, say the meal was $23, tax was $2 and tip was $5. Then you add 3% to the whole thing. See if you can convince the tax authorities that the food wasn’t $23.69 and the tax wasn’t $2.06.