Wallet Enrolment (coupons, payments and all needed restrictions)

Enrolment ::: enrol_wallet
Maintained by Mohammad Farouk
ALL IN ONE ENROLMENT PLUGIN. This enrollment method allow users to enrol themselves into courses using wallet credit. (manual charging wallet, charging by payment, coupons, discounts, cashback, awards, referrals, woocommerce connection, other course enrol restrictions, cohort restrictions, use availability condition plugins for restrictions and more). It simply provide your moodle site with ecommerce solution to sell courses and control the price.
Latest release:
58 sites
127 downloads
13 fans
Current versions available: 1

Wallet Enrollment

by Mo. Farouk

This plugin adds a wallet system to moodle, and users can enrol to courses using their credit.

What is wallet?
Wallet is where the users had funds in the moodle website, this wallet can be charged manually by admins, managers or any user with the capability enrol/wallet:creditdebit, Also it could be charged by the user himself using available payment gateways.

What the user do with this balance?
Users could pay for courses to get enrol, pay for course modules or sections restricted by availability_wallet to get access or pay a subscription fee to join the website using auth_wallet.

Wallet Enrollment:
This enrollment method allow the user to enrol themselves into courses using wallet credit or using payments gateways in addition to using coupons for direct enrollment, charging wallet or get discounts.

Admin can define either to totally use moodle for the wallet system and coupons, or use an existence Tera wallet (in a woocommerce).

So there is two options:
  1. Using Moodle as source for wallet: this allow all transaction to done internally on moodle site including the balance and coupon data.
  2. Using wordpress with woocommerce and Treawallet as wallet source: now you use the futures of woocommerce including coupons and wallet balance, also it creates users in wordpress automatically with the same email.

choose the source of the wallet

 Features :


1- Enrollment using wallet balance.
  • Manager creates a course and decide the cost for it.
  • Users can enrol themselves with their credit and the cost deducted from their wallets.

enrol using wallet

discount coupon applied

2- Charging wallet by manager (or users with capability) for other users.
  • By default site managers has the capability to add or deduct from a user's wallet balance.
  • Admin can change these capability "enrol/wallet:creditdebit" or grant it to any role.

charging other users

3- Topping up wallet by users using coupons or payments gateways.
  • Users can charge their wallets by themselves using payments gateways available.
  • Also can use fixed value coupons to do that.
  • Users can review their balance from profile page and topping up their wallets.

ballance informations in profile

4- Direct enrol using coupons or payment gateways.
  • In addition to enrol using wallet credit, user's can be direct enrol themselves using a coupon code it is a 100% discount or fixed with value greater than the course cost.
  • If the coupon with fixed value greater than the course cost, the remaining value will be added to the user's balance.
  • Also if there is payment gateway enabled they can enrol to the course by direct payment.
  • If the user already have a balance for example 20 USD, and the course cost 100 USD, so he will have to pay only 80 to get enrolled and the 20 will be deducted from his balance.

In case of insufficient balance user can charge the wallet by payment gateways or coupons

5- Cashback student when purchase a course (optional).
  • Admin can enable a cashback program, so when a user pay for a course, a percentage amount from what he paid will be return to his wallet.

cashback program

6- Awarding students in a given course if they completed the course with high mark (optional).
  • Encourage your students by awarding them for completing a course.
  • In each course, the course creator can enable awarding program with a certain condition and amount.
  • For example set the condition for 80, means that only students completed the course with 80% or more of the fullmark of the course will get awarded.
  • Setting up the value for 0.2 USD for awarding means that for every raw mark the student get above the condition will add 0.2 to his wallet (student grade is 900 out of max grade for the course 1000, this is a 100 grade above the condition, so 20 USD award added to his wallet).

Awards program

7- Referral Program.
  • You can enable referral program in the website.
  • Users can send their referral code or url to new user and both gets a referral gift.
  • Referral gift is in hold state until the new user get enrolled in at least one course.
  • Admin can choose what is the enrolment method able to release the hold gift.
  • Times users can use their referral code can be limited by a maximum value.

