The version that I heard (supposedly in the Talmud, but I have never actually read it there) is that it was a "Hillel/Shammai" story. Shammai was another rabbi, contemporary with and as famous as Hillel but uttlerly different in disposition and in his approach to the law. There are many Hillel/Shammai stories in the Talmud which are told both to show that there are different approaches to the Law, and to demonstrate they can have equal validity in different contexts.
Anyway, a wise-ass businessman decides to have fun one day, and approaches Shammai in his school, saying, "I'll give you a big contribution and come study at your school if you can teach me the whole Torah while I'm standing on one foot." Shammai got angry and kicked him out. The man thought this was pretty funny, and went to Hillel's school, saying the same thing. Hillel looked at him for a moment, and nodded, waiting. Finally he said, "Well, stand on one foot." The man, startled, did so. Hillel said, "Love your neighbor as yourself, all the rest is commentary. Now come and study." The man was so ashamed that he gave the school a large donation, and came in to study.
The story was repeated to me many times when I was a boy. As it is, I think, in virtually every Hebrew school. Giving contributions to schools is in the blood.