I frequently give extra cash when paying to get a five or ten back. I might pay $22.50 on $17.50.
Half the people I do this with try to give me $2.50 right away telling me I gave too much. I tell them to punch it into the computer and see what happens. They are amazed at the result as if it is magic.
I do the same thing, so I don’t have a bunch of change in my pockets. I didn’t even want a refund for the overcharge. I just told them they needed to make the prices the same on the pump and sign.