github.com/danil/iso8583@v0.21.0/codec8583/tsys_format_test.go (about)

     1  package codec8583_test
     2  
     3  import (
     4  	"bytes"
     5  	"fmt"
     6  	"runtime"
     7  	"strconv"
     8  	"testing"
     9  
    10  	"github.com/danil/iso8583/codec8583"
    11  )
    12  
    13  var TSYSMarshalerUnmarshalerMarshalUnmarshalTestCases = []struct {
    14  	decoded   iso8583Msg2
    15  	encoded   []byte
    16  	line      int
    17  	benchmark bool
    18  }{
    19  	{
    20  		decoded:   iso8583Msg2{MTIMessageTypeIndicator: "0200", PANPrimaryAccountNumber2: "5321000000002610", ProcessingCode3: "000000", AmountOrig4: "000000040000", TransmissionDateTime7: "0517141728", TraceNumber11: "000064", LocalTime12: "135253", LocalDate13: "0516", DateSettlement15: "0517", DateCapture17: "0516", MerchantType18: "6010", POSDataCode22: "9020", POSPointOfServiceConditionCode25: "00", AcquirerInstitutionID32: "999905", TrackData35: "0000000000000000000000000000000000000", RetrievalReference37: "713619909448", CardAccptrTermnlID41: "80110001", CardAccptrIDCode42: "80110001       ", CardAccptrNameLoc43: "CENTRAL OFFICE           Moscow       RU", CurrencyOrig49: "643", AdditionalInformation60: "02000000", MessageOriginator100: "MCTIDHI1", AccountFrom102: "00000000611643", AdditionalInformationPart1_120: "UD060CI045010100201003010040120501006010070100801009010ER00540073"},
    21  		encoded:   iso8583Bytes[1],
    22  		line:      func() int { _, _, l, _ := runtime.Caller(1); return l }(),
    23  		benchmark: true,
    24  	},
    25  	{
    26  		decoded: iso8583Msg2{MTIMessageTypeIndicator: "0421", PANPrimaryAccountNumber2: "5321000000002610", ProcessingCode3: "000000", AmountOrig4: "000000040000", Amount6: "000000040000", TransmissionDateTime7: "0613143650", TraceNumber11: "000064", LocalTime12: "135253", LocalDate13: "0516", MerchantType18: "6010", POSDataCode22: "9020", POSPointOfServiceConditionCode25: "00", AcquirerInstitutionID32: "999905", RetrievalReference37: "713619909448", AuthIDCode38: "058132", RespCode39: "00", CardAccptrTermnlID41: "80110001", CardAccptrIDCode42: "80110001       ", CardAccptrNameLoc43: "CENTRAL OFFICE          >Moscow       RU", CurrencyOrig49: "643", Currency51: "643", OriginalDataSerials56: "000000003912000000000000", AdditionalInformation60: "02000000", OtherAmtTrans61: "000000000000000000000000000000000000", OrigDataElemts90: "010000006406131436000000099990500000000000", ReplacementAmount95: "000000000000000000000000000000000000000000", MessageOriginator100: "OCTIDHI1", AccountFrom102: "00000000611643", AdditionalInformationPart1_120: "UD062CI045010100201003010040100501006010070100801009010IR000CS00241"},
    27  		encoded: []byte{0x30, 0x34, 0x32, 0x31, 0xf6, 0x38, 0x44, 0x81, 0xe, 0xe0, 0xa1, 0x18, 0x0, 0x0, 0x0, 0x42, 0x14, 0x0, 0x1, 0x0, 0x31, 0x36, 0x35, 0x33, 0x32, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x36, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x31, 0x33, 0x31, 0x34, 0x33, 0x36, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x34, 0x31, 0x33, 0x35, 0x32, 0x35, 0x33, 0x30, 0x35, 0x31, 0x36, 0x36, 0x30, 0x31, 0x30, 0x39, 0x30, 0x32, 0x30, 0x30, 0x30, 0x30, 0x36, 0x39, 0x39, 0x39, 0x39, 0x30, 0x35, 0x37, 0x31, 0x33, 0x36, 0x31, 0x39, 0x39, 0x30, 0x39, 0x34, 0x34, 0x38, 0x30, 0x35, 0x38, 0x31, 0x33, 0x32, 0x30, 0x30, 0x38, 0x30, 0x31, 0x31, 0x30, 0x30, 0x30, 0x31, 0x38, 0x30, 0x31, 0x31, 0x30, 0x30, 0x30, 0x31, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x45, 0x4e, 0x54, 0x52, 0x41, 0x4c, 0x20, 0x4f, 0x46, 0x46, 0x49, 0x43, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3e, 0x4d, 0x6f, 0x73, 0x63, 0x6f, 0x77, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x55, 0x36, 0x34, 0x33, 0x36, 0x34, 0x33, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x39, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x38, 0x30, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x34, 0x30, 0x36, 0x31, 0x33, 0x31, 0x34, 0x33, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x39, 0x39, 0x39, 0x39, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x38, 0x4f, 0x43, 0x54, 0x49, 0x44, 0x48, 0x49, 0x31, 0x31, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x31, 0x31, 0x36, 0x34, 0x33, 0x30, 0x36, 0x37, 0x55, 0x44, 0x30, 0x36, 0x32, 0x43, 0x49, 0x30, 0x34, 0x35, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x32, 0x30, 0x31, 0x30, 0x30, 0x33, 0x30, 0x31, 0x30, 0x30, 0x34, 0x30, 0x31, 0x30, 0x30, 0x35, 0x30, 0x31, 0x30, 0x30, 0x36, 0x30, 0x31, 0x30, 0x30, 0x37, 0x30, 0x31, 0x30, 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x39, 0x30, 0x31, 0x30, 0x49, 0x52, 0x30, 0x30, 0x30, 0x43, 0x53, 0x30, 0x30, 0x32, 0x34, 0x31},
    28  		line:    func() int { _, _, l, _ := runtime.Caller(1); return l }(),
    29  	},
    30  	{
    31  		decoded: iso8583Msg2{MTIMessageTypeIndicator: "0100", PANPrimaryAccountNumber2: "5321000000003429", ProcessingCode3: "000000", AmountOrig4: "000000005000", Amount6: "000000005000", TransmissionDateTime7: "1214180640", BillingRate10: "61000000", TraceNumber11: "000503", LocalTime12: "180640", LocalDate13: "1214", DateExpiration14: "2212", DateSettlement15: "1214", MerchantType18: "5999", POSDataCode22: "9030", POSPointOfServiceConditionCode25: "00", AcquirerInstitutionID32: "999037", TrackData35: "0000000000000000000000000000000000000", RetrievalReference37: "080000100062", AuthIDCode38: "042700", CardAccptrTermnlID41: "MTF TEST", CardAccptrIDCode42: "ABC123TESTMTF19", CardAccptrNameLoc43: "Misc Retail              Vegas        NV", CurrencyOrig49: "840", Currency51: "840", AdditionalInformation60: "05000000", OtherAmtTrans61: "000000000000000000000000", MessageOriginator100: "MAPIMAST", AccountFrom102: "00000012811643", AdditionalInformationPart1_120: "UD073CI045010100201003010040120501006010070100801009010CS0043081AD009010596632"},
    32  		encoded: []byte{0x30, 0x31, 0x30, 0x30, 0xf6, 0x7e, 0x44, 0x81, 0x2c, 0xe0, 0xa0, 0x18, 0x0, 0x0, 0x0, 0x0, 0x14, 0x0, 0x1, 0x0, 0x31, 0x36, 0x35, 0x33, 0x32, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x34, 0x32, 0x39, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x30, 0x30, 0x30, 0x31, 0x32, 0x31, 0x34, 0x31, 0x38, 0x30, 0x36, 0x34, 0x30, 0x36, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x30, 0x33, 0x31, 0x38, 0x30, 0x36, 0x34, 0x30, 0x31, 0x32, 0x31, 0x34, 0x32, 0x32, 0x31, 0x32, 0x31, 0x32, 0x31, 0x34, 0x35, 0x39, 0x39, 0x39, 0x39, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, 0x36, 0x39, 0x39, 0x39, 0x30, 0x33, 0x37, 0x33, 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x38, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x36, 0x32, 0x30, 0x34, 0x32, 0x37, 0x30, 0x30, 0x4d, 0x54, 0x46, 0x20, 0x54, 0x45, 0x53, 0x54, 0x41, 0x42, 0x43, 0x31, 0x32, 0x33, 0x54, 0x45, 0x53, 0x54, 0x4d, 0x54, 0x46, 0x31, 0x39, 0x4d, 0x69, 0x73, 0x63, 0x20, 0x52, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x56, 0x65, 0x67, 0x61, 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x56, 0x38, 0x34, 0x30, 0x38, 0x34, 0x30, 0x30, 0x38, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x38, 0x4d, 0x41, 0x50, 0x49, 0x4d, 0x41, 0x53, 0x54, 0x31, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x32, 0x38, 0x31, 0x31, 0x36, 0x34, 0x33, 0x30, 0x37, 0x38, 0x55, 0x44, 0x30, 0x37, 0x33, 0x43, 0x49, 0x30, 0x34, 0x35, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x32, 0x30, 0x31, 0x30, 0x30, 0x33, 0x30, 0x31, 0x30, 0x30, 0x34, 0x30, 0x31, 0x32, 0x30, 0x35, 0x30, 0x31, 0x30, 0x30, 0x36, 0x30, 0x31, 0x30, 0x30, 0x37, 0x30, 0x31, 0x30, 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x39, 0x30, 0x31, 0x30, 0x43, 0x53, 0x30, 0x30, 0x34, 0x33, 0x30, 0x38, 0x31, 0x41, 0x44, 0x30, 0x30, 0x39, 0x30, 0x31, 0x30, 0x35, 0x39, 0x36, 0x36, 0x33, 0x32},
    33  		line:    func() int { _, _, l, _ := runtime.Caller(1); return l }(),
    34  	},
    35  	{
    36  		decoded: iso8583Msg2{MTIMessageTypeIndicator: "0100", PANPrimaryAccountNumber2: "5321000000002610", ProcessingCode3: "000000", AmountOrig4: "000000003000", Amount6: "000000003000", TransmissionDateTime7: "0705162711", TraceNumber11: "914303", LocalTime12: "190306", LocalDate13: "0519", DateSettlement15: "0705", MerchantType18: "6012", POSDataCode22: "0120", POSPointOfServiceConditionCode25: "08", AcquirerInstitutionID32: "999905", RetrievalReference37: "713919914303", AuthIDCode38: "089460", CardAccptrTermnlID41: "88880012", CardAccptrIDCode42: "88880012       ", CardAccptrNameLoc43: "Rocketbank.ru Card2Card  MOSCOW       RU", CurrencyOrig49: "643", Currency51: "643", OriginalDataSerials56: "000000006853", AdditionalInformation60: "05000000", MessageOriginator100: "OCTIDHI1", AccountFrom102: "00000000611643", AdditionalInformationPart1_120: "UD057CI045010100201003010040100501006010070100801209010CS00241", PrivateUseFields126: "0000000000001000000000000000000000000000000000000000000000000000"},
    37  		encoded: []byte{0x30, 0x31, 0x30, 0x30, 0xf6, 0x3a, 0x44, 0x81, 0xc, 0xe0, 0xa1, 0x10, 0x0, 0x0, 0x0, 0x0, 0x14, 0x0, 0x1, 0x4, 0x31, 0x36, 0x35, 0x33, 0x32, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x36, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, 0x37, 0x30, 0x35, 0x31, 0x36, 0x32, 0x37, 0x31, 0x31, 0x39, 0x31, 0x34, 0x33, 0x30, 0x33, 0x31, 0x39, 0x30, 0x33, 0x30, 0x36, 0x30, 0x35, 0x31, 0x39, 0x30, 0x37, 0x30, 0x35, 0x36, 0x30, 0x31, 0x32, 0x30, 0x31, 0x32, 0x30, 0x30, 0x38, 0x30, 0x36, 0x39, 0x39, 0x39, 0x39, 0x30, 0x35, 0x37, 0x31, 0x33, 0x39, 0x31, 0x39, 0x39, 0x31, 0x34, 0x33, 0x30, 0x33, 0x30, 0x38, 0x39, 0x34, 0x36, 0x30, 0x38, 0x38, 0x38, 0x38, 0x30, 0x30, 0x31, 0x32, 0x38, 0x38, 0x38, 0x38, 0x30, 0x30, 0x31, 0x32, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x72, 0x75, 0x20, 0x43, 0x61, 0x72, 0x64, 0x32, 0x43, 0x61, 0x72, 0x64, 0x20, 0x20, 0x4d, 0x4f, 0x53, 0x43, 0x4f, 0x57, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x55, 0x36, 0x34, 0x33, 0x36, 0x34, 0x33, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x38, 0x35, 0x33, 0x30, 0x38, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x38, 0x4f, 0x43, 0x54, 0x49, 0x44, 0x48, 0x49, 0x31, 0x31, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x31, 0x31, 0x36, 0x34, 0x33, 0x30, 0x36, 0x32, 0x55, 0x44, 0x30, 0x35, 0x37, 0x43, 0x49, 0x30, 0x34, 0x35, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x32, 0x30, 0x31, 0x30, 0x30, 0x33, 0x30, 0x31, 0x30, 0x30, 0x34, 0x30, 0x31, 0x30, 0x30, 0x35, 0x30, 0x31, 0x30, 0x30, 0x36, 0x30, 0x31, 0x30, 0x30, 0x37, 0x30, 0x31, 0x30, 0x30, 0x38, 0x30, 0x31, 0x32, 0x30, 0x39, 0x30, 0x31, 0x30, 0x43, 0x53, 0x30, 0x30, 0x32, 0x34, 0x31, 0x30, 0x39, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x52},
    38  		line:    func() int { _, _, l, _ := runtime.Caller(1); return l }(),
    39  	},
    40  	{
    41  		decoded: iso8583Msg2{MTIMessageTypeIndicator: "0100", PANPrimaryAccountNumber2: "5321000000003429", ProcessingCode3: "010000", AmountOrig4: "000000010000", Amount6: "000000010000", TransmissionDateTime7: "1218170443", BillingRate10: "61000000", TraceNumber11: "000014", LocalTime12: "170443", LocalDate13: "1218", DateExpiration14: "2212", DateSettlement15: "1218", MerchantType18: "6011", POSDataCode22: "9010", POSPointOfServiceConditionCode25: "00", TransactionFee28: "D00000100", AcquirerInstitutionID32: "999901", TrackData35: "0000000000000000000000000000000000000", RetrievalReference37: "080000400014", AuthIDCode38: "060128", CardAccptrTermnlID41: "MTF TEST", CardAccptrIDCode42: "ABC123TESTMTF19", CardAccptrNameLoc43: "Member Financial Insti   Manchester    F", CurrencyOrig49: "840", Currency51: "840", PersonalIdentificationNumberData52: "AAAAAAAAAAA=", AdditionalInformation60: "02000000", OtherAmtTrans61: "000000000000000000000000", MessageOriginator100: "MAPIMAST", AccountFrom102: "00000012811643", AdditionalInformationPart1_120: "UD073CI045010100201003010040120501006012070120801009010CS0043081AD009010597111"},
    42  		encoded: []byte{0x30, 0x31, 0x30, 0x30, 0xf6, 0x7e, 0x44, 0x91, 0x2c, 0xe0, 0xb0, 0x18, 0x0, 0x0, 0x0, 0x0, 0x14, 0x0, 0x1, 0x0, 0x31, 0x36, 0x35, 0x33, 0x32, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x34, 0x32, 0x39, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x31, 0x32, 0x31, 0x38, 0x31, 0x37, 0x30, 0x34, 0x34, 0x33, 0x36, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x34, 0x31, 0x37, 0x30, 0x34, 0x34, 0x33, 0x31, 0x32, 0x31, 0x38, 0x32, 0x32, 0x31, 0x32, 0x31, 0x32, 0x31, 0x38, 0x36, 0x30, 0x31, 0x31, 0x39, 0x30, 0x31, 0x30, 0x30, 0x30, 0x44, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x36, 0x39, 0x39, 0x39, 0x39, 0x30, 0x31, 0x33, 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x38, 0x30, 0x30, 0x30, 0x30, 0x34, 0x30, 0x30, 0x30, 0x31, 0x34, 0x30, 0x36, 0x30, 0x31, 0x32, 0x38, 0x4d, 0x54, 0x46, 0x20, 0x54, 0x45, 0x53, 0x54, 0x41, 0x42, 0x43, 0x31, 0x32, 0x33, 0x54, 0x45, 0x53, 0x54, 0x4d, 0x54, 0x46, 0x31, 0x39, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x46, 0x69, 0x6e, 0x61, 0x6e, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x20, 0x20, 0x20, 0x4d, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x74, 0x65, 0x72, 0x20, 0x20, 0x20, 0x20, 0x46, 0x38, 0x34, 0x30, 0x38, 0x34, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x38, 0x30, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x38, 0x4d, 0x41, 0x50, 0x49, 0x4d, 0x41, 0x53, 0x54, 0x31, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x32, 0x38, 0x31, 0x31, 0x36, 0x34, 0x33, 0x30, 0x37, 0x38, 0x55, 0x44, 0x30, 0x37, 0x33, 0x43, 0x49, 0x30, 0x34, 0x35, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x32, 0x30, 0x31, 0x30, 0x30, 0x33, 0x30, 0x31, 0x30, 0x30, 0x34, 0x30, 0x31, 0x32, 0x30, 0x35, 0x30, 0x31, 0x30, 0x30, 0x36, 0x30, 0x31, 0x32, 0x30, 0x37, 0x30, 0x31, 0x32, 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x39, 0x30, 0x31, 0x30, 0x43, 0x53, 0x30, 0x30, 0x34, 0x33, 0x30, 0x38, 0x31, 0x41, 0x44, 0x30, 0x30, 0x39, 0x30, 0x31, 0x30, 0x35, 0x39, 0x37, 0x31, 0x31, 0x31},
    43  		line:    func() int { _, _, l, _ := runtime.Caller(1); return l }(),
    44  	},
    45  	{
    46  		decoded: iso8583Msg2{MTIMessageTypeIndicator: "0100", PANPrimaryAccountNumber2: "5321000000002610", ProcessingCode3: "010000", AmountOrig4: "000000100000", TransmissionDateTime7: "0525142545", TraceNumber11: "922274", LocalTime12: "172709", LocalDate13: "0525", DateSettlement15: "0525", MerchantType18: "6011", POSDataCode22: "0510", POSPointOfServiceConditionCode25: "02", AcquirerInstitutionID32: "999905", TrackData35: "0000000000000000000000000000000000000", RetrievalReference37: "714519922274", AuthIDCode38: "054254", CardAccptrTermnlID41: "00077810", CardAccptrIDCode42: "00077810       ", CardAccptrNameLoc43: "ATM NEOPALIMOVSKY 10    >MOSCOW       RU", CurrencyOrig49: "643", PersonalIdentificationNumberData52: "AAAAAAAAAAA=", ICCRelatedData55: "nyYIMw7FhG2DpOqfEBIBEKAAAyIAAAAAAAAAAAAAAP+fNwR2QAY3nzYCAF2VBYAABAAAmgMXBSWcAQGfAgYAAAAQAABfKgIJeIICOQCfGgIGQ58zA2BAIA==", OriginalDataSerials56: "000000001423", AdditionalInformation60: "05000000", MessageOriginator100: "OCTIDHI1", AccountFrom102: "00000000611643", AdditionalInformationPart1_120: "UD057CI045010120201003010040120501206012070120801009010CS00241"},
    47  		encoded: []byte{0x30, 0x31, 0x30, 0x30, 0xf2, 0x3a, 0x44, 0x81, 0x2c, 0xe0, 0x93, 0x10, 0x0, 0x0, 0x0, 0x0, 0x14, 0x0, 0x1, 0x0, 0x31, 0x36, 0x35, 0x33, 0x32, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x36, 0x31, 0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x32, 0x35, 0x31, 0x34, 0x32, 0x35, 0x34, 0x35, 0x39, 0x32, 0x32, 0x32, 0x37, 0x34, 0x31, 0x37, 0x32, 0x37, 0x30, 0x39, 0x30, 0x35, 0x32, 0x35, 0x30, 0x35, 0x32, 0x35, 0x36, 0x30, 0x31, 0x31, 0x30, 0x35, 0x31, 0x30, 0x30, 0x32, 0x30, 0x36, 0x39, 0x39, 0x39, 0x39, 0x30, 0x35, 0x33, 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x31, 0x34, 0x35, 0x31, 0x39, 0x39, 0x32, 0x32, 0x32, 0x37, 0x34, 0x30, 0x35, 0x34, 0x32, 0x35, 0x34, 0x30, 0x30, 0x30, 0x37, 0x37, 0x38, 0x31, 0x30, 0x30, 0x30, 0x30, 0x37, 0x37, 0x38, 0x31, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x54, 0x4d, 0x20, 0x4e, 0x45, 0x4f, 0x50, 0x41, 0x4c, 0x49, 0x4d, 0x4f, 0x56, 0x53, 0x4b, 0x59, 0x20, 0x31, 0x30, 0x20, 0x20, 0x20, 0x20, 0x3e, 0x4d, 0x4f, 0x53, 0x43, 0x4f, 0x57, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x55, 0x36, 0x34, 0x33, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x38, 0x38, 0x9f, 0x26, 0x8, 0x33, 0xe, 0xc5, 0x84, 0x6d, 0x83, 0xa4, 0xea, 0x9f, 0x10, 0x12, 0x1, 0x10, 0xa0, 0x0, 0x3, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x9f, 0x37, 0x4, 0x76, 0x40, 0x6, 0x37, 0x9f, 0x36, 0x2, 0x0, 0x5d, 0x95, 0x5, 0x80, 0x0, 0x4, 0x0, 0x0, 0x9a, 0x3, 0x17, 0x5, 0x25, 0x9c, 0x1, 0x1, 0x9f, 0x2, 0x6, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x5f, 0x2a, 0x2, 0x9, 0x78, 0x82, 0x2, 0x39, 0x0, 0x9f, 0x1a, 0x2, 0x6, 0x43, 0x9f, 0x33, 0x3, 0x60, 0x40, 0x20, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x34, 0x32, 0x33, 0x30, 0x38, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x38, 0x4f, 0x43, 0x54, 0x49, 0x44, 0x48, 0x49, 0x31, 0x31, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x31, 0x31, 0x36, 0x34, 0x33, 0x30, 0x36, 0x32, 0x55, 0x44, 0x30, 0x35, 0x37, 0x43, 0x49, 0x30, 0x34, 0x35, 0x30, 0x31, 0x30, 0x31, 0x32, 0x30, 0x32, 0x30, 0x31, 0x30, 0x30, 0x33, 0x30, 0x31, 0x30, 0x30, 0x34, 0x30, 0x31, 0x32, 0x30, 0x35, 0x30, 0x31, 0x32, 0x30, 0x36, 0x30, 0x31, 0x32, 0x30, 0x37, 0x30, 0x31, 0x32, 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x39, 0x30, 0x31, 0x30, 0x43, 0x53, 0x30, 0x30, 0x32, 0x34, 0x31},
    48  		line:    func() int { _, _, l, _ := runtime.Caller(1); return l }(),
    49  	},
    50  }
    51  
    52  func TestTSYSMarshalerUnmarshalerMarshalUnmarshal(t *testing.T) {
    53  	_, testFile, _, _ := runtime.Caller(0)
    54  	for _, tc := range TSYSMarshalerUnmarshalerMarshalUnmarshalTestCases {
    55  		tc := tc
    56  		t.Run(strconv.Itoa(tc.line), func(t *testing.T) {
    57  			t.Parallel()
    58  			linkToExample := fmt.Sprintf("%s:%d", testFile, tc.line)
    59  			enc, err := codec8583.TSYSMarshaler.Marshal(&tc.decoded)
    60  			if err != nil {
    61  				t.Fatalf("unexpected error: %#v - %s", err, linkToExample)
    62  			}
    63  			if !bytes.Equal(enc, tc.encoded) {
    64  				t.Errorf("[encoded message] expected: %#v, received: %#v - %s", tc.encoded, enc, linkToExample)
    65  			}
    66  			dec := iso8583Msg2{}
    67  			err = codec8583.TSYSUnmarshaler.Unmarshal(enc, &dec)
    68  			if err != nil {
    69  				t.Fatalf("unexpected error: %#v - %s", err, linkToExample)
    70  			}
    71  			if dec != tc.decoded {
    72  				t.Errorf("[decoded message] expected: %#v, received: %#v - %s", tc.decoded, dec, linkToExample)
    73  			}
    74  		})
    75  	}
    76  }
    77  
    78  func BenchmarkTSYSMarshalerMarshal(b *testing.B) {
    79  	for _, tc := range TSYSMarshalerUnmarshalerMarshalUnmarshalTestCases {
    80  		if !tc.benchmark {
    81  			continue
    82  		}
    83  		b.Run(strconv.Itoa(tc.line), func(b *testing.B) {
    84  			for i := 0; i < b.N; i++ {
    85  				_, err := codec8583.TSYSMarshaler.Marshal(&tc.decoded)
    86  				if err != nil {
    87  					fmt.Println(err)
    88  				}
    89  			}
    90  		})
    91  	}
    92  }
    93  
    94  func BenchmarkTSYSUnmarshalerUnmarshal(b *testing.B) {
    95  	for _, tc := range TSYSMarshalerUnmarshalerMarshalUnmarshalTestCases {
    96  		if !tc.benchmark {
    97  			continue
    98  		}
    99  		b.Run(strconv.Itoa(tc.line), func(b *testing.B) {
   100  			for i := 0; i < b.N; i++ {
   101  				dec := iso8583Msg2{}
   102  				err := codec8583.TSYSUnmarshaler.Unmarshal(tc.encoded, &dec)
   103  				if err != nil {
   104  					fmt.Println(err)
   105  				}
   106  			}
   107  		})
   108  	}
   109  }