Section 20D. No employer and no person retained or engaged by him as a labor relations expert, adviser or consultant or retained or engaged by such employer for the purpose of dealing or negotiating with any of his employees or with any labor organization representing or seeking to represent or organize such employees shall, himself or by his agent, pay or deliver or agree to pay or deliver, directly or indirectly, to any employee or to any group or committee of employees, nor shall any employee or labor union official solicit or accept from any employer or any person so retained or engaged by him, or his agent, any money or other thing of value for the purpose of encouraging or discouraging, or in any way interfering with, any employee or employees in exercising their rights to organize or to select a representative, or for the purpose of preventing the continued existence, operation or functioning of a labor organization; provided, however, that this section shall not apply to the payment of wages by such employer to an employee who is a union representative, to any payment for the purchase of goods at the prevailing market price from a union representative, to the payment of any debt, to the transfer of union dues properly withheld from the salaries or wages of employees, to payments to employees' trust or welfare funds, or to payments of salaries or fees to an employee, representative or agent for the performance of any lawful activity with respect to the expression of views or opinions in connection with pending employee elections or labor disputes or other matters involving relations between such employer and his employees. Whoever violates any provision of this section shall be punished by a fine of not more than three thousand dollars or by imprisonment in jail for not more than one year, or both.