// GET: /<controller>/ public IActionResult Index() { //var consent = _medBankServices.GetConsent(); var bankInfo = _medBankServices.GetAccountInfoById("ACC_ID_123456789").Result; return(View()); }
public async Task <IActionResult> addBank(accountViewModel model) { var acctModel = new accountModel(); //string accountId = "ACC _ID_" + model.acctNumber; if (model.bankName.ToLower() == "seb") { TempData["accountnumber"] = model.acctNumber; var redirecturl = _sEBAccountAuthService.AuthRedirectUrl(); return(Redirect(redirecturl)); } else { var bankInfo = _medBankServices.GetAccountInfoById(model.acctNumber).Result; acctModel.BankName = model.bankName; acctModel.BankAccountNumber = bankInfo.AccountNumber; acctModel.BankAccountName = bankInfo.AccountName; acctModel.Currency = bankInfo.Currency; acctModel.AccountType = bankInfo.AccountType; acctModel.Balance = bankInfo.AccountBalance; acctModel.TotalExpense = bankInfo.TotalExpenses; acctModel.TotalIncome = bankInfo.TotalIncome; acctModel.SandboxIdentification = bankInfo.SandboxIdentification; acctModel.CreatedAt = DateTime.Now; acctModel.User = await _userManager.GetUserAsync(HttpContext.User); acctModel.TransactionLimit = model.transactionLimit; _context.AccountModels.Add(acctModel); await _context.SaveChangesAsync(); } return(RedirectToAction(nameof(Dashboard))); }