We use the Stripe as Payment Processor.
- Create an account or test account in Stripe, and get the api keys.
https://dashboard.stripe.com/test/dashboard
- Create ecommerce-config.yml
Fill in the details of the api keys. Keep the file secure.
stripe:
publishable_key: pk_test_XXXX
secret_key: sk_test_XXX
country: db
- Set up the payment processor in tutor.
tutor config save --set "ECOMMERCE_PAYMENT_PROCESSORS=$(cat ecommerce-config.yml)" \
--set 'ECOMMERCE_ENABLED_PAYMENT_PROCESSORS=["stripe"]' \
--set 'ECOMMERCE_ENABLED_CLIENT_SIDE_PAYMENT_PROCESSORS=["stripe"]'
tutor local init --limit=ecommerce
- Create Commerce Configuration in Django LMS Dashboard
In the django administration dashboard, section “Home › Commerce › Commerce configurations”
https://tutor.yoursite.com/admin/commerce/commerceconfiguration/
Add Commerce Configuration
Enabled: True
Checkout on ecommerce service: True
Basket checkout page: /basket/add/
Cache Time To Live: 360
Receipt page: /checkout/receipt/?order_number=
Enable automatic refund approval: True
- Create waffle flag in Django Ecommerce Dashboard
In the django administration dashboard, section “Home › django-waffle › Flags › enable_client_side_checkout”
https://ecommerce.tutor.yoursite.com/admin/waffle/flag/
Add:
Name: enable_client_side_checkout
Everyone: Yes
Superusers: True
Staff: True
Authenticated: True
Note: This flag determines if the integrated/client-side checkout flow should be enabled.
More info in: Stripe ecommerce checkout errors - #7 by Headhurts - Tutor - Overhang.IO
- Create a course in the E-Commerce Courses page
Get the course key from the LMS by navigating to a course and examining its URL. The course key should look something like course-v1:edX+DemoX+Demo_Course.
Navigate to the E-Commerce Courses page (https://ecommerce.tutor.yoursite.com/courses/) to add the two test courses that are on your LMS instance to E-Commerce. Configure one course as a “Verified” course.
e.g.: https://ecommerce.tutor.yoursite.com/courses/course-v1:edX+DemoX+Demo_Course
Check different types of enrollment tracks in the documentation resources below.
- Enroll in a Paid Course in the LMS
e.g.: With a student account, go to the configured paid course:
https://tutor.yoursite.com/courses/course-v1:edX+DemoX+Demo_Course/about
and click on “Enroll Now”
That will redirect to the ecommerce module in: https://ecommerce.tutor.yoursite.com/basket/
- Use a test card to complete the checkout.
Get a Test Card from: https://stripe.com/docs/testing#cards
- Check the Ecommerce Dashboard to get an overview of the payments:
With an administrator account go to:
https://ecommerce.tutor.yoursite.com/dashboard/
- Check the status of the payments in the stripe dashboard:
https://dashboard.stripe.com/test/payments?status[]=successful
Documentation used to configure the ecommerce module
PD:
Tutor has his own discuss instance: discuss.overhang.io