chore:little fixes and formating and linting and patches
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// src/polar.ts
|
||||
import { Polar } from '@polar-sh/sdk';
|
||||
|
||||
export {
|
||||
validateEvent as validatePolarEvent,
|
||||
WebhookVerificationError as PolarWebhookVerificationError,
|
||||
@@ -33,11 +34,7 @@ export async function getProduct(id: string) {
|
||||
return polar.products.get({ id });
|
||||
}
|
||||
|
||||
export async function createPortal({
|
||||
customerId,
|
||||
}: {
|
||||
customerId: string;
|
||||
}) {
|
||||
export async function createPortal({ customerId }: { customerId: string }) {
|
||||
return polar.customerSessions.create({
|
||||
customerId,
|
||||
});
|
||||
@@ -64,7 +61,7 @@ export async function createCheckout({
|
||||
products: [productId],
|
||||
successUrl: getSuccessUrl(
|
||||
process.env.DASHBOARD_URL || process.env.NEXT_PUBLIC_DASHBOARD_URL!,
|
||||
organizationId,
|
||||
organizationId
|
||||
),
|
||||
customerEmail: user.email,
|
||||
customerName: [user.firstName, user.lastName].filter(Boolean).join(' '),
|
||||
|
||||
@@ -18,7 +18,7 @@ export type IPrice = {
|
||||
};
|
||||
|
||||
export const PRICING: IPrice[] = [
|
||||
{ price: 2.5, events: 5_000 },
|
||||
{ price: 2.5, events: 5000 },
|
||||
{ price: 5, events: 10_000 },
|
||||
{ price: 20, events: 100_000 },
|
||||
{ price: 30, events: 250_000, popular: true },
|
||||
@@ -52,8 +52,8 @@ export function getRecommendedPlan<T>(
|
||||
options: {
|
||||
formattedEvents: string;
|
||||
formattedPrice: string;
|
||||
} & IPrice,
|
||||
) => T,
|
||||
} & IPrice
|
||||
) => T
|
||||
): T | undefined {
|
||||
if (!monthlyEvents) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user