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 * } * }));*/ }
private static bool TxExists(string description, ObpRestClient client, DateTime laatsteKeerBinnengekomen) { var transactions = client.GetTransactionsForAccountFull(bankId, accountId, viewId); foreach (var transaction in transactions.Transactions) { if (transaction.Details.Value.Amount > 0 && transaction.Details.Description.Contains(description) && transaction.Details.Completed > laatsteKeerBinnengekomen) { Console.WriteLine(JsonConvert.SerializeObject(transaction, Formatting.Indented)); return(true); } } return(false); }