コード例 #1
0
        public async Task <SaveBankAccountResponse> PostSaveCanadaBankAccount(int ownerId, BillingParameters billingParam)
        {
            SaveBankAccountResponse   ret     = null;
            SaveUsaBankAccountCommand command = new SaveUsaBankAccountCommand();

            try
            {
                ownerCollection = testDataManager.GetEnrolledOwnerCollection(ownerId);
                IReadOnlyList <Account> accounts = await GetBillingAccountByPolicyHolderId(ownerCollection.OwnerInformation.UniqueId.ToString());

                command               = GetSaveUsaBankAccountCommandFromBillingParameter(accounts.First(), billingParam);
                command.AccountId     = BillingTestCommonSettings.Default.SaveUsaBankAccountBillingAccountId;
                command.NameOnAccount = $"bat{billingParam.BankAccountNameOnAccount}";

                RestRequestSpecification req = new RestRequestSpecification();
                req.Verb        = HttpMethod.Post;
                req.Headers     = Headers;
                req.ContentType = "application/json";
                req.RequestUri  = $"v2/bankaccounts/canada";
                req.Content     = JsonSerializer.Serialize(command);
                var returnPost = await asyncRestClientBilling.ExecuteAsync <string>(req);

                ret = JsonSerializer.Deserialize <SaveBankAccountResponse>(returnPost.Value);
            }
            catch (Exception ex)
            {
                log.Fatal(ex);
            }
            return(ret);
        }
コード例 #2
0
        public async Task SaveUsaBankAccount()
        {
            iep     = testDataManager.GenerateOwnerPetTestData(numPets: 1);
            ownerId = testDataManager.DoStandardEnrollmentReturnOwnerCollection(iep);
            BillingParameters       billingParams = iep.BillingParams;
            SaveBankAccountResponse respond       = await billingRestClient.PostSaveUsaBankAccount(ownerId, billingParams);

            Assert.IsNotNull(respond, $"failed to save bank account");
            BankAccount bAccount = await billingRestClient.GetBankAccouintsByOwnerId(ownerId);

            //var acount = qaLibRestClient.GetBillingAccountByOwnerId(ownerId);
        }