Documentation
¶
Index ¶
- Constants
- Variables
- type ActivityDetails
- type AmlAddress
- type AmlProfile
- type AmlResult
- type AttributeTypedeprecated
- type AttributeValuedeprecated
- type Client
- type Imagedeprecated
- func (image *Image) GetContentType() stringdeprecated
- func (image *Image) URL() stringdeprecated
- type ImageTypedeprecated
- type Profile
- func (p Profile) Address() *attribute.StringAttribute
- func (p Profile) DateOfBirth() (*attribute.TimeAttribute, error)
- func (p Profile) EmailAddress() *attribute.StringAttribute
- func (p Profile) FamilyName() *attribute.StringAttribute
- func (p Profile) FullName() *attribute.StringAttribute
- func (p Profile) Gender() *attribute.StringAttribute
- func (p Profile) GetAttribute(attributeName string) *attribute.GenericAttribute
- func (p Profile) GivenNames() *attribute.StringAttribute
- func (p Profile) MobileNumber() *attribute.StringAttribute
- func (p Profile) Nationality() *attribute.StringAttribute
- func (p Profile) Selfie() *attribute.ImageAttribute
- func (p Profile) StructuredPostalAddress() (*attribute.JSONAttribute, error)
- type UserProfiledeprecated
Constants ¶
const ( // HTTPMethodPost Post HTTP method HTTPMethodPost = "POST" // HTTPMethodGet Get HTTP method HTTPMethodGet = "GET" // HTTPMethodPut Put HTTP method HTTPMethodPut = "PUT" // HTTPMethodPatch Patch HTTP method HTTPMethodPatch = "PATCH" )
Variables ¶
var ( // ErrProfileNotFound profile was not found during activity retrieval for the provided one time use token ErrProfileNotFound = errors.New("ProfileNotFound") // ErrFailure there was a failure during activity retrieval ErrFailure = errors.New("Failure") // ErrSharingFailure there was a failure when sharing ErrSharingFailure = errors.New("SharingFailure") )
Functions ¶
This section is empty.
Types ¶
type ActivityDetails ¶
type ActivityDetails struct { UserProfile Profile // contains filtered or unexported fields }
ActivityDetails represents the result of an activity between a user and the application.
func (ActivityDetails) RememberMeID ¶
func (a ActivityDetails) RememberMeID() string
RememberMeID is a unique identifier Yoti assigns to your user, but only for your app. If the same user logs into your app again, you get the same id. If she/he logs into another application, Yoti will assign a different id for that app.
type AmlAddress ¶ added in v1.1.0
AmlAddress Address for Anti Money Laundering (AML) purposes
type AmlProfile ¶ added in v1.1.0
type AmlProfile struct { GivenNames string `json:"given_names"` FamilyName string `json:"family_name"` Address AmlAddress `json:"address"` SSN string `json:"ssn"` }
AmlProfile User profile for Anti Money Laundering (AML) checks
type AmlResult ¶ added in v1.1.0
type AmlResult struct { OnFraudList bool `json:"on_fraud_list"` OnPEPList bool `json:"on_pep_list"` OnWatchList bool `json:"on_watch_list"` }
AmlResult Result of Anti Money Laundering (AML) check for a particular user
func GetAmlResult ¶
GetAmlResult Parses AML result from response
func GetAmlResultFromResponse
deprecated
added in
v1.1.0
type AttributeType
deprecated
type AttributeType int
Deprecated: AttributeType format of the attribute
const ( // AttributeTypeDate date format AttributeTypeDate AttributeType = 1 + iota // AttributeTypeText text format AttributeTypeText // AttributeTypeJPEG JPEG format AttributeTypeJPEG // AttributeTypePNG PNG fornmat AttributeTypePNG // AttributeTypeJSON JSON fornmat AttributeTypeJSON )
type AttributeValue
deprecated
added in
v1.1.0
type AttributeValue struct { // Type represents the format of the piece of user data, whether it is a date, a piece of text or a picture // // Note the potential values for this variable are stored in constants with names beginning with // 'AttributeType'. These include: // yoti.AttributeTypeDate // yoti.AttributeTypeText // yoti.AttributeTypeJPEG // yoti.AttributeTypePNG // yoti.AttributeTypeJSON Type AttributeType Value []byte }
Deprecated: Will be removed in v3.0.0, values here will be available on Attribute objects. AttributeValue represents a small piece of information about a Yoti user such as a photo of the user or the user's date of birth.
func (AttributeValue) GetContentType
deprecated
added in
v1.1.0
func (val AttributeValue) GetContentType() (result string)
Deprecated: Will be removed in v3.0.0, use GetMIMEType() instead. GetContentType returns the MIME type of this piece of Yoti user information. For more information see: https://en.wikipedia.org/wiki/Media_type
type Client ¶ added in v1.1.0
type Client struct { // SdkID represents the SDK ID and NOT the App ID. This can be found in the integration section of your // application dashboard at https://www.yoti.com/dashboard/ SdkID string // Key should be the security key given to you by yoti (see: security keys section of // https://www.yoti.com/dashboard/) for more information about how to load your key from a file see: // https://github.com/getyoti/yoti-go-sdk/blob/master/README.md Key []byte }
Client represents a client that can communicate with yoti and return information about Yoti users.
func (*Client) GetActivityDetails ¶
func (client *Client) GetActivityDetails(token string) (ActivityDetails, []string)
GetActivityDetails requests information about a Yoti user using the one time use token generated by the Yoti login process. It returns the outcome of the request. If the request was successful it will include the users details, otherwise it will specify a reason the request failed.
func (*Client) GetUserProfile
deprecated
added in
v1.1.0
func (client *Client) GetUserProfile(token string) (userProfile UserProfile, firstError error)
Deprecated: Will be removed in v3.0.0. Use `GetActivityDetails` instead. GetUserProfile requests information about a Yoti user using the one time use token generated by the Yoti login process. It returns the outcome of the request. If the request was successful it will include the users details, otherwise it will specify a reason the request failed.
func (*Client) PerformAmlCheck ¶ added in v1.1.0
func (client *Client) PerformAmlCheck(amlProfile AmlProfile) (AmlResult, error)
PerformAmlCheck performs an Anti Money Laundering Check (AML) for a particular user. Returns three boolean values: 'OnPEPList', 'OnWatchList' and 'OnFraudList'.
type Image
deprecated
Deprecated: Will be removed in v3.0.0 - use attribute.Image instead. ImageType struct containing the type of the image and the data in bytes.
func (*Image) GetContentType
deprecated
Deprecated: Will be removed in v3.0.0, please use image.GetMIMEType instead. GetContentType returns the MIME type of this piece of Yoti user information. For more information see: https://en.wikipedia.org/wiki/Media_type
type ImageType
deprecated
type Profile ¶
type Profile struct {
// contains filtered or unexported fields
}
Profile represents the details retrieved for a particular user. Consists of Yoti attributes: a small piece of information about a Yoti user such as a photo of the user or the user's date of birth.
func (Profile) Address ¶
func (p Profile) Address() *attribute.StringAttribute
Address represents the user's address. Will be nil if not provided by Yoti
func (Profile) DateOfBirth ¶
func (p Profile) DateOfBirth() (*attribute.TimeAttribute, error)
DateOfBirth represents the user's date of birth. Will be nil if not provided by Yoti. Has an err value which will be filled if there is an error parsing the date.
func (Profile) EmailAddress ¶
func (p Profile) EmailAddress() *attribute.StringAttribute
EmailAddress represents the user's email address. Will be nil if not provided by Yoti
func (Profile) FamilyName ¶
func (p Profile) FamilyName() *attribute.StringAttribute
FamilyName represents the user's family name. Will be nil if not provided by Yoti
func (Profile) FullName ¶
func (p Profile) FullName() *attribute.StringAttribute
FullName represents the user's full name. Will be nil if not provided by Yoti
func (Profile) Gender ¶
func (p Profile) Gender() *attribute.StringAttribute
Gender represents the user's gender. Will be nil if not provided by Yoti
func (Profile) GetAttribute ¶
func (p Profile) GetAttribute(attributeName string) *attribute.GenericAttribute
GetAttribute retrieve an attribute by name on the Yoti profile. Will return nil if attribute is not present.
func (Profile) GivenNames ¶
func (p Profile) GivenNames() *attribute.StringAttribute
GivenNames represents the user's given names. Will be nil if not provided by Yoti
func (Profile) MobileNumber ¶
func (p Profile) MobileNumber() *attribute.StringAttribute
MobileNumber represents the user's mobile phone number. Will be nil if not provided by Yoti
func (Profile) Nationality ¶
func (p Profile) Nationality() *attribute.StringAttribute
Nationality represents the user's nationality. Will be nil if not provided by Yoti
func (Profile) Selfie ¶
func (p Profile) Selfie() *attribute.ImageAttribute
Selfie is a photograph of the user. Will be nil if not provided by Yoti
func (Profile) StructuredPostalAddress ¶
func (p Profile) StructuredPostalAddress() (*attribute.JSONAttribute, error)
StructuredPostalAddress represents the user's address in a JSON format. Will be nil if not provided by Yoti
type UserProfile
deprecated
added in
v1.1.0
type UserProfile struct { // ID is a unique identifier Yoti assigns to your user, but only for your app. // If the same user logs into your app again, you get the same id. // If she/he logs into another application, Yoti will assign a different id for that app. ID string // Selfie is a photograph of the user. This will be nil if not provided by Yoti Selfie *Image // GivenNames represents the user's given names. This will be an empty string if not provided by Yoti GivenNames string // Family represents the user's family name. This will be an empty string if not provided by Yoti FamilyName string // Full name represents the user's full name. This will be an empty string if not provided by Yoti FullName string // MobileNumber represents the user's mobile phone number. This will be an empty string if not provided by Yoti MobileNumber string // EmailAddress represents the user's email address. This will be an empty string if not provided by Yoti EmailAddress string // DateOfBirth represents the user's date of birth. This will be nil if not provided by Yoti DateOfBirth *time.Time // IsAgeVerified represents the result of the age verification check on the user. The bool will be true if they passed, false if they failed, and nil if there was no check IsAgeVerified *bool // Address represents the user's address. This will be an empty string if not provided by Yoti Address string // StructuredPostalAddress represents the user's address in a JSON format. This will be empty if not provided by Yoti StructuredPostalAddress interface{} // Gender represents the user's gender. This will be an empty string if not provided by Yoti Gender string // Nationality represents the user's nationality. This will be an empty string if not provided by Yoti Nationality string // OtherAttributes is a map of any other information about the user provided by Yoti. The key will be the name // of the piece of information, and the keys associated value will be the piece of information itself. OtherAttributes map[string]AttributeValue }
Deprecated: Will be removed in v3.0.0. Use `Profile` instead. UserProfile represents the details retrieved for a particular