Exemplo n.º 1
0
        public async Task <AdvanceJson> RequestForAdvance([FromBody] AdvanceListModel model)
        {
            var advProcessing = new AdvanceProcessing(_context, _acquirerApi, _accountApi, _log);
            var advance       = model.Map();

            try
            {
                advance = await advProcessing.Request(advance, model.AuthToken);

                await _context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                return(new AdvanceErrorJson(ex.Message));
            }

            return(new AdvanceJson(advance));
        }
Exemplo n.º 2
0
        public async Task <AdvanceJson> EndAdvanceEvaluation([FromQuery] AdvanceEvaluationModel model)
        {
            var advProcessing = new AdvanceProcessing(_context, _acquirerApi, _accountApi, _log);
            var advance       = model.Map();

            try
            {
                advance = await advProcessing.EndEvaluation(advance, model.IsApproved, model.AuthToken);
            }
            catch (Exception ex)
            {
                return(new AdvanceErrorJson(ex.Message));
            }

            await _context.SaveChangesAsync();

            return(new AdvanceJson(advance));
        }