(core) add appsumo endpoints with stub implementations

Summary:
This adds appsumo /token and /notification endpoints, with some
tests.  The stub implementation is sufficient for AppSumo
activation to succeed (when exposed via port forwarding for testing).
It needs fleshing out:

 * Implement upgrade/downgrade/refund and stripe subscription.
 * Implement custom landing page and flow.

Test Plan: added tests

Reviewers: dsagal, georgegevoian

Reviewed By: dsagal

Subscribers: alexmojaki

Differential Revision: https://phab.getgrist.com/D2864
This commit is contained in:
Paul Fitzpatrick
2021-06-17 16:48:46 -04:00
parent ca57b3c099
commit cc04c6481a
7 changed files with 101 additions and 12 deletions

View File

@@ -12,6 +12,13 @@ interface BillingAccountStatus {
message?: string;
}
// A structure for billing options relevant to an external authority, for sites
// created outside of Grist's regular billing flow.
export interface ExternalBillingOptions {
authority: string; // The name of the external authority.
invoiceId?: string; // An id of an invoice or other external billing context.
}
/**
* This relates organizations to products. It holds any stripe information
* needed to be able to update and pay for the product that applies to the
@@ -49,6 +56,12 @@ export class BillingAccount extends BaseEntity {
@Column({name: 'stripe_plan_id', type: String, nullable: true})
public stripePlanId: string | null;
@Column({name: 'external_id', type: String, nullable: true})
public externalId: string | null;
@Column({name: 'external_options', type: nativeValues.jsonEntityType, nullable: true})
public externalOptions: ExternalBillingOptions | null;
@OneToMany(type => BillingAccountManager, manager => manager.billingAccount)
public managers: BillingAccountManager[];