This is illegal, because you are intentionly frauding the taxation system.
Of course it seems *legal* on paper, but your intention is to by donating $ to get more $ back.
If so, everyone will keep donating and the government will go bankrucpy.
Donation is at max 29%, not your tax bracket. Its only a creidt, if you didn't pay any income tax during the year. You will not receive those money.
More detail, talk to a registered accountant.