public static BankAccountRef CreateAccount(APIClient client, string userId) { var accounts = client.GetBankAccounts(userId); var result = accounts.FirstOrDefault(e => e.Iban == IBAN); if (result == null) { var account = new BankAccount { Bic = BIC, Iban = IBAN, DisplayName = "Smoney default account", IsMine = true }; result = client.PostBankAccount(account, userId); } return new BankAccountRef { Id = result.Id.Value }; }
public BankAccount PutBankAccount(BankAccount bankAccount, string userId = null) { var uri = CreateUri(userId, bankaccounts); return PostAsync(uri, bankAccount); }