mirror of https://github.com/zulip/zulip.git
billing: Redirect to stripe card change page on clicking change card.
This commit is contained in:
parent
8c4ef3e9aa
commit
e185e91581
|
@ -102,7 +102,7 @@
|
|||
</div>
|
||||
{% if charge_automatically %}
|
||||
<div class="user-stripe-card-update input-box billing-page-field no-validation">
|
||||
<button class="user-stripe-card-update-button">
|
||||
<button class="user-stripe-card-update-button" id="update-card-button">
|
||||
<span class="billing-button-text">Update card</span>
|
||||
<object class="loader billing-button-loader" type="image/svg+xml" data="{{ static('images/loading/loader-white.svg') }}"></object>
|
||||
</button>
|
||||
|
|
|
@ -12,9 +12,6 @@
|
|||
{% block content %}
|
||||
|
||||
<div class="app portico-page">
|
||||
|
||||
{% include 'zerver/billing_nav.html' %}
|
||||
|
||||
<div class="billing-upgrade-page">
|
||||
<div class="hero small-hero"></div>
|
||||
|
||||
|
|
|
@ -36,6 +36,8 @@ export function initialize(): void {
|
|||
helpers.set_tab("billing");
|
||||
|
||||
$("#update-card-button").on("click", (e) => {
|
||||
$("#update-card-button .billing-button-text").text("");
|
||||
$("#update-card-button .loader").show();
|
||||
helpers.create_ajax_request(
|
||||
"/json/billing/session/start_card_update_session",
|
||||
"cardchange",
|
||||
|
@ -44,7 +46,10 @@ export function initialize(): void {
|
|||
(response) => {
|
||||
const response_data = helpers.stripe_session_url_schema.parse(response);
|
||||
window.location.replace(response_data.stripe_session_url);
|
||||
},
|
||||
}, () => {
|
||||
$("#update-card-button .loader").hide();
|
||||
$("#update-card-button .billing-button-text").text("Update card");
|
||||
}
|
||||
);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue