Skip to content

Admin user enrolled instead student when payment status is switched manually (EDD) #20

@360fun

Description

@360fun
  1. student buys a course
  2. EDD receives the payment and put it in pending status (I use Sorsawo EDD Bank Transfer)
  3. Admin switch the payment on Complete (value='publish') (when receives the money in the bank)
  4. Admin is enrolled instead of the student (BUG)

DEBUGGING
This seems to be the problem:
tutor_utils()->do_enroll($course_id, $payment_id);

Should pass also $user_id somehow, otherwise get_user_id calls get_current_user_id() which loads the current user id (the Admin) instead of the student id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions