forked from elmau/empresa-libre
63 lines
1.7 KiB
Python
63 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
|
|
|
|
from .conf import DEBUG, FINKOK
|
|
|
|
DEBUG = DEBUG
|
|
TIMEOUT = 10
|
|
|
|
#~ PACs que han proporcionado un entorno de pruebas libre y abierto
|
|
#~ ecodex, finkok
|
|
PAC = 'finkok'
|
|
|
|
|
|
#~ IMPORTANTE: Si quieres hacer pruebas, con tu propio correo de usuario y
|
|
#~ contraseña, ponte en contacto con Finkok para que te asignen tus datos de
|
|
#~ acceso, consulta su documentación para ver las diferentes opciones de acceso.
|
|
#~ Si solo estas haciendo pruebas de timbrado y ancelación, con estos datos debería
|
|
#~ ser suficiente.
|
|
def finkok(debug):
|
|
USER = FINKOK['USER']
|
|
PASS = FINKOK['PASS']
|
|
TOKEN = ''
|
|
auth = {
|
|
'DEBUG': debug,
|
|
'USER': '',
|
|
'PASS': TOKEN or PASS,
|
|
'RESELLER': {'USER': USER, 'PASS': PASS}
|
|
}
|
|
if debug:
|
|
USER = 'pruebas-finkok@correolibre.net'
|
|
PASS = ''
|
|
TOKEN = '5c9a88da105bff9a8c430cb713f6d35269f51674bdc5963c1501b7316366'
|
|
auth = {
|
|
'DEBUG': debug,
|
|
'USER': USER,
|
|
'PASS': TOKEN or PASS,
|
|
'RESELLER': {
|
|
'USER': '',
|
|
'PASS': ''
|
|
}
|
|
}
|
|
|
|
base_url = 'https://facturacion.finkok.com/servicios/soap/{}.wsdl'
|
|
if debug:
|
|
base_url = 'http://demo-facturacion.finkok.com/servicios/soap/{}.wsdl'
|
|
url = {
|
|
'timbra': base_url.format('stamp'),
|
|
'quick_stamp': False,
|
|
'cancel': base_url.format('cancel'),
|
|
'client': base_url.format('registration'),
|
|
'util': base_url.format('utilities'),
|
|
'codes': {
|
|
'200': 'Comprobante timbrado satisfactoriamente',
|
|
'307': 'Comprobante timbrado previamente',
|
|
'205': 'No Encontrado',
|
|
}
|
|
}
|
|
return auth, url
|
|
|
|
|
|
AUTH, URL = globals()[PAC](DEBUG)
|
|
|