Ejemplo n.º 1
0
        public async Task <string> JsonOperations(AgreementServicesRequest request)
        {
            var response = string.Empty;

            switch (request.Transformation.Operacion)
            {
            case OperationType.Consultar:
                response = await _jsonServices.GetAsync(
                    request.ServiceUri,
                    request.Transformation.IdFactura);

                break;

            case OperationType.Pagar:
                var resp = await _transformationRepository.TransformationCall(request.Transformation);

                var contenido = JObject.Parse(resp).GetValue("mensaje");
                response = await _jsonServices.PostAsync(
                    request.ServiceUri,
                    request.Transformation.IdFactura,
                    contenido.ToString());

                break;

            case OperationType.Compensar:
                response = await _jsonServices.DeleteAsync(
                    request.ServiceUri,
                    request.Transformation.IdFactura);

                break;
            }
            return(response);
        }