fix(server): should auto apply ea price for users (#9082)

This commit is contained in:
forehalo
2024-12-10 05:31:19 +00:00
parent 36a95463b4
commit 564faa439a
6 changed files with 78 additions and 55 deletions

View File

@@ -66,7 +66,7 @@ export abstract class SubscriptionManager {
): KnownStripePrice[] | Promise<KnownStripePrice[]>;
abstract checkout(
price: KnownStripePrice,
lookupKey: LookupKey,
params: z.infer<typeof CheckoutParams>,
args: any
): Promise<Stripe.Checkout.Session>;
@@ -206,9 +206,7 @@ export abstract class SubscriptionManager {
return customer;
}
protected async getPrice(
lookupKey: LookupKey
): Promise<KnownStripePrice | null> {
async getPrice(lookupKey: LookupKey): Promise<KnownStripePrice | null> {
const prices = await this.stripe.prices.list({
lookup_keys: [encodeLookupKey(lookupKey)],
limit: 1,