The Prophet ﷺ said, "Whoever seeks refuge in the name of Allah, grant him refuge. Whoever asks of you in the name of Allah, give to him. Whoever invites you, accept his invitation. Whoever does you a favor, repay him in kind. If you cannot find the means to repay him, then pray for him until you are sure you have repaid him."
حدثنا عفان حدثنا أبو عوانة حدثنا سليمان الأعمش عن مجاهد
عن النبي ﷺ قال من استعاذ بالله فأعيذوه ومن سألكم بالله فأعطوه ومن دعاكم فأجيبوه ومن أتى إليكم معروفا فكافئوه فإن لم تجدوا ما تكافئوه فادعوا له حتى تعلموا أن قد كافأتموه
Its isnad is sahih. Abu Dawud narrated it 2:52, 53 through Jareer, and 4:489 through Jareer and Abu Awana, both of them from Amash. Munziri said, Nasai also narrated it. It is in the Mustadrak 1:412, 413 through Ammar bin Zurayq from Amash, and he said, this is a hadith that is sahih according to the standard of the two Shaykhs, for Abu Awana, Jareer bin Abdul-Hameed, and Abdul-Aziz bin Muslim Qasmali all corroborated Ammar bin Zurayq in establishing this isnad from Amash. He then narrated it with his own isnad from these three, and Dhahabi agreed with him.Suyuti also attributed it in Jami Saghir 8411 to Ibn Hibban, marking it with the symbol for hasan. I do not know why, when it is a hadith that is sahih! For this reason Munawi said in his commentary, Nawawi said in his Riyad, it is a hadith that is sahih.As for his statement, "if you cannot find anything to reward him with," this is how it appears in the source texts and in the first place in Abu Dawud, in the jussive form. We have already discussed the permissibility of something like this at 1401 and 1412. In the Mustadrak at 372 it reads, "that you have indeed rewarded him," and in a manuscript in the margin of M it reads, "that you have indeed rewarded him." See also 2248, 2961, and 5263.