Issue Details (XML | Word | Printable)

Key: CONTRIB-1258
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anthony Borrow
Reporter: Mauro Rondinelli
Votes: 1
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Non-core contributed modules

Amazon FPS Enrol Module

Created: 08/May/09 09:13 PM   Updated: 29/Jul/09 09:08 PM
Component/s: Enrol: Amazon FPS
Affects Version/s: 1.9.4
Fix Version/s: None

File Attachments: 1. File amazon_fps.rar (185 kB)

Issue Links:
Relates
 

Database: MySQL
Participants: Anthony Borrow and Mauro Rondinelli
Security Level: None
Resolved date: 27/Jul/09
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
Amazon FPS Enrol Module : With Amazon FPS, you can accept payments on their website for selling your courses.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Mauro Rondinelli added a comment - 08/May/09 09:56 PM
Requirements:
  • Moodle 1.9.4
  • PHP 5.2.6
  • Module Crypt_HMAC 1.0.1
  • SSL

Features:

  • Support English and Spanish lang.
  • Email notifications.
  • Orders backend

For installation steps see install.txt file.

For resources and more information on the Amazon FPS, visit:

http://aws.amazon.com/fps/
http://aws.amazon.com/fps/faqs/


Anthony Borrow added a comment - 27/Jul/09 10:26 AM
Mauro - Thanks for sharing the code for the Amazon FPS enrollment type. Sorry it has taken me so long to reply as I was overwhelmed with work on other projects. I have had a chance to take an introductory look at the code you provided and had a couple comments, questions, etc. I am going to go ahead and add the code to CONTRIB but I figured I would touch base with you to get your input. Feel free to make the necessary changes. I'll create a component in the tracker and bump your privileges so you can manage issues related to this enrollment plugin.

1) The instructions for copying the lang files to the lang folder are not necessary. Moodle attempts to be modular and as such the lang files should be able to be found by looking in /enrol/amazon/lang/en_utf8. This allows for the user to simply download the file, decompress it to /enrol and go to the notifications page.
2) I noticed some strange characters in the install.txt file likely from not saving the file as UTF-8. While minor, we try to be consistent so it would help if you could do that.
3) You reference that the enrollment plugin requires Crypt_HMAC 1.0.1 but I noticed that that version has been deprecated and is no longer being maintained. Would the code work with Crypt_HMAC2 (http://pear.php.net/package/Crypt_HMAC2)? If so, I would recommend using that.
4) In the install.txt file it may be helpful for folks unfamiliar with Crypt_HMAC to have instructions about how where to find it and how to install it. I tend to presume the system administrator knows nothing and that will probably save you some questions when folks try to get it working.
5) At one point you refer to this code which is an enrollment type plugin as a module. I would discourage that simply because module refers specifically to activity modules in Moodle and thus it may confuse folks as to where this code is intended to be put.
6) If you have not already done so, I would encourage you to read http://docs.moodle.org/en/Development:Guidelines_for_contributed_code and make sure that we follow up on the various details like adding a page in Moodle Docs, adding an entry in the Modules and Plugins database, etc.

Do not hesitate to let me know if you have any questions or if there is anything I can do to be helpful. Thanks again for sharing this code with the Moodle community.

Peace - Anthony


Anthony Borrow added a comment - 27/Jul/09 10:31 AM
Mauro - I will also need for you to apply for CVS write access by filing out an application at http://moodle.org/cvs/ simply reference that you will maintaining the Amazon FPS code and need access to contrib/plugins/enrol/amazon and then I can approve the request so that you can begin maintaining the code in CVS. Peace - Anthony

Anthony Borrow added a comment - 27/Jul/09 10:43 AM
code added to cvs, privileges bumped, component created ... waiting for CVS write request

Anthony Borrow added a comment - 27/Jul/09 10:44 AM
moving to Enrol: Amazon FPS component

Mauro Rondinelli added a comment - 28/Jul/09 11:42 PM
Hi,

I move the lang folder to the enroll plugin directory. Lang strings are ok but i have problems with help files (the pop up windows says: Help file "access_key.html" could not be found!) the current path to the help files is:

[moodle_root]\enrol\amazon\lang\en_utf8\help\enrol\amazon

and the help buttom is created with:

helpbutton('access_key', 'Amazon FPS', 'enrol/amazon')

Where is wrong?

Thanks.


Anthony Borrow added a comment - 29/Jul/09 10:18 AM
Mauro - I do not think there is anything wrong on your end. I seem to recall a bug (and I believe there is a tracker issue for it that I will need to find and link to this issue) where by the help files were not being found for some plugin types. If I do not respond to this in a few days just give me a friendly little bump/reminder. Peace - Anthony

Anthony Borrow added a comment - 29/Jul/09 08:33 PM
Mauro - OK, I did a little code diving into the help.php file. For plugins, Moodle expects that the module be defined with an underscore; otherwise, it will assume that it is looking for something in the mod directory. This is what was happening in your config.html file where you had:

helpbutton('access_key', 'Amazon FPS', 'enrol/amazon')

I changed this to:

helpbutton('access_key', 'Amazon FPS', 'enrol_amazon')

which then has the following two paths in the list of possible locations to search in:

/lang/en_utf8/help/enrol_amazon/access_key.html
/enrol/amazon/lang/en_utf8/help/amazon/access_key.html

So I moved the help file to that new location and it works fiine (essentially I just moved /enrol/amazon/lang/en_utf8/help/enrol/amazon/* to /enrol/amazon/lang/en_utf8/help/amazon/*

What I do not like about this is that it is not completely consistent with where it should search. I think the help.php file should have the following possible locations to search in:

/lang/en_utf8/help/enrol_amazon/access_key.html
/enrol/amazon/lang/en_utf8/help/enrol_amazon/access_key.html

That way the /lang and /enrol paths follow the same basic structure of looking for */help/enrol_amazon/access_key.html rather than having one look in /help/enrol_amazon and the other in /help/amazon. I will see if I can address this in core because get_string (at least as I recall) behaves in this way.

Let me know if this explanation makes sense or only muddies the waters further.

Peace - Anthony


Anthony Borrow added a comment - 29/Jul/09 09:08 PM
Mauro - I created an issue in the tracker that I think would allow for better handling of searching for plugin help files so I am linking the issues. Peace - Anthony