Documentation ¶
Index ¶
- Variables
- func Bool(value bool) *bool
- func Int(value int) *int
- type AML
- type Client
- func (c *Client) CreateIdentityVerificationSession(ctx context.Context, request TokenRequest) (*TokenResponse, error)
- func (c *Client) DecodeHttpRequestIdentityCallback(request *http.Request) (*IdentityCallbackResp, error)
- func (c *Client) DecodeReaderIdentityCallback(reader io.Reader, sigHeader string) (*IdentityCallbackResp, error)
- type ClientOption
- type Data
- type Date
- type Document
- type IdentityCallbackResp
- type LID
- type LIDData
- type ServiceStatus
- type Status
- type TokenRequest
- type TokenResponse
- type Type
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidDate = errors.New("invalid date")
var ErrServerError = errors.New("received server error")
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ...ClientOption) (*Client, error)
NewClient Creates a new Idenfy API client
func (*Client) CreateIdentityVerificationSession ¶
func (c *Client) CreateIdentityVerificationSession(ctx context.Context, request TokenRequest) (*TokenResponse, error)
CreateIdentityVerificationSession Creates a new identity verification session and returns the response
func (*Client) DecodeHttpRequestIdentityCallback ¶
func (c *Client) DecodeHttpRequestIdentityCallback(request *http.Request) (*IdentityCallbackResp, error)
DecodeHttpRequestIdentityCallback Decodes an identity callback response from an *http.Request and verify its signature
func (*Client) DecodeReaderIdentityCallback ¶
func (c *Client) DecodeReaderIdentityCallback(reader io.Reader, sigHeader string) (*IdentityCallbackResp, error)
DecodeReaderIdentityCallback Decodes an identity callback response from an io.Reader and verify its signature
type ClientOption ¶
func WithApiCredentials ¶
func WithApiCredentials(accessKey, secretKey string) ClientOption
WithApiCredentials Option is used to specify Idenfy API credentials
func WithCallbackSignatureKey ¶
func WithCallbackSignatureKey(key string) ClientOption
WithCallbackSignatureKey Option is used to specify a callback signature key to verify requests signatures
func WithCustomEndpoint ¶
func WithCustomEndpoint(endpoint string) ClientOption
WithCustomEndpoint Option is used to specify an alternative API endpoint
func WithCustomHttpClient ¶
func WithCustomHttpClient(httpClient *http.Client) ClientOption
WithCustomHttpClient Option is used to specify a custom *http.Client to make requests with
type Data ¶
type Data struct { DocFirstname string `json:"docFirstName"` DocLastname string `json:"docLastName"` DocNumber string `json:"docNumber"` DocPersonalCode string `json:"docPersonalCode"` DocExpiry string `json:"docExpiry"` DocDob string `json:"docDob"` DocDateOfIssue string `json:"docDateOfIssue"` DocType Document `json:"docType"` DocSex string `json:"docSex"` DocNationality string `json:"docNationality"` DocIssuingCountry string `json:"docIssuingCountry"` DocTemporaryAddress string `json:"docTemporaryAddress"` DocBirthName string `json:"docBirthName"` BirthPlace string `json:"birthPlace"` Authority string `json:"authority"` Address string `json:"address"` MothersMaidenName string `json:"mothersMaidenName"` DriverLicenseCategory string `json:"driverLicenseCategory"` ManuallyDataChanged bool `json:"manuallyDataChanged"` FullName string `json:"fullName"` SelectedCountry string `json:"selectedCountry"` OrgFirstName string `json:"orgFirstName"` OrgLastName string `json:"orgLastName"` OrgNationality string `json:"orgNationality"` OrgBirthPlace string `json:"orgBirthPlace"` OrgAuthority string `json:"orgAuthority"` OrgAddress string `json:"orgAddress"` OrgTemporaryAddress string `json:"OrgTemporaryAddress"` OrgMothersMaidenName string `json:"orgMothersMaidenName"` OrgBirthName string `json:"orgBirthName"` AgeEstimate string `json:"ageEstimate"` ClientIpProxyRiskLevel string `json:"clientIpProxyRiskLevel"` DuplicateFaces []string `json:"duplicateFaces"` DuplicateDocFaces []string `json:"duplicateDocFaces"` }
type Date ¶
Date represents a date without time
func (Date) MarshalJSON ¶
MarshalJSON converts a Date into an Idenfy date
func (*Date) UnmarshalJSON ¶
UnmarshalJSON converts an Idenfy date into a Date
type Document ¶
type Document string
const ( ID_CARD Document = "ID_CARD" PASSPORT Document = "PASSPORT" RESIDENCE_PERMIT Document = "RESIDENCE_PERMIT" DRIVER_LICENSE Document = "DRIVER_LICENSE" AADHAAR Document = "AADHAAR" PAN_CARD Document = "PAN_CARD" VISA Document = "VISA" BORDER_CROSSING Document = "BORDER_CROSSING" ASYLUM Document = "ASYLUM" NATIONAL_PASSPORT Document = "NATIONAL_PASSPORT" INTERNATIONAL_PASSPORT Document = "INTERNATIONAL_PASSPORT" VOTER_CARD Document = "VOTER_CARD" OLD_ID_CARD Document = "OLD_ID_CARD" TRAVEL_CARD Document = "TRAVEL_CARD" PHOTO_CARD Document = "PHOTO_CARD" MILITARY_CARD Document = "MILITARY_CARD" PROOF_OF_AGE_CARD Document = "PROOF_OF_AGE_CARD" DIPLOMATIC_ID Document = "DIPLOMATIC_ID" )
type IdentityCallbackResp ¶
type IdentityCallbackResp struct { Final *bool `json:"final"` Platform string `json:"platform"` Status Status `json:"status"` Data Data `json:"data"` FileUrls map[string]string `json:"fileUrls"` AML []AML `json:"AML"` LID []LID `json:"LID"` ScanRef string `json:"scanRef"` ExternalRef string `json:"externalRef"` ClientId string `json:"clientId"` StartTime int64 `json:"startTime"` FinishTime int64 `json:"finishTime"` ClientIp string `json:"clientIp"` ClientIpCountry string `json:"clientIpCountry"` ClientLocation string `json:"clientLocation"` GdcMatch bool `json:"gdcMatch"` ManualAddress string `json:"manualAddress"` }
type ServiceStatus ¶
type Status ¶
type Status struct { Overall string `json:"overall"` FraudTags []string `json:"fraudTags"` MismatchTags []string `json:"mismatchTags"` AutoFace string `json:"autoFace"` ManualFace string `json:"manualFace"` AutoDocument string `json:"autoDocument"` ManualDocument string `json:"manualDocument"` AdditionalSteps string `json:"additionalSteps"` }
type TokenRequest ¶
type TokenRequest struct { ClientId string `json:"clientId"` Firstname string `json:"firstName,omitempty"` Lastname string `json:"lastName,omitempty"` SuccessUrl string `json:"successUrl,omitempty"` ErrorUrl string `json:"errorUrl,omitempty"` UnverifiedUrl string `json:"unverifiedUrl,omitempty"` Locale string `json:"locale,omitempty"` ShowInstructions *bool `json:"showInstructions,omitempty"` ExpiryTime *int `json:"expiryTime,omitempty"` SessionLength *int `json:"sessionLength,omitempty"` Country string `json:"country,omitempty"` Documents []Document `json:"documents,omitempty"` DateOfBirth *Date `json:"dateOfBirth,omitempty"` DateOfExpiry *Date `json:"dateOfExpiry,omitempty"` DateOfIssue *Date `json:"dateOfIssue,omitempty"` Nationality string `json:"nationality,omitempty"` PersonalNumber string `json:"personalNumber,omitempty"` DocumentNumber string `json:"documentNumber,omitempty"` Sex string `json:"sex,omitempty"` GenerateDigitString *bool `json:"generateDigitString,omitempty"` Address string `json:"address,omitempty"` TokenType Type `json:"tokenType,omitempty"` VideoCallQuestions []string `json:"videoCallQuestions,omitempty"` ExternalRef string `json:"externalRef,omitempty"` UtilityBill *bool `json:"utilityBill,omitempty"` CallbackUrl string `json:"callbackUrl,omitempty"` Questionnaire string `json:"questionnaire,omitempty"` }
func (TokenRequest) Validate ¶
func (t TokenRequest) Validate() error
Validate Validates the token request against Idenfy specifications
type TokenResponse ¶
type TokenResponse struct { ClientId string `json:"clientId"` Firstname string `json:"firstName,omitempty"` Lastname string `json:"lastName,omitempty"` SuccessUrl string `json:"successUrl,omitempty"` ErrorUrl string `json:"errorUrl,omitempty"` UnverifiedUrl string `json:"unverifiedUrl,omitempty"` Locale string `json:"locale,omitempty"` ShowInstructions *bool `json:"showInstructions,omitempty"` ExpiryTime *int `json:"expiryTime,omitempty"` SessionLength *int `json:"sessionLength,omitempty"` Country string `json:"country,omitempty"` Documents []Document `json:"documents,omitempty"` DateOfBirth *Date `json:"dateOfBirth,omitempty"` DateOfExpiry *Date `json:"dateOfExpiry,omitempty"` DateOfIssue *Date `json:"dateOfIssue,omitempty"` Nationality string `json:"nationality,omitempty"` PersonalNumber string `json:"personalNumber,omitempty"` DocumentNumber string `json:"documentNumber,omitempty"` Sex string `json:"sex,omitempty"` GenerateDigitString *bool `json:"generateDigitString,omitempty"` Address string `json:"address,omitempty"` TokenType Type `json:"tokenType,omitempty"` VideoCallQuestions []string `json:"videoCallQuestions,omitempty"` ExternalRef string `json:"externalRef,omitempty"` UtilityBill *bool `json:"utilityBill,omitempty"` CallbackUrl string `json:"callbackUrl,omitempty"` Questionnaire string `json:"questionnaire,omitempty"` Message string `json:"message,omitempty"` AuthToken string `json:"authToken,omitempty"` ScanRef string `json:"scanRef,omitempty"` DigitString string `json:"digitString,omitempty"` }
func (TokenResponse) GetRedirectUrl ¶
func (t TokenResponse) GetRedirectUrl() string
GetRedirectUrl Returns the URL to redirect the client to complete the verification