refactor payment states block
more test cases
finish testing