A Square or Stripe deposit is usually several invoices less the fee they kept. It will never equal the invoices, and it should not be filed as income.
The invoices are marked paid in full, the fee lands in its expense account, and the bank shows exactly what the statement shows.
When more came in than the invoices
The adjustment is positive instead. Send it to an income account, or tick Keep it as the customer's credit: it stays theirs and is applied to their next invoice.
Bills work the same way
A payment for several bills that got a discount takes a negative adjustment to a discount account; a bank charge on top of it takes a positive one.
Paying only part of an invoice
Change that invoice's amount instead of adding an adjustment. What is left stays open on the invoice.
Undoing it
Undo on the bank line takes back the payments and the adjustments together.