All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
It seems that the buyer in question deputized you to buy a piece of land without making any specifications. This is a general agency that necessitates working for the benefit of the principal. In other words, you should buy the best piece of land in return for the least price. However, you contradicted the requirement of that agency since you added a commission which denotes working for your own benefit. Hence, your goal contradicted with the goal of the principal, thus, you are questioned for this act.
Buying the land at market price does not discharge you because doing so most probably involves accusation. Such an accusation can not be dismissed by a case that does not result in an accusation. Moreover, you are also questioned for this act because of another reason: that you pursued commission may drive you to hasten in buying an inappropriate piece of land or the like.
Accordingly, you should pay the money taken as a commission to the heirs, whether you let them know about this incident or not. It is impermissible for you to give this money in charity on behalf of the deceased as long as you can pay the money to the heirs. You should seek the forgiveness of Allaah for lying to your principal. May Allaah Guide you to do whatever pleases Him.
Allaah Knows best.