Duplicated Transactions due to Confirm Transaction Failing

In certain circumstances, a Confirm Transaction can fail but the transaction can still be stored as confirmed. This can result in duplicated transactions.

What happened?

A Confirm Transaction request was sent but it failed. However, the service records the transaction as confirmed in spite of the response stating the request failed. Another Confirm Transaction request is sent and this can result in there being 2 transactions that are duplicates.

How to fix it

When a Confirm Transaction fails, you should fix the transaction and send it again rather than sending a new request.