(2) If the witness is summoned to attend and testify in this state the witness shall be tendered the sum of 10 cents a mile for each mile by the ordinary traveled route to and from the court where the prosecution is pending and $5 for each day that the witness is required to travel and attend as a witness. A witness who has appeared in accordance with the provisions of the summons shall not be required to remain within this state a longer period of time than the period mentioned in the certificate, unless otherwise ordered by the court. If such witness, after coming into this state, fails without good cause to attend and testify as directed in the summons, the witness shall be punished in the manner provided for the punishment of any witness who disobeys a subpoena issued from a court of record in this state. [Formerly 139.230]