Enrolment: Stripe Payment with SCA and Coupon

enrol_stripepayment
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.
559 sites
811 downloads
39 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. 


Screenshots

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

Contributors

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

Comments RSS

Comments

  • Picture of DualCube Team
    Mon, Jun 11, 2018, 5:27 PM
    Hi!! Diane,
    Thanks for the importance that you have given to our plugin. We will update those in our next update.
    Thank you.
  • Picture of Diane Villemure
    Tue, Jun 12, 2018, 3:04 AM

    In the enrol.html file, input variable "no_shipping" is set to 1 ( . No matter what value I change the 1 to (true, false, 2, 0) it doesn't trigger the shipping address in the Stripe checkout form. I have to add the parameter "data-shipping-address" in the "script" tag of enrol.html. Since I do not want to force user to enter their billing address but do need their shipping address for those courses where materials need to be sent, I coded the shipping parameter to read: data-shipping-address="?php if ($course->id == "16" or $course->id == "18" or ... etc) { echo 'true'; } else { echo 'false'; } ?" My question is, what does the hidden input variable no_shipping do when passed to charge.php?
  • Picture of DualCube Team
    Thu, Jun 14, 2018, 6:04 PM
    Hi!! Diane,
    no_shipping is not being used right now. We have kept it as a hook if someone saves something shipping related in the database.
    Thank you.
  • Picture of Cova Pardo
    Fri, Jun 15, 2018, 11:36 PM
    Hi, I'm trying to set up a one-off payment for an online course. When I tried doing that from my Stripe account I only had the choice to set up a payment plan. I contacted Stripe support and I was told is not possible to have one-off payments with Stripe, is that right? Thanks
  • Picture of Raymond Frangie
    Mon, Jul 9, 2018, 9:07 AM
    Hi Team,

    I'm getting the same error as Noctis above - simply installing by clicking Install Now on this page:

    Upgrading to new version
    enrol_stripepayment

    XML database file errors found

    More information about this error
    Debug info: Errors found in XMLDB file: PATH attribute does not match file directory: enrol/stripepayment/db
    Error code: ddlxmlfileerror
    Stack trace:

    line 352 of /lib/ddl/database_manager.php: ddl_exception thrown
    line 368 of /lib/ddl/database_manager.php: call to database_manager->load_xmldb_file()
    line 594 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
    line 1857 of /lib/upgradelib.php: call to upgrade_plugins()
    line 694 of /admin/index.php: call to upgrade_noncore()


    This is a local install of 3.5.x - Please advise fix...

    Cheers,
    Ray.
  • Picture of DualCube Team
    Tue, Jul 10, 2018, 9:42 PM
    Dear Raymond,

    Thanks for reaching out to us. We have updated the plugin. Please use the latest plugin from here.
    Thanks.
  • Picture of Anne Laure Guin alg
    Sun, Jul 22, 2018, 12:19 AM
    Hello,

    thank you for this plugin. I have installed the plugin and set up my Stripe account

    I have tried to pay on my moodle website and once the transaction has been done, a blank webpage appears with the following message:

    Network communication with Stripe failed

    But if I check on Stripe dashboard, it is written that the request is successful.

    Can you please help me find out what is wrong?
    Thank you

    Anne-Laure
  • Picture of DualCube Team
    Mon, Jul 23, 2018, 1:41 PM
    Dear Anne,
    Thanks for reaching out to us. Please turn on debugging on your Moodle site (Site Administration> Development> Debug) and see if there are any error notices. If there is any, please let us know. You can also send a screenshot at admin@dualcube.com
    Thank you.

  • Picture of wl chong
    Sun, Oct 21, 2018, 5:22 PM
    Hi, I got the following error on the moodle v3.5.2 using the latest plugin.

    enrol_stripepayment
    XML database file errors found

    More information about this error
    Debug info: Errors found in XMLDB file: PATH attribute does not match file directory: enrol/stripepayment/db
    Error code: ddlxmlfileerror
    Stack trace:
    line 352 of /lib/ddl/database_manager.php: ddl_exception thrown
    line 368 of /lib/ddl/database_manager.php: call to database_manager->load_xmldb_file()
    line 594 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
    line 1857 of /lib/upgradelib.php: call to upgrade_plugins()
    line 694 of /admin/index.php: call to upgrade_noncore()
  • Picture of ruthvik reddy
    Sat, Nov 3, 2018, 3:46 AM
    i am getting permission error when i am installing stripe from moodle directory.
    Message is (/error /local plugins /exc permission denied) .please help.
  • Picture of DualCube Team
    Mon, Nov 5, 2018, 2:32 PM
    Dear Ruthvik.

    Please change them to the right permission. The directory where, the plugin is , should have a permission of value 755 and the file permission should be 644.

    Thank you.
  • Picture of Robert Vogel
    Fri, Jan 4, 2019, 10:38 PM
    Hello Team,
    I am using Moodle 3.6 and get an http 500 error POST /enrol/stripepayment/charge.php HTTP/1.0
    Permissive is set to 755 for the directory and 644 for the files.
    Form to enter the credit card credentials came up, I got a green mark and the the error.
    User is not enrolled, transaction is not performed.
    Perhaps you have an idea.
    Best regards
    Robert
  • Picture of DualCube Team
    Mon, Jan 7, 2019, 8:38 PM
    Dear Robert,

    We have just uploaded a new version which is Moodle 3.6 compatible. Please download and install the new version.
    Thank you.
  • Picture of Robert Vogel
    Tue, Jan 8, 2019, 1:39 AM
    Hello Team,
    That was fast, thanks a lot. I tested a second ago and got the following error message:
    Fehler: 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 237
    Any ideas?
    Thanks for your feedback
    Regards
    Robert
Please login to post comments