The pilgrims had assembled in the land of Mina during Hajj Pilgrimage. Imam Jafar Sadiq (AS) and his companions sitting in a place were eating some grapes placed before them.
A beggar appeared and asked for alms. Imam Jafar Sadiq (AS) took some grapes to give him, but he refused to accept it and asked for money. Imam Jafar Sadiq (AS) told him to excuse him, as he did not have money. The beggar went away disappointed.
After going a few steps he had second thoughts came back and asked for the same grapes. Imam Jafar Sadiq (AS) now refused to give him those grapes too.
Soon after, another beggar appeared. Imam Jafar Sadiq (AS) again took some grapes and gave to him. He accepted it and said, “Thanks to the Lord of universe who gave me my sustenance”. On hearing these words, Imam Jafar Sadiq (AS) told him to wait and gave him two handfuls of grapes.
The beggar thanked Allah (SWT) for the second time.
Imam Jafar Sadiq (AS) again told him to wait and then turning to one of his friends and asked, “How much money is with you?” The man searched his pockets and produced nearly twenty Dirham, which he gave to the beggar at the order of Imam Jafar Sadiq (AS).
The beggar thanking Allah (SWT) for the third time said, “Thanks are exclusive to Allah (SWT). O Allah (SWT)! Thou art the Bestower of the good, and thou hast no companion.” On hearing these words, Imam Jafar Sadiq (AS) took off his garment and gave it to the beggar.
Now, the beggar changed his tone and spoke a few words of thanks to Imam Jafar Sadiq (AS) himself. Then Imam Jafar Sadiq (AS) did not give anything and he went away.
His friends and companions who were present there said, “We thought that had the beggar continued thanking Allah (SWT) in the same manner as before, Imam Jafar Sadiq (AS) would have continued giving him more and more.
But when he changed his words and praised and thanked Imam Jafar Sadiq (AS) himself, Imam Jafar Sadiq (AS) did not continue his assistance.”
Moral of the Story: Whenever you get anything remember that although it may be from someone, Allah (SWT) has wished for you to have it. So not only should you thank the person who has given it to you (Jazakallah) but also thank Allah (Alhamdulillah).
Reference : Life of imam Jafir as Sadiq a.s