Beispiel #1
0
        public async Task <TransactionResponse> ApproveTransaction(TransactionRequest req)
        {
            TransactionResponse response = new TransactionResponse();

            try
            {
                TransactionResponse getItem = await dep.GetPost(req);

                TransactionLevelFacade  transactionLevelFacade  = new TransactionLevelFacade();
                TransactionLevelRequest transactionLevelRequest = new TransactionLevelRequest();
                transactionLevelRequest.ID = getItem.ListTransaction.FirstOrDefault().TrasanctionLevel.ID;
                TransactionLevelResponse transactionLevelResponse = new TransactionLevelResponse();
                transactionLevelResponse = await transactionLevelFacade.GetNextLevel(transactionLevelRequest);

                if (transactionLevelResponse.model == null)
                {
                    response.IsSuccess = false;
                    response.Message   = transactionLevelResponse.Message;
                    return(response);
                }

                req.TrasanctionLevel.ID = transactionLevelResponse.model.ID;

                response = await dep.ApproveTransaction(req);
            }
            catch (Exception ex)
            {
                log.Error(ex);
                response.IsSuccess = false;
                response.Message   = ex.ToString();
            }
            return(response);
        }