Ejemplo n.º 1
0
        public ActionResult ConnectLogin(ConnectLoginViewModel model)
        {
            model.Login = Service.Logins.GetById(model.LoginId);
            var hookUrl = string.Format("{0}?loginId={1}", BuildHookUrl(), model.Login.Id);
            var options = new BankDataServiceOptions(model.Username, model.Password, model.Login.Institution, hookUrl,
                model.LoginId);
            var bankList = new List<BankLoginAccount>();
            var token = BankService.AuthenticateBankUser(options, out bankList);
            model.Login.AccessToken = token;
            Service.Logins.Upsert(model.Login);

            // Save banks
            foreach (BankLoginAccount bank in bankList) {
                Service.Accounts.Upsert(bank);
            }

            return RedirectToAction("AccountList", new {model.LoginId});
        }
Ejemplo n.º 2
0
 public ActionResult ConnectLogin(Guid loginId)
 {
     var login = Service.Logins.GetById(loginId);
     var model = new ConnectLoginViewModel();
     model.Login = login;
     return View(model);
 }