PayPal Subscription - Documentation

Thank you

  1. Create a PayPal account at
    • Although not required, it may be wise to upgrade your account to "Premier" status and get "Verified".


  1. Set the encoding to UTF-8.
    • Go to Profile > Profile and settings > My selling tools > More selling tools > PayPal button language encoding
    • Make sure you have your website's language set to Western European Languages
    • Click the "More Options" button
    • Set encoding to "UTF-8" and let the same encoding be used for IPN, too.


  • . PayPal Email Address

The first setting is your PayPal email address. This is the address associated with your PayPal account.

PayPal Identity Token


1. Log in to your PayPal account.

2. Hover over the cog in the upper right corner of the screen and select Account Settings

3. Under the Products & Services heading, click on Website payments on the left side of the screen

4. Click the Update link next to Website Preferences

5. Set Auto Return to On

6. For the return URL, enter your webpage URL.

7. In Payment Data Transfer, click the On option.

8. Click Save.

Enable instant payment notifications (IPN)

  • Go to Profile > Profile and settings > My selling tools > Getting paid and managing my risk > Instant payment notifications > Update
  • Turn IPN on and set the notification URL to your site's enrol/paypalsubscription/ipn.php (so it reads for example like ).


PayPal can provide more details, but as a high-level overview you will:

  1. Create "sandbox" accounts that are used for testing. At least one "BUSINESS" account is needed, and one "PERSONAL" account is needed, to represent both sides of a pretend transaction.
  2. These sandbox accounts will be registered/associated with the developer account for your REAL PayPal business account.
  3. When testing, in addition to the configuration flag above, remember to use the "BUSINESS" type sandbox account email address in the "PayPal business email" field in the PayPal plugin settings page. Do this instead of using your REAL business email address. Failure to use the pretend business account will result in an error message.


  1. Go to Site administration > Plugins > Enrolments > Manage enrol plugins and click the eye icon opposite PayPal Subscription. When enabled, it will no longer be greyed out. Manual enrolment must also be enabled, since the PayPal plugin requires it.
  2. Click the settings link, configure as required (see details of settings below), then click the 'Save changes' button.


·PayPal business email - This setting is case sensitive and must exactly match that in PayPal

·Default role assignment - This means the role that a new user will automatically be given in a course when they purchase access. Usually this would be "student" unless you have a special reason for choosing another role. As for other default settings, it may be overridden in individual courses.

Tip: If you wish to allow users to create their own accounts on your site then 

you need to set up Email based self registration.

Please remember to disable the sandbox and add the original email ID (not the sandbox app’s one )when you are in live mode.

And, please remember that this settings is applied to every course that has PayPal Subscription as the enrolment method. If you do not create a custom PayPal subscription enrolment method/ instance, the cost that is set in this settings will be applied.

Course settings for PayPal/ custom PayPal subscription enrolment method/ instance

  1. If you are using the Boost theme, click the gear menu from the Participants link and then click Enrolment methods. If you are using a different theme, go to Course administration > Users > Enrolment methods
  2. If you do not see PayPal, use the pull down menu "Add method" and select PayPal Enrolment . If you are a course teacher, your admin will need to allow you the capability enrol/paypal:config in order for you to add this method.
  3. Make sure PayPal has its "eye" opened:

Note: Make sure you don't have Self enrolment enabled as this would allow users to access the course without paying. If you do need some users to self enrol for free, then add an Enrolment key in the self enrolment settings.


  1. In Course Administration > Users > Enrolment methods, click the edit/hand/pen icon to the right of the PayPal subscription option.
  2. Optional: Give a name to this enrolment method if you wish in "Custom Instance name"
  3. Ensure that "Allow PayPal subscription enrolments" is set to "yes"
  4. In "Enrol cost", type in the cost of your course and in "Currency" choose your currency.
  5. Usually you would leave the "Assign role" as "student" unless you have a very special reason for allowing your users to enrol as, say, editing teachers etc
Enrollment duration
If you want to set the enrollment duration, then the user will be unenrolled from the specific course after exceeding the enrollment duration. Otherwise, users will remain enrolled.
You can also unenroll a user from a specific course using the admin subscription status page.
Subscription Interval
This is a mandatory setting, and it is not infinite. The valid range is
Valid subscription interval value is:
The valid range for Days is 1 to 90.
The valid range for Weeks is 1 to 52.
The valid range for Months is 1 to 24.
The valid range for Years is 1 to 5.
The valid range for the subscription interval cycle is 1 to 52
If you want to change the cycle times displayed on the purchase page then you must change it manually. First you must go Moodle folder
Moodle > Enrol > PayPal/Subscription > Enrol.php
Subscription Status page
You have to add a menu on your Moodle instance and put the URL that is given below
  1. Click the "Save changes" button.


When a new user clicks on your course link, they will see a message inviting them to go to PayPal to purchase access to the course.