> long as you get the gift after you have done the deed, it's just a gift, isn't that the ruling?
What ruling?
Generally, no, accepting gifts in exchange for official actions is illegal (and punished) irrespective of whether payment is made up front or in arrears [1].
[1] https://www.justice.gov/usao-sdny/pr/us-senator-robert-menen...