Generate a unique identifier for each payment so that gateways do not think that we're processing the same payment again

Fixes #1998