The Ben Ish Chai in Shu"t Rav Poalim (Sec. 4. Orach Chaim - Siman 2) says in the context of where a person unknowingly wore invalid teffilin for many years. The Ben Ish Chai writes that the person still gets the merit for the mitzvah. He quotes the Chid"a (Sefer Devash Ma'areches 4 - Sec. 4) who echoes this point.
(end of reference)
(Perhaps the Gemara in Kiddushin (40a) is a proof as well, which states:
אמר רב אסי אפילו חשב אדם לעשות מצוה ונאנס ולא עשאה, מעלה עליו הכתוב כאילו עשהו
. If one desired to fulfill a mitzvah but was unable to due to extenuating circumstance, the Torah considers as if he fulfilled it.
So too, as when you gave the money you desired to give tzedaka, the fact that it was fraud is an Ones and you had no idea it was a fraud. Therefore, you still get the merit of giving charity.)
That is in regards to merit. However, in terms of fulfilling your obligation, it would seem to be that you have not fulfilled the mitzvah of Ma'aser Kesafim, for this is not a case of Ones, physically barred from performing the mitzvah, rather this would be considered a case of shogeg - an unwitting mistake, as you should have looked into the charity beforehand. (As per this source quoted by Shalom here:)
Furthermore, from a Nedarim - halachic oath standpoint, you would be obligated to give again, for if you had in mind to pledge to give money to a specific yeshiva or organization. Because of there was fraud, the money never made it to that organization. Thus, in this case you would need to give the money again in order to fulfill the oath that you took.