public void VerificationsApiBasePathTest()
        {
            string basePath = "http://abc.io";

            verificationsApi = new VerificationsApi(basePath);
            Assert.Equal(basePath, verificationsApi.GetBasePath());
        }
        public void VerificationsApiConfigurationTest()
        {
            Configuration config = new Configuration();

            config.BasePath  = "http://abc.io";
            verificationsApi = new VerificationsApi(config);
            Assert.Equal(config.BasePath, verificationsApi.GetBasePath());
        }
Esempio n. 3
0
        public IActionResult Verify([FromBody] string body)
        {
            JObject    obj        = JObject.Parse(body);
            PersonInfo personInfo = new PersonInfo();

            personInfo.FirstGivenName = obj["firstGivenName"].ToString();
            personInfo.MiddleName     = obj["middleName"].ToString();
            personInfo.FirstSurName   = obj["firstSurName"].ToString();
            personInfo.YearOfBirth    = (int)obj["yearOfBirth"];
            personInfo.MonthOfBirth   = (int)obj["monthOfBirth"];
            personInfo.DayOfBirth     = (int)obj["dayOfBirth"];

            Location location = new Location();

            location.BuildingNumber = obj["buildingNumber"].ToString();
            location.StreetName     = obj["streetName"].ToString();
            location.StreetType     = obj["streetType"].ToString();
            location.PostalCode     = obj["postalCode"].ToString();

            Communication communication = new Communication();

            communication.Telephone    = obj["telephone"].ToString();
            communication.EmailAddress = obj["emailAddress"].ToString();

            Passport passport = new Passport();

            passport.Number = obj["passportNumber"].ToString();

            DataFields dataFields = new DataFields();

            dataFields.PersonInfo    = personInfo;
            dataFields.Location      = location;
            dataFields.Communication = communication;
            dataFields.Passport      = passport;

            VerifyRequest verifyRequest = new VerifyRequest(countryCode: "AU", dataFields: dataFields);

            verifyRequest.AcceptTruliooTermsAndConditions = true;
            verifyRequest.CleansedAddress   = false;
            verifyRequest.ConfigurationName = ConfigurationName;

            try
            {
                VerifyResult result = new VerificationsApi(config).Verify(Mode, verifyRequest);
                return(new OkObjectResult(JsonConvert.SerializeObject(result, Formatting.Indented)));
            }
            catch (ApiException e)
            {
                return(StatusCode(e.ErrorCode, new Trulioo.SampleApp.Models.ObjectResult(
                                      errorCode: e.ErrorCode,
                                      message: e.Message,
                                      operation: "VerificationsApi#Verify"
                                      )));
            }
        }
        public void VerificationsApiApiAllParamsTest()
        {
            Configuration config      = new Configuration();
            ApiClient     client      = new ApiClient();
            ApiClient     asyncClient = new ApiClient();

            verificationsApi = new VerificationsApi(client, asyncClient, config);
            Assert.Equal(config, verificationsApi.Configuration);
            Assert.Equal(client, verificationsApi.Client);
            Assert.Equal(asyncClient, verificationsApi.AsynchronousClient);
        }
        public VerificationsApiTests()
        {
            int           port   = PortUtils.FindFreeTcpPort();
            Configuration config = new Configuration();

            config.BasePath = "http://localhost:" + port;
            config.ApiKey.Add("x-trulioo-api-key", TEST_API_KEY);
            verificationsApi = new VerificationsApi(config);

            mockServer = WireMockServer.Start(port);
        }
 public void VerificationsApiTest()
 {
     verificationsApi = new VerificationsApi();
     Assert.Equal("https://gateway.trulioo.com", verificationsApi.GetBasePath());
 }
 public VerificationsApiTests()
 {
     instance = new VerificationsApi();
 }