(1) Where a person who has become surety without the request of the principal obligor, has performed the obligation or has otherwise, at his or her own expense, procured the discharge of the principal obligor, the latter is liable to indemnify the surety to the extent that he or she was enriched as of the time of discharge.
(2) Where a person has become surety against the will of the principal obligor, has performed the obligation or has otherwise at his or her own expense procured the discharge of the principal obligor, the latter is liable to indemnify the surety only to the extent that the latter is still being enriched.
(3) If, in the preceding paragraph, the principal obligor claims that he had, prior to the demand for indemnification, a good cause for set-off against the obligee, the claim, which would have been extinguished by such set-off, shall be transferred to the surety.