R. Yochanan: "Aser Te'aser" - tithe in order that Tis'asher (you will become rich).
Reish Lakish's son: What is your source for this?
R. Yochanan: Go try it!
Question (Reish Lakish's son): "Lo Tenasu Es Hash-m" (one may not test Hash-m)!
Answer (R. Yochanan citing R. Hoshaya): This is the exception - "Havi'u Es Kol ha'Ma'aser... u'Vechanuni Na ba'Zos...Eftach Lachem Arubos ha'Shomayim va'Harikosi Lachem Berachah Ad Bli Dai".
Question: What does it mean "Ad Bli Dai"?
Answer (Rami bar Rav): It means, until your lips will wear out from saying 'Enough'!
Pesachim 8a (Beraisa): One who says 'I give this coin to Tzedakah in order that my son should live', or 'in order that I will merit the world to come' is a total Tzadik.
Rambam (Hilchos Yesodei ha'Torah 10:5): If a Navi's words have come true time after time, or if he was endorsed to be a Navi by an established Navi and he goes in the ways of Nevu'ah, it is forbidden to have doubts whether or not his Nevu'ah is true.
Me'iri (DH Kasuv): "Lo Tenasu" refers primarily to doubting or making too many tests for a Navi established by fulfillment of his prophecies, or a Navi endorsed by an established Navi. The Lav includes doing a Mitzvah on condition to receive reward, or to see if he will be rewarded after doing the Mitzvah. Even though the Torah promises reward - "Im b'Chukosai Telechu" - this is just a promise that the reward will come in the end, not that we may serve Hash-m on condition. 'Aser in order that Tis'asher', i.e. it will cause that you become rich, but you may not tithe on this condition. "U'Vechanuni Na ba'Zos" promises that the reward will come unless demerits prevent it. When one gives Tzedakah in order that his son will live, he shows trust that his son will live, but he will not harbor thoughts against Hash-m no matter what happens. When the Gemara says that one may not test Hash-m 'except for this', it means only that here one is more confident than elsewhere.
SMaG (Lavin 4): One may not do a Mitzvah with intent to see if he will be blessed for it. The exception is Ma'aser.
Teshuvas Maharil 160 (brought in R. Izik Stein on SMaG): If someone vowed on condition (with a proper Tanai Kaful), we cannot force him to fulfill it. Granted, he serves out of fear and is not a Tzadik Gamur, but this is acceptable. Most vows are on condition - "Im Yihyeh Elokim Imadi...", "Im Nason Titen..."
Levush (YD 220:15): If one specified that he will fast or give Tzedakah if Ploni recovers, he is exempt if Ploni died. A proper Tanai is not needed, for Nedarim follow the person's intent. All the more so, if he said 'I will give this coin to Tzedakah if my son will live; if not, not', he is exempt if his son died, even though it is improper to serve in order to get reward like this.
Shitah Mekubetzes (Kesuvos 50a DH Mai): One should give a fifth of his income for Ma'aser. The Torah wrote "Aser Ta'aser" to teach that it is better to give part at a time than all at once. Also, one Ma'aser may be used for any Mitzvah, even for Seforim or other Mitzvah needs of his household. We learn from Ma'aser Sheni, which one keeps for his family. The other Ma'aser is given to the poor, e.g. Kohanim and Leviyim who engage in Torah. One who is meticulous about Ma'aser is guaranteed to succeed financially.
Sha'arei Teshuvah (Sha'ar 3, 30): One may test Hash-m only regarding Ma'aser, but not regarding other Tzedakah.
Question (Tosfos Pesachim 8b DH she'Yizkeh): Why is one who gives Tzedakah so that his son should live or he will merit the world to come a total Tzadik? One should not be like a slave who serves with intent for reward (Avos 1:3)!
Answer #1 (Tosfos): It is improper only if he will regret the Mitzvah if he does not get his request.
Question (Maharsha Pesachim 8a DH Al): Tosfos' question does not even begin! It is permitted to test Hash-m through Ma'aser, and all forms of Tzedakah. All the more so it is permitted to serve in order to get reward!
Answer (Maharsha): The Gemara sought to prove from Tzedakah that a Mitzvah with ulterior motives is a proper Mitzvah. This shows that Tzedakah is different only regarding "Lo Tenasu". Regarding whether or not serving for reward is a Mitzvah, it is like other Mitzvos.
Yad ha'Melech (Hilchos Teshuvah 10:4 DH Mekor): This is the Rambam's source to say that l'Chatchilah there is no difference between Tzedakah and other Mitzvos. Regarding all of them it is best to serve without intent for reward.
Answer #2 (Pnei Yehoshua Rosh Hashanah 4a DH b'Tosfos DH Bishvil): Drashos ha'Ran (5 DH veha'Chelek ha'Sheni) says that there is no contradiction. One who does Mitzvos to get reward is no worse one who serves out of fear; he is a total Tzadik (Sotah 31a). Pirkei Avos advises to serve out of love. This is a higher level, i.e. Chasid.
Answer #3 (Chasam Sofer Pesachim 8a DH Sela): One may test Hash-m through Ma'aser only in order to get rich, like we expound 'Aser in order that Tis'asher.' It says "u'Vechanuni Na ba'Zos", i.e. "Eftach Lachem Arubos ha'Shomayim..."
Note: The other Meforshim explain that "ba'Zos" refers only to the Reisha, "Havi'u Es Kol ha'Ma'aser".
Answer #4 (Aruch l'Ner Rosh Hashanah 4a DH b'Tosfos DH Bishvil): Indeed, it is lowly for a slave to tell his master 'I want to serve you for reward'. But it is praiseworthy to say 'May I be Your slave for many years!'
Gevuras Ari (Ta'anis 9a DH Omar): Regarding all Mitzvos one may serve in order to get reward. One who says 'I give this coin to Tzedakah in order that my son should live' is a total Tzadik. Only regarding Ma'aser one may test Hash-m.
Teshuvas Radvaz (3:441 DH Teshuvah): Normally, it is forbidden to test Hash-m. The Torah permits this regarding Ma'aser, i.e. Tzedakah, in order to benefit Aniyim. All the more so Nedarim, which are improper only because of the concern lest one transgress, are permitted for the benefit of Aniyim!
Teshuvas Minchas Yitzchak (2:84:7): One may test Hash-m through Ma'aser and give Tzedakah for the sake of reward because the purpose of these Mitzvos is the benefit of the recipient. Therefore, proper intent is not essential. The same applies to Bikur Cholim, for it is in the category of Chesed.
Teshuvas Yavi'a Omer (6:YD 29:5): The only problem with doing a Mitzvah in a reeking place is that Mitzvos require intent, and one may not have intent there. One may text Hash-m through Ma'aser because the receipt benefits, so intent is unnecessary (Ahavas Tziyon citing the Noda bi'Yehudah, Pesach Einayim Bava Basra 10b), so it may be done in a reeking place.
Rema (YD 247:4): Giving Tzedakah makes one wealthy. It is forbidden to test Hash-m except for this - "u'Vechanuni Na ba'Zos". Some say that one may test Hash-m only regarding Ma'aser, but not regarding other Tzedakah.
Derishah (1): The Beis Yosef permits testing only regarding Ma'aser. The Tur permits regarding all Tzedakah. This is because he holds that Tzedakah comes from Ma'aser; he says (Siman 249) that a tenth is the medium Shi'ur for Tzedakah.
Rebuttal (Pischei Teshuvah 2, citing She'alas Ya'avetz 1:3, SHLaH and Mishnas Chachamim): The verse discusses Ma'aser of grain. Ma'aser of money is like mere Tzedakah, one may not test Hash-m regarding this!
Shach (3, from the Maharshal): One may test regarding Ma'aser because surely wealth will come - 'Aser in order that Tis'asher.'
Pischei Teshuvah (1): Mishnas Chachamim says that one may test Hash-m by tithing in order to become wealthy, but not regarding other benefits, e.g. that his children should live.