(1) Where a surety has, without notifying the principal obligor, performed or otherwise procured a discharge of the principal obligation at his own expense, and the principal obligor had a defense available against the obligee, he or she may set it up against the surety, and where the defense so set up is a set-off, the claim which would be extinguished by the set-off shall be transferred to the surety.
(2) Where a surety has not notified the principal obligor that he had performed the obligation or otherwise procured at his or her own expense a discharge, and the principal obligor has in good faith effected performance to the obligee or otherwise procured a discharge for value, the principal obligor may treat his or her act of discharge as effective.