mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 10:11:35 +10:00
feat: add organisations (#1820)
This commit is contained in:
13
packages/ee/server-only/stripe/is-price-seats-based.ts
Normal file
13
packages/ee/server-only/stripe/is-price-seats-based.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import type { Stripe } from '@documenso/lib/server-only/stripe';
|
||||
import { stripe } from '@documenso/lib/server-only/stripe';
|
||||
|
||||
export const isPriceSeatsBased = async (priceId: string) => {
|
||||
const foundStripePrice = await stripe.prices.retrieve(priceId, {
|
||||
expand: ['product'],
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
const product = foundStripePrice.product as Stripe.Product;
|
||||
|
||||
return product.metadata.isSeatBased === 'true';
|
||||
};
|
||||
Reference in New Issue
Block a user