Enrolment: Stripe Payment with SCA and Coupon

Maintained by Picture of DualCube TeamDualCube Team
Now avail the much-awaited coupon functionality while enrolling students in Moodle courses using a Stripe payment gateway for paid courses with Strong customer authentication (SCA). Stripe Receipt sent to customers for any successful transaction. This plugin will help the admins and webmasters to offer their students a percent-off or amount-off discount for the paid courses. This plugin helps admins and webmasters use Stripe as the payment gateway.
745 sites
42 fans
Current versions available: 2

Stripe Payment: 

Introducing the newest offering from Team Dualcube: Stripe Payment!

Now avail the much-awaited coupon functionality while enrolling students in Moodle courses using Stripe payment gateway for paid courses with Strong customer authentication (SCA).

This plugin will help the admins and webmasters to offer their students a percent-off or amount-off discount for the paid courses.

Stripe Payment:

1. Registered users can login to the Moodle site and happily apply the promo codes for a discount before payment. On successful payment, they can access the course.

2. Admins and Webmasters, now, can create, manage and keep track of all promotional codes directly in their Stripe dashboard.

3. Strong customer authentication (SCA) implemented with 4 layers of complex security to comply with EU Revised Directive on Payment Services (PSD2) on payment service providers within the European Economic Area.

4. The first of it's kind to use Payment intent method for Stripe-coupon. 

5. Works with all stable versions of Moodle till v 3.8.1

6. Latest Stripe SDK

Stripe Payment Documentation:

This plugin has all the settings for development as well as for production usage. Its easy to install, set up and effective.

Creating Merchant Account :

1) Create account at https://stripe.com.

2) Complete your merchant profile details from https://dashboard.stripe.com/account.

3) Now set up secret key and publishers key at https://dashboard.stripe.com/account/apikeys.

4) For test mode use test api keys and for live mode use live api keys.

Now you are done with merchant account set up.

Installation Guidance : 

Login to your moodle site as an “admin user” and follow the steps.

1) Upload the zip package from Site administration > Plugins > Install plugins. Choose Plugin type 'Enrolment method (enrol)'. Upload the ZIP package, check the acknowledgement and install.

2) Go to Enrolments > Manage enrol plugins > Enable 'Stripe' from list

3) Click 'Settings' which will lead to the settings page of the plugin

4) Provide merchant credentials for Stripe. Note that, you will get all the details from your merchant account. Now select the checkbox as per requirement. Save the settings.

5) Select any course from course listing page.

6) Go to Course administration > Users > Enrolment methods > Add method 'Stripe' from the dropdown. Set 'Custom instance name', 'Enrol cost' etc and add the method.

Adding coupons:

Go to your Stripe Dashboard >  Billing > Coupons > Create a coupon.

Type in the coupon’s name: it can be anything and for your reference only.
Type in the Coupon’s ID : This is the Coupon code which your students will need to enter if they want to avail the discount.

Choose Coupon Type: 
1. Percentage discount : offers % off on the course price 
2. Fixed amount discount : Offers a fixed amount off on the course price.

Duration: For duration, when using the value repeating, also specify duration in months as the number of months for which the coupon should repeatedly apply. Otherwise the coupon can be set to apply only to a single invoice or to them all.

Redemption : The max_redemptions and redeem_by values apply to the coupon across every customer you have. For example, you can restrict a coupon to the first 50 customers that use it, or you can make a coupon expire by a certain date. If you do the latter, this only impacts when the coupon can be applied to a customer. If you set a coupon to last forever when used by a customer, but have it expire on January 1st, any customer given that coupon will have that coupon’s discount forever, but no new customers can apply the coupon after January 1st.

If a coupon has a max_redemptions value of 50, it can only be applied among all your customers a total of 50 times, although there’s nothing preventing a single customer from using it multiple times. (You can always use logic on your end to prevent that from occurring.)


This completes all the steps from the administrator end. Now registered users can login to the Moodle site and view the course after a successful payment of the discounted price. 


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4


