2358. A surety having paid a debt has no remedy against the principal debtor who pays it subsequently, if he failed to inform the debtor that he had paid it.
A surety who has paid without informing the principal debtor has no remedy against him if, at the time of the payment, the debtor had defences that could have enabled him to have the debt declared extinguished. In these circumstances, the surety has a remedy only for the sum the debtor could have been required to pay, to the extent that the debtor could set up other defences against the creditor to cause the debt to be reduced.
In any case, the surety retains his right of action for recovery against the creditor.