Пример #1
0
        public async Task <CollectPaymentResponse> PostPayAccountPaymentCollections(int ownerId)
        {
            CollectPaymentResponse ret = null;

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

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

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

                ret = JsonSerializer.Deserialize <CollectPaymentResponse>(returnPost.Value);
            }
            catch (Exception ex)
            {
                log.Fatal(ex);
            }
            return(ret);
        }
Пример #2
0
        public void Init()
        {
            InitTestClass();

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

            command           = new CollectPaymentCommand();
            command.AccountId = BillingApiTestSettings.Default.BillingServiceApiPaymentCollectionsAccountId;
            pcResponse        = new CollectPaymentResponse();
        }
Пример #3
0
        public async Task AccountBalancePayNow_bug161553()
        {
            log.Info($"\t\tAccountBalancePayNow_bug161553()");
            // enroll
            iep     = testDataManager.GenerateOwnerPetTestData(numPets: 1);
            ownerId = testDataManager.DoStandardEnrollmentReturnOwnerCollection(iep);
            // pay now
            CollectPaymentResponse pay = await billingRestClient.PostPayAccountPaymentCollections(ownerId);

            Assert.IsNotNull(pay?.PaymentId, $"failed to pay balance for owner {ownerId}");
            // verify balance
            await billingDataVerifiers.verifyAccountDueBalance(ownerId, 0.0m);
        }