How to cancel a payment that awaits confirmation in Metamask using web3?

I’m working on a crypto payment system using ethers Web3Provider

web3.eth.sendTransaction(transactionObject)

After the user calls this method, this dialog is shown:
enter image description here

In the app the user is able to close the payment dialog leaving this pending. Is there a way to reject this payment using JS when closing the dialog inside the app? Clearing all payments would also be a solution but in the documentation I can’t find anything about this case.