mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
14 lines
479 B
TypeScript
14 lines
479 B
TypeScript
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';
|
|
};
|