In all cases where foreclosure of any personal property lien except conditional sales contracts has been commenced by summary proceedings, the property owner or any person claiming right of possession or any other encumbrancer, may at any time before the sale of the property under such summary proceedings present to the circuit judge and file in the office of the clerk of courts for any county where such summary proceeding is pending, an affidavit stating that he has a defense to such foreclosure and desires to have the same conducted by court procedure. Thereupon the circuit judge shall issue an injunctional order directed to the lien holder and any agent conducting the proceeding, enjoining further summary procedure and requiring foreclosure of the lien in court. The order may be enforced the same as any other injunction of the court. If the defense shall not be established the costs incurred in the summary proceedings may be taxed as additional costs in the court proceeding against the party asserting the defense.
SDCL 21-54-3