Spaces:
Sleeping
Sleeping
Manejo de sandbox y producción en Stripe
Browse files- autenticacion.py +12 -7
- globales.py +2 -2
autenticacion.py
CHANGED
@@ -1,17 +1,22 @@
|
|
1 |
import os
|
2 |
import socket
|
3 |
|
4 |
-
def defineAmbiente():
|
5 |
-
print("Estoy en define ambiente...")
|
6 |
if local_check():
|
7 |
print("Entorno Local...")
|
8 |
-
import bridges
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
else:
|
12 |
-
print("Entorno remoto listo...")
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
15 |
return llave
|
16 |
|
17 |
def local_check():
|
|
|
1 |
import os
|
2 |
import socket
|
3 |
|
4 |
+
def defineAmbiente(env):
|
|
|
5 |
if local_check():
|
6 |
print("Entorno Local...")
|
7 |
+
import bridges
|
8 |
+
if env == 'prod':
|
9 |
+
llave = bridges.llave_prod
|
10 |
+
else:
|
11 |
+
llave = bridges.llave_sandbox
|
12 |
|
13 |
else:
|
14 |
+
print("Entorno remoto listo...")
|
15 |
+
if env == 'prod':
|
16 |
+
llave = os.getenv("llave_prod")
|
17 |
+
else:
|
18 |
+
llave = os.getenv("llave_sandbox")
|
19 |
+
|
20 |
return llave
|
21 |
|
22 |
def local_check():
|
globales.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
import autenticacion
|
2 |
|
3 |
-
|
4 |
-
|
|
|
1 |
import autenticacion
|
2 |
|
3 |
+
env = "prod" #o dev (Define si es sandbox o producción en Stripe.)
|
4 |
+
llave = autenticacion.defineAmbiente(env)
|