pixUtils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagPayloadFormatIndicator     = "00"
	TagMerchantAccountInformation = "26"
	TagMerchantCategoryCode       = "52"
	TagTransactionCurrency        = "53"
	TagTransactionAmount          = "54"
	TagCountryCode                = "58"
	TagMerchantName               = "59"
	TagMerchantCity               = "60"
	TagAdditionDataFieldTemplate  = "62"
	TagCRC                        = "63"

	/*
	   Merchant Account Information Tags
	*/
	TagGUI         = "00"
	TagPixKey      = "01"
	TagDescription = "02"
	TagFss         = "03"
	TagUrl         = "25"

	/*
	   Adittional Data Field Template Tags
	*/
	TagReferenceLabel = "05"
)

Variables

View Source
var BcbGui = "br.gov.bcb.pix"
View Source
var BcbGuiTag = EmvTag{
	Tag:   "00",
	Size:  14,
	Value: BcbGui,
}

Functions

func RemoveAccents

func RemoveAccents(s string) (string, error)

Types

type AdditionalDataStructure

type AdditionalDataStructure struct {
	ReferenceLabel EmvTag
}

type CreateDynamicPixParams

type CreateDynamicPixParams struct {
	MerchantName string
	MerchantCity string
	Url          string
}

type CreateStaticPixParams

type CreateStaticPixParams struct {
	PixKey            string
	MerchantName      string
	MerchantCity      string
	TransactionAmount float64
	ReferenceLabel    string
	AditionalData     string
}

type EmvTag

type EmvTag struct {
	Size  int
	Value string
	Tag   string
}

type MaiStructure

type MaiStructure struct {
	GUI         EmvTag // EL 00
	PixKey      EmvTag // EL 01
	Description EmvTag // EL 02
	Fss         EmvTag // EL 03
	Url         EmvTag // EL 25
}

type PixEmv

type PixEmv struct {
	PayloadFormatIndicator     EmvTag
	MerchantAccountInformation MaiStructure
	MerchantCategoryCode       EmvTag
	TransactionCurrency        EmvTag
	TransactionAmount          EmvTag
	CountryCode                EmvTag
	MerchantName               EmvTag
	MerchantCity               EmvTag
	AdditionDataFieldTemplate  AdditionalDataStructure
	CRC                        EmvTag
}

type PixObject

type PixObject struct {
	Raw      string
	Type     string
	Elements PixEmv
}

func CreateDynamicPix

func CreateDynamicPix(params CreateDynamicPixParams) PixObject

func CreateStaticPix

func CreateStaticPix(params CreateStaticPixParams) PixObject

func ParsePix

func ParsePix(emvString string) (parsedPix PixObject, err error)

Jump to

Keyboard shortcuts

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