public ActionResult Index(AccountModel accountModel) { AccountModel model = this.serviceOperations.GetCustomerAccountTransactions(accountModel); if (model.Accounts == null) { model.Accounts = accounts; } return View(model); }
internal AccountModel GetCustomerAccounts() { AccountModel model = new AccountModel(); //Demo purposes only. The OAuth tokens returned by the SAML assertion are valid for 1 hour and do not need to be requested before each API call. SamlRequestValidator validator = new SamlRequestValidator(AggCatAppSettings.Certificate, AggCatAppSettings.ConsumerKey, AggCatAppSettings.ConsumerSecret, AggCatAppSettings.SamlIdentityProviderId, AggCatAppSettings.CustomerId); ServiceContext ctx = new ServiceContext(validator); AggregationCategorizationService svc = new AggregationCategorizationService(ctx); try { AccountList accountList = svc.GetCustomerAccounts(); if (accountList != null && accountList.AnyIntuitObjects != null) { model.Accounts = accountList.AnyIntuitObjects.ToList(); } else { accountList = null; } model.Error = null; model.Success = true; } catch (AggregationCategorizationException ex) { model.Accounts = null; model.Error = ex.ToString(); model.Success = false; } return model; }
internal AccountModel GetCustomerAccountTransactions(AccountModel accountModel) { try { //Demo purposes only. The OAuth tokens returned by the SAML assertion are valid for 1 hour and do not need to be requested before each API call. SamlRequestValidator validator = new SamlRequestValidator(AggCatAppSettings.Certificate, AggCatAppSettings.ConsumerKey, AggCatAppSettings.ConsumerSecret, AggCatAppSettings.SamlIdentityProviderId, AggCatAppSettings.CustomerId); ServiceContext ctx = new ServiceContext(validator); AggregationCategorizationService svc = new AggregationCategorizationService(ctx); accountModel.Transactions = svc.GetAccountTransactions(accountModel.AccountId, new DateTime(2011, 01, 01)).AnyIntuitObjects.ToList(); accountModel.Success = true; accountModel.Error = null; } catch (AggregationCategorizationException ex) { accountModel.Transactions = null; accountModel.Success = false; accountModel.Error = ex.ToString(); } return accountModel; }