示例#1
0
        /// <inheritdoc />
        public ScreeningResult OrganizationScreening(
            string idType,
            string countries,
            string id       = null,
            string name     = null,
            string source   = null,
            bool?rawJson    = null,
            string listType = null,
            int?offset      = null,
            int?limit       = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Information}/organizations/screening",
                                                  new Dictionary <string, object>()
            {
                { "idType", idType },
                { "countries", countries },
                { "id", id },
                { "name", name },
                { "source", source },
                { "rawJson", rawJson },
                { "listType", listType },
                { "offset", offset },
                { "limit", limit }
            });

            return(Get <ScreeningResult>(url));
        }
示例#2
0
        /// <inheritdoc />
        public Task <Organization.SearchResult> OrganizationSearchAsync(string idType,
                                                                        string countries,
                                                                        string id     = null,
                                                                        string name   = null,
                                                                        string source = null,
                                                                        bool?rawJson  = null,
                                                                        string cursor = null,
                                                                        int?offset    = null,
                                                                        int?limit     = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Information}/organizations/search",
                                                  new Dictionary <string, object>()
            {
                { "idType", idType },
                { "countries", countries },
                { "id", id },
                { "name", name },
                { "source", source },
                { "rawJson", rawJson },
                { "cursor", cursor },
                { "offset", offset },
                { "limit", limit }
            });

            return(GetAsync <Organization.SearchResult>(url));
        }
        /// <summary>
        /// Lists historic identification sessions filtered by the provided parameters.
        /// </summary>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <param name="day"></param>
        /// <param name="status"></param>
        /// <param name="identityProviderType"></param>
        /// <param name="externalId"></param>
        /// <param name="name"></param>
        /// <param name="skip"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public async Task <LogItemList> ListLogEntriesAsync(
            int year,
            int?month     = null,
            int?day       = null,
            string status = null,
            string identityProviderType = null,
            string externalId           = null,
            string name  = null,
            int?skip     = null,
            int?pageSize = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Identification}/log/filter/{year}",
                                                  new Dictionary <string, object>()
            {
                { "month", month },
                { "day", day },
                { "status", status },
                { "identityProviderType", identityProviderType },
                { "externalId", externalId },
                { "name", name },
                { "skip", skip },
                { "pageSize", pageSize }
            });

            return(await GetAsync <LogItemList>(url));
        }
示例#4
0
        /// <inheritdoc />
        public Task <Person.SearchResult> PersonSearchAsync(
            string dateOfBirth = null,
            string postalCode  = null,
            string countries   = null,
            string id          = null,
            string name        = null,
            string source      = null,
            bool?rawJson       = null,
            int?offset         = null,
            int?limit          = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Information}/persons/search",
                                                  new Dictionary <string, object>()
            {
                { "dateOfBirth", dateOfBirth },
                { "postalCode", postalCode },
                { "countries", countries },
                { "id", id },
                { "name", name },
                { "source", source },
                { "rawJson", rawJson },
                { "offset", offset },
                { "limit", limit }
            });

            return(GetAsync <Person.SearchResult>(url));
        }
示例#5
0
        /// <inheritdoc />
        public Task <Person.AddressVerification> PersonVerifyAddressAsync(
            string country,
            string identityNumber = null,
            string givenName      = null,
            string surname        = null,
            string dateOfBirth    = null,
            string caseRef        = null,
            string street         = null,
            string streetNumber   = null,
            string postalCode     = null,
            string city           = null,
            string source         = null,
            bool?rawJson          = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Information}/countries/{country}/persons/address/verify",
                                                  new Dictionary <string, object>()
            {
                { "identityNumber", identityNumber },
                { "givenName", givenName },
                { "surname", surname },
                { "dateOfBirth", dateOfBirth },
                { "caseRef", caseRef },
                { "street", street },
                { "streetNumber", streetNumber },
                { "postalCode", postalCode },
                { "city", city },
                { "source", source },
                { "rawJson", rawJson }
            });

            return(GetAsync <Person.AddressVerification>(url));
        }
