aadhaarapi

package module
v0.0.0-...-c32691d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCaptcha

func GetCaptcha() (captchaImg []byte, sessionCookie string, err error)

GetCaptcha - To fetch captcha and session id from UIDAI.

func IsAadhaarError

func IsAadhaarError(err error) bool

func IsAadhaarPageError

func IsAadhaarPageError(err error) bool

func IsInvalidCaptcha

func IsInvalidCaptcha(err error) bool

func IsInvalidSessionId

func IsInvalidSessionId(err error) bool

func IsInvalidUIDOrVID

func IsInvalidUIDOrVID(err error) bool

func IsOtpFailure

func IsOtpFailure(err error) bool

func IsRedownloadError

func IsRedownloadError(err error) bool

func IsRetryableError

func IsRetryableError(err error) bool

func IsSessionExpired

func IsSessionExpired(err error) bool

func IsTechnicalError

func IsTechnicalError(err error) bool

func IsValidAadhaarNo

func IsValidAadhaarNo(aadhaar string) bool

func ValidateXMLSignature

func ValidateXMLSignature(xmlData []byte) (bool, error)

Types

type OfflineAadhaarXML

type OfflineAadhaarXML struct {
	XMLName xml.Name `xml:"OfflinePaperlessKyc"`
	UidData struct {
		Poi struct {
			Dob        string `xml:"dob,attr"`
			EmailHash  string `xml:"e,attr"`
			Gender     string `xml:"gender,attr"`
			MobileHash string `xml:"m,attr"`
			Name       string `xml:"name,attr"`
		} `xml:"Poi"`
		Poa struct {
			CareOf     string `xml:"careof,attr"`
			Country    string `xml:"country,attr"`
			District   string `xml:"dist,attr"`
			House      string `xml:"house,attr"`
			Landmark   string `xml:"landmark,attr"`
			Locality   string `xml:"loc,attr"`
			Pincode    string `xml:"pc,attr"`
			Postoffice string `xml:"po,attr"`
			State      string `xml:"state,attr"`
			Street     string `xml:"street,attr"`
			Subdist    string `xml:"subdist,attr"`
			Vtc        string `xml:"vtc,attr"`
		} `xml:"Poa"`
		Photo string `xml:"Pht"`
	} `xml:"UidData"`
}

type VerifyAadhaarNumberPageResult

type VerifyAadhaarNumberPageResult struct {
	Msg          string
	IsVerified   bool
	AgeBand      string
	State        string
	Gender       string
	MobileNumber string
	Details      string
}

type VerifyAadhaarNumberResult

type VerifyAadhaarNumberResult struct {
	Msg          string
	IsVerified   bool
	AgeBand      string
	State        string
	Gender       string
	MobileNumber string
	Details      string
}

func VerifyAadhaarNumber

func VerifyAadhaarNumber(opt VerifyCaptchaOpt) (result VerifyAadhaarNumberResult, err error)

VerifyAadhaarNumber

type VerifyCaptchaOpt

type VerifyCaptchaOpt struct {
	SessionId    string // SessionId received from GetCaptcha
	UidNo        string // Aadhaar no
	SecurityCode string // Captcha
}

type VerifyCaptchaResult

type VerifyCaptchaResult struct {
	Msg string
}

func VerifyCaptcha

func VerifyCaptcha(opt VerifyCaptchaOpt) (result VerifyCaptchaResult, err error)

VerifyCaptcha Once captcha fetched, need to call this API with aadhaar number(uid_no) and captcha(security_code). On success user will receive an OTP on phone number associated with aadhaar.

type VerifyOTPAndGetAadhaarOpt

type VerifyOTPAndGetAadhaarOpt struct {
	SessionId string // SessionId received from GetCaptcha
	OTP       string // OPT received in mobile or mAadhaar TOTP
	ZipCode   string
}

type VerifyOTPAndGetAadhaarResult

type VerifyOTPAndGetAadhaarResult struct {
	Details OfflineAadhaarXML

	XmlSignatureValidated bool
	ZipFile               []byte
	XmlFile               []byte
}

func VerifyOTPAndGetAadhaar

func VerifyOTPAndGetAadhaar(opt VerifyOTPAndGetAadhaarOpt) (result VerifyOTPAndGetAadhaarResult, err error)

VerifyOTPAndGetAadhaar download zip file from UIDAI and fetch details.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL