## Enrolment: Authorize.net

enrol_authorizedotnet
Maintained by DualCube 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.
117 sites
17 fans

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 :

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:

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:

Click Account from the main toolbar.

Click Response/Receipt URLs under Transaction Format Settings.

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

Click Submit.

### Contributors

• Mon, 20 Feb 2017, 3:55 PM
Hi Zhivko,

Thanks for reaching out! Production Mode means "Live Mode" where you can make live (actual) payment transactions.
You can enable Production Mode of authorize .net from
Site administration > Plugins > Enrolments > enable authorize.net > settings > check for "Check for production mode".

Yes, you should enable it when you are doing actual transactions in currency to enrol users. Please let me know if we can help with anything else.

Thanks and Regards,
Arindam
• Tue, 21 Feb 2017, 3:32 PM
Thank you Arindam!
• Fri, 24 Feb 2017, 5:50 PM
I'm trying to make a payment and getting an error message: (14) The referrer, relay response or receipt link URL is invalid.
Just called Authorize.net, their representative didn't have any clue... Does the Relay Response URL need to be "http://your_moodle_website/enrol/authorizedotnet/ipn.php" (as required above) or it should actually be "http://your_moodle_website/enrol/authorize.net/ipn.php"??
Thanks
• Mon, 27 Feb 2017, 3:51 PM
Hello,
Although I have selected the options - Notify Student, Notify Teacher and Notify Admin -  no one gets notified when student gets enrolled.
Is this a plugin issue? Or is there any site level or course level setting I need to adjust for this?

Thanks!
• Mon, 27 Feb 2017, 4:43 PM
@Zhivko,
The relay response url will be - http://your_moodle_website/enrol/authorizedotnet/ipn.php
• Sat, 15 Apr 2017, 1:21 AM
I installed this plugin a few days ago. Got the authorize.net account set up and but imediately after the payment form is processed, the browser goes to this page (http://my_website_domain/enrol/authorizedotnet/update.php?id=1) with the following error... "Coding error detected, it must be fixed by a programmer: Invalid property courseid specified". Is this plugin still recieving aid from developer? I would ask for assistance in this. Additional info: The payment gateway succeeded- payment was processed but user was not enrolled into class(charged but not granted access to the course)
• Tue, 18 Apr 2017, 1:11 AM
More information on the post I made before. I tried creating a new course, and tested with a brand new student account. I got the same error:
"Coding error detected, it must be fixed by a programmer: Invalid property courseid specified"
This error happens immediately after payment is sent to Authorize.net. The payment is succesful, but the update that enrolls the student is not happening. Please advise. Thank you.
• Tue, 18 Apr 2017, 1:19 AM
One last info bit, each time the error occurred the url changed sligthly...
First time was http://pmnerds.com/enrol/authorizedotnet/update.php?id=1
Second time was http://pmnerds.com/enrol/authorizedotnet/update.php?id=2
Third time was http://pmnerds.com/enrol/authorizedotnet/update.php?id=3
• Tue, 18 Apr 2017, 8:12 PM
@William,

Then set up and test it using your sandbox account.

Kindly let me know the output.

Thanks and Regards,
Arindam
• Wed, 19 Apr 2017, 1:52 AM
Is this what you needed?
Coding error detected, it must be fixed by a programmer: Invalid property courseid specified

×Debug info:
Error code: codingerror
×Stack trace:
line 215 of /lib/classes/message/message.php: coding_exception thrown
line 125 of /enrol/authorizedotnet/update.php: call to core\message\message->__set()
• Wed, 19 Apr 2017, 2:06 AM
I figured out the issue!
in the file listed above..(line 125 of /enrol/authorizedotnet/update.php: call to core\message\message->__set()) is a change from moodle 3.1.
but essentially, change
$eventdata = new \core\message\message();$eventdata->courseid = SITEID;

to

\$eventdata = new stdClass();

if you are using moodle version 3.1

Thanks for the plugin!
• Thu, 20 Apr 2017, 5:18 PM
Hi William,

Thanks and Regards,
Arindam
• Thu, 22 Jun 2017, 10:46 PM
Recent Moodle upgrade and now I am seeing this error on a test run:

Looks like the bug above and so tells me this is still in your distribution code. Using:

M 2.7.20
Authorize.net enrol_authorizedotnet Additional 2015061502 2.5 (Build: 20150610)

Going to try the above fix...
• Thu, 22 Jun 2017, 11:07 PM
Well, I'm not sure what the message code / API should be for M 2.7 but I turned notify students off, and it started to process again. I still need some help here, where can I look at the old releases ? Thanks
• Tue, 27 Jun 2017, 3:14 PM
Hi John,