If a poor person asks for charity and I give some money to that person, but he then returns it to me, (because he doesn't feel it is enough, or any other reason) have I accomplished the mitzvah of tzedakah or not? Meaning, does it technically count as tzedakah and then, by him returning it, is that second act a gift on his part, or has he annulled my mitzvah as if it didn't happen?
The Rashba (Shut Rashba 1:18) discusses which mitzvot do not have a special blessing recited prior to performing them. He writes:
וכן אין מברכין על מצוה שאינה תלויה כולה ביד העושה. מפני שאפשר שלא יתרצה בה חברו ונמצא מעשה מתבטל. כגון מתנות עניים והלואת הדלים ונתינת צדקה והענקה וכיוצא בהם.
Similarly, one does not bless prior to a mitzva which is not entirely dependant on the doer for perhaps his friend will not accept the act and it will turn out that his action is nullified. [This applies] for example to [the mitzvot of] leaving agriculural gifts for the poor [ie Leket Shichecha and Peah], loaning money to poor people, giving Tzedaka, giving gifts to a freed slave and other similar ones. (emphasis and translation mine)
You accomplished the maaseh mitzvah, and Hashem rewarded you for it by giving back the same amount that you gave. If only the reward for giving tzedaka would always be so simple!