diff --git a/frontend_tests/node_tests/billing_helpers.js b/frontend_tests/node_tests/billing_helpers.js index a6d4176580..d7eaaf1dbe 100644 --- a/frontend_tests/node_tests/billing_helpers.js +++ b/frontend_tests/node_tests/billing_helpers.js @@ -127,7 +127,7 @@ run_test('create_ajax_request', () => { assert.equal(state.form_input_section_show, 1); }; - helpers.create_ajax_request("/json/billing/upgrade", "autopay", {id: "stripe_token_id"}); + helpers.create_ajax_request("/json/billing/upgrade", "autopay", {id: "stripe_token_id"}, ["licenses"]); }); diff --git a/static/js/billing/billing.js b/static/js/billing/billing.js index d9e0c699b6..15e1978ae6 100644 --- a/static/js/billing/billing.js +++ b/static/js/billing/billing.js @@ -7,7 +7,7 @@ exports.initialize = function () { image: '/static/images/logo/zulip-icon-128x128.png', locale: 'auto', token: function (stripe_token) { - helpers.create_ajax_request("/json/billing/sources/change", "cardchange", stripe_token = stripe_token); + helpers.create_ajax_request("/json/billing/sources/change", "cardchange", stripe_token); }, }); diff --git a/static/js/billing/helpers.js b/static/js/billing/helpers.js index 41ec4a3def..ff874273dc 100644 --- a/static/js/billing/helpers.js +++ b/static/js/billing/helpers.js @@ -1,4 +1,4 @@ -exports.create_ajax_request = function (url, form_name, stripe_token = null) { +exports.create_ajax_request = function (url, form_name, stripe_token = null, numeric_inputs = []) { const form = $("#" + form_name + "-form"); const form_loading_indicator = "#" + form_name + "_loading_indicator"; const form_input_section = "#" + form_name + "-input-section"; @@ -6,8 +6,6 @@ exports.create_ajax_request = function (url, form_name, stripe_token = null) { const form_error = "#" + form_name + "-error"; const form_loading = "#" + form_name + "-loading"; - const numeric_inputs = ["licenses"]; - loading.make_indicator($(form_loading_indicator), {text: 'Processing ...', abs_positioned: true}); $(form_input_section).hide(); diff --git a/static/js/billing/upgrade.js b/static/js/billing/upgrade.js index d8d45cf3c3..0262d0e5e3 100644 --- a/static/js/billing/upgrade.js +++ b/static/js/billing/upgrade.js @@ -6,7 +6,7 @@ exports.initialize = () => { image: '/static/images/logo/zulip-icon-128x128.png', locale: 'auto', token: function (stripe_token) { - helpers.create_ajax_request("/json/billing/upgrade", "autopay", stripe_token = stripe_token); + helpers.create_ajax_request("/json/billing/upgrade", "autopay", stripe_token, ["licenses"]); }, }); @@ -33,7 +33,7 @@ exports.initialize = () => { return; } e.preventDefault(); - helpers.create_ajax_request("/json/billing/upgrade", "invoice"); + helpers.create_ajax_request("/json/billing/upgrade", "invoice", undefined, ["licenses"]); }); const prices = {};