ʿUmar bin al Khattab ؓ appointed me in charge of the zakah, and when had finished with it and handed it over to him, he ordered that I be given some remuneration. I said: I only did it for the sake of Allah and my reward is with Allah. He said: Take what is given to you. I was appointed to do some work at the time of the Messenger of Allah ﷺ and he gave me some remuneration, and I said the same as you have said, but the Messenger of Allah ﷺ said to me: ʿIf you are given something without asking for it, then take it and give some in charity.” (Using translation from Aḥmad 371)
خُذْ مَا أُعْطِيتَ فَإِنِّي قَدْ عَمِلْتُ عَلَى عَهْدِ رَسُولِ اللهِ ﷺ فَقُلْتُ مِثْلَ قَوْلِكَ فَقَالَ لِي رَسُولُ اللهِ ﷺ «إِذَا أُعْطِيتَ شَيْئًا مِنْ غَيْرِ أَنْ تَسْأَلَ فَكُلْ وَتَصَدَّقْ»