static void GetMinAndMaxDateOfTransactions(ObpRestClient client) { var accounts = client.GetAccounts(); foreach (var account in accounts) { var accountBalance = client.GetAccountByIdCore(account.BankId, account.Id); Console.WriteLine("your account " + accountBalance.Label + " of type " + accountBalance.Type + " has " + accountBalance.Balance.Amount + " " + accountBalance.Balance.Currency); var result = client.GetTransactionsForAccountCore(account.BankId, account.Id); if (result != null && result.Transactions.Length > 0) { var transactions = result.Transactions; Console.WriteLine("stats for this account : Bank -" + account.BankId + " - account id: " + account.Id); GetMinAndMaxTransactionsDates(transactions); SumAllIncomesAndExpenses(transactions); GetIncomesAndExpenseByMonth(transactions); //GetReccuringIncomesAndExpenses(transactions); Console.WriteLine(""); } else { Console.WriteLine("this account is empty : Bank -" + account.BankId + " - account id: " + account.Id); } } }
private static void Test( ObpRestClient client, string bankId, string accountId, string viewId, string transactionRequestType, string description, string currency) { Test("GetAccountByIdCore", () => client.GetAccountByIdCore(bankId, accountId)); Test("GetAccountsAtBank", () => client.GetAccountsAtBank(bankId)); Test("GetAccountByIdFull", () => client.GetAccountByIdFull(bankId, accountId, viewId)); Test("GetAccounts", client.GetAccounts); Test( "GetTransactionById", () => client.GetTransactionById(bankId, accountId, viewId, "f64ae303-5be6-45e1-9bba-9a7dbbf11ccf")); Test("GetTransactionsForAccountCore", () => client.GetTransactionsForAccountCore(bankId, accountId)); Test("GetTransactionsForAccountFull", () => client.GetTransactionsForAccountFull(bankId, accountId, viewId)); Test("GetAccountsAtAllBanksPublic", client.GetAccountsAtAllBanksPublic); Test("GetTransactionTypesOfferedByBankResponse", () => client.GetTransactionTypesOfferedByBankResponse(bankId)); Test( "GetTransactionRequestTypesForAccount", () => client.GetTransactionRequestTypesForAccount(bankId, accountId, viewId)); Test("GetTransactionRequests", () => client.GetTransactionRequests(bankId, accountId, viewId)); Test("GetRoles", client.GetRoles); Test( "CreateTransactionRequest", () => client.CreateTransactionRequest( bankId, accountId, viewId, transactionRequestType, new CreateTransactionRequestRequest { To = new TransactionRequestAccount { AccountId = accountId, BankId = bankId }, Description = description, Value = new AmountOfMoney { Amount = 1000m, Currency = currency } })); }
private static void Test( ObpRestClient client, string bankId, string accountId, string viewId, string transactionRequestType, string description, string currency) { Test("GetAccountByIdCore", () => client.GetAccountByIdCore(bankId, accountId)); //Test("GetAccountsAtBank", () => client.GetAccountsAtBank(bankId)); Test("GetAccountByIdFull", () => client.GetAccountByIdFull(bankId, accountId, viewId)); Test("GetAccounts", client.GetAccounts); //Test("GetTransactionById",() => client.GetTransactionById(bankId, accountId, viewId, "f64ae303-5be6-45e1-9bba-9a7dbbf11ccf")); Test("GetTransactionsForAccountCore", () => client.GetTransactionsForAccountCore(bankId, accountId)); Test("GetTransactionsForAccountFull", () => client.GetTransactionsForAccountFull(bankId, accountId, viewId)); Test("GetAccountsAtAllBanksPublic", client.GetAccountsAtAllBanksPublic); Test("GetTransactionTypesOfferedByBankResponse", () => client.GetTransactionTypesOfferedByBankResponse(bankId)); Test( "GetTransactionRequestTypesForAccount", () => client.GetTransactionRequestTypesForAccount(bankId, accountId, viewId)); Test("GetTransactionRequests", () => client.GetTransactionRequests(bankId, accountId, viewId)); Test("GetRoles", client.GetRoles); /*Test( * "CreateTransactionRequest", * () => * client.CreateTransactionRequest( * bankId, * accountId, * viewId, * transactionRequestType, * new CreateTransactionRequestRequest * { * To = * new TransactionRequestAccount * { * AccountId = accountId, * BankId = bankId * }, * Description = description, * Value = * new AmountOfMoney * { * Amount = 1000m, * Currency = currency * } * }));*/ }