Ejemplo n.º 1
0
        public async void TestPayoutsItemCancelRequest()

        {
            var response = await PayoutsPostTest.TestCreatePayoutRequest();

            CreatePayoutResponse batch   = response.Result <CreatePayoutResponse>();
            PayoutsGetRequest    request = new PayoutsGetRequest(batch.BatchHeader.PayoutBatchId);



            Thread.Sleep(10000);
            HttpResponse getResponse = await TestHarness.client().Execute(request);

            PayoutBatch batchDetails = getResponse.Result <PayoutBatch>();

            Assert.NotNull(batchDetails.Items);
            Assert.NotNull(batchDetails.Items[0]);
            Assert.NotNull(batchDetails.Items[0].PayoutItemId);

            Console.WriteLine("Status: " + batchDetails.Items[0].TransactionStatus);
            Thread.Sleep(10000);

            if (batchDetails.Items[0].TransactionStatus.Equals("UNCLAIMED"))
            {
                PayoutsItemCancelRequest cancelRequest = new PayoutsItemCancelRequest(batchDetails.Items[0].PayoutItemId);

                HttpResponse cancelResponse = await TestHarness.client().Execute(cancelRequest);

                Assert.Equal(200, (int)cancelResponse.StatusCode);
                Assert.NotNull(cancelResponse.Result <PayoutItemResponse>());
            }
            // Add your own checks here
        }
Ejemplo n.º 2
0
        public async void TestPayoutsGetRequest()
        {
            var response = await PayoutsPostTest.TestCreatePayoutRequest();

            CreatePayoutResponse batch   = response.Result <CreatePayoutResponse>();
            PayoutsGetRequest    request = new PayoutsGetRequest(batch.BatchHeader.PayoutBatchId)
                                           .Page(4)
                                           .PageSize(2)
                                           .TotalRequired(true);

            HttpResponse getResponse = await TestHarness.client().Execute(request);

            Assert.Equal(200, (int)getResponse.StatusCode);
            Assert.NotNull(getResponse.Result <PayoutBatch>());

            // Add your own checks here
        }
        public async void TestPayoutsItemGetRequest()
        {
            var response = await PayoutsPostTest.TestCreatePayoutRequest();

            CreatePayoutResponse batch   = response.Result <CreatePayoutResponse>();
            PayoutsGetRequest    request = new PayoutsGetRequest(batch.BatchHeader.PayoutBatchId);


            HttpResponse getResponse = await TestHarness.client().Execute(request);

            PayoutBatch batchDetails = getResponse.Result <PayoutBatch>();

            PayoutsItemGetRequest itemGetRequest = new PayoutsItemGetRequest(batchDetails.Items[0].PayoutItemId);

            HttpResponse itemGetResponse = await TestHarness.client().Execute(itemGetRequest);

            Assert.Equal(200, (int)itemGetResponse.StatusCode);
            Assert.NotNull(itemGetResponse.Result <PayoutItemResponse>());

            // Add your own checks here
        }