fix(stripe): update subscription webhook handling should use customer id as a fallback

This commit is contained in:
Bereket Engida
2025-03-02 13:36:51 +03:00
parent 25de4b5f4f
commit 1c16655aba
4 changed files with 28 additions and 20 deletions

View File

@@ -20,6 +20,7 @@ import { nextCookies } from "better-auth/next-js";
import { passkey } from "better-auth/plugins/passkey";
import { stripe } from "@better-auth/stripe";
import { Stripe } from "stripe";
import Database from "better-sqlite3";
const from = process.env.BETTER_AUTH_EMAIL || "delivered@resend.dev";
const to = process.env.TEST_EMAIL || "";
@@ -50,10 +51,7 @@ const STARTER_PRICE_ID = {
export const auth = betterAuth({
appName: "Better Auth Demo",
database: {
dialect,
type: process.env.USE_MYSQL ? "mysql" : "sqlite",
},
database: new Database("stripe-1.db"),
emailVerification: {
async sendVerificationEmail({ user, url }) {
const res = await resend.emails.send({