Example #1
0
        public async Task FundingTestMethod()
        {
            string katapultPrivate = " ";
            string ordernumber     = "1033711204843";

            IAffirmAPI      affirmAPI        = new AffirmAPI(contextAccessor, httpClient, false, null);
            KatapultFunding katapultResponse = await affirmAPI.KatapultFundingAsync(katapultPrivate);

            if (katapultResponse != null)
            {
                FundingObject fundingObject = katapultResponse.FundingReport.FundingObjects.Where(f => f.OrderId.Equals(ordernumber)).FirstOrDefault();
                Console.WriteLine(JsonConvert.SerializeObject(fundingObject));
            }
            else
            {
                Assert.Fail();
            }
        }
Example #2
0
        public async Task TestMethod1()
        {
            IAffirmAPI affirmAPI = new AffirmAPI(contextAccessor, httpClient, false, null);
            dynamic    response  = await affirmAPI.ReadAsync(publicKey, privateKey, chargeId);

            if (response != null)
            {
                //response = GetDynamicValue("?xml", response);
                //string status_code = GetDynamicValue("status_code", response);
                //string message = GetDynamicValue("message", response);
                //string code = GetDynamicValue("code", response);
                //string type = GetDynamicValue("type", response);
                string status_code = response.status_code;
                string message     = response.message;
                string code        = response.code;
                string type        = response.type;
            }
            else
            {
                Assert.Fail();
            }
        }
Example #3
0
        public async Task TestMethod3()
        {
            IAffirmAPI affirmAPI = new AffirmAPI(contextAccessor, httpClient, false, null);
            dynamic    response  = await affirmAPI.AuthorizeAsync(publicKey, privateKey, "U5LL34ABTDS8A7DM", "1023171562818");

            if (response != null)
            {
                //response = GetDynamicValue("?xml", response);
                //string status_code = GetDynamicValue("status_code", response);
                //string message = GetDynamicValue("message", response);
                //string code = GetDynamicValue("code", response);
                //string type = GetDynamicValue("type", response);
                string status_code = response.status_code;
                string message     = response.message;
                string code        = response.code;
                string type        = response.type;
                Console.WriteLine(response);
            }
            else
            {
                Assert.Fail();
            }
        }