bank

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bank provides China UnionPay CardBIN searching.

Get search card BIN:

resp, err := bank.Get("6222021234567890123")

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrParamIllegal PARAM_ILLEGAL
	ErrParamIllegal = errors.New("bank: PARAM_ILLEGAL")
	// ErrCardBINNotMatch CARD_BIN_NOT_MATCH
	ErrCardBINNotMatch = errors.New("bank: CARD_BIN_NOT_MATCH")
)

Functions

This section is empty.

Types

type Bank

type Bank struct {
	// contains filtered or unexported fields
}

Bank bank

func New

func New(cb []*CardBIN) *Bank

New returns a bank point that is initialized by []*CardBIN

func (Bank) Get

func (in Bank) Get(card string) (c *CardBIN, e error)

func (Bank) Insert

func (in Bank) Insert(cb *CardBIN)

type CardBIN

type CardBIN struct {
	Bin    string
	Bank   string
	Type   string
	Length int
}

CardBIN is bank card bin

func Get

func Get(card string) (*CardBIN, error)

Get fetch card BIN via card

func (CardBIN) BankName

func (cb CardBIN) BankName() string

BankName return CardBIN bankname

Jump to

Keyboard shortcuts

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