All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
Scholars held different views as to whether it is permissible for one to perform Hajj on behalf of someone else before he performs it for himself. Those who adopt the opinion that it is impermissible say that if one did this, the Hajj he performed is counted as an obligatory Hajj which he did for himself.
Hence, you have fulfilled the obligation of Hajj according to the opinion of Ash-Shaafi‘i and Ahmad which is the preponderant one. However, this opinion does not correspond to that of Maalik and Abu Haneefah . So if you want to avoid being caught up in the difference of opinions among scholars, perform Hajj for yourself once again.
You should know that the obligation of Hajj is not fulfilled for the one who authorized you to perform it on his behalf or on behalf of his deceased relative. You should return his money to him in case he gave you any in return for performing Hajj on his behalf.