public void Test_Idempotency_UsersCreateBankAccountsCa()
        {
            string key     = DateTime.Now.Ticks.ToString();
            var    john    = this.GetJohn();
            var    account = new BankAccountCaPostDTO(john.FirstName + " " + john.LastName, john.Address, "TestBankName",
                                                      "123", "12345", "234234234234");

            Api.Users.CreateBankAccountCa(key, john.Id, account);

            var result = Api.Idempotency.Get(key);

            Assert.IsInstanceOf <BankAccountCaDTO>(result.Resource);
        }
        public void Test_Users_CreateBankAccount_CA()
        {
            try
            {
                UserNaturalDTO       john    = this.GetJohn();
                BankAccountCaPostDTO account = new BankAccountCaPostDTO(john.FirstName + " " + john.LastName, john.Address, "TestBankName", "123", "12345", "234234234234");

                BankAccountDTO createAccount = this.Api.Users.CreateBankAccountCa(john.Id, account);

                Assert.IsTrue(createAccount.Id.Length > 0);
                Assert.IsTrue(createAccount.UserId == (john.Id));
                Assert.IsTrue(createAccount.Type == BankAccountType.CA);
                Assert.IsTrue(((BankAccountCaDTO)createAccount).AccountNumber == "234234234234");
                Assert.IsTrue(((BankAccountCaDTO)createAccount).BankName == "TestBankName");
                Assert.IsTrue(((BankAccountCaDTO)createAccount).BranchCode == "12345");
                Assert.IsTrue(((BankAccountCaDTO)createAccount).InstitutionNumber == "123");
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
 /// <summary>Creates CA bank account.</summary>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="userId">User identifier.</param>
 /// <param name="bankAccount">Bank account instance to be created.</param>
 /// <returns>Bank account instance returned from API.</returns>
 public BankAccountCaDTO CreateBankAccountCa(String idempotencyKey, String userId, BankAccountCaPostDTO bankAccount)
 {
     return(this.CreateObject <BankAccountCaDTO, BankAccountCaPostDTO>(idempotencyKey, MethodKey.UsersCreateBankAccountsCa, bankAccount, userId));
 }
 /// <summary>Creates CA bank account.</summary>
 /// <param name="userId">User identifier.</param>
 /// <param name="bankAccount">Bank account instance to be created.</param>
 /// <returns>Bank account instance returned from API.</returns>
 public BankAccountCaDTO CreateBankAccountCa(String userId, BankAccountCaPostDTO bankAccount)
 {
     return(CreateBankAccountCa(null, userId, bankAccount));
 }
Beispiel #5
0
 /// <summary>Creates CA bank account.</summary>
 /// <param name="userId">User identifier.</param>
 /// <param name="bankAccount">Bank account instance to be created.</param>
 /// <returns>Bank account instance returned from API.</returns>
 public async Task <BankAccountCaDTO> CreateBankAccountCa(String userId, BankAccountCaPostDTO bankAccount)
 {
     return(await CreateBankAccountCa(null, userId, bankAccount));
 }
        public async Task <BankAccountCaDTO> CreateBankAccountCa(string idempotencyKey, string userId, BankAccountCaPostDTO bankAccount)
        {
            var targetUrl = $"{_baseUrl}/users/{userId}/bankaccounts/ca";

            return(await CreateEntity <BankAccountCaDTO, BankAccountCaPostDTO>(targetUrl, bankAccount, idempotencyKey));
        }