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);
        }
Exemple #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();
        }