diff --git a/src/routes/api/webhook/stripe/+server.ts b/src/routes/api/webhook/stripe/+server.ts index 7370213..47d1697 100644 --- a/src/routes/api/webhook/stripe/+server.ts +++ b/src/routes/api/webhook/stripe/+server.ts @@ -3,6 +3,7 @@ import stripe from 'stripe'; import { PUBLIC_STRIPE_SECRET_KEY } from '$env/static/public'; import { PUBLIC_STRIPE_ENDPOINT_SECRET } from '$env/static/public'; import { + createOrRetrieveCustomer, deletePriceRecord, deleteProductRecord, manageSubscriptionStatusChange, @@ -54,6 +55,9 @@ export const POST: RequestHandler = async ({ request }) => { case 'product.deleted': await deleteProductRecord(event.data.object as stripe.Product); break; + case 'customer.created': + await createOrRetrieveCustomer(event.data.object as stripe.Customer); + break; case 'customer.subscription.created': case 'customer.subscription.updated': case 'customer.subscription.deleted': {