Use pyament method id (=4) as condition for if(...). The other condition (tariffIs24_7()) is used in calling functions.