Update routes/subscription.py
Browse files- 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 |
-
|
|
|
15 |
stripe.api_version = "2023-10-16"
|
16 |
|
17 |
-
# 🔥 Supabase Configuração
|
18 |
SUPABASE_URL = "https://ussxqnifefkgkaumjann.supabase.co"
|
19 |
-
SUPABASE_KEY =
|
|
|
|
|
|
|
|
|
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}",
|