This is Debtor Invoice financing or Facatoring.
There are different ways of handling this depending on the arrangement Client has with the Financer.
Note that the Customer invoice should not be 'closed' until the Customer actually pays, otherwise you will lose control of your Debtor management. The factoring is like 'finance/loan'.
In your accounting software (you haven't mentioned what you're using) you'll need a Factoring Account (suggest CC type) and a Factoring charges expense account.
The Factoring Account should be reconciled like a bank/credit card account.
Depending on what software you use, you may actually be able to access a "how to do".
Let us know how you go.