The Gemara (Shabbos 150a) points out that we are restricted on Shabbos ממצוא חפצך, from looking after our personal business affairs - but that this implies that חפצי שמים מותרין, Divine business affairs are okay.
Based on this, it lists several categories of things that are permitted on Shabbos under this heading, one of which is פוסקין צדקה לעניים - making assessments of tzedakah for the needy. (Some of the other things listed there are familiar from the Shabbos zemer Mah Yedidus.)
This is codified in Shulchan Aruch, Orach Chaim 306:7. Rema there writes that "some say that in places where it is customary to recite a Mi Shebeirach for one who reads from the Torah, and he makes a pledge for tzedakah or for the chazzan, that it is prohibited on Shabbos to spell out how much he intends to give; but the custom is to be lenient, since it is permitted לפסוק צדקה."
Mishnah Berurah there (:27) explains that this can't be considered buying and selling (מקח וממכר), since nothing is actually changing hands. Further on (:33) he adds that there is a dispute whether it is permitted to "sell" mitzvos on Shabbos, with some authorities forbidding it and others saying it's fine because no actual object is being bought, "so in places where they are customarily lenient on this, one should not object against them."