Cambios API Econo

This commit is contained in:
2020-12-17 15:06:50 -07:00
parent 3efa6e6af0
commit 8212c08c89

View File

@@ -49,7 +49,7 @@ Public Class E141 : Implements IHttpHandler
Public ReadOnly Property TokenAutorizacion As String Public ReadOnly Property TokenAutorizacion As String
Get Get
If EsProduccion Then If EsProduccion Then
Return "$2y$10$8Mk3YeIkJESilIwD.U5dG.SsA4JloycJKbaGls8TNEw/AKBE1qane" Return "$2y$10$EZlXnFrhUc4aRVwjy5/v0.3JPdFNjyeANDc64YXJ5eHD8pMsv93Q."
Else Else
Return "$2y$10$8Mk3YeIkJESilIwD.U5dG.SsA4JloycJKbaGls8TNEw/AKBE1qane" Return "$2y$10$8Mk3YeIkJESilIwD.U5dG.SsA4JloycJKbaGls8TNEw/AKBE1qane"
End If End If
@@ -59,7 +59,7 @@ Public Class E141 : Implements IHttpHandler
Public ReadOnly Property URLBase As String Public ReadOnly Property URLBase As String
Get Get
If EsProduccion Then If EsProduccion Then
Return "https://econollantas-pruebas.fidelityapps.mx" Return "https://services.fidelityapps.mx/"
Else Else
Return "https://econollantas-pruebas.fidelityapps.mx/" Return "https://econollantas-pruebas.fidelityapps.mx/"
End If End If
@@ -92,28 +92,31 @@ Public Class E141 : Implements IHttpHandler
Else Else
context.Response.ContentType = "text/html" context.Response.ContentType = "text/html"
Dim FiltrarTodos = If(context.Request("FiltrarTodos") = Nothing, "", context.Request("FiltrarTodos").ToString()) If Not String.IsNullOrEmpty(Metodo) Then
Dim FiltrarTodos = If(context.Request("FiltrarTodos") = Nothing, "", context.Request("FiltrarTodos").ToString())
Dim respuesta As Boolean = False Dim respuesta As Boolean = False
'TAREAS PROGRAMADAS 'TAREAS PROGRAMADAS
Select Case Metodo Select Case Metodo
Case "CrearActualizarProductos" Case "CrearActualizarProductos"
respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False)) respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False))
Case "ActualizarPrecios" Case "ActualizarPrecios"
respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False)) respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False))
Case "ActualizarExistencias" Case "ActualizarExistencias"
respuesta = ActualizarExistencias() respuesta = ActualizarExistencias()
Case "ActualizarVendedores" Case "ActualizarVendedores"
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False)) respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
End Select End Select
If respuesta Then If respuesta Then
retorno = "True" retorno = "True"
Else Else
retorno = "False" retorno = "False"
End If
End If End If
End If End If
context.Response.Write(retorno) context.Response.Write(retorno)
@@ -202,7 +205,7 @@ Public Class E141 : Implements IHttpHandler
Using httpClient = New HttpClient() Using httpClient = New HttpClient()
httpClient.Timeout = New TimeSpan(0, 5, 0) httpClient.Timeout = New TimeSpan(0, 5, 0)
Using request = New HttpRequestMessage(HttpMethod.Post, New Uri(url)) Using request = New HttpRequestMessage(HttpMethod.Post, New Uri(url))
request.Headers.Add("token", TokenAutorizacion) request.Headers.Add("X-PUBLIC-AUTH", TokenAutorizacion)
Using content = New StringContent(payload, Encoding.UTF8, "application/json") Using content = New StringContent(payload, Encoding.UTF8, "application/json")
request.Content = content request.Content = content
@@ -607,7 +610,7 @@ Public Class E141 : Implements IHttpHandler
End Select End Select
If VendedorData.Length > 4 Then If VendedorData.Length > 4 Then
Nombre = String.Concat(VendedorData(VendedorData.Length - 1), " ", VendedorData(VendedorData.Length)) Nombre = String.Concat(VendedorData(VendedorData.Length - 2), " ", VendedorData(VendedorData.Length - 1))
Apellido = String.Concat(VendedorData(0), " ", VendedorData(1)) Apellido = String.Concat(VendedorData(0), " ", VendedorData(1))
End If End If