If you had a connection to a congressman, and spoke to him directly, and said vote yes (or no) on a bill and I will give your upcoming campaign $1M dollars, would that be considered legal under US law?
That is quid pro quo corruption and/or bribery, and is a felony.
See (inter alia) 18 U.S.C. §201, specifically (c)(1)(A), which imposes a fine or jail to anyone who:
directly or indirectly gives, offers, or promises anything of value to any public official, former public official, or person selected to be a public official, for or because of any official act performed or to be performed by such public official, former public official, or person selected to be a public official