Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/iamfaizankhalid/nishan-go

Golang wrapper for NADRA's Nishan APIs
https://github.com/iamfaizankhalid/nishan-go

biometrics golang kyc-service nadra verification wrapper

Last synced: about 2 months ago
JSON representation

Golang wrapper for NADRA's Nishan APIs

Awesome Lists containing this project

README

        

Nishan Pakistan

[![Tests](https://github.com/IamFaizanKhalid/nishan-go/actions/workflows/test.yml/badge.svg)](https://github.com/IamFaizanKhalid/nishan-go/actions/workflows/test.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/IamFaizanKhalid/nishan-go)](https://goreportcard.com/report/github.com/IamFaizanKhalid/nishan-go) [![Release](https://img.shields.io/github/v/release/IamFaizanKhalid/nishan-go.svg?style=flat-square)](https://github.com/IamFaizanKhalid/nishan-go/releases) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/IamFaizanKhalid/nishan-go/blob/master/LICENSE)


Golang wrapper for [NADRA's Nishan](https://nishan.nadra.gov.pk/) APIs.

## Installation

```console
go get -u github.com/IamFaizanKhalid/nishan-go
```

## Usage Example

```go
package main

import (
"fmt"
"github.com/IamFaizanKhalid/nishan-go"
"github.com/IamFaizanKhalid/nishan-go/errors"
)

func main() {
api, err := nishan.NewClient("your_company", "your_api_key")
if err != nil {
panic(err)
}

response := api.KnowYourCustomer(nishan.Request{
CitizenNo: "1234567890124",
Fingerprint: "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAA...",
FingerIndex: 6,
})

if response.ErrCode != errors.Nil {
switch response.ErrCode {
case errors.FingerprintMismatch:
panic("fingerprint didn't match")
case errors.FingerIndexUnavailable:
panic(fmt.Sprintf("data available only for following finger indexes: %v", response.FingerList))
default:
panic(response.ErrMessage)
}
}

fmt.Printf("Welcome %s %s!", response.PersonalData.Name, response.PersonalData.FatherName)
}
```

## Reference
- [API Docs](https://nishan.nadra.gov.pk/tech-stack)

## License

© 2023-time.Now() Faizan Khalid

Released under the [MIT License](https://github.com/IamFaizanKhalid/nishan-go/blob/master/LICENSE)