What to record if someone pays my purchase invoice and I owe that person?

You create a second supplier - let’s call him Supplier B
You have entered a Purchase Invoice to Supplier A (the original supplier) to whom you owe the payment.

Supplier B pays Supplier A on your behalf - you record this using a Journal Entry - for example if invoice was for 10,400 Euro

If there is a fee involved, then you should record that as a Purchase Invoice from Supplier B for the amount of the fee

Supplier B’s account now records the correct amount that you now owe