示例#6
0
        /// <summary>
        /// Queries your documents using the provided parameters.
        /// </summary>
        /// <param name="externalId"></param>
        /// <param name="signerId"></param>
        /// <param name="externalSignerId"></param>
        /// <param name="fromDate"></param>
        /// <param name="toDate"></param>
        /// <param name="lastUpdated"></param>
        /// <param name="signedDate"></param>
        /// <param name="nameOfSigner"></param>
        /// <param name="title"></param>
        /// <param name="status"></param>
        /// <param name="tags"></param>
        /// <param name="offset"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        public async Task <CollectionWithPaging <DocumentSummary> > ListDocumentSummariesAsync(
            string externalId       = null,
            Guid?signerId           = null,
            string externalSignerId = null,
            DateTime?fromDate       = null,
            DateTime?toDate         = null,
            DateTime?lastUpdated    = null,
            DateTime?signedDate     = null,
            string nameOfSigner     = null,
            string title            = null,
            DocumentStatus?status   = null,
            string tags             = null,
            int?offset = null,
            int?limit  = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.SignatureDocuments}/summary",
                                                  new Dictionary <string, object>()
            {
                { "externalId", externalId },
                { "signerId", signerId },
                { "externalSignerId", externalSignerId },
                { "fromDate", fromDate },
                { "toDate", toDate },
                { "lastUpdated", lastUpdated },
                { "signedDate", signedDate },
                { "nameOfSigner", nameOfSigner },
                { "title", title },
                { "status", status },
                { "tags", tags },
                { "offset", offset },
                { "limit", limit }
            });

            return(await GetAsync <CollectionWithPaging <DocumentSummary> >(url));
        }
示例#7
0
        /// <summary>
        /// Returns a list of accounts you have access to.
        /// </summary>
        /// <returns></returns>
        public async Task <IList <AccountListItem> > ListAccountsAsync(
            string name                 = null,
            string orgNo                = null,
            string uniCustomerNo        = null,
            DateTime?createdBefore      = null,
            DateTime?createdAfter       = null,
            DateTime?lastModifiedBefore = null,
            DateTime?lastModifiedAfter  = null,
            string dealerName           = null,
            string dealerReference      = null,
            List <string> tags          = null,
            bool?enabled                = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Admin}/account/list", new Dictionary <string, object>()
            {
                { "name", name },
                { "orgNo", orgNo },
                { "uniCustomerNo", uniCustomerNo },
                { "createdBefore", createdBefore },
                { "createdAfter", createdAfter },
                { "lastModifiedBefore", lastModifiedBefore },
                { "lastModifiedAfter", lastModifiedAfter },
                { "dealerName", dealerName },
                { "dealerReference", dealerReference },
                { "tags", tags },
                { "enabled", enabled }
            });

            return(await GetAsync <IList <AccountListItem> >(url));
        }
        /// <summary>
        /// Invalidates an identification session to avoid using the same request twice.
        /// </summary>
        /// <param name="requestId"></param>
        public void InvalidateSession(string requestId)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Identification}/session/invalidate",
                                                  new Dictionary <string, object>()
            {
                { "requestId", requestId }
            });

            Put(url);
        }
        /// <summary>
        /// Returns a list of previously created sessions. The session data returned from this endpoint does not contain any personal information.
        /// </summary>
        /// <param name="cursor"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        public Task <PaginatedData <IdSession> > ListSessionsAsync(string cursor = null, int?limit = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.IdentificationV2}/sessions", new Dictionary <string, object>()
            {
                { "cursor", cursor },
                { "limit", limit }
            });

            return(GetAsync <PaginatedData <IdSession> >(url));
        }
示例#10
0
        /// <inheritdoc />
        public IEnumerable <Geodata.DivisionListItem> ListCountrySubdivisions(string countryCode, string lang = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Information}/geodata/countries/{countryCode}/subdivisions",
                                                  new Dictionary <string, object>()
            {
                { "lang", lang }
            });

            return(Get <IEnumerable <Geodata.DivisionListItem> >(url));
        }
示例#11
0
        /// <summary>
        /// Retrieves up to 100 unhandled events for your account. After you retrieve this list the events will be "locked" for 10 minutes to give you time to handle them.
        /// Please handle the events using one of the endpoints in this API to avoid retrieving the same events multiple times.
        /// </summary>
        /// <param name="eventType"></param>
        /// <param name="tags"></param>
        /// <returns></returns>
        public async Task <IList <Event> > ListUnhandledEventsAsync(string eventType = null, string tags = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Notification}/events", new Dictionary <string, object>()
            {
                { "eventType", eventType },
                { "tags", tags }
            });

            return(await GetAsync <IList <Event> >(url));
        }
示例#12
0
        /// <summary>
        /// Peeks the top 100 unhandled events regardless if they are locked or not. Don't use this endpoint to handle events.
        /// </summary>
        /// <param name="eventType"></param>
        /// <param name="tags"></param>
        /// <returns></returns>
        public IList <Event> PeekEvents(string eventType = null, string tags = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Notification}/events/peek", new Dictionary <string, object>()
            {
                { "eventType", eventType },
                { "tags", tags }
            });

            return(Get <IList <Event> >(url));
        }
示例#13
0
        /// <summary>
        /// Cancels a document.
        /// </summary>
        /// <param name="documentId"></param>
        /// <param name="reason"></param>
        /// <returns></returns>
        public void CancelDocument(Guid documentId, string reason = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.SignatureDocuments}/{documentId}/cancel",
                                                  new Dictionary <string, object>()
            {
                { "reason", reason }
            });

            Post(url);
        }