Picture of DualCube Team
DualCube Team (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS


  • Picture of Abel Carreto
    Wed, Jan 4, 2017, 9:36 PM
    Hi, after lots of hours looking for a solution, it can be translated just inserting that string on enrol.html "data-panel-label="Pagar con tarjeta"
    Thanks anyway...
  • Picture of Carl Dennis
    Thu, Feb 2, 2017, 9:48 PM
    Really liking the idea of this plugin - will this be enabled for 3.2?
  • Picture of Antony Goodman
    Sat, Feb 4, 2017, 2:12 AM
    +1 for a 3.2 version please
  • Picture of DualCube Team
    Sat, Feb 11, 2017, 6:52 PM
    Yes, this will obviously be enabled for Moodle 3.2. Please stay tuned, we will be launching that in a few days at most.
  • Picture of Tarek Loubani
    Tue, Feb 14, 2017, 3:25 AM
    Thank you! I am installing a new system with 3.2 and will really enjoy this plugin too!
  • Picture of Mohamed Ali
    Sun, Mar 19, 2017, 7:39 PM
    Thank you for putting this together. I tested and it works very well. Is it possible to display the list of courses with each course having the buy button under it so when the students clicks pay, they are asked to create account and make payment inside. Right now it only shows S. to which many people may not know what it means.
  • Picture of Arindam Ghosh
    Mon, Mar 20, 2017, 8:25 PM
    @ Ali,

    Please go to /stripepayment/pix folder and rename icon.gif and paste your preferable button image and name it to icon with proper image extension like .png, .svg, ,jpg, .gif.
    after that please purge moodle cache and you will be able to see your own button.
  • Picture of Tarek Loubani
    Sat, Apr 1, 2017, 1:35 AM
    Hello all! Does this allow for refunds if people self-unenrol? If not, would the developers consider a bounty to add this feature along with a "penalty" cost for unenrolment?
  • Picture of DualCube Team
    Wed, Apr 5, 2017, 8:48 AM
    Hi @Tarek,
    Yes the refund module can be implemented with customization. Please let me now for further assistance.

    Thanks and Regards,
  • Picture of Mo Elhammamy
    Thu, Apr 6, 2017, 1:51 PM

    Any clue? the plugin is working on noodle 2.9 but when installed to my 3.1 when ever i process payment it takes me to a blank screen and display this message?

    Something else happend, completely unrelated to stripe
  • Picture of Joey Joey
    Fri, Apr 7, 2017, 1:07 AM
    My don't work moodle 3.2 , not appear stripe Enrolment methods
  • Picture of DualCube Team
    Sat, Apr 8, 2017, 1:35 PM
    @Mo Elhammamy

    >> Go to Dashboard / ► Site administration / ► Development / ► Debugging / ► Debug messages / ►select "DEVELOPER: extra Moodle debug messages for developers" and check the checkbox of "Display debug messages" / ► click "save changes" button.

    Please send us a screenshot where your error massage displayed during the process of payment.

    Thanks and Regards,
  • Picture of DualCube Team
    Sat, Apr 8, 2017, 1:38 PM

    >>Go to Dashboard / ► Site administration / ► Plugins / ► Enrolments / ► Manage enrol plugins / ►Enable "Stripe Payment" by clicking the eye icon and by clicking the "Settings" link, set up your plugin.

    After that go to Dashboard / ►"your course" / ► Users / ► Enrolment methods / ► Add method / ►choose "Stripe Payment" and configure as per your requirement.

    Please let me know if this solves your problem.

    Thanks and Regards,
  • Picture of Mo Elhammamy
    Wed, Apr 19, 2017, 8:11 AM
    @DualCube Team

    Thanks for your reply please I can upload the screenshot in this page, how can I send it to you?

    The error "Something else happened, completely unrelated to Stripe" apprears at the page http://dev.moodle.itfe.edu.au/enrol/stripepayment/charge.php is this helpful?
  • Picture of T JR
    Tue, Apr 25, 2017, 5:21 AM
    Hi Arindam, Excellent plug-in. Much better than the PayPal equivalent as it make the payment process so much less invasive. What I would like now would be an option for students to pay for individual elements within a course (such as the Availability conditions: PayPal plugin - https://moodle.org/plugins/availability_paypal) Do you have any plans for such an extension? Many thanks.
Please login to post comments