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 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. This plugin helps admins and webmasters use Stripe as the payment gateway.
434 sites
36 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. 


After years of not getting it just right, our excellent design and development team combined craft, care, love and experience to deliver two impeccable Moodle Themes i.e “Nalanda” and “University” , blend with a smooth and rich UI.

It was mostly our clients who inspired us for this venture. Their constant feedback and appreciation led us to build this for the countless Moodle lovers.

You can view the demo of Nalanda here: http://nalanda.dualcube.com/

** Much awaited Dark mode is coming with the new update.

You can view the demo of University here:


We also have a premium version of the MooWoodle plugin (https://wordpress.org/plugins/moowoodle/) on Dualcube with Single Sign-On feature.

This is to be installed in Moodle.

To get any of these products: https://dualcube.com/shop/

Thank you.


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

Show comments
  • Picture of Josick Guermeur
    Mon, Feb 3, 2020, 8:26 PM
    Quite sorry but something's wrong/
    I upgraded again to "enrol_stripepayment_moodle38_2020020300" and it doesn't work
    On sending payment (real, not sandbox) I have the same message as Mared "Something else happened, completely unrelated to Stripe"
    The payment is made on Stripe dashboard but the user is not registered on the bought course......
    I unistalled that version and came back to "enrol_stripepayment_moodle38_2019121201" of which you say in your documetation that it is SCA Complient.
    It works perfectly except that it doesn't ask for buyer's address.
    I think all this has nothing to do with Stipe, just your plugin.
  • Picture of Josick Guermeur
    Mon, Feb 3, 2020, 8:39 PM
    I think the coupon system is very likely to create the bug......I did not crate any coupon on Stripe dashboard
  • Picture of DualCube Team
    Mon, Feb 3, 2020, 9:43 PM
    Dear josick,
    Please check all the settings in accordance with documentation. And, please make sure that the currency selected on your stripe account is the same with the one on your moodle stripe payment plugin settings.
    We have tested with all the stable versions of Moodle and with different currencies. They all are working fine.
    Thank you.
  • Picture of Josick Guermeur
    Mon, Feb 3, 2020, 10:33 PM
    I'm using your plugin since nearly a year so I'm pretty familiar with the settings.
    Of course I am using the same currency all over.
    THE only interesting question is:
    Why does enrol_stripepayment_moodle38_2019121201works and enrol_stripepayment_moodle38_2020020300 bugs installed on the same moodle, on the same system.
    The only visible difference is the coupon thing on the latest one.
  • Picture of Sys Admin
    Mon, Feb 3, 2020, 11:33 PM

    We can confirm with others Josick and others.

    When someone try to purchase this error message is coming up "Exception - Argument 1 passed to message_send() must be an instance of core\message\message, instance of stdClass given, called in [dirroot]\enrol\stripepayment\charge.php on line 255"

    There is no spot for users to put their email address or home address in either.

    We are running Moodle 3.8.1 with default Boost Theme.

    Thank you.
  • Picture of Josick Guermeur
    Tue, Feb 4, 2020, 12:02 AM
    Exception - Argument 1 passed to message_send() must be an instance of core\message\message, instance of stdClass given, called in [dirroot]\enrol\stripepayment\charge.php on line 255
    Yes that is the message I had on Sunday 2 Today it has changed to what I just said before
  • Picture of Mared Washweshny
    Tue, Feb 4, 2020, 11:25 AM
    The update that was released today updated the UI to a more modern style with a logo, looks nice.

    However the issue still outstanding with the purchase not reflecting on the course enrollment

    On Moddle: Something else happened, completely unrelated to Stripe
    On Stripe: PaymentIntent status: succeeded

    Nothing has changed, the same settings, currency , keys and everything that used to work prior to updating to 3.0, this is mainly a bug in the code, I can collect any logs you want to be able to find root cause, I don't care for collecting addresses since I'm not physically shipping anything to the end user.

    Thanks again
  • Picture of Mared Washweshny
    Tue, Feb 4, 2020, 11:36 AM
    The coupon validator file have a weird issue as well, it's giving 404 error not found, I'm able to locate the file in that directory so I have no idea how this happened
    Request URL: https://MOODLEROOT/enrol/stripepayment/validate-coupon.php
    Request Method: POST
    Status Code: 404 Not Found

    Tested on both Chrome 79 and Edge. The apply coupon button doesn't show anything.
  • Picture of DualCube Team
    Tue, Feb 4, 2020, 5:31 PM
    Dear all,
    The message_send issue has been fixed. Please update your plugin to the latest version. Will be waiting for your feedback.
    Thank you.
  • Picture of Josick Guermeur
    Tue, Feb 4, 2020, 5:53 PM
    Downgrade from 3.0 after testing and having the result I described to 2.0 is not possible on Moodle
    So what I had to do twice is uninstall 3.0 then reinstall 2.0 which means that I have to remake stripe registration on the courses needing it.
    So I think I'll wait for other testers's advice.
  • Picture of Sys Admin
    Tue, Feb 4, 2020, 9:08 PM
    I just upgraded to the latest version. We too have had the same issue as Josick where you can't downgrade so we setup a dev site just to test this issue.

    With the latest update Release 3.0 (Build: 2020013100) we are getting the same error reported prior "Something else happened, completely unrelated to Stripe"
  • Picture of Mared Washweshny
    Wed, Feb 5, 2020, 8:44 AM
    I tested the update that was released today and still getting "Something else happened, completely unrelated to Stripe"

    Tried removing the enrollment method and re-adding, but no luck

    so from today's version testing those are the outstanding issues:
    1. Custom instance name not showing at all
    2. Payment doesn't go through and gives "Something else happened, completely unrelated to Stripe", the file giving the error at that point is charge.php
    3. If possible to change "Submit Payment" to "Send Payment via Stripe" to match Moodle native paypal plugin
    4. Coupon-validator file is not working, the browser console always showing 404 error when the file does exist and have same permissions, where do you even add coupons?

    On Stripe payment logs I see two events for every purchase, one status green and one that apparently failed as it says "incomplete"

  • Picture of Josick Guermeur
    Wed, Feb 5, 2020, 6:55 PM
    OK let's wait and see....
  • Picture of Mared Washweshny
    Fri, Feb 7, 2020, 7:26 AM
    The weird thing is I created a new test account and when testing the payment it does work with no problem. Not sure how but "Something else happened, completely unrelated to Stripe" does show only for existing users, new users payment works fine (Sandbox using in all cases)
  • Picture of DualCube Team
    Sat, Feb 8, 2020, 2:27 PM
    Dear Mared,

    We tested for both new and existing users and it works fine. Can you please explain more about what type of 'existing users' you are talking about? Or you can share your test site access to this mail id trideep@dualcube.com.

    Thank you.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Please login to post comments