He swore that he would pay the taxi fare, then his friend paid it
Question

I got in a taxi with one of my neighbours, and I said to him, swearing an oath, that I would pay the fare, but unfortunately he insisted on paying, and he paid. What should I do? Should I offer expiation for breaking an oath, or should I go to this neighbour and give him the cost of the fare, and thus I will not have to offer expiation?
Praise be to Allah.If someone swears an oath that he will do something in the future, then he does not do it, he must offer expiation for breaking his oath.
Ibn Qudaamah said: If someone swears that he will do something, then he does not do it, or he swears that he will not do something, then he does it, in that case he must offer expiation, and there is no difference of opinion concerning that among the fuqaha’ of the regions. Ibn ‘Abd al-Barr said: The oath concerning which expiation must be paid according to the consensus of the Muslims is that which refers to actions in the future."(Al-Mughni  13/445).
The scholars of the Permanent Committee for Ifta’ were asked:
I received a visitor during the night, and with a slip of the tongue I swore that I would slaughter an animal to feed him, but he swore that I should not slaughter an animal for him, and he said to me: I swear by Allah three times that you should not slaughter this animal, and I was shocked, and I was afraid to break his oath. I hope that you can advise me as to what I must do?
They replied: If the matter is as mentioned, then you must offer expiation for breaking an oath (kaffaarat yameen), which is freeing a believing slave, or feeding or clothing ten poor persons. If you cannot do that, then you must fast for three days. Allah, may He be exalted, says (interpretation of the meaning):
{Allah will not impose blame upon you for what is meaningless in your oaths, but He will impose blame upon you for [breaking] what you intended of oaths. So its expiation is the feeding of ten needy people from the average of that which you feed your [own] families or clothing them or the freeing of a slave. But whoever cannot find [or afford it] - then a fast of three days [is required]. That is the expiation for oaths when you have sworn } [Al-Maa’idah 5:89].
And Allah is the source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and companions.
Permanent Committee for Academic Research and Ifta’
Shaykh ‘Abdullah ibn Ghadyaan, Shaykh ‘Abd ar-Razzaaq ‘Afeefi, Shaykh ‘Abd al-‘Azeez ibn ‘Abdillah ibn Baaz." (Fataawa al-Lajnah ad-Daa’imah 23/73).
Shaykh Ibn ‘Uthaymeen was asked:
When I am sitting with a group of friends in a restaurant, and I want to pay the bill, one of them will go ahead and pay the bill, but I swear that I will pay the bill and I say: By Allah, you will not pay, but he pays without caring about my swearing by Allah. Is this permissible? Is my swearing by Allah regarded as an oath, and is it he who has to offer expiation for that?
He replied:
Firstly: I advise this questioner and others not to swear by Allah that someone else should do something or not do something, because this swearing puts the person or those to whom he swears the oath in a difficult situation. What is meant by it being a difficult situation for them is that if the one concerning whom the oath was sworn goes against the oath, then the one who swore the oath has to offer expiation. As for it putting the one concerning whom the oath was sworn in a difficult situation, that is because he may comply with the oath with difficulty, and perhaps in addition to it being difficult and harmful, he is only doing it to please the one who swore the oath urging him to do it, and that will put him in a difficult and awkward situation.
As for expiation, if someone swears an oath that he will do something, or urging someone else to do something or refrain from something, either he accompanies his oath with the phrase “in sha Allah (if Allah wills),” so he says: “By Allah, if Allah wills, you will surely do such and such, or I will surely do such and such,” or he does not say that.
If he accompanies his oath with the words “in sha Allah,” there is no breaking of the oath and no expiation, even if the oath is not fulfilled.
If he does not say “in sha Allah,” then he is breaking his oath if he does not do what he swore to do, or if he does what he swore not to do.
What a person should do if he swears an oath – whether it is to urge himself to do something or to urge someone else to do it – is to say, “In sha Allah,” because in saying “in sha Allah” there are two great benefits, the first of which is that this is a means of making easy what he swore to do. The second benefit is that if he breaks his oath and does not do what he swore to do, or he does what he swore not to do, then no expiation is required of him…
With regard to the question of the questioner who swore that his friend should not pay the bill in the restaurant, and then his friend paid it, he must offer expiation for his oath, because his friend did not fulfil his oath." (Fataawa Noor ‘ala ad-Darb  11/256-257).
With regard to your going to him and giving him the taxi fare, this does not waive the obligation of offering expiation for breaking your oath, because it became obligatory upon you when the oath was broken and when he did what you swore he should not do.
The expiation for breaking an oath (kaffaarat yameen) has been explained in detail in the answer to question no. 45676 .
And Allah knows best.