Section 40. Subject to the foregoing limitations in respect to shares and deposits and requirements relative to notice, shares may be subscribed for and deposits may be accepted in the name of one or two persons in trust for another provided the name and residence of the beneficiary is disclosed, and such shares and deposits shall be carried in the name of the shareholder or depositor as trustee or trustees. Payments may be made to the trustee, and if there are two trustees, payments may be made to both or to either or to the survivor. If no other notice of existence and terms of a trust has been received in writing by the credit union, upon the death of the trustee or if there are two trustees then upon the death of both, the amount then on deposit together with the dividends thereon may be paid to the person for whom such deposit was made or to his legal representative. Withdrawals and payments made as provided in this section shall fully discharge the liability of the credit union to all persons.