Every endorser who shall pay off and discharge the debt on which he is endorser, either pending the action or after judgment, whether the judgment against the principal and the endorsers is joint or several, shall be entitled to control the judgment and execution founded thereon against the principal and all prior endorsers, in the same manner, upon the same proof, and under the same circumstances as provided in this article in the case of sureties; and, if such endorser shall collect the same from a prior endorser, the latter shall have the same control of the judgment or judgments against the principal or any endorser prior to him.