Availability conditions: PayPal

Maintained by Picture of Daniel Neis Araujo Daniel Neis Araujo
An Availability Condition to require a PayPal payment to access activities and resources.
264 sites
26 fans

PayPal Availability Condition

With this plugin you can put a price in any course content and ask for a PayPal payment to allow access.
The person in charge to configure the enrolment method on the course will be able to configure the enrolment cost's value and currency.
The user will be able to pay in some other currency at PayPal website. The conversion rates will be calculated and applied by PayPal.


  • Put these files at moodle/availability/condition/paypal/
  • Log in your Moodle as Admin and go to "Notifications" page
  • Follow the instructions to install the plugin
  • You must activate the IPN at your PayPal account
  • You must also use HTTPS on your Moodle site


This works like the PayPal enrol plugin, but instead of restricting the full course, you can restrict individual activities, resources or sections (and you can combine it with other availability conditions, for example, to exclude some group from paying using and "or" restriction set).

For each restriction you add, you can set a business email address, cost, currency, item name and item number.


The development of this plugin was funded by TRREE - TRAINING AND RESOURCES IN RESEARCH ETHICS EVALUATION - http://www.trree.org/

Dev Info

Please, report issues at: https://github.com/danielneis/moodle-availability_paypal/issues

Feel free to send pull requests at: https://github.com/danielneis/moodle-availability_paypal/pulls


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3


