Al-Kahf • BN-TAFSEER-IBN-E-KASEER
﴿ فَٱنطَلَقَا حَتَّىٰٓ إِذَآ أَتَيَآ أَهْلَ قَرْيَةٍ ٱسْتَطْعَمَآ أَهْلَهَا فَأَبَوْا۟ أَن يُضَيِّفُوهُمَا فَوَجَدَا فِيهَا جِدَارًۭا يُرِيدُ أَن يَنقَضَّ فَأَقَامَهُۥ ۖ قَالَ لَوْ شِئْتَ لَتَّخَذْتَ عَلَيْهِ أَجْرًۭا ﴾
“And so the two went on, till, when they came upon some village people, they asked them for food; but those [people] refused them all hospitality. And they saw in that (village] a wall which was on the point of tumbling down, and [the sage] rebuilt it [whereupon Moses] said: "Hadst thou so wished, surely thou couldst [at least] have obtained some payment for it?"”
Please check ayah 18:78 for complete tafsir.