Moodle plugins directory: Authorize.net | Moodle.org
Authorize.net
Authorize.Net is a Moodle payment gateway that enables you to accept credit cards, debit cards, and bank transfers for your courses. In addition, it's simple to configure the price and associated currency for course enrollments. You can also take advantage of unique features that other payment gateways do not offer.
To learn more about Authorize.Net functionality, view this document.
Set Course Price - With Authorze.net you can assign prices within a specific course section and configure the cost and associated currency of course enrollments.
Robust Security - It has reliable security and anti-fraud features making it a credible plugin for international transactions.
Advanced Security Option (Premium) -Get fraud prevention filters, a simple checkout system, and user information storage so your students. With Authorize.Net students don’t have to re-enter information every time.
This document will help you to configure the plugin further https://dualcube.com/docs/enrolment-in-moodle-using-authorize-net/
"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!
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.
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!
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.
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
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!
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.
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
We are working to debug the issue.
Thank you.
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
We are still trying to fix it but yes, the previous version still works for many installations. Thank you.