If the surety pays off the debt pending an action against the principal and himself or against the principal alone, such payment shall operate only to cause the action to proceed for the benefit of such surety, and the judgment may be entered in the name of the original plaintiff for the use of such surety.
Ala. Code § 8-3-8 (1975)