In Settings->Email there are new settings under Invoice Link Settings for limiting what invoices show by Terms and also by Locations (QuickBooks Online) and Customer Types.
For each of those settings you can choose one or more options and then in the Customer Payment Link, only invoices with matching Terms and Locations would show (Both open and past invoices).
For filtering by Customer Type, the payment link would only show invoices for your customer if your customer had a matching customer type or if you have any applicable child customers with a matching customer type you would see their invoices.
If you set multiple different types of filters (e.g. Terms and Locations), any invoices have to match all types (e.g. the invoice would have to have a Term that is one of the selected ones and also have a Location that is one of the selected ones).