Insurance companies authorised to carry out surety business which have provided a surety bond, an endorsement or a guarantee, whether legal, regulatory or contractual in origin, have recourse by operation of law and in all cases against the customer who gave the undertaking, his co-obligors and the persons who acted as surety and, for payments made under their undertaking, subrogation in the rights of the creditor as provided for in article 1346 of the Civil Code.