If a person (Reuven) makes a neder/nedevah to a shul for a certain amount of money (for example when buying an aliyah) and someone else (Shimon) comes along and offers to pay for this, is Reuven yotzei his obligation or since it’s a neder/nedevah then it falls on Reuven to fulfill the obligation and give the money? (Assuming Shimon didn’t first give the money to Reuven who bought the aliyah as a gift, but rather Shimon went ahead and paid the shul in place of him).
The Shach (Yoreh De’ah 259:9) and other poskim (see Chochmas Adam 145:5) mention that for all matters of nedarim we follow the principle of umdena, meaning we evaluate the intention of the person involved, and we follow the evaluation.
This principle will also apply to the person who paid the money (Shimon): If Shimon pays on behalf of Reuven, we can assume that the gabbai who receives the money, and wishes to accept the payment on behalf of Reuven, makes a legal transfer of the money on behalf of Reuven, so that Reuven’s neder is paid off.
This idea is mentioned by Maaseh Ha-Tzedakah, in conjunction with the hataras nedarim of Erev Rosh Hashanah. He also mentions that it would be permitted for Reuven to do hatarah, out of doubt, for the neder.