- You'll need a Moodle installation that is visible on the internet. See https://ngrok.com/.
- You'll also need to have a PayPal developer account and set up Sandbox accounts (at least 1 facilitator/business and 1 buyer account). For more information, see https://developer.paypal.com/developer/accounts/
- Optional: Set up Moodle SMTP settings.
- Set $CFG->usepaypalsandbox = true; in your config.php to use sandbox account for testing.
- As admin go to Site administration > plugins > Enrolments > Manage enrol plugins
- Enable PayPal enrolment methods
- Set "Paypal business email" to PayPal facilitator sandbox account. (Site administration ► Plugins ► Enrolments ► PayPal)
- Go to an existing course (c1) and navigate to Enrolment methods (Course administration ► Users ►Enrolment methods)
- Set Add method to "PayPal" and set "Enrol cost" to 1
- Log in as a student and click on the course, then the "Send payment via PayPal" button
- Confirm payment and click on the link to go back to your Moodle site.
- Ensure you are enrolled in the course
- Backup course and restore it as a new course
- New paypal enrolment method should be created.