Sahih Muslim Book 10, Hadith Number 3871.

Chapter : He who took something as loan and made its payment back, over and above that (19 approved) and best among you is one who is best in making payment.

Abd Sa’id reported: Bilal (Allah be pleased with him) came with fine quality of dates. Allah’s Messenger (may peace be upon him) said to him: From where (you have brought them)? Bilal said: We had inferior quality of dates and I exchanged two sa’s (of inferior quality) with one sa’ (of fine quality) as food for Allah’s Apostle (may peace be upon him), whereupon Allah’s Messenger (may peace be upon him) said: Woe! it is in fact usury; therefore, don’t do that. But when you intend to buy dates (of superior quality), sell (the inferior quality) in a separate bargain and then buy (the superior quality). And in the hadith transmitted by Ibn Sahl there is no mention of” whereupon”.