View Source iso8583_process (iso8583_erl v0.4.1)

this module is responsible for processing iso8583 messages

Summary

Functions

for adding fields which are supposed to be echoed
this converts data between bases and also pads the data for our purposes
for creating the final bitmap this bitmap is an 8/16 byte binary with each byte being represented by an integer. integer converted to a 2 bit binary represents presence or absence of those fields
for getting the bitmap,mti,Data fields
gets the bitmap type
this is for getting a particular field or mti or bitmap in an iso message back
gets the specification for a particular field
for getting various specification types
creats a new map specification which contains the various data elements and a bitmap from a specification file can throw an error if there are bugs in the specification
this is for loading field information for mtis
marshalls a message to be sent. pack all the different elements in a message into an iolist
for processing the message given the bitmap and the binary containing the data elements
this is for setting a particular field in the message or an mti field will have to be validated and then after field is validated an entry is created as a map for it padding may be added to the field depending on the type of field as well as if its fixed or vlength
this part accepts a list iso message with the header removed and extracts the mti,bitmap,data elements into a map object it also accepts a specification which will be used for getting the specifications for the message exceptions can be thrown here if the string for the message hasnt been formatted well but they should be caught in whichever code is calling the system the data is first converted into a binary before the processing is done . much faster and uses less memory than using lists
this is for validating a specification

Functions

Link to this function

add_echo_fields(Map_transaction, Map_recipient, Specification_mti)

View Source
-spec add_echo_fields(map(), map(), map()) -> map().
for adding fields which are supposed to be echoed
Link to this function

check_mandatory_fields(List_mandatory_keys, Iso_map)

View Source
-spec check_mandatory_fields(list(), map()) -> true | false.
for checking mandatory fields
Link to this function

convert_base_pad(Data_Base_10, Number_pad, Pad_digit)

View Source
-spec convert_base_pad(integer(), integer(), binary()) -> binary().
this converts data between bases and also pads the data for our purposes
Link to this function

create_bitmap(_, Bitmap_final_bit)

View Source
-spec create_bitmap(binary | hex, binary()) -> binary() | list().
for creating the final bitmap this bitmap is an 8/16 byte binary with each byte being represented by an integer. integer converted to a 2 bit binary represents presence or absence of those fields
Link to this function

get_bitmap_subs(_, Bin_message, Specification)

View Source
-spec get_bitmap_subs(atom(), binary(), map()) -> tuple().
for getting the bitmap,mti,Data fields
Link to this function

get_bitmap_type(Specification)

View Source
-spec get_bitmap_type(map()) -> atom().
gets the bitmap type
Link to this function

get_field(Fld_num, Iso_Map)

View Source
-spec get_field(Fld_num :: pos_integer() | mti | bit, Iso_Map :: map()) -> {ok, term()} | error.
this is for getting a particular field or mti or bitmap in an iso message back
Link to this function

get_size_send(Fields_iolist, Length_max_size)

View Source
-spec get_size_send(iolist(), non_neg_integer()) -> list().
Link to this function

get_spec_field(Field, Specification)

View Source
-spec get_spec_field(non_neg_integer() | mti, map()) -> tuple().
gets the specification for a particular field
Link to this function

get_spec_mti(Spec_type, Mti, Spec_field_map)

View Source
-spec get_spec_mti(atom(), map(), map()) -> list() | error.
for getting various specification types
Link to this function

load_specification(Filename)

View Source
-spec load_specification(string() | binary()) -> map().
creats a new map specification which contains the various data elements and a bitmap from a specification file can throw an error if there are bugs in the specification
Link to this function

load_specification_mti(Filename)

View Source
-spec load_specification_mti(string() | binary()) -> map().
this is for loading field information for mtis
Link to this function

pack(Message_Map, Specification)

View Source
-spec pack(Message_Map :: map(), map()) -> iolist().
marshalls a message to be sent. pack all the different elements in a message into an iolist
Link to this function

process_data_element(Bitmap, Index_start, Data_binary, Specification)

View Source
-spec process_data_element(binary(), integer(), binary(), map()) -> map().
for processing the message given the bitmap and the binary containing the data elements
Link to this function

set_field(Iso_Map, Fld_num, Fld_val)

View Source
-spec set_field(Iso_Map :: map(), Fld_num :: pos_integer() | mti, Fld_val :: binary()) -> {ok, map()}.
this is for setting a particular field in the message or an mti field will have to be validated and then after field is validated an entry is created as a map for it padding may be added to the field depending on the type of field as well as if its fixed or vlength
-spec set_field_list(List :: list()) -> map().
Link to this function

set_mti(Iso_Map, Fld_val)

View Source
-spec set_mti(Iso_Map :: map(), Fld_val :: binary()) -> {ok, map()}.
Link to this function

unpack(Rest, Specification)

View Source
-spec unpack(list(), map()) -> map().
this part accepts a list iso message with the header removed and extracts the mti,bitmap,data elements into a map object it also accepts a specification which will be used for getting the specifications for the message exceptions can be thrown here if the string for the message hasnt been formatted well but they should be caught in whichever code is calling the system the data is first converted into a binary before the processing is done . much faster and uses less memory than using lists
Link to this function

validate_specification(Spec_info)

View Source
-spec validate_specification(map()) -> boolean().
this is for validating a specification