Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-67662

Students are not enrolled immediately after paying for course through PayPal

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.1, 3.8
    • Fix Version/s: None
    • Component/s: Enrolments
    • Labels:
    • Testing Instructions:
      Hide
      • Visit <yoursite>/admin/settings.php?section=manageenrols and turn on PayPal.
      • Click on the settings and set PayPal business email.
      • In the config.php file add '$CFG->usepaypalsandbox = true;'
      • Create a course that uses the PayPal enrolment plugin and set the price to $1.
      • Log in as a student.
      • Change your email as a valid PayPal sandbox user.
      • Visit the new course containing and click on the PayPal link.
      • Confirm payment and click on the link to go back to your Moodle site.

      Expected:

      • Student is enrolled in the course.

      What is happening:

      • Student sees "Thank you for your payment! Unfortunately your payment has not yet been fully processed".
      • Wait 10 seconds.
      • Press CTRL R to refresh the page.
      • Student is enrolled in the course.
      Show
      Visit <yoursite>/admin/settings.php?section=manageenrols and turn on PayPal. Click on the settings and set PayPal business email. In the config.php file add '$CFG->usepaypalsandbox = true;' Create a course that uses the PayPal enrolment plugin and set the price to $1. Log in as a student. Change your email as a valid PayPal sandbox user. Visit the new course containing and click on the PayPal link. Confirm payment and click on the link to go back to your Moodle site. Expected: Student is enrolled in the course. What is happening: Student sees "Thank you for your payment! Unfortunately your payment has not yet been fully processed". Wait 10 seconds. Press CTRL R to refresh the page. Student is enrolled in the course.
    • Workaround:
      Hide

      Add pause before the checking it the user is enrolled or not.

      enrol/paypal/return.php

      $fullname = format_string($course->fullname, true, array('context' => $context));
      +sleep(5);
      if (is_enrolled($context, NULL, '', true)) {

      Show
      Add pause before the checking it the user is enrolled or not. enrol/paypal/return.php $fullname = format_string($course->fullname, true, array('context' => $context)); +sleep(5); if (is_enrolled($context, NULL, '', true)) {
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE

      Description

      Payment goes through. IPN History shows return code of 200 for the transaction. Receipt is sent after payment notification is sent (money definitely flows, just not fast).

      User gets: "Thank you for your payment! Unfortunately your payment has not yet been fully processed". Does not get enroled.

      When user waits 2 - 10 seconds the user is enrolled.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rdebleu Renaat Debleu
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: