You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.8 KiB
80 lines
1.8 KiB
import os
|
|
from datetime import datetime
|
|
import uuid
|
|
import requests
|
|
import json
|
|
from audios.client import getaudio
|
|
from audios.client import concat_sln44_files
|
|
from audios.client import getname
|
|
from serfinansa.clientes.personas import Persona
|
|
from serfinansa.clientes.empresas import Empresa
|
|
|
|
__enviroment__ = os.environ.get('IVR_ENVIROMENT', 'master')
|
|
|
|
|
|
|
|
|
|
def cumple_actualizar(self):
|
|
namespace = "apps.cumple_actualizar"
|
|
self.Tracking.tracking_namespace_start(namespace)
|
|
|
|
|
|
cedul = str(self.cliente.cc)
|
|
cedul1 = '"'+cedul+'"'
|
|
|
|
|
|
|
|
|
|
url1 = "https://psepruebas.bancoserfinanza.com:5030/connect/token"
|
|
|
|
payloadun='client_id=ProfileServices&client_secret=ADKuJvxbZbzP%2BL3RihceVL1ZBKtN2OnMJ%2FSwDfBI7Co%3D&grant_type=client_credentials&scope=ProfileServices'
|
|
headersun = {
|
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
}
|
|
|
|
rs1se = requests.request("POST", url1, headers=headersun, data=payloadun)
|
|
jsonr=rs1se.json()
|
|
#print(rs1se.text)
|
|
|
|
#print(jsonr["access_token"])
|
|
|
|
|
|
url2 = "http://tanato-pru:4003/api/Profile/ValidateDataClient"
|
|
|
|
payload2 = json.dumps({
|
|
"idCliente": self.cliente.cc,
|
|
"tipoId": "1"
|
|
})
|
|
headers2 = {
|
|
'Authorization': 'Bearer {token}'.format(token=str(jsonr["access_token"])),
|
|
'Content-Type': 'application/json',
|
|
"Accept":'application/json'
|
|
}
|
|
|
|
rs1se2 = requests.request("POST", url2, headers=headers2, data=payload2)
|
|
|
|
respu = rs1se2.text
|
|
rddata = json.loads(rs1se2.text)
|
|
rddata = json.dumps(rddata)
|
|
c = "codigo"
|
|
|
|
|
|
|
|
con1 = rddata.find(c)
|
|
ncodigo = rddata[con1+10:con1+12]
|
|
|
|
self.ivr_log.debug(
|
|
"el codigo " + ncodigo
|
|
)
|
|
if ncodigo == "00":
|
|
|
|
self.menu_Actualizar()
|
|
|
|
else:
|
|
|
|
return
|
|
|
|
|
|
|
|
self.Tracking.tracking_namespace_end(namespace)
|