Commit 6c647d76 by Diana Huang

Return the correct data to the backend.

parent 4471079f
...@@ -74,7 +74,7 @@ def create_order(request): ...@@ -74,7 +74,7 @@ def create_order(request):
if not verified_mode: if not verified_mode:
return HttpResponseBadRequest(_("This course doesn't support verified certificates")) 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.")) 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 # I know, we should check this is valid. All kinds of stuff missing here
......
...@@ -19,10 +19,21 @@ ...@@ -19,10 +19,21 @@
} }
var submitToPaymentProcessing = function() { 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( var xhr = $.post(
"create_order", "create_order",
{ {
"course_id" : "${course_id}" "course_id" : "${course_id}",
"contribution": contribution
}, },
function(data) { function(data) {
for (prop in data) { for (prop in 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