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

Authorize.net enrolment plugin no longer processing responses correctly

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_19_STABLE
    • Workaround:
      Hide

      To fix this bug, edit file: /enrol/authorize/authorizenetlib.php

      Change line 279 from:

      fgets($fp, 4096);

      To be:

      $data = fgets($fp, 4096);

      Then insert this line:

      while (!empty($data) && $data=trim(fgets($fp, 4096))); //get any remaining headers (fix to accommodate extra headers)

      This line would be directly before the "$data = fgets($fp, $length);" line.

      Show
      To fix this bug, edit file: /enrol/authorize/authorizenetlib.php Change line 279 from: fgets($fp, 4096); To be: $data = fgets($fp, 4096); Then insert this line: while (!empty($data) && $data=trim(fgets($fp, 4096))); //get any remaining headers (fix to accommodate extra headers) This line would be directly before the "$data = fgets($fp, $length);" line.
    • Testing Instructions:
      Hide

      For a course that has Authorize.net as it's enrolment method, attempt to enrol in the course. Enter all the credit card info and submit it. It will return with an error message, and you will not be enroled in the course.

      Show
      For a course that has Authorize.net as it's enrolment method, attempt to enrol in the course. Enter all the credit card info and submit it. It will return with an error message, and you will not be enroled in the course.

      Description

      Sometime around August 24 2012, the Authorize.net enrolment plugin no longer processed responses from Authorize.net properly, causing an error message and students to not be enroled despite successful transactions. The cause was some extra headers being sent back that the plugin was not built to process as it assumed only 1 line of header, which until recently, worked fine.

      I have a simple 2 line fix which will deal with the extra headers.

        Attachments

          Activity

            People

            Assignee:
            danmarsden Dan Marsden
            Reporter:
            jking Jeff King
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: