mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 16:01:58 +00:00
ES and TypeScript modules are strict by default and don’t need this directive. ESLint will remind us to add it to new CommonJS files and remove it from ES and TypeScript modules. Signed-off-by: Anders Kaseorg <anders@zulip.com>
44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
"use strict";
|
|
|
|
exports.initialize = function () {
|
|
helpers.set_tab("billing");
|
|
|
|
const stripe_key = $("#payment-method").data("key");
|
|
const card_change_handler = StripeCheckout.configure({
|
|
// eslint-disable-line no-undef
|
|
key: stripe_key,
|
|
image: "/static/images/logo/zulip-icon-128x128.png",
|
|
locale: "auto",
|
|
token(stripe_token) {
|
|
helpers.create_ajax_request("/json/billing/sources/change", "cardchange", stripe_token);
|
|
},
|
|
});
|
|
|
|
$("#update-card-button").on("click", (e) => {
|
|
const email = $("#payment-method").data("email");
|
|
card_change_handler.open({
|
|
name: "Zulip",
|
|
zipCode: true,
|
|
billingAddress: true,
|
|
panelLabel: "Update card",
|
|
email,
|
|
label: "Update card",
|
|
allowRememberMe: false,
|
|
});
|
|
e.preventDefault();
|
|
});
|
|
|
|
$("#change-plan-status").on("click", (e) => {
|
|
helpers.create_ajax_request("/json/billing/plan/change", "planchange", undefined, [
|
|
"status",
|
|
]);
|
|
e.preventDefault();
|
|
});
|
|
};
|
|
|
|
window.billing = exports;
|
|
|
|
$(() => {
|
|
exports.initialize();
|
|
});
|