Referral settings Referral page

8- Generate coupons with limiting the usage, and time.
  • If you use moodle as a wallet source, you can add a coupon manually or generate any number you need of coupons.
  • Coupons could be of type fixed of percent.
  • Determine the interval of time at which the coupon could be used or just anytime.
  • Determine the maximum usage for each coupon.
  • Only users with capability "enrol/wallet:createcoupon" could generate coupons and with "enrol/wallet:deletecoupon" can delete coupons.
  • Editing coupons is not an option now but I'll try to add it in the future.
  • You can choose the length of random coupon, the type of characters in the generated random coupon (lowercase, uppercase and digits).

generate random coupons 

view coupons

9- Admin can switch to use woocommerce Tera wallet and woocommerce coupons.
  • If you use woocommerce as a wallet source, so you can't use moodle coupons.
  • Instate you use woocommerce coupons so you can generate and create it their.
10- Cohorts restrictions.
  • In each enrol_wallet instance, course creator can decide if only users in a certain course can enrol (using any of previous methods) or not.
11- Another course enrollment restriction.
  • Course creator can decide to restrict using wallet enrollment so only users enrolled in a set of other selected courses can enrol themselves in this course.
  • Also the creator can select a set of 10 courses in example, and set number of of required courses 5 for example, so the user must be enrolled at least in five courses from the 10 selected.

Cohorts and courses restriction

12- Configure self-unenrol option.
  • Enable or disable the ability for users to unenrol themselves.
  • Can enable with period condition.

self Unenrol

13- Display the transactions of wallet.
  • Users with capability "enrol/wallet:transactions" can see all wallet transaction can review any transaction in the website.
  • Other user can see only their own transactions.
  • Using Wallet Balance block plugin to allow users to see their balance anywhere and recharge it by payment.

wallet transactions

14 - Optional ability to transfer credit between users.
  • Admin can enable the option for users to transfer credit to each other by email.
  • The capability enrol/wallet:transfer is set to all users by default, can be altered by admin.
  • A transfer fee can be set.
  • Admin can configure if the fee deducted from the sender balance or from the receiver balance.

Admin settings:


Transfer form:

Transfer form

15- Bulk edit all enrolments in selected courses.
  • Their is an option for admins to edit all users enrollments in selected courses in bulk from a central place.

bulk edit all enrollments in selected courses

16- Bulk edit all wallet enrolment instances in selected courses.
  • Admins can edit all wallet enrolment instances in all or selected courses from a central place.

Bulk edit all wallet enrol instances in selected courses

17- Enable gifts as wallet credits upon creation of a user.
  • From settings, admins can enable new user gift program.
  • This gives new users a balance in their wallet as a gift for joining the website.

gifts for new users

18- Discounts on courses for specific users depend on custom profile field.
  • Want to give certain student a discount 50%?
  • Or another student want to give him courses for free?
  • If yes, create a custom profile field and make it locked, also invisible if needed.
  • In wallet enrolment setting, select this field as a discount field.
  • Users with 20 in this field will get 20% discount in all courses.
  • Users with 100 or 'free' in this field will get courses for free.

discounts according to profile field

19- Conditional discounts.

  • In the latest version a conditional discount rules added.
  • Admin can enable or disable conditional discounts.
  • Conditional discount applied for charging the wallet only.
  • Add a rule which is an amount for charging wallet, if the user charge their wallet with a value exceed the rule, the discount applied.
  • Decide the percentage amount for this discount.

conditional discount settings

  • Discount appear on confirmation when user top-up their wallet using payment along with the refund policy (if admin left it blank nothing appears).

discount appear in confirmation

  • Also discount appear to users with capability 'creditdebit' as a final calculated value when they try to recharge other user wallet.

Final value during charging

