يٰٓاَيُّهَا الَّذِيْنَ اٰمَنُوْا لَا تُبْطِلُوْا صَدَقٰتِكُمْ بِالْمَنِّ وَالْاَذٰىۙ كَالَّذِيْ يُنْفِقُ مَالَهٗ رِئَاۤءَ النَّاسِ وَلَا يُؤْمِنُ بِاللّٰهِ وَالْيَوْمِ الْاٰخِرِۗ فَمَثَلُهٗ كَمَثَلِ صَفْوَانٍ عَلَيْهِ تُرَابٌ فَاَصَابَهٗ وَابِلٌ فَتَرَكَهٗ صَلْدًا ۗ لَا يَقْدِرُوْنَ عَلٰى شَيْءٍ مِّمَّا كَسَبُوْا ۗ وَاللّٰهُ لَا يَهْدِى الْقَوْمَ الْكٰفِرِيْنَ ( البقرة: ٢٦٤ )
Yaaa ayyuhal lazeena aamanoo laa tubtiloo sadaqaatikum bilmanni wal azaa kallazee yunfiqu maalahoo ri'aaa'an naasi wa laa yu'minu billaahi wal yawmil aakhiri famasaluhoo kamasali safwaanin 'alaihi turaabun fa asaabahoo waabilun fatara kahoo saldaa; laa yaqdiroona 'alaa shai'im mimmaa kasaboo; wallaahu laa yahdil qawmal kaafireen (al-Baq̈arah 2:264)
O you who have believed, do not invalidate your charities with reminders [of it] 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. (Al-Baqarah  : 264)
1 Mufti Taqi Usmani
O you who believe, do not nullify your acts of charity by boasting about (doing people a) favour and by causing (them) hurt, like the one who spends his wealth to show off before peopleand does not believe in Allah and in the Last Day. So, his example is like a rock on which there is dust, then a heavy rain came over it and left it barren. They have no ability to gain anything out of what they have done, and Allah does not give guidance to the people who disbelieve.