When receiving a customer's payment, you'll need to use the Receive Payment option instead of recording it as a Bank Deposit. This will ensure that the invoice can be marked as paid in QBO.
Navigate to the Accounting on the left panel and select Chart of Accounts
Select the account where the payment was deposited and then click view register
Then click Edit
Once on the Bank Deposit Screen, select the customer's name in the Received From the column.
In the Accounts column select Accounts Receivable
Click Save and close.
The payment will show up as a credit in the Receive Payments tab.