Undertaking, in general, means an agreement to be responsible for something. If you give the undertaking to do something, you formally promise to do it. In a legal context, it refers to a party consenting to a surety arrangement.
They will pay a debt or fulfill a duty if the other person who is bound to pay the debt or perform the duty fails to do so.