Return the correct data to the backend.

This commit is contained in:
Diana Huang
2013-08-28 17:06:52 -04:00
parent 4471079f71
commit 6c647d7630
2 changed files with 13 additions and 2 deletions

View File

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

View File

@@ -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) {