iso8583

package module
v0.0.0-...-421ff82 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

GoDoc

ISO 8583 is a financial industry messaging format. when you make a purchase using your card, that transaction will probably reach you bank encoded in ISO 8583 format.

This (golang)[https://golang.org] package provides tools for packing and unpacking those kinds of messages

installation

$ go get -u github.com/mofax/iso8583

example

package main

import "github.com/mofax/iso8583"

func main() {

}

check out the docs on GO DOCS

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitMapArrayToHex

func BitMapArrayToHex(arr []int64) (string, error)

BitMapArrayToHex converts a iso8583 bit array into a hex string

func FixedLengthIntegerValidator

func FixedLengthIntegerValidator(field int, length int, data string) (bool, error)

FixedLengthIntegerValidator checks that an integer that is supposed to be of fixed width is of that length

func HexToBitmapArray

func HexToBitmapArray(hexString string) ([]int64, error)

HexToBitmapArray converts a hex string to a bit array

func MtiValidator

func MtiValidator(mti MtiType) (bool, error)

MtiValidator validates and iso8583 mti

func VariableLengthAlphaNumericValidator

func VariableLengthAlphaNumericValidator(field int, min int, max int, data string) (bool, error)

VariableLengthAlphaNumericValidator checks variable length alphanum Fields for the correct length

func VariableLengthIntegerValidator

func VariableLengthIntegerValidator(field int, min int, max int, data string) (bool, error)

VariableLengthIntegerValidator checks that a variable length integer field is within the min and max lengths specified by the spec

Types

type ElementsType

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

ElementsType stores iso8583 elements in a map

func (*ElementsType) GetElements

func (e *ElementsType) GetElements() map[int64]string

GetElements returns the available elemts as a map

type FieldDescription

type FieldDescription struct {
	ContentType string `yaml:"ContentType"`
	MaxLen      int    `yaml:"MaxLen"`
	MinLen      int    `yaml:"MinLen"`
	LenType     string `yaml:"LenType"`
	Label       string `yaml:"Label"`
}

FieldDescription contains fields that describes an iso8583 Field

type IsoStruct

type IsoStruct struct {
	Spec     Spec
	Mti      MtiType
	Bitmap   []int64
	Elements ElementsType
}

IsoStruct is an iso8583 container

func NewISOStruct

func NewISOStruct(filename string, secondaryBitmap bool) IsoStruct

NewISOStruct creates a new IsoStruct based on the content of the specfile provided

func (*IsoStruct) AddField

func (iso *IsoStruct) AddField(field int64, data string) error

AddField adds the provided iso8583 field into the current struct also updates the bitmap in the process

func (*IsoStruct) AddMTI

func (iso *IsoStruct) AddMTI(data string) error

AddMTI adds the provided iso8583 MTI into the current struct also updates the bitmap in the process

func (*IsoStruct) DeleteField

func (iso *IsoStruct) DeleteField(field int64) error

Delete Fields delete the provided iso8583 field from the current struct also updates the bitmap in the process

func (*IsoStruct) Parse

func (iso *IsoStruct) Parse(i string) (IsoStruct, error)

Parse parses an iso8583 string

func (*IsoStruct) ToString

func (iso *IsoStruct) ToString() (string, error)

ToString packs the mti, bitmap and elements into a string

type MtiType

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

MtiType is the message type identifier type

func (*MtiType) String

func (m *MtiType) String() string

String returns the mti as a string

type Spec

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

Spec contains a strutured description of an iso8583 spec properly defined by a spec file

func SpecFromFile

func SpecFromFile(filename string) (Spec, error)

SpecFromFile returns a brand new empty spec

type ValidationError

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

ValidationError happens when validation fails

Jump to

Keyboard shortcuts

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