Imam an-Nawāwi, may Allah have mercy upon him said:
Our ashāb said: if a man gives out the fitra for an ajnabī (non-relative), without his iźn (permission), it does not suffice for him, i.e the ajnabī. This is because it is an ‘ibāda (worship), hence the obligation is not dropped from the mukallaf without his iźn. If he gives iźn, then his portion of fitrā has been discharged from him, just as how one said to another: “Settle for me my debt!” , and as how one authorize another as wakīl in handing over his money for zaka, and in slaughtering his sacrifice. If a person has a young child who is wealthy (mūsir) whereby the young child’s fitra is not obligatory upon that person, and then the person discharges the fitra of the child using his own wealth, it is permissible without khilāf. Al-Qadhi Abu Tayyīb, al-Mawardī, al-Bandinijī, al-Baghawī and the ashāb declared this explicitly. This is because he has independent autonomy over his young child’s tamlīk (ownership transfers). However if he is old and discerning enough, it is not permissible except with his iźn. This is because he no longer has autonomy over his child’s tamlīk. The ruling for the grandfather is just like the father and the ruling for the majnūn (mentally challenged) is just like the child. Al-Māwardī and al-Baghawī said:
if the walī discharges the fitra of the child or the majnūn from his own wealth as charity, if it is his father or grandfather then it is permissible. It is as if he gave him its ownership and then undertakes himself as a walī to discharge its payment from what he transfers to him. If he is a guardian or a trustee, then it is not allowed except with the iźn of a qādhi. When the qādhi gives iźn, then it becomes as if he has iźn, as if the child took over ownership from him, and then gave him permission to discharge it.
There is consensus in these amongst our aśhab with regard to it. Al-Māwardi cited from the aśhab: Zufar and Muhammad bin Hasan said “the fitra of the young child is obligatory upon the parents while their nafqa is taken from their wealth”
And Allah knows best.