Moibe commited on
Commit
2695e7b
·
1 Parent(s): 11cdb7c

Remote env check

Browse files
Files changed (5) hide show
  1. app.py +3 -3
  2. autenticacion.py +1 -0
  3. funciones.py +7 -17
  4. globales.py +2 -1
  5. herramientas.py +0 -6
app.py CHANGED
@@ -1,7 +1,7 @@
1
- import funciones, globales
2
  from fastapi import FastAPI, Form
3
- from fastapi import FastAPI, File, UploadFile
4
- from fastapi.responses import StreamingResponse, FileResponse, JSONResponse
5
  from fastapi import FastAPI, Form
6
  from typing import Optional # Importa Optional
7
 
 
1
+ import funciones
2
  from fastapi import FastAPI, Form
3
+ from fastapi import FastAPI
4
+ from fastapi.responses import JSONResponse
5
  from fastapi import FastAPI, Form
6
  from typing import Optional # Importa Optional
7
 
autenticacion.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import socket
3
 
4
  def defineAmbiente():
 
5
  if local_check():
6
  print("Entorno Local...")
7
  import bridges
 
2
  import socket
3
 
4
  def defineAmbiente():
5
+ print("Estoy en define ambiente...")
6
  if local_check():
7
  print("Entorno Local...")
8
  import bridges
funciones.py CHANGED
@@ -1,18 +1,8 @@
1
- import globales
2
- import herramientas
3
- import conexion_firebase
4
  import stripe
 
5
 
6
- def funcion_generica(platillo):
7
- try:
8
- return "Hola"
9
-
10
- except Exception as e:
11
- print("Excepción: ", e)
12
- # Opción para regresar imagen genérica. (ya no porque se envía desde backend.)
13
- # return "default.png"
14
- return '{"Error 500": e}'
15
-
16
  def create_checkout_session(price_id, customer_email=None, customer_id=None):
17
  """
18
  Crea una nueva Checkout Session para un pago único.
@@ -31,10 +21,10 @@ def create_checkout_session(price_id, customer_email=None, customer_id=None):
31
  'price': price_id,
32
  'quantity': 1,
33
  }],
34
- 'mode': 'payment', # Para pagos únicos (one-time payment)
35
- 'success_url': 'https://tudominio.com/gracias?session_id={CHECKOUT_SESSION_ID}',
36
- 'cancel_url': 'https://tudominio.com/cancelar',
37
- 'locale': 'es', # Establece el idioma del checkout a español
38
  'client_reference_id': 'Moibe'
39
  }
40
 
 
 
 
 
1
  import stripe
2
+ import bridges
3
 
4
+ stripe.api_key = bridges.llave
5
+
 
 
 
 
 
 
 
 
6
  def create_checkout_session(price_id, customer_email=None, customer_id=None):
7
  """
8
  Crea una nueva Checkout Session para un pago único.
 
21
  'price': price_id,
22
  'quantity': 1,
23
  }],
24
+ 'mode': 'subscription', #payment Para pagos únicos (one-time payment) o #subscription
25
+ 'success_url': 'https://app.splashmix.ink/', #'https://tudominio.com/gracias?session_id={CHECKOUT_SESSION_ID}'
26
+ 'cancel_url': 'https://app.splashmix.ink/',
27
+ 'locale': 'fr', #'es' # Establece el idioma del checkout a español
28
  'client_reference_id': 'Moibe'
29
  }
30
 
globales.py CHANGED
@@ -1,5 +1,6 @@
1
  import autenticacion
2
- version = "0.0.0"
 
3
 
4
  llave = autenticacion.defineAmbiente()
5
 
 
1
  import autenticacion
2
+
3
+ version = "0.0.1" #remote env check
4
 
5
  llave = autenticacion.defineAmbiente()
6
 
herramientas.py CHANGED
@@ -3,12 +3,6 @@ from datetime import datetime
3
  import conexion_firebase
4
  import pytz
5
 
6
- # if globales.servidor == "moibe":
7
- # segundos = "segundos_dev"
8
- # last_timestamp = "last_timestamp_dev"
9
- # else:
10
- # segundos = "segundos_prod"
11
- # last_timestamp = "last_timestamp_prod"
12
 
13
  def obtenUltimoTimestamp():
14
  """
 
3
  import conexion_firebase
4
  import pytz
5
 
 
 
 
 
 
 
6
 
7
  def obtenUltimoTimestamp():
8
  """