Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ async function handler(req: Request) {
in: ["pending", "processing", "processed", "failed"],
},
programId: {
not: ACME_PROGRAM_ID,
notIn: [
ACME_PROGRAM_ID,
// programs that are in the migration process
"prog_1KPAZMF49X9A1WEWRBM55KZY7",
],
},
partner: {
payoutsEnabledAt: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export async function customerSubscriptionUpdated(
return `Invalid price ID in customer.subscription.updated event: ${priceId}`;
}

if (!["active", "trialing"].includes(updatedSubscription.status)) {
return `Invalid updated subscription status "${updatedSubscription.status}" for subscription ${updatedSubscription.id}, skipping...`;
}

const stripeId = updatedSubscription.customer.toString();

const workspace = await prisma.project.findUnique({
Expand Down Expand Up @@ -57,12 +61,7 @@ export async function customerSubscriptionUpdated(
subscription: updatedSubscription,
});

const subscriptionCanceled =
(updatedSubscription.status === "active" ||
updatedSubscription.status === "trialing") &&
updatedSubscription.cancel_at_period_end;

if (subscriptionCanceled) {
if (updatedSubscription.cancel_at_period_end) {
const owners = workspace.users.map(({ user }) => user);
const cancelReason = updatedSubscription.cancellation_details?.feedback;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { notFound, redirect } from "next/navigation";
import { CSSProperties } from "react";
import { ApplyHeader } from "../../header";
import { CTAButtons } from "./cta-buttons";
import { PixelConversion } from "./pixel-conversion";
import { Screenshot } from "./screenshot";

export const dynamic = "force-dynamic";
Expand Down Expand Up @@ -85,111 +84,101 @@ export default async function SuccessPage(props: {
const hasPartnerProfile = !!enrollmentId;

return (
<>
{program.slug === "perplexity" && <PixelConversion />}
<div
className="relative"
style={
{
"--brand": program.group.brandColor || "#000000",
"--brand-ring": "rgb(from var(--brand) r g b / 0.2)",
} as CSSProperties
}
>
<ApplyHeader
group={program.group}
showLogin={false}
showApply={false}
/>
<div className="p-6">
<div className="grid grid-cols-1 gap-5 sm:pt-20">
<span className="w-fit rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-700">
Step 2 of 2
</span>
<h1 className="text-4xl font-semibold">
{hasPartnerProfile
? "Application submitted"
: "Finish your application"}
</h1>
<div className="flex flex-col gap-4 text-base text-neutral-700">
{hasPartnerProfile && (
<p>
Your application has been submitted for review.
{application && (
<>
{" "}
You'll receive an update at{" "}
<strong className="font-semibold">
{application.email}
</strong>
.
</>
)}
</p>
)}
{!hasPartnerProfile && (
<p>
Your application to{" "}
<strong className="font-semibold">{program.name}</strong> has
been saved, but you still need to create your{" "}
<strong className="font-semibold">Dub Partners</strong>{" "}
account to complete your application.
<br />
<br />
Once you create your account, your application will be
submitted to <b>{program.name}</b> and you'll hear back from
them{" "}
<strong className="font-semibold">
{application?.email
? `at ${application.email}`
: "via email"}
</strong>
.
</p>
)}
</div>
</div>

{/* Buttons */}
<div className="mt-12 flex flex-col gap-3">
<CTAButtons />
<div
className="relative"
style={
{
"--brand": program.group.brandColor || "#000000",
"--brand-ring": "rgb(from var(--brand) r g b / 0.2)",
} as CSSProperties
}
>
<ApplyHeader group={program.group} showLogin={false} showApply={false} />
<div className="p-6">
<div className="grid grid-cols-1 gap-5 sm:pt-20">
<span className="w-fit rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-700">
Step 2 of 2
</span>
<h1 className="text-4xl font-semibold">
{hasPartnerProfile
? "Application submitted"
: "Finish your application"}
</h1>
<div className="flex flex-col gap-4 text-base text-neutral-700">
{hasPartnerProfile && (
<p>
Your application has been submitted for review.
{application && (
<>
{" "}
You'll receive an update at{" "}
<strong className="font-semibold">
{application.email}
</strong>
.
</>
)}
</p>
)}
{!hasPartnerProfile && (
<p>
Your application to{" "}
<strong className="font-semibold">{program.name}</strong> has
been saved, but you still need to create your{" "}
<strong className="font-semibold">Dub Partners</strong> account
to complete your application.
<br />
<br />
Once you create your account, your application will be submitted
to <b>{program.name}</b> and you'll hear back from them{" "}
<strong className="font-semibold">
{application?.email ? `at ${application.email}` : "via email"}
</strong>
.
</p>
)}
</div>
</div>

{/* Screenshot */}
<div className="relative mt-16">
<Screenshot
program={{ name: program.name, logo: program.logo }}
className="h-auto w-full [mask-image:linear-gradient(black_80%,transparent)]"
/>
<div className="absolute bottom-0 left-1/2 -translate-x-1/2">
<div className="absolute -inset-[50%] rounded-full bg-white blur-lg" />

{programSlug !== "dub" && (
<div className="relative flex items-center gap-2 rounded-full border border-neutral-100 bg-gradient-to-b from-white to-neutral-50 p-2 shadow-[0_8px_28px_0_#00000017]">
<img
className="size-10 shrink-0 rounded-full"
src={program.logo || `${OG_AVATAR_URL}${program.name}`}
alt={`${program.name} logo`}
/>
<BoltFill className="shrink-0 text-[var(--brand)] opacity-30" />
<Logo className="size-10 shrink-0" />
</div>
)}
</div>
</div>
{/* Buttons */}
<div className="mt-12 flex flex-col gap-3">
<CTAButtons />
</div>

{/* Feature grid */}
<div className="mt-16 grid grid-cols-1 gap-10 sm:grid-cols-2">
{FEATURES.map(({ icon: Icon, title, description }) => (
<div key={title} className="flex flex-col gap-2.5 text-sm">
<Icon className="size-4 shrink-0 text-[var(--brand)]" />
<h3 className="font-semibold text-neutral-900">{title}</h3>
<p className="text-neutral-500">{description}</p>
{/* Screenshot */}
<div className="relative mt-16">
<Screenshot
program={{ name: program.name, logo: program.logo }}
className="h-auto w-full [mask-image:linear-gradient(black_80%,transparent)]"
/>
<div className="absolute bottom-0 left-1/2 -translate-x-1/2">
<div className="absolute -inset-[50%] rounded-full bg-white blur-lg" />

{programSlug !== "dub" && (
<div className="relative flex items-center gap-2 rounded-full border border-neutral-100 bg-gradient-to-b from-white to-neutral-50 p-2 shadow-[0_8px_28px_0_#00000017]">
<img
className="size-10 shrink-0 rounded-full"
src={program.logo || `${OG_AVATAR_URL}${program.name}`}
alt={`${program.name} logo`}
/>
<BoltFill className="shrink-0 text-[var(--brand)] opacity-30" />
<Logo className="size-10 shrink-0" />
</div>
))}
)}
</div>
</div>

{/* Feature grid */}
<div className="mt-16 grid grid-cols-1 gap-10 sm:grid-cols-2">
{FEATURES.map(({ icon: Icon, title, description }) => (
<div key={title} className="flex flex-col gap-2.5 text-sm">
<Icon className="size-4 shrink-0 text-[var(--brand)]" />
<h3 className="font-semibold text-neutral-900">{title}</h3>
<p className="text-neutral-500">{description}</p>
</div>
))}
</div>
</div>
</>
</div>
);
}

This file was deleted.

Loading
Loading