Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:2:264

O you who have believed, do not invalidate your charities with reminders or injury as does one who spends his wealth ˹only˺ to be seen by the people and does not believe in Allah and the Last Day. His example is like that of a ˹large˺ smooth stone upon which is dust and is hit by a downpour that leaves it bare. They are unable ˹to keep˺ anything of what they have earned. And Allah does not guide the disbelieving people.  

O you who believe, annul not, the rewards of, your voluntary almsgivings with reproach and injury, as, in the manner of the annulment of the expenditure of, one who expends of his substance to show off to men and believes not in God and the Last Day: this is the hypocrite. The likeness of him is as the likeness of a smooth rock on which is soil, and a torrent, of intense rain, smites it, and leaves it barren, and smooth with nothing on it. They have no power (lā yaqdirūna is a resumption of the statement about the likeness of the one that expends for show; the person becomes plural on account of the ˹potential plural˺ implication of alladhī, ‘the one who’) over anything that they have earned, that they did, in other words, they find no reward for it in the Hereafter, just as one finds nothing of the dust that was on the surface of the smooth rock, after the rain has washed it away. God guides not the disbelieving folk.
القرآن:٢:٢٦٤

يَا أَيُّهَا الَّذِينَ آمَنُوا لَا تُبْطِلُوا صَدَقَاتِكُمْ بِالْمَنِّ وَالْأَذَىٰ كَالَّذِي يُنْفِقُ مَالَهُ رِئَاءَ النَّاسِ وَلَا يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الْآخِرِ ۖ فَمَثَلُهُ كَمَثَلِ صَفْوَانٍ عَلَيْهِ تُرَابٌ فَأَصَابَهُ وَابِلٌ فَتَرَكَهُ صَلْدًا ۖ لَا يَقْدِرُونَ عَلَىٰ شَيْءٍ مِمَّا كَسَبُوا ۗ وَاللَّهُ لَا يَهْدِي الْقَوْمَ الْكَافِرِينَ  

{يأيها الذين آمنوا لا تبطلوا صدقاتكم} أي أجورها {بالمن والأذى} إبطالا {كالذي} أي كإبطال نفقة الذي {ينفق ماله رئاء الناس} مرائيا لهم {ولا يؤمن بالله واليوم الآخر} هو المنافق {فمثله كمثل صفوان} حجر أملس {عليه تراب فأصابه وابل} مطر شديد {فتركه صلدا} صلبا أملس لا شيء عليه {لا يقدرون} استئناف لبيان مثل المنافق المنفق رئاء الناس وجمع الضمير باعتبار معنى الذي {على شيء مما كسبوا} عملوا أي لا يجدون له ثوابا في الآخرة كما لا يوجد على الصفوان شئ من التراب الذي كان عليه لإذهاب المطر له {والله لا يهدى القوم الكافرين}.