public async Task PagosBusiness_ModificarEstadoPagoPersona_ShouldModify()
        {
            PagosBusiness pagosBusiness = new PagosBusiness();

            //HistorialPagosPersonas pagoParaBuscar = new HistorialPagosPersonas
            //{
            //    Consecutivo = 23,
            //    EstadoDelPago = EstadoDeLosPagos.Aprobado,
            //    ReferenciaPago = "1000",
            //    ObservacionesCliente = "AHHH"
            //};

            SecureMessagesHelper secure = new SecureMessagesHelper();

            HistorialPagosPersonas pagoParaBuscar = await secure.DecryptMessageToEntity <HistorialPagosPersonas>(@"V2ml95eBh7ItyXvGE6HFf6mruGwgX8chJa/x60rD2aiiauGmpgz8l9RegHPQoX+zJ7f+wGTg/V85DDxde85FS4Niz3y1KOVixk6P/r+3tXXVSzXdmLGOBpizdjTQ232Lhgnayf/nSJxh4OvS3WCpxJ9kEqOqozcYykOf6z7UjtFqQMwPbFE1Sx8+PW2KXIVidJGdu8GuLnlL7KNIJRnYNvtStdcPrMlqtW3UA8HBRpf/JEII5BCUGnmjz/WIm3p/i6KTd+3Di5Rks+rpQxHotNr+KiWFSC399YcU3EJrltxK7qGHDv/wiKULK2To/cjZX1TLgWUyncPssZ5e5G77UHihfhgRSK4I21UYnF8AKTI013dQd1ybSSKOOWHv4/a2NoNqeohygEJr0/nHe38aJ3S8Th59GngCH9dnMjIGeR8mL8F4R7ZTZOxV4a5H7p3CgCs+ak3cF6L4et1Qyg8QyLG3H4tHyZP/AhO6vsXzx0Hp1sP9hE5pYWZuZJmRlDMTQRaiVOu4o2m8aQnRSVZ0oXEqkR7Gm6RlDJRvwFDRSmKEDGA2s6itBXnIVM5wrxp5wC/PTjPd7AhKkQ3eHDbtaHKOzbKZHAI1dI8Vlb20KyUWKEpckP4xO4INptYOf7IsFSdSOh5AkznIblWhGTj9q96xmmBTztPKjxAKXW6m4iWulLlT6OdMd1wK+o32z0YoUYT0qCJbfQaGbFhd5zu2z5+VaK6xhh9FX9rGZ/7+rZ9wmd+iIFi31LFsn+II1Ak4I++i0gOlVCAQ34eYZ41/i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0TRkHQlKX48i3/hP5D7NQX/CZNB31hu+Ad0HxQFzqtZGCVqCGhI6aL4sWE/sFd+e8xL+vt4GqTslAsDZXC4Jp1jSFB/vl072wOOo8qf3W/ggGJgNxBEcyRmX6k+pn8An0/d9InFNz3SRVHkgxqdpGDCOJd4l41IgLhypmsIDDH34O7xVNPXbOgCEuEjqkodMjBykX7v0n5s7s2DxyiVx3TAyJH0+UNwbVsQDTrdiU+inLbPdd+kyl2TWzm0r7jAnLRgOSfhVkVbnaF/bZBYQNPjXJcqAyUdqmUbvcZpRMC9AxRCRhT0ZBaIU8vhX2BFe33VJR0GNUJmPkUJgDo9D35A==");

            var respuesta = await pagosBusiness.ModificarEstadoPagoPersona(pagoParaBuscar);

            Assert.IsNotNull(respuesta);
        }
Beispiel #2
0
        public async Task <IHttpActionResult> ModificarEstadoPagoPersona(HistorialPagosPersonas historialPagoParaModificar)
        {
            if (historialPagoParaModificar == null || historialPagoParaModificar.Consecutivo <= 0 || historialPagoParaModificar.CodigoPersona <= 0 || historialPagoParaModificar.CodigoPlan <= 0 ||
                historialPagoParaModificar.EstadoDelPago == EstadoDeLosPagos.SinEstadoDelPago)
            {
                return(BadRequest("monedaParaModificar vacio y/o invalido!."));
            }
            else if (historialPagoParaModificar.EstadoDelPago == EstadoDeLosPagos.PendientePorAprobar && historialPagoParaModificar.CodigoArchivo <= 0 && string.IsNullOrWhiteSpace(historialPagoParaModificar.ReferenciaPago))
            {
                return(BadRequest("historialPagoParaModificar debe tener un archivo y codigo de referencia si se va a reportar!."));
            }

            try
            {
                Tuple <WrapperSimpleTypesDTO, TimeLineNotificaciones> tupleWrapper = await _pagosBusiness.ModificarEstadoPagoPersona(historialPagoParaModificar);

                if (tupleWrapper.Item1.Exitoso && tupleWrapper.Item2 != null)
                {
                    NoticiasBusiness noticiasBusiness = new NoticiasBusiness();

                    IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext <ChatHub>();
                    hubContext.Clients.Group(ChatHub._prefixChatGroupName + tupleWrapper.Item2.CodigoPersonaDestino.ToString()).receiveNotification(tupleWrapper.Item2);
                }

                return(Ok(tupleWrapper.Item1));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }