Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 2.0
    • Component/s: Enrolments
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Very nice tasks, it should not be difficult for anybody who already tried to developed something with PayPal services using the sandbox accounts.

      Potential benefits:

      • finally we could have multiple instances each with different cost & role
      • option for extending of enrolments
      • final solution for currencies
      • etc.

      This should work 100% because money are involved directly

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            dougiamas Martin Dougiamas added a comment -

            Another one for you, Aaron. http://docs.moodle.org/en/Paypal

            In a nutshell, a user trying to enter a course using this gets a form with a Paypal "Pay now" button. They go to PayPal, send money, PayPal then calls a Moodle return script directly and enrols the user, so when the user next tries to enter that course, they can. Magic.

            Used to work fine, just needs updating to the new enrol classes like the others.

            If it's easy to fix the things Petr mentioned along the way all the better, but at a minimum we just need to match the features we had before.

            You will need to use a real Paypal account: they offer a sandbox for developers who are testing: https://developer.paypal.com/

            Show
            dougiamas Martin Dougiamas added a comment - Another one for you, Aaron. http://docs.moodle.org/en/Paypal In a nutshell, a user trying to enter a course using this gets a form with a Paypal "Pay now" button. They go to PayPal, send money, PayPal then calls a Moodle return script directly and enrols the user, so when the user next tries to enter that course, they can. Magic. Used to work fine, just needs updating to the new enrol classes like the others. If it's easy to fix the things Petr mentioned along the way all the better, but at a minimum we just need to match the features we had before. You will need to use a real Paypal account: they offer a sandbox for developers who are testing: https://developer.paypal.com/
            Hide
            binare Eugene Venter added a comment -

            Hi there,

            Please see the attached patch for an upgraded PayPal enrolments plugin.

            Cheers,
            Eugene.

            Show
            binare Eugene Venter added a comment - Hi there, Please see the attached patch for an upgraded PayPal enrolments plugin. Cheers, Eugene.
            Hide
            binare Eugene Venter added a comment -

            Oops!

            Cocked up the version number ; see the latest attachment for the correct patch.

            Show
            binare Eugene Venter added a comment - Oops! Cocked up the version number ; see the latest attachment for the correct patch.
            Hide
            skodak Petr Skoda added a comment -

            1/

            $mailstudents = $plugin->get_config('enrol_mailstudents');
            $mailteachers = $plugin->get_config('enrol_mailteachers');
            $mailadmins = $plugin->get_config('enrol_mailadmins');

            from ipn.php deos not look correct

            2/ the instance id should be somewhere in enrol_paypal table, right? Otherwise we do not know which instance in course it is belonging to

            3/ if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', 'u.id ASC',
            should be probably replaced by the new CFG->coursecontact but it should be probably done later, maybe 2.1

            The rest looks ok if it works, I do not have a setup to actually test it, thanks!

            Show
            skodak Petr Skoda added a comment - 1/ $mailstudents = $plugin->get_config('enrol_mailstudents'); $mailteachers = $plugin->get_config('enrol_mailteachers'); $mailadmins = $plugin->get_config('enrol_mailadmins'); from ipn.php deos not look correct 2/ the instance id should be somewhere in enrol_paypal table, right? Otherwise we do not know which instance in course it is belonging to 3/ if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', 'u.id ASC', should be probably replaced by the new CFG->coursecontact but it should be probably done later, maybe 2.1 — The rest looks ok if it works, I do not have a setup to actually test it, thanks!
            Hide
            binare Eugene Venter added a comment -

            Hi Petr,

            You can check out the latest attached patch. It now includes those ipn config fixes you pointed out, as well as a db upgrade script that adds an instanceid field to the enrol_paypal table.

            Cheers,
            Eugene.

            Show
            binare Eugene Venter added a comment - Hi Petr, You can check out the latest attached patch. It now includes those ipn config fixes you pointed out, as well as a db upgrade script that adds an instanceid field to the enrol_paypal table. Cheers, Eugene.
            Hide
            skodak Petr Skoda added a comment -

            strange, it looks like you did not use the xmldb editor to make the install.xml changes and upgrade.php - missing field in install,xml, missing savepoint in upgrade.php

            Show
            skodak Petr Skoda added a comment - strange, it looks like you did not use the xmldb editor to make the install.xml changes and upgrade.php - missing field in install,xml, missing savepoint in upgrade.php
            Hide
            binare Eugene Venter added a comment -

            lol, I didn't use the Editor, will do so henceforth , thanks!

            Ps. I've attached a latest patch.

            Hope this helps,
            Eugene.

            Show
            binare Eugene Venter added a comment - lol, I didn't use the Editor, will do so henceforth , thanks! Ps. I've attached a latest patch. Hope this helps, Eugene.
            Hide
            skodak Petr Skoda added a comment -

            +1 for the commit

            Show
            skodak Petr Skoda added a comment - +1 for the commit
            Hide
            dougiamas Martin Dougiamas added a comment -

            yay!

            Show
            dougiamas Martin Dougiamas added a comment - yay!
            Hide
            skodak Petr Skoda added a comment -

            reopening, the currency default is incorrect which creates problems during install

            Show
            skodak Petr Skoda added a comment - reopening, the currency default is incorrect which creates problems during install
            Hide
            skodak Petr Skoda added a comment -

            fixed

            Show
            skodak Petr Skoda added a comment - fixed

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10