Section 13A. If a certificate wherein a judge of a court of record in any state which by its laws has made provision for commanding persons within its borders to attend and testify in criminal actions, prosecutions and other criminal proceedings pending, or grand jury investigations and other proceedings commenced or about to commence, in this commonwealth certifies under the seal of such court that there is a criminal proceeding pending in such court, or that a grand jury investigation or proceeding has commenced or is about to commence within the jurisdiction of such court, that a person being within this commonwealth is a material witness in such proceeding or investigation and that his presence will be required for a specified number of days, is presented to a justice of the superior court sitting in and for the county, or the justice or a special justice of the district court in the judicial district, in which such person is, such justice or special justice shall make an order directing such person to appear at a time and place certain for a hearing upon the question of compelling his attendance at such proceeding or investigation.
If at the hearing the justice or special justice determines that the witness is material and necessary, that it will not cause undue hardship to the witness to be compelled to attend and testify in the proceeding or investigation in such other state, and that the laws of such other state and of any other state through which the witness may be required to pass by the ordinary traveled route will give to him protection from arrest and the service of process, civil or criminal, as provided in section thirteen C, he shall issue a summons, which term shall include a subpoena, order or other notice requiring the appearance of a witness in any state where such process is used in lieu of a summons, with a copy of such certificate attached, directing the witness to attend and testify in the court where the proceeding is pending, or before the grand jury before which the investigation or proceeding has commenced or is about to commence, at a time and place specified in the summons. At any such hearing such certificate shall be prima facie evidence of all the facts stated therein.
If in any such certificate it is recommended that the witness be taken into immediate custody and delivered to an officer of the requesting state to assure his attendance at such a proceeding or investigation therein, such justice or special justice may, in lieu of notification of the hearing, direct that such witness be forthwith brought before him for said hearing and the justice or special justice at the hearing, if satisfied of the desirability of such custody and delivery, for which determination such certificate shall be prima facie evidence of such desirability, may, in lieu of issuing a summons, order that said witness be taken into custody and delivered to an officer of the requesting state.
If a witness who is summoned as hereinbefore provided, after being paid or tendered by some properly authorized person the sum of ten cents a mile for each mile by the ordinary traveled route to and from the place where the proceeding is pending, or the grand jury investigation or proceeding has commenced or is about to commence, and five dollars for each day that he is required to travel and attend as a witness, fails without good cause to attend and testify as directed in the summons, he shall be punished in the manner provided for the punishment of a witness who disobeys a summons issued from a court of record of this commonwealth.