'Check whether the user has an active enrollment and has paid.
If a user is enrolled in a paid course mode, we assume
that the user has paid.
Arguments:
user (User): The user to check.
course_key (CourseKey): The key of the course to check.
Returns:
Tuple `(has_paid, is_active)` indicating whether the user
has paid and whether the user has an active account.'

def _check_enrollment(self, user, course_key):

    (enrollment_mode, is_active) = CourseEnrollment.enrollment_mode_for_user(user, course_key)
    has_paid = False
    if ((enrollment_mode is not None) and is_active):
        all_modes = CourseMode.modes_for_course_dict(course_key, include_expired=True)
        course_mode = all_modes.get(enrollment_mode)
        has_paid = (course_mode and (course_mode.min_price > 0))
    return (has_paid, bool(is_active))
