A dirham for a dirham, and a Dinar for a Dinar.I said, "I heard Ibn Abbas say something different."He replied, "I once met Ibn Abbas and said to him, 'Tell me about what you say regarding currency exchange. Is it something you heard from the Messenger of Allah ﷺ, or something you found in the Book of Allah?'He answered, 'I did not find it in the Book of Allah, nor did I hear it from the Messenger of Allah ﷺ. Rather, Usama bin Zayd informed me that the Messenger of Allah ﷺ said, "Riba occurs only in deferred transactions."'"
حدثنا محمد بن الصباح حدثنا سفيان بن عيينة عن عمرو بن دينار عن أبي صالح عن أبي هريرة قال سمعت
الدرهم بالدرهم والدينار بالدينار فقلت إني سمعت ابن عباس يقول غير ذلك قال أما إني لقيت ابن عباس فقلت أخبرني عن هذا الذي تقول في الصرف أشيء سمعته من رسول الله ﷺ أم شيء وجدته في كتاب الله فقال ما وجدته في كتاب الله ولا سمعته من رسول الله ﷺ ولكن أخبرني أسامة بن زيد أن رسول الله ﷺ قال إنما الربا في النسيئة
Bukhari narrated it in "Sales", chapter "Selling a dinar for a dinar on deferred payment," Hadith: 2178, 2179, from the hadith of Amr bin Dinar, and Muslim in "Sharecropping", the previous chapter, Hadith: 1596, from the hadith of Sufyan, with the same wording.