diff --git a/app/client/ui/BillingPage.ts b/app/client/ui/BillingPage.ts index 4c1b2072..e45ddeab 100644 --- a/app/client/ui/BillingPage.ts +++ b/app/client/ui/BillingPage.ts @@ -182,6 +182,7 @@ export class BillingPage extends Disposable { makeSummaryFeature([`Your next invoice is `, getPriceString(sub.nextTotal), ' on ', dateFmt(sub.periodEnd)]), ] : null, + tier ? this.buildAppSumoLink(this._appModel.currentOrg?.billingAccount?.externalOptions?.invoiceId) : null, getSubscriptionProblem(sub), testId('summary') ), @@ -250,6 +251,22 @@ export class BillingPage extends Disposable { return null; } + // Include a precise link back to AppSumo for changing plans. + public buildAppSumoLink(invoiceId: string | undefined) { + if (!invoiceId) { return null; } + return dom('div', + css.billingTextBtn({ style: 'margin: 10px 0;' }, + cssBreadcrumbsLink( + css.billingIcon('Plus'), 'Change your AppSumo plan', + { + href: `https://appsumo.com/account/redemption/${invoiceId}/#change-plan`, + target: '_blank' + }, + testId('appsumo-link') + ) + )); + } + public buildPlansPage() { // Fetch plan and card data if not already present. this._model.fetchData().catch(reportError); diff --git a/app/common/UserAPI.ts b/app/common/UserAPI.ts index f229a80d..4e1398d0 100644 --- a/app/common/UserAPI.ts +++ b/app/common/UserAPI.ts @@ -65,6 +65,9 @@ export interface BillingAccount { individual: boolean; product: Product; isManager: boolean; + externalOptions?: { + invoiceId?: string; + }; } // Information about the product associated with an org or orgs.