veriff

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

README

veriff-api-client-go

Go Reference Go Report Card Maintainability Test Coverage

Veriff API Client for Go

Installation

go get github.com/brokeyourbike/veriff-api-client-go

Usage

client := veriff.NewClient("veriff.com", "token")
client.CreateSession(context.TODO(), veriff.CreateSessionPayload{})

Authors

License

BSD-3-Clause License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(baseURL, token string, options ...ClientOption) *client

func NewRequest

func NewRequest(r *http.Request) *request

Types

type Client

type Client interface {
	CreateSession(ctx context.Context, payload CreateSessionPayload) (data CreateSessionResponse, err error)
}

type ClientOption

type ClientOption func(*client)

ClientOption is a function that configures a Client.

func WithHTTPClient

func WithHTTPClient(c HttpClient) ClientOption

WithHTTPClient sets the HTTP client for the paystack API client.

func WithLogger

func WithLogger(l *logrus.Logger) ClientOption

WithLogger sets the *logrus.Logger for the paystack API client.

type CreateSessionPayload

type CreateSessionPayload struct {
	Verification struct {
		Person struct {
			FirstName   string `json:"firstName,omitempty"`
			LastName    string `json:"lastName,omitempty"`
			DateOfBirth string `json:"dateOfBirth,omitempty"`
			Gender      string `json:"gender,omitempty"`
		} `json:"person"`
		Callback   string `json:"callback,omitempty"`
		VendorData string `json:"vendorData"`
	} `json:"verification"`
}

type CreateSessionResponse

type CreateSessionResponse struct {
	Status       string `json:"status"`
	Verification struct {
		ID           string `json:"id"`
		URL          string `json:"url"`
		VendorData   string `json:"vendorData"`
		Host         string `json:"host"`
		Status       string `json:"status"`
		SessionToken string `json:"sessionToken"`
	} `json:"verification"`
}

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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