If any bank fails to pay all or any part of such deposits on demand of the Treasurer, pursuant to the terms and conditions of the contract relating to the deposit that is to be withdrawn in whole or in part, the Treasurer shall forthwith recover upon or convert the security therefor into money and disburse it according to law.