Picture of Daniel Neis Araujo
Daniel Neis Araujo (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Ruan Botes
    Wed, 18 Apr 2018, 8:13 AM
    So I have a question. I have looked at the form and moodle to see if I can get the answer but I have not been too successful. I have the plug in for PayPal and the eye is open. I have disabled guest access as I read I cant have paid for courses at the same time. I need to configure some things in PayPal which is proving to be more difficult than I thought. What I really want to know is:
    If learners enroll using PayPal as a method so they pay before they get access is it possible for learners to be automatically be enrolled onto the course without any input from anyone else but just by clicking on the PayPal button?
    The other thing that I would like to know is can leaners be automatically unenrolled from the course once completed?

    The next question is not a PayPal one but rather a data capturing one. I want to know if the site allows guest access is there a way of cracking how many people have logged in to look at what is available?

    Thanks I appreciate any assistance. I have only been working with Moodle for a short while.

  • Picture of Daniel Neis Araujo
    Thu, 3 May 2018, 1:58 AM
    Hello, Ruan

    when the student clicks the PayPal button he/she will be redirected to paypal site, then will confirm the purchase then, and will finally be redirect to the corresponding activity, without need for anyone else to do anything.
    there is no way to automatic unenrol user from course when completed. it would be bad for analytics. but you can suspend the enrolment.

    you can take a look at the guest's logs if you configure your moodle to do so (it does it for default). look for "log guest access".
  • Picture of Melvyn Gomez
    Tue, 15 May 2018, 6:47 AM
    What happen when an user has paid and the PayPal admin do a refund? the user must not be able to see the content?
  • Picture of Daniel Neis Araujo
    Wed, 16 May 2018, 8:54 PM
    If the admin does a refund at PayPal website, he/she will also need to manually unenrol the user.
  • Picture of Madhukar Reddy
    Sat, 21 Jul 2018, 7:54 PM
    Hi Daniel, i have configured paypal enrollment procedure as mentioned on moodle paypal integration document, also modified setting on paypal account same, but when i click on send paypal payment, it is showing error like : Things don't appear to be working at the moment. Please try again later. can you please help me to resolve my issue
  • Picture of Daniel Neis Araujo
    Mon, 23 Jul 2018, 10:53 PM
    Hi, Madhukar

    the enrol plugin is part of Moodle, you may look at the general developers forum to get support.
    But if your problem is with the availability condition, it may be that there is some information you mistyped when configuring the plugin. Aslo, paypal requires your site to be under SSL/HTTPS to work.
  • Picture of Yannick Vrolant
    Mon, 3 Sep 2018, 7:38 PM

    Is it possible to have end-users select their preferred currency among a list of several currencies (e.g. US dollar, Euro...) as they pay to enrol in a course ?

    Thanks for helping,

  • Picture of Daniel Neis Araujo
    Mon, 3 Sep 2018, 8:14 PM

    the person in charge to configure the enrolment method on the course will configure the cost's value and currency.
    At paypal, user will be able to pay in some other currency and the conversion rates will be calculated and applied by Paypal.
  • Picture of Shriram Joshi
    Fri, 7 Sep 2018, 3:36 PM
    Hi Daniel

    It's a great utility for moodle and I must appreciate efforts by the team

    I am having my Moodle 3.5 Hosting on AWS through Bitnami Moodle stack.
    Site is configured to work on HTTPS and is associated with elastic IP and public domain.
    Domain is registered with Godaddy.

    Everything working fine.............
    Site URL is - https://learncomputeronline.in

    I had my PayPal business account in India and is absolutely clear in terms of all commercial and technical requirements.

    For last three weeks, I am struggling to have my course payment made through PayPal.
    PayPal button on Cours Page successfully takes me to my PayPal payment page but after giving details though my PayPal account or even with any credit or debit card........payment was not getting successfully processed. IT use to give error - "We can not process your payment this time. Please go back to your merchant site and try to pay with some alternate payment method."

    I raised this concern to may agencies.........Including Forum of Moodle, Forum of Bitnami etc.

    Later on Moodle's technical coordinator helped me with trying payment to one of my Course "TYBom IT" which i purposefully kept at just 0.10 USD.

    Surprisingly Her payment went through smoothly and I got entry of her payment in My PayPal account as successfully. Even she got the enrolment to course also as expected by this integration.

    So I wondered what's going wrong with me when I am trying to make payment for same scenario.

    Few things then noted are mentioned here .......

    When I used to submit for payment, address bar of browser displays one PayPal error code at the end of URL.........


    I searched through this error code in google.

    Then I found below forum link where all people facing similar error from pay pal for various applications they hosted in which currency was not Indian Rs - INR and all of them were having PayPal account in India and all of them trying to get money form their Indian cusotmers only but in USD.


    This forum implies that there is regulation or restriction in India..........that PayPal can not receive or process any payment from Indian Customers in any other currency other than INR.

    This is the reason............PayPal could process Moodle technical coordinator's payment in USD since she was not from India.

    But it ultimately rejected my all payments because I was from India.

    Even though PayPal has officially started with Indian currencies from 1st March 2018 this year, they still seems to be bounded by this regulation act.

    So there seems to be no way if i had account of PayPal in India..............I will not be able to accept payment from Indian Customers.

    Unless Moodle's PayPal plugin provides INR currency in PayPal configuration screen.

    There is option that I should Create specific payment button in PayPal to accept Indian payment and include the same in my Moodle's course page. This will resolve my problem of getting payment from Indian customers..............but then it will not register user to course.

    in fact there is option in configuring this button to specify INP URL which I can do ............but then I need to know the Specific attribute variables that need to pass to that URL.

    Can you gibe me exact nature of Attribute variables that should get passed through PayPal IPN notification in normal case..........so that same i can try to configure in my custom PayPal button.

    Or it will be simple if you can release the new version of PayPal plugin with INR as in built currency option.

    Please support,

  • Picture of Shriram Joshi
    Fri, 7 Sep 2018, 3:41 PM
    Further to my comment above - I got Below confirmation mail form PayPal Technical support team,

    As you rightly mentioned, Indian buyers cannot pay Indian merchants in USD currency. Domestic transactions must be made only in INR currency.

    "We could see that your account is KYC verified and ready to accept domestic payments. In order to resolve the issue, you need to implement a currency switcher in your website which will toggle between INR and USD based on buyer location. If buyer is from India show INR else otherwise."

    So PayPal is definatly not supporting Indian customers to apply for my course through PayPal since my own PayPal account is in India.

    So only hope of option remains is to get INR currency in you PayPal Plugin for your next version.

    Till that time, I will not be able to have online payment in anyway for my courses.

  • Picture of Daniel Neis Araujo
    Wed, 10 Oct 2018, 5:27 AM
    Big thanks to Maj Shirish Patil that discovered that we need a change on the PayPal enrolment plugin to make Indian Rupee available on this plugin too.
    For all of you with problems using this on India, please take a look and vote on MDL-63603
  • Picture of G J
    Wed, 31 Oct 2018, 9:02 AM
    Any suggestions on how a discount code would be integrated into this plugin? Ex: If I can create coupon codes to reduce the price for customers who have the code?
  • Picture of Rekha C
    Thu, 22 Nov 2018, 10:35 PM

    How would paypal work for INR?

    When INR is enabled in the plugin, suppose in the drop down of a course i select INR, can i get payments by foreign buyers who have USD balances? or any other currency balances?

    or, can i put 2 paypal buttons - one for USD and one for INR?

  • Picture of Daniel Neis Araujo
    Thu, 29 Nov 2018, 9:59 PM

    converting between currencies are managed by PayPal that has different rules in different countries.
    You can have more than one button on same course (just add more enrol methods with other currencies) but I am not sure how PayPal will handle that at the end (if it will allow people to pay you in dollars, or other currencies)
  • Picture of Sven Niland
    Fri, 30 Nov 2018, 5:52 AM
    Is there a version of this plugin updated to work properly in Moodle 3.5+? Is that expected soon?
1 2 3

Commenting temporarily disabled