I think you're on to something.
The fact Andrew states he solved it by using contains instead of == suggest he was comparing to string 0 not number 0
Not that it should matter but payload.code is definitely a number so your example would be the correct solution.