Enrolment: Authorize.net

enrol_authorizedotnet
Maintained by Picture of DualCube TeamDualCube Team
Enrolment in Moodle using Authorize.net payment gateway for paid courses This plugin helps admins and webmasters use Authorize.net as the payment gateway. Authorze.net is one of the most commonly used payment gateways and offers considerable number of features unsupported by other payment gateways like Paypal. This plugin has all the settings for development as well as for production usage. Its easy to install, set up and effective.
174 sites
205 downloads
34 fans
Current versions available: 1

Enrolment in Moodle using Authorize.net payment gateway for paid courses


This plugin helps admins and webmasters use Authorize.net as the payment gateway. PAuthorze.net is one of the most commonly used payment gateways and offers considerable number of features unsupported by other payment gateways like Paypal. This plugin has all the settings for development as well as for production usage. Its easy to install, set up and effective.


Installation Guidence :


Login to your moodle site as an “admin user” and follow the steps.


1) Upload the zip package from Site administration > Plugins > Install plugins. Choose Plugin type 'Enrolment method (enrol)'. Upload the ZIP package, check the acknowledgement and install.


2) Go to Enrolments > Manage enrol plugins > Enable 'Authorize.net' from list


3) Click 'Settings' which will lead to the settings page of the plugin


4) Provide merchant credentials for Authorize.net, select the checkbox as per requirement. Save the settings.


5) Select any course from course listing page.


6) Go to Course administration > Users > Enrolment methods > Add method 'Authorize.net' from the dropdown. Set 'Custom instance name', 'Enrol cost' etc and add the method.


This completes all the steps from the administrator end. Now registered users can login to the Moodle site and view the course after a successful payment.



Note: You need to configure the Default Relay Response URL in you authorized.net account. The Relay Response URL will be "http://your_moodle_website/enrol/authorizedotnet/ipn.php"


To add a Default Relay Response URL:


Log into the Merchant Interface at https://account.authorize.net/ or Sandbox Interface https://sandbox.authorize.net/.

Click Account from the main toolbar.

Click Response/Receipt URLs under Transaction Format Settings.

Click Edit next to Default Relay Response URL. The Relay Response page appears.

In the URL text field, enter the URL where the payment gateway should send the transaction response. This URL must start with either "http://" or "https://". Parameterized URLs are not permitted.

Click Submit. A confirmation message indicates that the URL has been added.



To add a URL to the list of authorized Response or Receipt URLs:


Log into the Merchant Interface at https://account.authorize.net/ or Sandbox Interface https://sandbox.authorize.net/.

Click Account from the main toolbar.

Click Response/Receipt URLs under Transaction Format Settings.

Click Add URL.

Enter the new URL. This URL must start with either "http://" or "https://".

Click Submit.



Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3

Contributors

