This, too, is impermissible. Nevertheless, some jurists allow it when a real need arises—for instance, a beggar approaches you while you have only a ten-riyal note, so you say, “Here is ten; give me nine back,” in order to give him one riyal in charity. They granted this concession because the aim is almsgiving, which cannot be achieved except in this manner, and neither party intends a commercial sale.
Buying and selling inside the mosque remain unlawful for both seller and buyer. As for the person who hears a transaction taking place, what is his duty? The Prophet ﷺ instructed: “Say to him, ‘May Allah not make your trade profitable.’” One is to invoke against him that Allah cause him loss and withhold profit. The Prophet ﷺ also said: “For the mosques were not built for this.”
These words—“for the mosques were not built for this”—may be added by the speaker after the supplication, or they may be the Prophet’s own rationale for the ruling, in which case they need not be repeated. Yet if adding them will soften the other man’s heart, then saying them is commendable; you may say, “May Allah not bless your trade, for the mosques were not constructed for this.” That is, they were not built for buying and selling; they were built for prayer, the remembrance of Allah, reciting the Quran, seeking knowledge, and similar acts.
Therefore, if saying “for the mosques were not built for this” will calm him and prevent him from taking offense, then say it. When I invoke this supplication against someone, I do so only because the Messenger ﷺ commanded it, and the command of the Messenger must be obeyed just as the command of Allah: “Obey Allah and obey the Messenger” (Quran 3:32). Hence I say, “May Allah not prosper your trade, for the mosques were not built for this,” aiming to put his heart at ease.
The same ruling applies to announcing lost property. A man may come and say, “I have lost such-and-such,” for example a purse of money