Check for all payment status and optimize query