Reference: Surah Al-Kahf – Quran, Chapter 18, Verse 77: Arabic and English Translation
77. Then they both proceeded, till, when they came to the people of a town, they asked them for food, but they refused to entertain them. Then they found therein a wall about to collapse and he (Khidr) set it up straight. [Musa (Moses)] said: If you had wished, surely, you could have taken wages for it!” (Translation by Muhsin Khan / Hilali)
Then the two went forth until when they came to a town, they asked its people for food, but they refused to play host to them. They found in that town a wall that was on the verge of tumbling down, and he buttressed it, whereupon Moses said: “If you had wished, you could have received payment for it.” (Translation by Abu Al-Alaa Maududi)
Then they proceeded: until, when they came to the inhabitants of a town, they asked them for food, but they refused them hospitality. They found there a wall on the point of falling down, but he set it up straight. (Moses) said: “If thou hadst wished, surely thou couldst have exacted some recompense for it!” (Translation by Yusuf Ali)


See Full Surah Al-Kahf