Is this legal?
It should not be.
Only citizens who can vote for a candidate should be able to contribute to their campaign.