This guide provides a step-by-step process for installing and configuring a Moodle 4 Stripe with variants, discounts and affiliation system. Follow the instructions carefully to ensure proper setup and functionality.
Stripe for Moodle is a powerful and flexible enrolment and blocks plugin for Moodle 4, designed to streamline payment processing, discount management and course customization. With a robust set of features, this plugin enables administrators to enhance their course offerings, manage complex pricing structures per in-course content and provide a seamless enrolment experience for users.
Stripe Payments Integration
Securely process payments with Stripe, supporting all payment methods enabled in your Stripe dashboard. Enjoy real-time payment management and reconciliation. Works also with Stripe's adaptive pricing.
Self-Hosted Discounts
Create and manage discounts directly within Moodle with ease. Apply discounts to specific courses, course variants, or individual users for maximum flexibility. Additionally, assign an affiliate user to each discount code for seamless tracking.
Affiliation System
Track affiliates who refer users to your courses using discount codes. Affiliate users can view their statistics and commissions directly on their dashboard (via a Moodle block). Administrators can access and display affiliation statistics for all users.
Course Variants
Offer multiple versions of the same course with different features, pricing, or enrolment options. Variants comparing boxes included. Display course content per variant.
Discount Variants
Customize discount structures based on courses, course variants, or users.
Course Bundles
Bundle multiple courses together with a single course variant enrolment, allowing you to offer value-packed deals to your users.
Multi-Currency Support
Enable users to pay in their preferred currency with dynamic currency selection.
Custom Currency Rates
Configure exchange rates by setting your own custom rates for greater control over pricing (as processing fees aren't always the same for all currencies).
Free and Paid Enrolment Options
Allow users to enrol in free or paid courses, accommodating diverse course offerings and payment models.
Before starting, ensure you have:
⚠️ Warning
Installation order is required as 2nd and 3rd extension depend on 1st.
After installation, configure the plugin to match your site's needs.
Field Name | Description |
---|---|
Test publishable key | Stripe publishable key for testing mode. Used to initialize Stripe in sandbox mode. |
Test secret key | Stripe secret key for testing mode. Enables secure communication with Stripe API in sandbox mode. |
Live publishable key | Stripe publishable key for production mode. Used to initialize Stripe in live mode. |
Live secret key | Stripe secret key for production mode. Enables secure communication with Stripe API in live mode. |
API mode | Determines whether the plugin operates in sandbox (test) or production mode. Default: Sandbox (test). |
Test admin users | A list of admin users who will always use sandbox mode (if chosen above), regardless of the global API mode setting. If left empty, all users follow the global API mode. |
Notify students | Enable notifications for students when specific events occur (e.g., successful enrolment). Default: No. |
Notify teachers | Enable notifications for teachers when specific events occur. Default: No. |
Notify admins | Enable notifications for admins when specific events occur. Default: Yes. |
Enable coupon section | Enable the use of coupon codes during enrolment. Default: No. |
"See prices" button style | Custom CSS classes for styling the "See prices" button. Default: class="btn btn-lg btn-warning text-white p-3 w-100" style="max-width:400px;" . |
Action on enrolment expiration | Defines what happens when a user's enrolment expires. Options include disabling enrolment and removing roles. Default: Disable course enrolment and remove roles. |
Webservice token | A unique token used for web services. Ensure the REST protocol is enabled and create a new token if needed. |
Field Name | Description |
---|---|
Enable enrolment | Allow this enrolment method to be enabled by default. Options: Yes/No. Default: No. |
Default role | Default role assigned to users enrolled through this method. Default: Student. |
Enrolment duration | Default length of time that the enrolment is valid. Enter 0 for unlimited duration. Default: None. |
Base currency | Default currency for transactions. Default: USD. |
Round exchanged prices | Rounds exchanged currency prices to the specified number of decimal places. Options: Zero, One, Two. Default: Two. |
Currencies | Select enabled currencies for transactions. These are available Stripe-supported currencies. Default: USD, AUD, CAD, EUR, GBP. |
XYZ to ZYX | Exchange rate for XYZ to ZYX. Appears after saving enabled currencies. |
Field Name | Description |
---|---|
"Ignis.Dev Stripe" section | |
Custom instance name | A custom name for the instance of the enrolment method. Just to identify it at admin side. |
Enable enrolment | Allows the enrolment method to be enabled or disabled for the instance. Options: Yes/No. Default: Yes. |
Base currency | The base currency used for prices in this instance. Default: GBP. |
Assign role | Role assigned to users upon enrolment. Default: Student. |
Max enrolments | Maximum number of users allowed to enrol via this method. Leave empty for unlimited. Default: Empty. |
Enrolment duration | Duration for which enrolment is valid. Enter 0 for unlimited. Default: 0. |
Enrolment start date | Optional start date for enrolment. Can be enabled and set manually. Default: Disabled. |
Enrolment end date | Optional end date for enrolment. Can be enabled and set manually. Default: Disabled. |
"Add variant" section | |
Variant name | |
Name | The display name of the variant. This will be shown to users as option during enrolment. |
Description | An optional description for the variant to provide additional details. Shown on compare boxes. |
Variant configuration | |
State | Enables or disables the variant. Options: On/Off. Default: On. |
Price | The cost associated with this variant. Leave blank for free enrolments. |
Payment type | Defines the payment model. Options: One-time payment or Subscription. Default: One-time payment. |
Assign role | The role to assign users enrolled via this variant. Default: Student. |
Max enrolments | The maximum number of users allowed to enrol using this variant. Leave blank for unlimited. |
Enrolment duration | Duration of enrolment for this variant. Enter 0 for unlimited. Default: 0 days. |
Enrol start | Optional start date for this enrolment variant. Can be enabled and set manually. Default: Disabled. |
Enrol end | Optional end date for this enrolment variant. Can be enabled and set manually. Default: Disabled. |
Bundle courses | Allows you to associate additional courses with this variant. Search and select courses to bundle. |
"Existing variants" section | |
Variant name | |
ID | A unique identifier for the variant. Generated automatically |
Name | The display name of the variant. Must be unique and is required. |
Description | A brief description of the variant. Optional but useful for providing additional context. Shown at compare boxes. |
Variant configuration | |
State | Enables or disables the variant. Options: On/Off. |
Price | The cost associated with this variant. Enter a numeric value. |
Payment type | Defines the payment model. Options: One-time payment or Subscription. |
Assign role | The role to assign users enrolled via this variant. Default: Student. |
Max enrolments | Maximum number of users allowed to enrol using this variant. Leave blank for unlimited. This field is being changed after each enrolment. |
Enrolment duration | Duration of enrolment for this variant. Enter 0 for unlimited. |
Enrol start | Optional start date for this enrolment variant. Can be enabled and set manually. Default: Disabled. |
Enrol end | Optional end date for this enrolment variant. Can be enabled and set manually. Default: Disabled. |
Bundle courses | Allows you to associate additional courses with this variant. Search and select courses to bundle. User will be enroled to boundled courses at once. Eeach bundled course must have configured "manual" enrolment method, because it's being used as enrolment. |
Sort | The position of this variant in the list of available variants and compare box. |
Delete variant | Deletes the variant permanently (after pressing save changes). This action is irreversible. |
<p>
{variantid:1}Any content for pourchased variant id 1{variantid}
{variantid:2}Any content for pourchased variant id 2{variantid}
{variantid:3}
Any content for pourchased variant id 3
{variantid}
</p>
Don't forget to press Save and return to course.
⚠️ Warning
Make sure that you placed your variantid tags inside your actual html elements (paragraphs, divs etc.), like in an example above, so showing/hiding content won't mess up your html structure.
⚠️ Warning
Syntax isn't processed for admin users, it will display untouched content if viewing user is site admin.
💡 Tip
To display custom text in a hidden content area, simply override thenotavailable
language string in thefilter_ignisdevvariant
translation settings. It can be for example "You don't have access to this content" text.
Field Name | Description |
---|---|
Add new discount | |
Discount code | |
Code | A unique code for the discount. Leave blank to generate a 6-character code automatically. |
Desc. | A description of the discount, providing additional context. Optional. |
Discount variants | |
"Add variant" button | Dynamically add discount details. Each variant includes: |
Value | The discount value (e.g., amount or percentage). Required. |
Course variant ID | The course variant ID to which this discount applies. Leave blank for all variants. Having other discount variant with course variant set doesn't exclude application of discount that doesn't have course variant set on that variant. |
Quantity | The number of times this discount can be used. Leave empty for unlimited. 0 means it can't be used anymore (quantity exceeded). This field is being changed automatically after user enrolment. |
Settings | |
State | Enable or disable the discount. Options: On/Off. |
Operator | Defines the type of discount. Options: Amount (flat value) or Percent (percentage-based). |
Base currency | The currency used for the discount calculation. |
Expires | Optional expiration date for the discount. Can be enabled and set manually. Default: Disabled. |
Courses | Specify courses to which the discount applies. Leave empty for all courses. |
Select users | Specify users to whom the discount applies. Leave empty for all users. |
Select affiliate user | Assign an affiliate user eligible for the discount. Default: None. |
Affiliate rate type | Define the affiliate reward type. Options: Flat or Percent. Default: Percent. |
Affiliate rate | The value of the affiliate reward based on the selected rate type. |
Existing discounts | |
Discount code | |
ID | A system-generated unique identifier for the discount. This field is read-only. |
Code | A unique code for the discount. This field is read-only and cannot be edited once generated. |
Desc. | A description of the discount, providing additional context. Optional. |
Discount variants | |
"Add variant" button | Dynamically add discount details. Each variant includes: |
Value | The discount value (e.g., amount or percentage). Required. |
Course variant ID | The course variant ID to which this discount applies. Leave blank for all variants. Having other discount variant with course variant set doesn't exclude application of discount that doesn't have course variant set on that variant. |
Quantity | The number of times this discount can be used. Leave empty for unlimited. 0 means it can't be used anymore (quantity exceeded). This field is being changed automatically after user enrolment. |
Settings | |
State | (Required) Enable or disable the discount. Options: On/Off. |
Operator | (Required) Defines the type of discount. Options: Amount (flat value) or Percent (percentage-based). |
Base currency | (Required) The currency used for the discount calculation. Default: GBP. |
Expires | Optional expiration date for the discount. Can be enabled and set manually. Default: Disabled. |
Courses | Specify courses to which the discount applies. Leave empty for all courses. |
Select users | Specify users to whom the discount applies. Leave empty for all users. |
Select affiliate user | Assign an affiliate user eligible for the discount. Default: None. |
Affiliate rate type | Define the affiliate reward type. Options: Flat or Percent. Default: Percent. |
Affiliate rate | The value of the affiliate reward based on the selected rate type. |
Delete discount | Deletes the discount permanently. This action is irreversible. Discount is being removed after pressing save changes button. |
For additional help related to these extensions, if you're our customer, reach out through our support ticket system at https://ignis.dev/support. For pre-sale questions use "Ask a question" button at https://ignis.dev/p/stripe-for-moodle-with-variants-discounts-and-affiliation
💡 Tip
Tables{enrol_ignisdevstripe}
and{ignisdev_discounts}
have additionalparams
(TEXT type) columns that can be used to hold your custom data.
💡 Tip
After succeful payment, user is redirected to course url with additional url parampurchased=1
.
💡 Tip
Any text can be translated to your language by customizing language pack as usual through Moodle admin panel.
💡 Tip
To add payment method image displayed below checkout form, simply upload 72x48 px image to:
enrol\ignisdevstripe\pix\payment-methods
directory. Images are displaying in alphabetical order (ascending).
13/01/2025 - 1.0.0 (2025011300)