20- Manual refunding and Policy.

  • Admins can customize a refunding policy to display it to users.
  • Users can see how much of their wallet balance is refundable.
  • All gifts, cashback, credit from discount and awards are not refundable.
  • Admin can set a grace time period for refunding, after this time is over the balance turn to be nonrefundable (14 days by default).
  • Setting grace period to 0 means that is no grace period and no transformations for the balance.
  • If Admin unchecked 'enable refund' so all balance now on will be nonrefundable.

refunding policy

21 - Auto refund upon unenrol.
  • Enable or disable refunding users by unenrol.
  • Conditions like grace period could be configured.
  • Unenrol deduction fee can be configured.

refund upon unenrol

22 - Notifications for every transaction.
  • Users gets a notifications for every debit or credit type of transaction in their wallet.
  • Admins can change the way users get notify from messages setting.

23 - Low balance notice.
  • Display a warning notice to the user in case of low balance.

low balance notice

  • This is optional and admin can decide the minimum balance to call it a low balance.

low balance notice settings

24 - Events.

  • Almost any action in this plugin triggers its own event.
  • Transactions events: with every credit or debit action to users wallet.
  • Using coupon: if a coupon used it triggers its own event.
  • Cashback: if a user receive a cashback.
  • Award: If a user get a high mark in a course and receive award for it.
  • Gift: If a new user get gifted.
  • These events helps administrators or managers to track the wallet workflow.

25 - Enhanced security.

  • In the latest version, connection to wordpress is secure using encrypted data.
  • Also using shared secret key which the admin must match those in moodle and wordpress in order for secure connection.

26 - Login and logout to wordpress.

  • When a user login or logout from moodle website, automatically logged in or out from wordpress website.
  • Admin can disable this option of course.

wordpress connection settings

27 - Auto create wordpress user.
  • only active if the wallet source is wordpress.
  • Creating new user in wordpress website with same username and password.
  • Update the password automatically when updated in moodle.
  • Updating another user data not available yet in current version.
28 - (NEW) Availability Restrictions.
  • Availability Conditions plugins meant to be used for restrict sections of course modules only, but now using enrol wallet some of them could be used to restrict enrollment by wallet balance, coupons or payments.
  • Tested with profile, grade, activity completion, date and another course completion plugins.
  • Not support group, grouping, any payment plugins.
  • Other plugins may work and maybe not according to their logic, don't hesitate to contact me for any help about this future. 
  • Admin settings:

admin settings for availability conditions.

  • Instance form:

Instance edit form

  • User view:

User view of conditions.


Wallet block (block_wallet)


Also you can install block_wallet to display the balance for the user.

In addition the block give the ability for users to top-up their wallet using fixed value coupon or using payment gateways.
And a link to see their wallet transaction history.

And for managers it allow them to credit or debit any user.

Restriction by wallet payment (availablity_wallet)

Restrict access to course modules and sections by payment with wallet balance.

Signup with wallet balance confirmation (auth_wallet)

Add a condition for joining the web site by payment or minimum wallet balance in the user's wallet to join and use the website.

Moo-Wallet


If you welling to use existence Tera-wallet in woocommerce, you can download a wordpress plugin (moo-wallet) from here:

This wordpress lite plugin connects enrol_wallet plugin in moodle with wordpress site.
Install it in wordpress and enable it.
Make sure that you have Tera wallet plugin in wordpress.
Now you can use woocommerce coupons and tera wallet, users can chargr their wallets from woocommerce or from moodle.

 Installing via uploaded ZIP file 

1. Log in to your Moodle site as an admin and go to _Site administration >
   Plugins > Install plugins_.
2. Upload the ZIP file with the plugin code. You should only be prompted to add
   extra details if your plugin type is not automatically detected.
3. Check the plugin validation report and finish the installation.

Installing manually

The plugin can be also installed by putting the contents of this directory to

    {your/moodle/dirroot}/enrol/wallet

Afterwards, log in to your Moodle site as an admin and go to _Site administration >
Notifications_ to complete the installation.

Alternatively, you can run

    $ php admin/cli/upgrade.php

to complete the installation from the command line.

License

