mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
billing: Make invoice upgrade use create_ajax_request.
This commit is contained in:
@@ -172,32 +172,7 @@ $(function () {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
loading.make_indicator($('#invoice_loading_indicator'),
|
||||
{text: 'Processing ...', abs_positioned: true});
|
||||
$("#invoice-input-section").hide();
|
||||
$('#invoice-error').hide();
|
||||
$("#invoice-loading").show();
|
||||
$.post({
|
||||
url: "/json/billing/upgrade",
|
||||
data: {
|
||||
signed_seat_count: get_form_input("invoice", "signed_seat_count"),
|
||||
salt: get_form_input("invoice", "salt"),
|
||||
schedule: get_form_input("invoice", "schedule"),
|
||||
billing_modality: get_form_input("invoice", "billing_modality"),
|
||||
licenses: get_form_input("invoice", "invoiced_licenses", false),
|
||||
},
|
||||
success: function () {
|
||||
$("#invoice-loading").hide();
|
||||
$('#invoice-error').hide();
|
||||
$("#invoice-success").show();
|
||||
location.reload();
|
||||
},
|
||||
error: function (xhr) {
|
||||
$("#invoice-loading").hide();
|
||||
$('#invoice-error').show().text(JSON.parse(xhr.responseText).msg);
|
||||
$("#invoice-input-section").show();
|
||||
},
|
||||
});
|
||||
create_ajax_request("/json/billing/upgrade", "invoice");
|
||||
});
|
||||
|
||||
var prices = {};
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
</p>
|
||||
<h4>Number of users (minimum {{ min_invoiced_licenses }})</h4>
|
||||
<input type="number" min="{{ min_invoiced_licenses }}" autocomplete="off"
|
||||
id="invoiced_licenses" name="invoiced_licenses" required/><br>
|
||||
id="invoiced_licenses" name="licenses" required/><br>
|
||||
<button type="submit" id="invoice-button" class="stripe-button-el invoice-button">Buy Standard</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user