mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) link AppSumo activations with stripe, and support upgrades/downgrades
Summary: This links AppSumo sign-ups with Stripe subscriptions and our billing pages. Different AppSumo tiers are supported by different coupons on the standard plan. Configuration of this is in stripe, and then cached in the database. The front end is tweaked just enough to make completing a sign-up possible. It is not yet friendly. Not covered includes: * Streamlining landing page. * Making billing pages git clearer summaries of AppSumo states. * Making flow through Cognito as graceful as possible - default probably doesn't meet AppSumo requirements. * Disabling site on cancellation/refund. * Downgrades when more seats in use than lower tier allows. Test Plan: api-level tests added. No front-end tests yet. Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2878
This commit is contained in:
@@ -1673,7 +1673,8 @@ export class HomeDBManager extends EventEmitter {
|
||||
// Pick out properties that are allowed to be changed, to prevent accidental updating
|
||||
// of other information.
|
||||
const updated = pick(billingAccountCopy, 'inGoodStanding', 'status', 'stripeCustomerId',
|
||||
'stripeSubscriptionId', 'stripePlanId', 'product');
|
||||
'stripeSubscriptionId', 'stripePlanId', 'product', 'externalId',
|
||||
'externalOptions');
|
||||
billingAccount.paid = undefined; // workaround for a typeorm bug fixed upstream in
|
||||
// https://github.com/typeorm/typeorm/pull/4035
|
||||
await transaction.save(Object.assign(billingAccount, updated));
|
||||
|
||||
Reference in New Issue
Block a user