kpspub

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 5 Imported by: 0

README

KPSPublic Go Client

KPSPublic is a SOAP service provided by the Turkish Tax Administration. This is a Go client for KPSPublic.

Installation

go get github.com/9ssi7/kpspub

Usage

package main

import "github.com/9ssi7/kpspub"

func main() {
	isVerified, err := kpspub.Verify(context.Background(), kpspub.VerifyConfig{
		BirthDay:         <YOUR_BIRTH_DAY>, // 1-31
		BirthMonth:       <YOUR_BIRTH_MONTH>, // 1-12
		BirthYear:        <YOUR_BIRTH_YEAR>, // 1900-2099
		FirstName:        <YOUR_FIRST_NAME>, // "ahmet"
		LastName:         <YOUR_LAST_NAME>, // "yılmaz"
		TCIdentityNumber: <YOUR_TC_IDENTITY_NUMBER>, // "11111111111"
		SerialNumber:     <YOUR_SERIAL_NUMBER>, // "xxxxx"
	})
	if err != nil {
		panic(err)
	}
	println(isVerified) // true or false
}

Contributing

Contributions are always welcome!

License

MIT

Documentation

Index

Constants

View Source
const ApiUrl string = "https://tckimlik.nvi.gov.tr/Service/KPSPublicv2.asmx"

Variables

This section is empty.

Functions

func Verify

func Verify(ctx context.Context, cnf VerifyConfig) (bool, error)

func VerifyWithNewID

func VerifyWithNewID(ctx context.Context, config VerifyConfig) (bool, error)

func VerifyWithOldID

func VerifyWithOldID(ctx context.Context, config VerifyConfig) (bool, error)

Types

type VerifyConfig

type VerifyConfig struct {

	// TCIdentityNumber is the Turkish Identity Number
	TCIdentityNumber string

	// FirstName is the first name of the person
	FirstName string

	// LastName is the last name of the person
	LastName string

	// BirthYear is the birth year of the person
	BirthYear int

	// BirthMonth is the birth month of the person
	BirthMonth int

	// BirthDay is the birthday of the person
	BirthDay int

	// SerialNumber is the serial number of the ID card
	SerialNumber string
}

Verify verifies the given information with the Turkish Identity Number

Jump to

Keyboard shortcuts

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