The main scenario of this handler, on purchase validation, is to enrol the buyer in a course designated by the internal parameters. This enrolment can be done under a role to be defined, by default the standard Moodle Student role.
If a course intended for user support exists, a secondary enrolment in customer support can be triggered.
The enrolment can be configured with a duration. By default it is permanent. If the duration is defined and the product is “renewable”, it will be possible to extend the enrolment duration on the same product code.
The product must not be purchasable if the buyer already has an active enrolment in this course. This can only be checked in the logged-in state. If the product is accessible to the logged-out public, then the restriction cannot be tested for logged-out buyers.