“Second, the Gemara (Kesuvos 98b) discusses the case of someone who bought something on behalf of his friend, and was given a bonus by the storeowner. Does the bonus belong to the person whose money it is, or to the agent who came to the store and made the purchase? The Gemara says to split the bonus.” (C.M. 183:6)
“Thus,” concluded Rabbi Dayan, “since the extra sefer was due to the purchase of both the discs and the other two sefarim, and since Mendel was the agent to buy the discs – you should split the extra sefer. Mendel should return 12.5 NIS.”
“You said there was another, simpler way?” asked Menachem.
“Yes,” said Rabbi Dayan. “Since you were willing to spend 50 for the discs anyway, Mendel could have bought you a sefer with the extra money.”