Moodle plugins directory: PayPal | Moodle.org
PayPal
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.
Install
- Put these files at moodle/availability/condition/paypal/
- You may use composer
- or git clone
- or download the latest version from https://github.com/danielneis/moodle-availability_paypal/archive/master.zip
- Log in your Moodle as Admin and go to "Notifications" page
- Follow the instructions to install the plugin
- You must set the "Return URL" at PayPal to https://YOURMOODLESITEADDRESS/availability/condition/paypal/ipn.php (this may conflict with Moodle's enrollment PayPal plugin, make sure you use separate apps if you use PayPal enrollment)
- You must activate the IPN at your PayPal account
- You must have HTTPS enabled and working on your Moodle site
Usage
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.
Funding
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
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.
Shriram
For all of you with problems using this on India, please take a look and vote on MDL-63603
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?
Rekha
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)
I made available a version tested on 36. It may work from 3.2 onwards.
I got it working after that post. Thanks for replying.
The plug-in worked fine but recently people are paying and the plugin does not enrolled them to the course
Many thanks, Jack
When I pay with paypal it redirect to the activity in moodle but it doesn't recognize the payment.
This is the error log.
500 POST /availability/condition/paypal/ipn.php PayPal IPN
Warning FastCGI sent in stderr: "PHP message: PHP Warning: require_once(/var/www/vhosts/moodle.prueba.edu/httpdocs/lib/eventslib.php): failed to open stream: No such file or directory in /var/www/vhosts/moodle.prueba.edu/httpdocs/availability/condition/paypal/ipn.php on line 36" while reading response header from upstream
Can anyone help me?
Thank you for your work inthis plugin.
I have a problem with the plugin. In my moodle site version 3.8 and Adaptabel theme.
I installed it, activated my IPN in my PayPal account and I use HTTPS .
But the restricted activity only show a green rectangule with the word "Restricted", when the cursor place over it, it show a massage as follows:
"Restricted, Not available at least you made a payment with PayPal"
And it do not have any link that show me the payment request.
Please let me know if I need to do anything more in order to have this plugin working.
I will appreciate your answer...
C. Olvera
I made available on github a new version that must be compatible with 3.6, 3.7 and 3.8
Can someone test and give feedback, please? If it works I'll publish here too.
https://github.com/danielneis/moodle-availability_paypal/