Bishr bin Umar (may Allah have mercy on him) narrates from Hammam (may Allah have mercy on him): "There is no harm in buying silver for gold even when the silver is greater in quantity, provided the deal is in cash; on credit it is not permissible. Likewise (there is no harm) in taking barley for wheat even when the barley is greater in quantity, provided the deal is in cash; but on credit it is not permissible."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب البيوع / 10506