Store transaction ID via payment_complete method

As discussed in #5563, this is the preferred way to store the transaction ID.

This PR closes #5157.