Reference: Fataawa Noor ‘alad-Darb – Question No.6290, Page 121, Volume 12
Question: A seller who makes a mistake in calculating [the total amount due] – unintentionally gives the buyer more or less change [than he is due]; [in this case] should he give [the buyer] the remainder [of the change] or [just] keep it?
Response: Yes, if the seller finds out the buyer has given him more [money] than is due, then he must return the excess [money] back to him. And if he (the buyer) has since died, then he must return it to his inheritors, and if he does not know them and has lost hope of returning [the money], then he must donate the money in charity on his (the buyer’s) behalf.
If [on the other hand] it becomes apparent that the buyer paid him (the seller) less than what was due, then he (the seller) should search for him and request he pay the remainder; however, would he (the buyer) admit to it or not? [in which case] this matter should be taken to court.