Fix comments.
Update payment listener and state resolver to loop through all payments.