Sayyiduna Marwan bin Qays (may Allah be pleased with him) narrates (he had taken over the herding (ra'iyyah) from his family in the blessed time of the Prophet (peace and blessings be upon him)); he narrates: A man came to the Prophet (peace and blessings be upon him) and said: "O Messenger of Allah, my father has died. He had vowed that he would walk on foot to Makkah and slaughter a camel, and he has left no wealth. Will this vow be fulfilled on his behalf if someone walks on his behalf and I slaughter a camel for him from my own wealth?" The Prophet (peace and blessings be upon him) said: "Yes. Fulfil it on his behalf, slaughter on his behalf, and walk on his behalf. What do you think: if your father owed a debt to a man and you paid it on his behalf from your own wealth, would that man not go back pleased? So Allah Almighty has more right to be pleased."
Al-Tabarani recorded it in al-Mu'jam al-Kabir, and its narrators are thiqat (trustworthy).