Accounting for financed transactions should be completed separately to your invoice reconciliations (in your accounting software) i.e you should not be reconciling payments in your software if you have received an advance, as the customer has not yet made payment.
When you receive the remaining funds back (less the fees), you need to recognise the full amount on the remaining invoice, so the invoice is cleared. The difference should be coded to an expense account for the fees on your P&L.
For example, if the invoice value was £2000, but incurred £50 costs. You would need to DR Expense £50, DR Banking £1950, CR AR £2000.