I\'m getting the error use of unassigned variable \"ps\" when declaring if paymentstatus is null or has value in the \"if\" statement. I\'m thinking that i allready declared ps
Yes, you did declare the variable.
Yet it says "unassigned" not "undeclared", and you didn't assign any value to the variable. Just set it to null.