The Messenger of Allah ﷺ said, "Charity is not lawful for a wealthy person except in three cases. For one fighting in the path of Allah, for the traveler, and for a man whose neighbor received charity and then gifted some of it to him."
حدثنا وكيع حدثنا ابن أبي ليلى عن عطية
قال رسول الله ﷺ لا تحل الصدقة لغني إلا لثلاثة في سبيل الله وابن السبيل ورجل كان له جار فتصدق عليه فأهدى له