Picture of DualCube Team
DualCube Team (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Evan Erickson
    Wed, Jun 17, 2020, 12:41 AM
    I installed and configured the Authorize.net plugin as outlined in the documentation, when I do a test purchase I'm receiving this error message:
    "Exception - Call to a member function enrol_user() on null
    More information about this error"

    And when I click on the "More information about this error, it directs me to here: https://docs.moodle.org/38/en/error/moodle/generalexceptionmessage

    Any idea how to determine what is causing this issue? Thanks!
  • Picture of tech fossil
    Sun, Jun 21, 2020, 2:19 PM
    great software
  • Picture of DualCube Team
    Tue, Jun 23, 2020, 8:28 PM
    Dear Evan,
    Please reset all the keys of Authorize.net and put the newly generated ones. In addition, please turn off the production mode (checkbox on your plugin settings) if you are using the sandbox credentials. Thank you.
  • Picture of DualCube Team
    Tue, Jun 23, 2020, 8:29 PM
    Thank you Tech Fossil!
  • Picture of Evan Erickson
    Wed, Jun 24, 2020, 9:18 PM
    Hi DualCube Team, thank you for the assistance, I reset all of the keys in Authorize.net Key and I'm still not able to resolve this issue. Here's what I received from the DeBug:

    Exception - Call to a member function enrol_user() on null

    More information about this error

    Debug info:
    Error code: generalexceptionmessage
    Stack trace:
    line 237 of /enrol/authorizedotnet/update.php: Error thrown
    Output buffer:
    Notice: Undefined variable: plugin_instance in /var/www/html/enrol/authorizedotnet/update.php on line 230

    Notice: Trying to get property 'enrolperiod' of non-object in /var/www/html/enrol/authorizedotnet/update.php on line 230

    Notice: Undefined variable: plugin in /var/www/html/enrol/authorizedotnet/update.php on line 237

    How would I resolve this issue? Thanks!
  • Picture of DualCube Team
    Thu, Jun 25, 2020, 12:02 PM
    Dear Evan,

    Can you please use this version: https://moodle.org/plugins/download.php/20822/enrol_authorizedotnet_moodle38_2019122000.zip

    And let us know if it solves your issue.

    Thank you.
  • Picture of Evan Erickson
    Thu, Jun 25, 2020, 8:04 PM
    Hi DualCube Team,

    I installed the plugin version you sent over (2019122000) but I am still receiving this error from DeBug:

    Exception - Call to a member function enrol_user() on null

    More information about this error

    Debug info:
    Error code: generalexceptionmessage
    Stack trace:
    line 237 of /enrol/authorizedotnet/update.php: Error thrown
    Output buffer:
    Notice: Undefined variable: plugin_instance in /var/www/html/enrol/authorizedotnet/update.php on line 230

    Notice: Trying to get property 'enrolperiod' of non-object in /var/www/html/enrol/authorizedotnet/update.php on line 230

    Notice: Undefined variable: plugin in /var/www/html/enrol/authorizedotnet/update.php on line 237
  • Picture of Evan Erickson
    Wed, Aug 12, 2020, 8:48 PM
    Hello, I'm still having issues with the Authorize.net plugin working in Moodle 3.8.3+ (Build: 20200605) using the Authorize.net Plugin [2.5 (Build: 20150610) - 2020072400], when I run De-Bug this is the error that I am receiving:

    Exception - Call to a member function enrol_user() on null

    More information about this error

    Debug info:
    Error code: generalexceptionmessage
    Stack trace:
    line 237 of /enrol/authorizedotnet/update.php: Error thrown
    Output buffer:
    Notice: Undefined variable: plugin in /var/www/html/enrol/authorizedotnet/update.php on line 237

    Anyone encounter this error or able to resolve it? This has been persistent for MONTHS and still haven't figured out how to get this issue resolved. Much appreciated and thank you!
  • Picture of Corey Zinn
    Tue, Aug 25, 2020, 11:23 PM
    I am seeing the same error as Evan Erickson - referencing line 237 of update.php, undefined variable: plugin. This is using Moodle 3.5 and the 2020072400 build of the Authorize.net plugin.

    I do not know if this has any bearing, but I noticed that the latest plugin does not have the ipn.php file anymore, yet the instructions still indicate to use this file as the relay response URL.

    Any help would be appreciated.

    Thanks.
  • Picture of Corey Zinn
    Fri, Aug 28, 2020, 8:47 PM
    I have gathered additional information from the Apache error log (using WAMP setup). When a user tries to enroll in a course using Authorize.Net, the lines shown below are captured in the error.log file (Note that I have changed client and site information in the errors below; also note that our site is not directly in htdocs, but in a folder under htdocs).

    Again, any help would be appreciated. Thanks.

    From Apache error.log file:

    [Fri Aug 28 08:28:53.287656 2020] [:error] [pid 106900:tid 856] [client NNN] Debugging: Coding problem: $PAGE->context was not set. You may have forgotten to call require_login() or $PAGE->set_context(). The page may not display correctly as a result in \r\n* line 493 of \\lib\\pagelib.php: call to debugging()\n* line 1544 of \\lib\\pagelib.php: call to moodle_page->magic_get_context()\n* line 1934 of \\lib\\setuplib.php: call to moodle_page->initialise_theme_and_output()\n* line 49 of \\enrol\\authorizedotnet\\pay_process.php: call to bootstrap_renderer->__call()\n, referer: https://SITENAME/enrol/index.php?id=74
    [Fri Aug 28 08:28:53.505668 2020] [:error] [pid 106900:tid 856] [client NNN] PHP Warning: SimpleXMLElement::__construct(): namespace warning : xmlns: URI AnetApi/xml/v1/schema/AnetApiSchema.xsd is not absolute in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 72, referer: https://SITENAME/enrol/index.php?id=74
    [Fri Aug 28 08:28:53.512669 2020] [:error] [pid 106900:tid 856] [client NNN] PHP Warning: SimpleXMLElement::__construct(): <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 72, referer: https://SITENAME/enrol/index.php?id=74
    [Fri Aug 28 08:28:53.512669 2020] [:error] [pid 106900:tid 856] [client NNN] PHP Warning: SimpleXMLElement::__construct(): ^ in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 72, referer: https://SITENAME/enrol/index.php?id=74
    [Fri Aug 28 08:28:53.518669 2020] [:error] [pid 106900:tid 856] [client NNN] PHP Warning: curl_setopt(): CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 115, referer: https://SITENAME/enrol/index.php?id=74
    [Fri Aug 28 08:28:53.783684 2020] [:error] [pid 106900:tid 856] [client NNN] PHP Notice: Undefined property: stdClass::$authCode in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 128, referer: https://SITENAME/enrol/index.php?id=74
    [Fri Aug 28 08:28:53.783684 2020] [:error] [pid 106900:tid 856] [client NNN] PHP Notice: Undefined property: stdClass::$responseCode in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 129, referer: https://SITENAME/enrol/index.php?id=74
    [Fri Aug 28 08:28:53.783684 2020] [:error] [pid 106900:tid 856] [client NNN] PHP Notice: Undefined property: stdClass::$transId in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 130, referer: https://SITENAME/enrol/index.php?id=74
    [Fri Aug 28 08:28:54.125704 2020] [:error] [pid 106900:tid 856] [client NNN] PHP Notice: Undefined variable: plugin in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\update.php on line 237, referer: https://SITENAME/enrol/authorizedotnet/pay_process.php
    [Fri Aug 28 08:28:54.126704 2020] [:error] [pid 106900:tid 856] [client NNN] Default exception handler: Exception - Call to a member function enrol_user() on null Debug: \r\nError code: generalexceptionmessage\n* line 237 of \\enrol\\authorizedotnet\\update.php: Error thrown\n, referer: https://SITENAME/enrol/authorizedotnet/pay_process.php
  • Picture of DualCube Team
    Tue, Sep 1, 2020, 8:16 PM
    Thanks Corey,
    We are working to debug the issue.
    Thank you.
  • Picture of Corey Zinn
    Tue, Sep 1, 2020, 9:46 PM
    DualCube - Thank you for looking into this issue.

    Note that I did change the URL from the test URL to production (in pay_process.php file) and tried again. Some of the errors are the same, but some are different. Below is what is in the apache error log now with an attempted transaction:


    [Tue Sep 01 09:35:29.209973 2020] [:error] [pid 96840:tid 872] [client NNNN:65163] Debugging: Coding problem: $PAGE->context was not set. You may have forgotten to call require_login() or $PAGE->set_context(). The page may not display correctly as a result in \r\n* line 493 of \\lib\\pagelib.php: call to debugging()\n* line 1544 of \\lib\\pagelib.php: call to moodle_page->magic_get_context()\n* line 1934 of \\lib\\setuplib.php: call to moodle_page->initialise_theme_and_output()\n* line 49 of \\enrol\\authorizedotnet\\pay_process.php: call to bootstrap_renderer->__call()\n, referer: https://SITENAME/enrol/index.php?id=74
    [Tue Sep 01 09:35:29.436986 2020] [:error] [pid 96840:tid 872] [client NNNN:65163] PHP Warning: SimpleXMLElement::__construct(): namespace warning : xmlns: URI AnetApi/xml/v1/schema/AnetApiSchema.xsd is not absolute in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 72, referer: https://SITENAME/enrol/index.php?id=74
    [Tue Sep 01 09:35:29.444986 2020] [:error] [pid 96840:tid 872] [client NNNN:65163] PHP Warning: SimpleXMLElement::__construct(): <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 72, referer: https://SITENAME/enrol/index.php?id=74
    [Tue Sep 01 09:35:29.444986 2020] [:error] [pid 96840:tid 872] [client NNNN:65163] PHP Warning: SimpleXMLElement::__construct(): ^ in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\pay_process.php on line 72, referer: https://SITENAME/enrol/index.php?id=74
    [Tue Sep 01 09:35:31.344095 2020] [:error] [pid 96840:tid 872] [client NNNN:65163] PHP Warning: mysqli::real_escape_string() expects parameter 1 to be string, array given in C:\\Apache24\\htdocs\\SITEFOLDER\\lib\\dml\\mysqli_native_moodle_database.php on line 1112, referer: https://SITENAME/enrol/authorizedotnet/pay_process.php
    [Tue Sep 01 09:35:31.347095 2020] [:error] [pid 96840:tid 872] [client NNNN:65163] PHP Notice: Undefined variable: plugin in C:\\Apache24\\htdocs\\SITEFOLDER\\enrol\\authorizedotnet\\update.php on line 237, referer: https://SITENAME/enrol/authorizedotnet/pay_process.php
    [Tue Sep 01 09:35:31.348095 2020] [:error] [pid 96840:tid 872] [client NNNN:65163] Default exception handler: Exception - Call to a member function enrol_user() on null Debug: \r\nError code: generalexceptionmessage\n* line 237 of \\enrol\\authorizedotnet\\update.php: Error thrown\n, referer: https://SITENAME/enrol/authorizedotnet/pay_process.php
  • Picture of Evan Erickson
    Fri, Oct 2, 2020, 4:42 AM
    Have these issues been resolved yet? Just curious is anyone is having any luck using this plugin since I'm still getting the same errors as I mentioned above...
  • Picture of Corey Zinn
    Tue, Oct 6, 2020, 9:07 PM
    Evan - I have heard nothing more. We ended up going back to previous version for now, since it works.
  • Picture of DualCube Team
    Thu, Oct 8, 2020, 12:14 PM
    Dear Corey,
    We are still trying to fix it but yes, the previous version still works for many installations. Thank you.
1 2 3 4 5 6 7 8
Please login to post comments