If a witness, required to enter into an undertaking to appear and testify, either with or without sureties, refuses compliance with the order for that purpose, the magistrate must commit him to prison until he complies or is legally discharged.
Idaho Code § 19-823