How did you receive the payment? Did you receive it through the Receive Payment option? Or did you receive the payment via Bank Deposit? If so, you'll need to link the deposit to your open transaction to mark it as paid.
To edit the deposit:
From the left menu, select Accounting.
Select Chart of Accounts under the Toolbar.
Find the account you deposited the payment to, then select View Register (or Account History).
Locate and choose the correct deposit.
On Bank Deposit screen, scroll down to Add funds to this deposit, then find the fund you need to edit.
In the Received From column, search and choose the appropriate Customer name.
In the Account column, search and select Account's Receivable.
Select Save and close.
After that, you can apply the deposit to the invoice. See the steps below.