Return the correct data to the backend.
This commit is contained in:
@@ -74,7 +74,7 @@ def create_order(request):
|
||||
if not verified_mode:
|
||||
return HttpResponseBadRequest(_("This course doesn't support verified certificates"))
|
||||
|
||||
if contribution < verified_mode.min_price:
|
||||
if int(contribution) < verified_mode.min_price:
|
||||
return HttpResponseBadRequest(_("No selected price or selected price is below minimum."))
|
||||
|
||||
# I know, we should check this is valid. All kinds of stuff missing here
|
||||
|
||||
@@ -19,10 +19,21 @@
|
||||
}
|
||||
|
||||
var submitToPaymentProcessing = function() {
|
||||
var contribution_input = $("input[name='contribution']:checked")
|
||||
var contribution = 0;
|
||||
if(contribution_input.attr('id') == 'contribution-other')
|
||||
{
|
||||
contribution = $("input[name='contribution-other-amt']").val();
|
||||
}
|
||||
else
|
||||
{
|
||||
contribution = contribution_input.val();
|
||||
}
|
||||
var xhr = $.post(
|
||||
"create_order",
|
||||
{
|
||||
"course_id" : "${course_id}"
|
||||
"course_id" : "${course_id}",
|
||||
"contribution": contribution
|
||||
},
|
||||
function(data) {
|
||||
for (prop in data) {
|
||||
|
||||
Reference in New Issue
Block a user