(a) If a person in any state which, by its laws, has made provision for commanding persons within its borders to attend and testify in criminal proceedings or grand jury investigations commenced or about to be commenced in this state is a material witness in a criminal proceeding pending in a court of record in this state or in a grand jury investigation which has commenced or is about to commence, a judge of such court may issue a certificate under the seal of the court stating these facts and specifying the number of days the witness will be required. Said certificate may include a recommendation that the witness be taken into immediate custody and delivered to an officer of this state to assure his attendance in this state. This certificate shall be presented to a judge of a court of record in the county in which the witness is found.
(b) If said certificate recommends that the witness be taken into immediate custody and delivered to an officer of this state to assure his attendance in this state, the judge of the court of record where the certificate is presented shall order that said witness be taken into custody and delivered to an officer of this state, which order shall be sufficient authority to such officer to take such witness into custody and hold him unless and until he may be released by bail, recognizance or order of the judge issuing the certificate. This certificate shall be presented to a judge of a court of record in the county in which the witness resides or is found if he is not a resident of that state.
(c) If the witness is summoned to attend and testify in this state, he shall be tendered the sum of $.15 a mile for each mile traveled by the ordinary route to and from the court where the proceeding is pending and $15.00 for each day that he is required to travel and attend as a witness, to be paid out of the district attorney's fund or such other fund as may be provided therefor upon the direction of the district attorney. A witness who has appeared in accordance with the provisions of the summons shall not be required to remain within the state a longer period of time than the period mentioned in the certificate, unless otherwise ordered by the court.
(d) If such witness, after coming into this state, fails without good cause to attend and testify as directed in the summons, he shall be punished in the manner prescribed for the punishment of any witness who disobeys a summons issued from a court of record in this state.