habulaj commited on
Commit
9686665
·
verified ·
1 Parent(s): 0b08e96

Update routes/subscription.py

Browse files
Files changed (1) hide show
  1. routes/subscription.py +8 -3
routes/subscription.py CHANGED
@@ -11,12 +11,17 @@ router = APIRouter()
11
  logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
12
  logger = logging.getLogger(__name__)
13
 
14
- stripe.api_key = "sk_test_51N6K5JB9VMe0qzbOjlJvMEsfdQyrFgV49vRaeErtmhrzHV3Cu3f5jMDJmrhKdI5uqvpHubjkmwDQgMOtCEmz19t800AouH7W6g"
 
15
  stripe.api_version = "2023-10-16"
16
 
17
- # 🔥 Supabase Configuração
18
  SUPABASE_URL = "https://ussxqnifefkgkaumjann.supabase.co"
19
- SUPABASE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVzc3hxbmlmZWZrZ2thdW1qYW5uIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Mzc2NTE2MjMsImV4cCI6MjA1MzIyNzYyM30.SWb6lh3foBp8MrZaHpjt5kKkzXNyBYh3vgfayIM7bzs"
 
 
 
 
20
  SUPABASE_HEADERS = {
21
  "apikey": SUPABASE_KEY,
22
  "Authorization": f"Bearer {SUPABASE_KEY}",
 
11
  logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
12
  logger = logging.getLogger(__name__)
13
 
14
+ # 🔥 Pegando as chaves do ambiente
15
+ stripe.api_key = os.getenv("STRIPE_KEY") # Lendo do ambiente
16
  stripe.api_version = "2023-10-16"
17
 
18
+ # 🔥 Supabase Configuração com Secrets
19
  SUPABASE_URL = "https://ussxqnifefkgkaumjann.supabase.co"
20
+ SUPABASE_KEY = os.getenv("SUPA_KEY") # Lendo do ambiente
21
+
22
+ if not stripe.api_key or not SUPABASE_KEY:
23
+ raise ValueError("❌ STRIPE_KEY ou SUPA_KEY não foram definidos no ambiente!")
24
+
25
  SUPABASE_HEADERS = {
26
  "apikey": SUPABASE_KEY,
27
  "Authorization": f"Bearer {SUPABASE_KEY}",