2023 Mohammad Farouk <phun.for.physics@gmail.com>

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program.  If not, see <https://www.gnu.org/licenses/>;.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7
Screenshot #8
Screenshot #9

Contributors

Mohammad Farouk (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Hoda Farazandeh
    Mon, 27 Nov 2023, 4:22 PM
    Hello Mohammad and thank you for this amazing plugins, it's what we've been looking for.
    We're using moodle 3.10 and when we're trying to add wallet balance block or go to wallet transaction or charger we get this error:

    Class 'core_user\fields' not found

    Can you please help us resolve this problem?
  • Mohammad Farouk
    Mon, 27 Nov 2023, 11:17 PM
    Hello Hoda, I'll consider this issue in the next update
  • Hoda Farazandeh
    Wed, 29 Nov 2023, 2:10 PM
    Thank you Mohammad
    Regards,
  • Mohammad Farouk
    Thu, 30 Nov 2023, 5:34 AM
    Hello Hoda, the problem should be solved in the new version.
  • Ahmed Tim
    Sat, 3 Feb 2024, 6:45 PM
    Thank you, Mohammad. It is an amazing plugin. I have a question. Can we make the wallet for a system using points/coins instead of currency with a calculation formula in the background? For instance, buy 1000 points would cost 15usd and buying 2000 points would cost 20usd. We also should display the wallet and use availability for points and not the currency? Thank you again! Keep up the great work.
  • Mohammad Farouk
    Mon, 5 Feb 2024, 2:30 AM
    Hello Ahmed, I was thinking about that to, and sure I'll try to work on it as soon as possible.
  • johan verweij
    Mon, 4 Mar 2024, 11:14 PM
    hello mohammad we really love this plugin, but i was wondering, is it possible for students to top-up the wallet with stripe payments? we really need that function ;)
  • Mohammad Farouk
    Wed, 6 Mar 2024, 11:29 PM
    Hello johan
    It is okay to use any payment gateway plugin
    here is one for stripe already founded on plugin database
    https://moodle.org/plugins/paygw_stripe
  • johan verweij
    Mon, 18 Mar 2024, 3:42 AM
    hello mohammad i´ve found the stripe payment... but i found a little thing that doesn´t work... on the startpage i got offers.... and when i click on it... it will show cashback and referral program ... but when i click more (for more information.... it won´t load the referral page and goes back to the startpage.. is this normal?

    also i wanted to ask, if it is possible, when users do an topup to they´re wallet... that i can make a bunck off deals or something...
    for example: when a user does an topup with 30 euro´s they get 3 euro (or something) free from us.... hopefully you´ll understand what i mean ;)

    great plugin and a lot of my students are already using this great plugin ;)
  • Mohammad Farouk
    Tue, 26 Mar 2024, 11:56 AM
    Hello johan
    First: I'll check this bug in more link for referral page
    Second: Yes there is a conditional discount for topping up, you can set them up from the setting page
  • johan verweij
    Mon, 1 Apr 2024, 8:19 PM
    sorry mohammed there is realy something wrong with the referral page... it doesn´t open and it brings me back to the startpage.... do you know what is wrong?
  • johan verweij
    Mon, 1 Apr 2024, 8:21 PM
    you can check it on our college ;) https://school.paranormaal-netwerk.nl/
  • Mohammad Farouk
    Sun, 14 Apr 2024, 6:02 AM
    Hello Johan
    I think this is because referral program is disabled from settings. try to enable it from enrol wallet admin settings page.
  • chyntori Tori
    Mon, 15 Apr 2024, 1:34 PM
    Hi, I am getting error writing to database when purchasing a course with credits.
    I tested with two accounts and one always get the course and the other always get the error. The credits get substracted while didn't get enrolled. Please help.
  • Mohammad Farouk
    Tue, 16 Apr 2024, 5:47 AM
    Hello chyntori, please add an issue in https://github.com/fmido88/moodle-enrol_wallet/issues
    Provide steps, version on plugin and moodle also screenshot of the error messages with enabled debugging messages
1 2
Please login to post comments