示例#14
0
        /// <summary>
        /// Retrieves the attachment file.
        /// </summary>
        /// <param name="documentId"></param>
        /// <param name="attachmentId"></param>
        /// <param name="fileFormat"></param>
        /// <returns></returns>
        public async Task <Stream> GetAttachmentFileAsync(Guid documentId, Guid attachmentId, FileFormat fileFormat)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.SignatureDocuments}/{documentId}/files/attachments/{attachmentId}",
                                                  new Dictionary <string, object>()
            {
                { "fileFormat", fileFormat }
            });

            return(await GetFileAsync(url));
        }
示例#15
0
        /// <summary>
        /// Retrieves the signed document file for the specified signer.
        /// </summary>
        /// <param name="documentId"></param>
        /// <param name="signerId"></param>
        /// <param name="fileFormat"></param>
        /// <returns></returns>
        public Stream GetFileForSigner(Guid documentId, Guid signerId, FileFormat fileFormat)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.SignatureDocuments}/{documentId}/files/signers/{signerId}",
                                                  new Dictionary <string, object>()
            {
                { "fileFormat", fileFormat }
            });

            return(GetFile(url));
        }
        /// <summary>
        /// Retrieves the response of a single identification session.
        /// </summary>
        /// <param name="requestId"></param>
        /// <param name="metaData"></param>
        /// <returns></returns>
        public async Task <IdentificationResponse> GetSessionAsync(string requestId, bool?metaData = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Identification}/session", new Dictionary <string, object>()
            {
                { "requestId", requestId },
                { "metaData", metaData }
            });

            return(await GetAsync <IdentificationResponse>(url));
        }
        /// <summary>
        /// Invalidates an identification session to avoid using the same request twice.
        /// </summary>
        /// <param name="requestId"></param>
        public async Task InvalidateSessionAsync(string requestId)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Identification}/session/invalidate",
                                                  new Dictionary <string, object>()
            {
                { "requestId", requestId }
            });

            await PutAsync(url);
        }
示例#18
0
        /// <inheritdoc />
        public Task <Geodata.CountryInfo> GetCountryInfoAsync(string countryCode, string lang = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Information}/geodata/countries/{countryCode}",
                                                  new Dictionary <string, object>()
            {
                { "lang", lang }
            });

            return(GetAsync <Geodata.CountryInfo>(url));
        }
示例#19
0
        /// <inheritdoc />
        public Task <IEnumerable <Geodata.CountryListItem> > ListCountriesAsync(string lang = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Information}/geodata/countries",
                                                  new Dictionary <string, object>()
            {
                { "lang", lang }
            });

            return(GetAsync <IEnumerable <Geodata.CountryListItem> >(url));
        }
        /// <summary>
        /// Retrieves the status of a single identification session.
        /// </summary>
        /// <param name="requestId"></param>
        /// <returns></returns>
        public IdentificationCompleteResponse GetSessionStatus(string requestId)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Identification}/session/status",
                                                  new Dictionary <string, object>()
            {
                { "requestId", requestId }
            });

            return(Get <IdentificationCompleteResponse>(url));
        }
示例#21
0
 private static string ListSignMethodsUrlWithParams(string url, SignatureMechanism mechanism, FileType fileType, Language language,
                                                    bool signableAttachments)
 {
     url = APIHelper.AppendQueryParams(url,
                                       new Dictionary <string, object>()
     {
         { "mechanism", mechanism },
         { "fileType", fileType },
         { "language", language },
         { "signableAttachments", signableAttachments }
     });
     return(url);
 }
示例#22
0
        /// <inheritdoc />
        public Task <Organization.BasicInfo> GetBasicOrganizationInfoAsync(string country, string id,
                                                                           string idType = null, string source = null,
                                                                           bool?rawJson  = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Information}/countries/{country}/organizations/{id}",
                                                  new Dictionary <string, object>()
            {
                { "idType", idType },
                { "source", source },
                { "rawJson", rawJson }
            });

            return(GetAsync <Organization.BasicInfo>(url));
        }
示例#23
0
        /// <summary>
        /// Returns a list of transactions for the requested account.
        /// </summary>
        /// <returns></returns>
        public async Task <IList <Transaction> > ListTransactionsAsync(
            int year,
            int?month     = null,
            bool?getAsCsv = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Admin}/invoice", new Dictionary <string, object>()
            {
                { "year", year },
                { "month", month },
                { "getAsCsv", getAsCsv }
            });

            return(await GetAsync <IList <Transaction> >(url));
        }
