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
767 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

  • CPDO Clock
    Sat, Feb 20, 2016, 2:10 AM
    The customer's first and last name should also be visible on both the confirmation emails and the transaction record on the dashboard but currently only the email shows. Is there an easy way to change this? Also, in spite of the course name showing in the payment window, the stripe report still shows "Charge for Enrollment Cost" under payments. Is there a way for this course name to show in the transaction record on the Stripe Dashboard?
  • Picture of Eric Smoyer
    Sat, Apr 2, 2016, 12:15 AM
    No matter what I try, when I go to add Stripe Payment to the Course Enrollment Method, it returns a "Page not Found" error. Any insight to this? I have tried searching around and am not able to find much about it. I am on the latest Moodle 3.0. (Posted in GitHub issues as well) Thanks for any advice!
  • Picture of Jesús Romero
    Sun, May 29, 2016, 7:34 PM
    It would be great a new version for Moodle 3.1.

    this plugin looks fine because payments commisions are better than PayPal... but i cannot join because i use Moodle 3.1...
  • Picture of Jesús Romero
    Sun, May 29, 2016, 8:35 PM
    And i have another question... is it necesary that client has a stripe account or client can use his credit card without stripe account and without make a new stripe account?

    Im really impatient to get Moodle 3.1 versión of this plugin...
  • Picture of Mitchell Kellett
    Tue, May 31, 2016, 7:15 PM
    Heya,

    I modified charge.php line 116 to "<?php p($courseshortname) ?> - <?php p($coursefullname) ?>" so that it would push the course name to stripe for the receipt. Instead of the course name I now get "<?php p() ?> - <?php p() ?>". Do you guys have an idea how I can make it pass the short name and then course name onto stripe?

    Cheers
  • Picture of Mitchell Kellett
    Tue, May 31, 2016, 7:24 PM
    Also is there a way to include the email in the data sent to stripe? I would like stripe to email the receipt automatically.
  • CPDO Clock
    Wed, Jun 1, 2016, 12:44 AM
    Dual Cube offered the following code To help with much of this. The course>fullname code shows in Stripe with the period and space or ". " then " ." at the other end. I'm not sure if they're necessary.

    in charge.php use this for course name in Stripe Dashboard:
    "description" => ". $course->fullname ."

    Also this to show the course name in the payment wondow:
    "Charge for". $course->fullname ."Enrolment Cost".$cost

    Use this to customise your payment window with your logo: <?php p($PAGE->theme->setting_file_url('logo', 'logo')) ?>

    The only thing keeping me from my true love of this plugin is the need to manually send receipts for every charge when asked because the request isn't included in the code. I found the "receipt_email" code in the Stripe documentation but this code doesn't appear in either charge.php or enrol.html

    Stripe suggested (in charge.php):
    "description" => $course->fullname,
    "receipt_email" => $user_email // replace with your variable
    ));

    The last line is the last piece of this puzzle.
  • Picture of Mitchell Kellett
    Wed, Jun 1, 2016, 12:34 PM
    Hey Sean, Tha ks for getting back to me I read the comments from them as my starting point. And I tried to pass the email through the billing address as well with no success. Will give your solution a go and see how that works.

    Cheers
  • Picture of DualCube Team
    Thu, Jul 21, 2016, 3:09 PM
    @ Eric Please change permissions all folders as 755 and files as 644. Let me know if that works.
  • Picture of DualCube Team
    Thu, Jul 21, 2016, 3:10 PM
    @Romero This plugin working is fine in moodle 3.1.
    Please check permissions all folders and files.

    Your point: And i have another question... is it necesary that client has a stripe account or client can use his credit card without stripe account and without make a new stripe account?

    >> No it is not necessary.
    But in case of admin of moodle site it is necessary.
  • Picture of Lisa Walker
    Fri, Aug 26, 2016, 5:53 PM
    Hi
    Thanks so much for this plugin - it's a much nicer interface for the user than other payment plugins that I've explored. I'm now looking at using it for users to book places on face-to-face sessions with a limited number of seats. For future releases it would be really useful to have a maximum enrolment limit, in the same way as can be set in the self enrolment option. Are there any plans for this? Brilliant plugin - but that would be the icing on the cake smile
  • Picture of DualCube Team
    Sat, Aug 27, 2016, 6:24 PM
    Hello Lisa,

    Thanks for your nice words! Really appreciate the enthusiasm you promoted to the team smile. We will surely try to implement this feature in the very next update.

    Thanks and Regards,
    Arindam
  • Picture of DualCube Team
    Mon, Aug 29, 2016, 4:40 PM
    Hello,

    We have updated the plugin with this feature available now. Please download the latest version and let me know .
  • Picture of Lisa Walker
    Mon, Sep 5, 2016, 5:43 PM
    Hi Arindam.
    Thanks for making this update so quickly. Apologies for taking so long to feed back - some unrelated issues with my Moodle site were preventing me from testing the plugin properly. I've now been able to test it and all seems to be working exactly as expected. This has solved a hugely frustrating issue for me, so thank you again!
    Lisa
  • Picture of Pete Potter
    Fri, Sep 9, 2016, 7:53 PM
    Ive installed this and set it up on Moodle 3.0. I've tested this using the test keys and live key. The payment looks to be successful as I see a green tick, but the next page load is a white screen with
    "Authentication with Stripe's API failed"

    I'm not sure what causes this?

    Thanks
    Pete
Please login to post comments