Commit 935323a8 by Clinton Blackburn Committed by Clinton Blackburn

Enrolling via E-Commerce API for combined login-registration page

The login-registration page now supports using the E-Commerce API when enrolling users in honor seats (of courses with SKUs).
parent eaa7a220
......@@ -5,7 +5,7 @@ define(['js/common_helpers/ajax_helpers', 'js/student_account/enrollment'],
describe( 'edx.student.account.EnrollmentInterface', function() {
var COURSE_KEY = 'edX/DemoX/Fall',
ENROLL_URL = '/api/enrollment/v1/enrollment',
ENROLL_URL = '/commerce/orders/',
FORWARD_URL = '/course_modes/choose/edX/DemoX/Fall/',
EMBARGO_MSG_URL = '/embargo/blocked-message/enrollment/default/';
......@@ -26,7 +26,7 @@ define(['js/common_helpers/ajax_helpers', 'js/student_account/enrollment'],
requests,
'POST',
ENROLL_URL,
'{"course_details":{"course_id":"edX/DemoX/Fall"}}'
'{"course_id":"edX/DemoX/Fall"}'
);
// Simulate a successful response from the server
......
......@@ -9,7 +9,7 @@ var edx = edx || {};
edx.student.account.EnrollmentInterface = {
urls: {
enrollment: '/api/enrollment/v1/enrollment',
orders: '/commerce/orders/',
trackSelection: '/course_modes/choose/'
},
......@@ -23,14 +23,11 @@ var edx = edx || {};
* @param {string} courseKey Slash-separated course key.
*/
enroll: function( courseKey ) {
var data_obj = {
course_details: {
course_id: courseKey
}
};
var data = JSON.stringify(data_obj);
var data_obj = {course_id: courseKey},
data = JSON.stringify(data_obj);
$.ajax({
url: this.urls.enrollment,
url: this.urls.orders,
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: data,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment