Documentation ¶
Index ¶
- Constants
- Variables
- func CopyRequestToResponse(isoReq *Iso8583Message, isoResp *Iso8583Message)
- func GetSpecNames() []string
- func ReadSpecDefs(fileName string)
- func ReadSpecDefsFromBuf(buf *bytes.Buffer)
- type BitMap
- func (bmp *BitMap) Bytes() []byte
- func (bmp *BitMap) Def() string
- func (bmp *BitMap) GetId() int
- func (bmp *BitMap) IsOn(pos int) bool
- func (bmp *BitMap) Parse(isoMsg *Iso8583Message, buf *bytes.Buffer)
- func (bmp *BitMap) SetId(id int)
- func (bmp *BitMap) SetOff(pos int)
- func (bmp *BitMap) SetOn(pos int)
- func (bmp *BitMap) SetSpec(isoMsgDef *MessageDef)
- type BitmappedField
- type FieldAttributes
- type FieldData
- type FieldDefExp
- type FixedFieldDef
- func (fieldDef *FixedFieldDef) Assemble(isoMsg *Iso8583Message, buf *bytes.Buffer)
- func (fieldDef *FixedFieldDef) BitPosition() int
- func (fieldDef *FixedFieldDef) DataLength() int
- func (fieldDef *FixedFieldDef) Def() string
- func (fieldDef *FixedFieldDef) EncodedLength(dataLen int) []byte
- func (fieldDef *FixedFieldDef) GetId() int
- func (fieldDef *FixedFieldDef) IsFixed() bool
- func (fieldDef *FixedFieldDef) Parse(isoMsg *Iso8583Message, fData *FieldData, buf *bytes.Buffer) *FieldData
- func (fieldDef *FixedFieldDef) SetBitPosition(id int)
- func (fieldDef *FixedFieldDef) SetId(id int)
- func (fieldDef *FixedFieldDef) String() string
- type Iso8583Message
- func (isoMsg *Iso8583Message) Bitmap() *BitMap
- func (isoMsg *Iso8583Message) Bytes() []byte
- func (isoMsg *Iso8583Message) Dump() string
- func (isoMsg *Iso8583Message) Field(pos int) (*FieldData, error)
- func (isoMsg *Iso8583Message) GetBinaryBitmap() string
- func (isoMsg *Iso8583Message) GetFieldByName(name string) *FieldData
- func (isoMsg *Iso8583Message) GetFieldData(position int) (data string, err error)
- func (isoMsg *Iso8583Message) GetFieldDataById(id int) *FieldData
- func (isoMsg *Iso8583Message) GetMessageType() string
- func (isoMsg *Iso8583Message) IsSelected(position int) bool
- func (isoMsg *Iso8583Message) Parse(buf *bytes.Buffer) (err error)
- func (isoMsg *Iso8583Message) SetData(data []string)
- func (isoMsg *Iso8583Message) SetField(pos int, value string)
- func (isoMsg *Iso8583Message) SetFieldData(id int, fieldVal string)
- func (isoMsg *Iso8583Message) SpecName() string
- func (isoMsg *Iso8583Message) TabularFormat() *list.List
- func (isoMsg *Iso8583Message) ToWebMsg(isReq bool) *WebMsgData
- type IsoField
- type JsonFieldDef
- type JsonSpecDef
- type JsonSpecDefs
- type MessageDef
- type Tuple
- type VariableFieldDef
- func (field *VariableFieldDef) Assemble(isoMsg *Iso8583Message, buf *bytes.Buffer)
- func (field *VariableFieldDef) BitPosition() int
- func (field *VariableFieldDef) DataLength() int
- func (field *VariableFieldDef) Def() string
- func (field *VariableFieldDef) EncodedLength(dataLen int) []byte
- func (field *VariableFieldDef) GetId() int
- func (field *VariableFieldDef) IsFixed() bool
- func (field *VariableFieldDef) Parse(isoMsg *Iso8583Message, fData *FieldData, buf *bytes.Buffer) *FieldData
- func (field *VariableFieldDef) SetBitPosition(id int)
- func (field *VariableFieldDef) SetId(id int)
- func (field *VariableFieldDef) String() string
- type WebMsgData
Constants ¶
const ( V1 = "V1" V0 = "V0" IsoMsg1100 = "1100" IsoMsg1110 = "1110" IsoMsg1420 = "1420" IsoMsg1430 = "1430" IsoMsg1804 = "1804" IsoMsg1814 = "1814" IsoRespDecline = "100" IsoRespPickup = "200" IsoRespApproval = "000" IsoFormatError = "909" IsoRespDrop = "999" )
Variables ¶
var ErrUnsupportedEncoding = errors.New("libiso: Invalid/Unsupported field encoding")
Functions ¶
func CopyRequestToResponse ¶
func CopyRequestToResponse(isoReq *Iso8583Message, isoResp *Iso8583Message)
copy all data from request to response message
func ReadSpecDefs ¶
func ReadSpecDefs(fileName string)
func ReadSpecDefsFromBuf ¶
Types ¶
type BitMap ¶
type BitMap struct {
// contains filtered or unexported fields
}
func (*BitMap) SetSpec ¶
func (bmp *BitMap) SetSpec(isoMsgDef *MessageDef)
type BitmappedField ¶
type FieldAttributes ¶
type FieldData ¶
type FieldData struct {
// contains filtered or unexported fields
}
func (FieldData) Bytes ¶
return the raw data associated with this field it will also include any ll portions for a variable field
type FieldDefExp ¶
FieldDefExp represents the ISO8583 field information required to be sent as JSON to paysim application
func GetSpecLayout ¶
func GetSpecLayout(specName string) []*FieldDefExp
GetSpecLayout returns all fields associated with a spec
type FixedFieldDef ¶
type FixedFieldDef struct {
// contains filtered or unexported fields
}
func NewFixedFieldDef ¶
func NewFixedFieldDef(pName string, pDataEncoding int, pFieldLen int) *FixedFieldDef
create a new fixed field definition
func (*FixedFieldDef) Assemble ¶
func (fieldDef *FixedFieldDef) Assemble(isoMsg *Iso8583Message, buf *bytes.Buffer)
add the field data into buf as per the encoding
func (*FixedFieldDef) BitPosition ¶
func (fieldDef *FixedFieldDef) BitPosition() int
func (*FixedFieldDef) DataLength ¶
func (fieldDef *FixedFieldDef) DataLength() int
func (*FixedFieldDef) Def ¶
func (fieldDef *FixedFieldDef) Def() string
func (*FixedFieldDef) EncodedLength ¶
func (fieldDef *FixedFieldDef) EncodedLength(dataLen int) []byte
func (*FixedFieldDef) GetId ¶
func (fieldDef *FixedFieldDef) GetId() int
func (*FixedFieldDef) IsFixed ¶
func (fieldDef *FixedFieldDef) IsFixed() bool
func (*FixedFieldDef) Parse ¶
func (fieldDef *FixedFieldDef) Parse( isoMsg *Iso8583Message, fData *FieldData, buf *bytes.Buffer) *FieldData
parse and return field data by reading appropriate bytes from the buffer buf
func (*FixedFieldDef) SetBitPosition ¶
func (fieldDef *FixedFieldDef) SetBitPosition(id int)
func (*FixedFieldDef) SetId ¶
func (fieldDef *FixedFieldDef) SetId(id int)
func (*FixedFieldDef) String ¶
func (fieldDef *FixedFieldDef) String() string
type Iso8583Message ¶
type Iso8583Message struct {
// contains filtered or unexported fields
}
Iso8583Message represents a ISO message within a specification
func NewIso8583Message ¶
func NewIso8583Message(specName string) *Iso8583Message
NewIso8583Message returns a new message for the spec
func (*Iso8583Message) Bitmap ¶
func (isoMsg *Iso8583Message) Bitmap() *BitMap
Bitmap returns bitmap within the message
func (*Iso8583Message) Bytes ¶
func (isoMsg *Iso8583Message) Bytes() []byte
func (*Iso8583Message) Dump ¶
func (isoMsg *Iso8583Message) Dump() string
create a string dump of the iso message
func (*Iso8583Message) GetBinaryBitmap ¶
func (isoMsg *Iso8583Message) GetBinaryBitmap() string
GetBinaryBitmap returns the 'Bitmap' as binary string
func (*Iso8583Message) GetFieldByName ¶
func (isoMsg *Iso8583Message) GetFieldByName(name string) *FieldData
set field
func (*Iso8583Message) GetFieldData ¶
func (isoMsg *Iso8583Message) GetFieldData(position int) (data string, err error)
GetFieldData returns the data associated with the 'position'
in the iso_msg
func (*Iso8583Message) GetFieldDataById ¶
func (isoMsg *Iso8583Message) GetFieldDataById(id int) *FieldData
func (*Iso8583Message) GetMessageType ¶
func (isoMsg *Iso8583Message) GetMessageType() string
GetMessageType returns the 'Message Type' as string
func (*Iso8583Message) IsSelected ¶
func (isoMsg *Iso8583Message) IsSelected(position int) bool
IsSelected returns a boolean indicating
if the 'position' is selected in the bitmap
func (*Iso8583Message) Parse ¶
func (isoMsg *Iso8583Message) Parse(buf *bytes.Buffer) (err error)
parse the bytes from 'buf' and populate 'Iso8583Message'
func (*Iso8583Message) SetData ¶
func (isoMsg *Iso8583Message) SetData(data []string)
SetData sets data into individual fields by id
func (*Iso8583Message) SetField ¶
func (isoMsg *Iso8583Message) SetField(pos int, value string)
set field
func (*Iso8583Message) SetFieldData ¶
func (isoMsg *Iso8583Message) SetFieldData(id int, fieldVal string)
func (*Iso8583Message) SpecName ¶
func (isoMsg *Iso8583Message) SpecName() string
SpecName returns the name of the specification for this message
func (*Iso8583Message) TabularFormat ¶
func (isoMsg *Iso8583Message) TabularFormat() *list.List
create a string dump of the iso message
func (*Iso8583Message) ToWebMsg ¶
func (isoMsg *Iso8583Message) ToWebMsg(isReq bool) *WebMsgData
ToWebMsg
type IsoField ¶
type IsoField interface { Parse(*Iso8583Message, *FieldData, *bytes.Buffer) *FieldData Assemble(*Iso8583Message, *bytes.Buffer) String() string IsFixed() bool SetId(int) GetId() int DataLength() int EncodedLength(int) []byte Def() string BitPosition() int SetBitPosition(int) // contains filtered or unexported methods }
type JsonFieldDef ¶
type JsonFieldDef struct { BitPosition int Name string Type string Attrs FieldAttributes Children []JsonFieldDef }
JsonFieldDef represents the definition of a field in the specs.json file
type JsonSpecDef ¶
type JsonSpecDef struct { SpecName string Fields []JsonFieldDef }
JsonSpecDef represents the definition of a field in the specs.json file
type JsonSpecDefs ¶
type JsonSpecDefs struct {
Specs []JsonSpecDef
}
type MessageDef ¶
type MessageDef struct {
// contains filtered or unexported fields
}
func GetMessageDefByName ¶
func GetMessageDefByName(specName string) *MessageDef
GetMessageDefByName returns a spec definition for the given spec_name
func (*MessageDef) Name ¶
func (isoDef *MessageDef) Name() string
type VariableFieldDef ¶
type VariableFieldDef struct {
// contains filtered or unexported fields
}
VariableFieldDef represents the definition of a variable field
func NewVariableFieldDef ¶
func NewVariableFieldDef(pName string, pLenEncoding int, pDataEncoding int, pLenIndSize int) *VariableFieldDef
NewVariableFieldDef creates a new fixed field definition
func (*VariableFieldDef) Assemble ¶
func (field *VariableFieldDef) Assemble(isoMsg *Iso8583Message, buf *bytes.Buffer)
add the field data into buf as per the encoding
func (*VariableFieldDef) BitPosition ¶
func (field *VariableFieldDef) BitPosition() int
func (*VariableFieldDef) DataLength ¶
func (field *VariableFieldDef) DataLength() int
func (*VariableFieldDef) Def ¶
func (field *VariableFieldDef) Def() string
func (*VariableFieldDef) EncodedLength ¶
func (field *VariableFieldDef) EncodedLength(dataLen int) []byte
return the length part of the variable field as a []byte slice
func (*VariableFieldDef) GetId ¶
func (field *VariableFieldDef) GetId() int
func (*VariableFieldDef) IsFixed ¶
func (field *VariableFieldDef) IsFixed() bool
func (*VariableFieldDef) Parse ¶
func (field *VariableFieldDef) Parse( isoMsg *Iso8583Message, fData *FieldData, buf *bytes.Buffer) *FieldData
func (*VariableFieldDef) SetBitPosition ¶
func (field *VariableFieldDef) SetBitPosition(id int)
func (*VariableFieldDef) SetId ¶
func (field *VariableFieldDef) SetId(id int)
func (*VariableFieldDef) String ¶
func (field *VariableFieldDef) String() string
type WebMsgData ¶
To send data back and forth between browser and paysim application