diff --git a/lib/abacatepay.ts b/lib/abacatepay.ts index fe701f5..4e6d7ec 100644 --- a/lib/abacatepay.ts +++ b/lib/abacatepay.ts @@ -177,12 +177,31 @@ const apiKey = isProduction ? process.env.ABACATE_APIKEY || "demo_key" : process.env.ABACATE_TEST_APIKEY || "demo_key"; -// Log para debug (apenas em desenvolvimento) -if (process.env.NODE_ENV !== "production") { - console.log( - `🔧 AbacatePay: Using ${isProduction ? "PRODUCTION" : "TEST"} environment` - ); -} +// Log completo das variáveis de ambiente configuradas +console.log("\n🔧 =========================================="); +console.log("🔧 VARIÁVEIS DE AMBIENTE DO ABACATEPAY"); +console.log("🔧 =========================================="); +console.log(`📊 NODE_ENV: ${process.env.NODE_ENV || "não definido"}`); +console.log(`📊 Environment: ${isProduction ? "PRODUCTION" : "TEST"}`); +console.log( + `📊 API Key: ${apiKey ? "✅ Configurada (masqueada)" : "❌ NÃO CONFIGURADA"}` +); +console.log( + `📊 API Key preview: ${ + apiKey ? apiKey.substring(0, 10) + "..." : "não definida" + }` +); +console.log( + `📊 Webhook Secret: ${ + process.env.ABACATEPAY_WEBHOOK_SECRET + ? "✅ Configurada" + : "❌ NÃO CONFIGURADA" + }` +); +console.log( + `📊 Base URL: ${process.env.NEXT_PUBLIC_BASE_URL || "não definido"}` +); +console.log("🔧 ==========================================\n"); export const abacatePay = new AbacatePayClient({ apiKey,