It seems that onTransactionComplete is being called twice on a successful transaction. I’m sure only one browser window is open so it’s not that it’s being called from multiple screens. My apache log looks like:
xx.xx.xx.xx - - [12/Mar/2019:01:34:48 +0000] “POST /abcHTTP/1.1” 200 39
xx.xx.xx.xx - - [12/Mar/2019:01:34:48 +0000] “POST /abcHTTP/1.1” 500 84976
The second header returns a 500 because I set a unique index on the transaction id from twitch to make sure it didn’t accidentally enter it twice. I made some error checking to prevent the 500 error but it’s really weird that it seems to call twice.
I added a try/catch to get rid of the 500 and still see the same thing. I end up with the data inserted once as I would like but the browser is only seeing the second response for some reason and so I end up with a different response than I should.
It’s very strange behavior, I’ve tried console.log() on onTransactionComplete and I see it once only but it seems to only log once, which made me thing that maybe jQuery’s post function was the culprit but I’ve tried logging with that as well and I cannot seem to see any double log entries there either.