The name `actual_ipn?` and what the code is doing is backwards.

Also, if `ipn.length` is zero, then `(ipn =~ /(VERIFIED|INVALID)/) == 0` is always going to fail.  At least the `&&` should be changed to `||`, but I think there are more issues than just this.  Let's discuss.