Making newly entered payments invalidate previously entered payments so the most recent payment is used by the gateway.

Fixes #2828