示例#24
0
        /// <summary>
        /// Retrieve organization information
        /// </summary>
        /// <returns></returns>
        public OrganizationResponse GetAmlOrganization(OrganizationQueryModel organizationQuery)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Addons}/aml/organization/",
                                                  new Dictionary <string, object>()
            {
                { "OrganizationNumber", organizationQuery.OrganizationNumber },
                { "Nationality", organizationQuery.Nationality },
                { "DunsNumber", organizationQuery.DunsNumber },
                { "Expands", string.Join(",", organizationQuery.Expands) },
                { "RequestUri", organizationQuery.RequestUri },
                { "Language", organizationQuery.Language },
            });

            return(Get <OrganizationResponse>(url));
        }
示例#25
0
        /// <inheritdoc />
        public Task <Organization.Ubo> GetOrganizationUltimateBeneficialOwnersAsync(string country, string id,
                                                                                    string idType = null, string source = null,
                                                                                    bool?rawJson  = null)
        {
            var url = APIHelper.AppendQueryParams(
                $"{Urls.Information}/countries/{country}/organizations/{id}/ultimate-beneficial-owners",
                new Dictionary <string, object>()
            {
                { "idType", idType },
                { "source", source },
                { "rawJson", rawJson }
            });

            return(GetAsync <Organization.Ubo>(url));
        }
示例#26
0
        /// <summary>
        /// Returns a list of transactions.
        /// </summary>
        /// <param name="oauthClientId"></param>
        /// <param name="fromDate"></param>
        /// <param name="toDate"></param>
        /// <returns></returns>
        public async Task <IList <MerchantSignTransaction> > ListTransactionsAsync(
            string oauthClientId = null,
            long?fromDate        = null,
            long?toDate          = null)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.MerchantSign}/signature/list",
                                                  new Dictionary <string, object>()
            {
                { "oauthClientId", oauthClientId },
                { "fromDate", fromDate },
                { "toDate", toDate }
            });

            return(await GetAsync <IList <MerchantSignTransaction> >(url));
        }
示例#27
0
        public void AppendsQueryParams()
        {
            var q = new Dictionary <string, object>()
            {
                { "foo", "bar" },
                { "limit", 25 },
                { "fileFormat", FileFormat.StandardPackaging },
                { "fromDate", new DateTime(2018, 01, 01, 8, 0, 0, DateTimeKind.Utc) },
                { "toDate", new DateTimeOffset(2018, 01, 01, 8, 0, 0, TimeSpan.Zero) },
                { "mock", null }
            };

            var url = APIHelper.AppendQueryParams("https://api.signicat.io", q);

            Assert.IsNotEmpty(url);
            Assert.AreEqual("https://api.signicat.io?foo=bar&limit=25&fileFormat=standard_packaging&fromDate=2018-01-01T08:00:00Z&toDate=2018-01-01T08:00:00+00:00", url);
        }
示例#28
0
        /// <inheritdoc />
        public Organization.Authorization GetOrganizationAuthorization(
            string country,
            string id, string idType = null,
            string source            = null,
            bool?rawJson             = null)
        {
            var url = APIHelper.AppendQueryParams(
                $"{Urls.Information}/countries/{country}/organizations/{id}/authorization",
                new Dictionary <string, object>()
            {
                { "idType", idType },
                { "source", source },
                { "rawJson", rawJson }
            });

            return(Get <Organization.Authorization>(url));
        }
示例#29
0
        public PersonResponse GetAmlPerson(PersonQueryModel personQuery)
        {
            var url = APIHelper.AppendQueryParams($"{Urls.Addons}/aml/person/",
                                                  new Dictionary <string, object>()
            {
                { "dateOfBirth", personQuery.DateOfBirth },
                { "firstName", personQuery.FirstName },
                { "lastName", personQuery.LastName },
                { "ssn", personQuery.Ssn },
                { "countryOfSSn", personQuery.CountryOfSsn },
                { "language", personQuery.Language },
                { "Expands", string.Join(",", personQuery.Expands) },
                { "matchMode", personQuery.MatchMode },
                { "addPdfAppendix", personQuery.AddPdfAppendix },
            });

            return(Get <PersonResponse>(url));
        }
        public void GetAmlOrganization()
        {
            var opts = Fixture.Create <OrganizationQueryModel>();
            var url  = APIHelper.AppendQueryParams($"{Urls.Addons}/aml/organization/",
                                                   new Dictionary <string, object>()
            {
                { "OrganizationNumber", opts.OrganizationNumber },
                { "Nationality", opts.Nationality },
                { "DunsNumber", opts.DunsNumber },
                { "Expands", string.Join(",", opts.Expands) },
                { "RequestUri", opts.RequestUri },
                { "Language", opts.Language },
            });

            var response = _addonsService.GetAmlOrganization(opts);

            Assert.IsNotNull(response);
            AssertRequest(HttpMethod.Get, url);
        }