Ejemplo n.º 1
0
        public async Task <bool> PostCreditBalanceRefunds(int ownerId)
        {
            bool ret = false;

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

                RefundCreditBalanceCommand command = new RefundCreditBalanceCommand();
                command.AccountId = accounts.First().Id;

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

                ret = returnPost.Success;
            }
            catch (Exception ex)
            {
                log.Fatal(ex);
            }
            return(ret);
        }
Ejemplo n.º 2
0
        public async Task CreditBalanceRefunds_empryCommand()
        {
            command         = new RefundCreditBalanceCommand();
            request.Content = JsonSerializer.Serialize(command);
            cbrResult       = await asyncRestClientBilling.ExecuteAsync <string>(request);

            Assert.IsFalse(cbrResult.Success, $"successed");
            Assert.IsTrue(cbrResult.Message.Contains(@"Account id must be supplied and non-empty."), $"unexpected message - {cbrResult.Message}");
        }
Ejemplo n.º 3
0
        public void Init()
        {
            InitTestClass();

            request.Verb       = HttpMethod.Post;
            request.RequestUri = $"v2/creditbalancerefunds";

            command           = new RefundCreditBalanceCommand();
            command.AccountId = BillingApiTestSettings.Default.BillingServiceApiAccountExternalId.ToString();
        }