mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Improving billing page user experience
Summary: Improving billing page user experience. - Updated labels for canceled plan - Adding option to downgrade from team plan to free team plan - Updating default name for teamFree plan when it is not available in Stripe - Minor bug fixes Test Plan: updated tests Reviewers: cyprien Reviewed By: cyprien Subscribers: cyprien Differential Revision: https://phab.getgrist.com/D3515
This commit is contained in:
@@ -48,6 +48,9 @@ export interface BillingModel {
|
||||
getCustomerPortalUrl(): string;
|
||||
// Renews plan (either by opening customer portal or creating Stripe Checkout session)
|
||||
renewPlan(): string;
|
||||
// Downgrades team plan. Currently downgrades only from team to team free plan, and
|
||||
// only when plan is cancelled.
|
||||
downgradePlan(planName: string): Promise<void>;
|
||||
}
|
||||
|
||||
export interface ISubscriptionModel extends IBillingSubscription {
|
||||
@@ -124,6 +127,10 @@ export class BillingModelImpl extends Disposable implements BillingModel {
|
||||
return this._billingAPI.renewPlan();
|
||||
}
|
||||
|
||||
public async downgradePlan(planName: string): Promise<void> {
|
||||
await this._billingAPI.downgradePlan(planName);
|
||||
}
|
||||
|
||||
public async cancelCurrentPlan() {
|
||||
const data = await this._billingAPI.cancelCurrentPlan();
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user