Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

349 B
Raw Blame
import { getPlanFromPriceId } from "../utils";

export function getQuantityFromPriceId(priceId?: string) {
  if (!priceId) {
    return 1;
  }
  try {
    const plan = getPlanFromPriceId(priceId);
    return plan?.minQuantity ?? 1;
  } catch (error) {
    console.error("Error getting quantity for priceId: %s", priceId, error);
    return 1;
  }
}