Skip to content

Commit fbbe0d8

Browse files
Fix Stripe logs
1 parent 9e00a3a commit fbbe0d8

File tree

1 file changed

+9
-1
lines changed
  • supabase/functions/stripe-payment-methods

1 file changed

+9
-1
lines changed

supabase/functions/stripe-payment-methods/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,16 @@ serve(async (req) => {
3434

3535
console.log('👤 STRIPE PAYMENT METHODS - Utilisateur:', user.email);
3636

37+
// Check if Stripe secret key is available
38+
const stripeSecretKey = Deno.env.get("STRIPE_SECRET_KEY");
39+
console.log('🔑 STRIPE SECRET KEY - Disponible:', !!stripeSecretKey, 'Longueur:', stripeSecretKey?.length || 0);
40+
41+
if (!stripeSecretKey) {
42+
throw new Error("STRIPE_SECRET_KEY not found in environment variables");
43+
}
44+
3745
// Initialize Stripe
38-
const stripe = new Stripe(Deno.env.get("STRIPE_SECRET_KEY") || "", {
46+
const stripe = new Stripe(stripeSecretKey, {
3947
apiVersion: "2023-10-16",
4048
});
4149

0 commit comments

Comments
 (0)