Skip to content

Releases: moov-io/iso8583

Release v0.10.0

15 Feb 20:28
7bead25

Choose a tag to compare

Changelog

  • added message.Marshal(data) which sets values of message fields using values provided in the data struct.
  • added support of index tag for both message.Marshal() and message.Unmarshal(). Now you can name your fields as you want and use index tag to specify the field index matching the ISO8583 specification. Examples are here and here.
  • removed iso8583.Unmarshal. Please, use message.Unmarshal instead.
  • removed message.Data()
  • deprecated message.SetData(data). Use message.Marshal() instead.
  • deprecated field.SetData(data). Use field.Marshal(data) instead.
  • changed current behavior of message.SetData(data). Before it could be used to get values into a struct after calling message.Unpack() like this:
data := &ISOMessage{}
mesage.SetData(data)
message.Unpack(rawMessage)

data.F1.Value //  in previous versions, values were populated during unpacking, but now they are not

Now message.SetData(data) only sets field values and you can't get values back to the struct using it. In order to get values into the struct you have to use message.Unmarshal(data) like this:

message.Unpack(rawMessage)
data := &ISOMessage{}
mesage.Unmarshall(data)

data.F1.Value //  now you can get the value

Migration Guide

Two main changes that you may need to do in your code:

  1. Replace message.SetData(data) with message.Marshal(data). Latter simply sets field values with values provided in the data struct. Without any side effects.
  2. Replace message.Data()(*YouMessageTypehere) with message.Unmarshal(data). It sets data struct values with message field values. No side-effects.
  3. If you used SetData() with Unpack to get access to message field values, then you have to replace it with just message.Unmarshal(data).

You have to change your code from this

type ISO87Data struct {
	F0 *field.String
	F2 *field.String
	F4 *field.String
}

message := NewMessage(spec)
data := &ISO87Data{}
err := message.SetData(data) // you "link" data internally
err = message.Unpack(rawMsg) // here values are populated into linked data struct. it will not work anymore.

// access field values
data.F0.Value
data.F2.Value
data.F4.Value

to this:

type ISO87Data struct {
	F0 *field.String
	F2 *field.String
	F4 *field.String
}

message := NewMessage(spec)
err := message.Unpack(rawMsg)

data := &ISO87Data{}
err = message.Unmarshal(data)

// access field values
data.F0.Value
data.F2.Value
data.F4.Value

If you have any questions, please, submit an issue or ask in our community Slack channel.

Release v0.10.0-beta

14 Feb 14:33

Choose a tag to compare

Release v0.10.0-beta Pre-release
Pre-release

Changes in this PR are not backward compatible! Few things have changed. Hopefully, migration will not be painful for you. If you have any questions, please, let us know here or in our community Slack channel.

Changes:

  • added message.Marshal(data) which sets values of message fields using values provided in data struct.
  • added support of index tag for both message.Marshal() and message.Unmarshal(). Now you can name your fields as you want and used index tag to specify field index in the ISO8583 specification. Examples are here and here.
  • removed iso8583.Unmarshal. Please, use message.Unmarshal instead.
  • removed message.Data()
  • deprecated message.SetData(data). Use message.Marshal() instead.
  • deprecated field.SetData(data). Use field.Marshal(data) instead.
  • changed current behavior of message.SetData(data). Before it could be used to get values into a struct after calling message.Unpack() like this:
data := &ISOMessage{}
mesage.SetData(data)
message.Unpack(rawMessage)

data.F1.Value //  if previous versions values were populated during unpacking, but now they are not

Now message.SetData(data) only sets field values. No way to get values back to the struct. In order to get values into struct you have to use message.Unmarshal(data) like this:

message.Unpack(rawMessage)
data := &ISOMessage{}
mesage.Unmarshall(data)

data.F1.Value //  now you can get the value

Migration Guide

Two main changes that you may need to do in your code:

  1. Replace message.SetData(data) with message.Marshal(data). Latter, simply sets field values with values provided in the data struct. Without any side-effects.
  2. Replce message.Data()(*YouMessageTypehere) with message.Unmarshal(data). It sets data` struct values with message field values. No side-effects.
  3. If you used SetData() and call Unpack to get access to message field values, replace it with message.Unmarshal(data).

You have to change your code from this

type ISO87Data struct {
	F0 *field.String
	F2 *field.String
	F4 *field.String
}

message := NewMessage(spec)
data := &ISO87Data{}
err := message.SetData(data) // you "link" data internally
err = message.Unpack(rawMsg) // here values are populated into linked data struct. no more.

// now you access you
data.F0.Value
data.F2.Value
data.F4.Value

to this:

type ISO87Data struct {
	F0 *field.String
	F2 *field.String
	F4 *field.String
}

message := NewMessage(spec)
err := message.Unpack(rawMsg)

data := &ISO87Data{}
err = message.Unmarshal(data)

// now you access fields in data
data.F0.Value
data.F2.Value
data.F4.Value

Release v0.9.0

09 Feb 18:03
07d52aa

Choose a tag to compare

Changelog

  • Fix panic on message.Unpack(nil) or empty/smaller than expected input slice length (#161)
  • Implement iso8583.Unmarshal method to populate data struct with message field values (#157)
  • Deprecated: message.Data() will be removed in the next release. Please, use iso8583.Unmarshal instead (see the example here).

Release v0.8.4

19 Jan 15:27
d31b768

Choose a tag to compare

What's Changed

  • added a missing rightPadder to JSON spec builder by @adamdecaf in #156

Full Changelog: v0.8.2...v0.8.4

Release v0.8.3

08 Dec 14:39
605da49

Choose a tag to compare

Release v0.8.3 Pre-release
Pre-release
Extend MTI enum (#153)

* Add Reversal Request Response to MTI enum

* Add 0180 and 0190

* Add administrative messages

* specify that 0180 is positive

* fix whitespace

Co-authored-by: louis <[email protected]>

v0.8.2: Extend MTI enum (#153)

08 Dec 14:21
605da49

Choose a tag to compare

Changelog

  • Extend MTI enum (#153) (add reversal response, administrative messages, network management, etc.)

Release v0.8.1

03 Dec 22:21

Choose a tag to compare

Changelog

  • Fix issue with packing zero length fields #149
  • Add Clone() method for iso8583 message #150

Release v0.7.0

02 Dec 20:48
9c1cf1e

Choose a tag to compare

Changelog

  • Replace %v with %w in error messages (#152)

Release v0.6.8

15 Oct 09:27
679e5a6

Choose a tag to compare

Changelog

  • Fix BCD decoding to limit number of bytes being read from source #137

Release v0.6.7

12 Oct 14:42
fd6755c

Choose a tag to compare

Changelog

  • Use = as default the separator in Track 2 #135