Commit 2653f0ad by Clinton Blackburn

Fixed credit form submission bug

Firefox requires the form to be attached to a DOM element

ECOM-2492
parent 7427d82c
......@@ -23,6 +23,7 @@ var edx = edx || {};
context: this,
success: function (requestData) {
var $form = $('<form>', {
'class': 'hidden',
'action': requestData.url,
'method': 'POST',
'accept-method': 'UTF-8'
......@@ -35,7 +36,7 @@ var edx = edx || {};
}).appendTo($form);
});
$form.submit();
$form.appendTo('body').submit();
}
});
};
......
......@@ -288,6 +288,8 @@ function completeOrder(event) { // jshint ignore:line
providerId = $(event).data("provider"),
$errorContainer = $("#error-container");
event.preventDefault();
analytics.track(
"edx.bi.credit.clicked_complete_credit",
{
......
......@@ -36,6 +36,8 @@ var edx = edx || {};
username = $target.data("user"),
providerId = $target.data("provider");
event.preventDefault();
edx.commerce.credit.createCreditRequest(providerId, courseKey, username).fail(function () {
$(".credit-action").hide();
$errorContainer.toggleClass("is-hidden");
......
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