-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix : noneprefixer did not return correct fixed len #304
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #304 +/- ##
=======================================
Coverage 74.98% 74.98%
=======================================
Files 44 44
Lines 2495 2495
=======================================
Hits 1871 1871
Misses 407 407
Partials 217 217 ☔ View full report in Codecov by Sentry. |
Hey! Thanks for the PR and the fixes!
I saw different encodings used for the numeric fields. It depends on the card brand / processor. The difference between str := field.NewStringValue("100")
str.Value() // "100"
i := field.NewNumericValue(100)
i.Value() // 100 There will be an error if you try to unpack a message with a non-numeric field value for a field specified as |
We should revert the change to the |
hello @alovak , thank you for answering my question. i was confused by the anyways i cherry picked to other changes. if you want to merge this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@T-eli thanks a lot for the fixes!
@T-eli if you have any other questions, feel free to ask them on either https://github.com/moov-io/iso8583/issues or joining Moov Slack community (channel #iso8583) |
thanks @alovak. |
this pull request contains 2 fixes:
while i am here i have a question if the someone can answer:
-> Aren't Numeric Fields usually encoded in BCD?
Nemric field pack method:
data := []byte(strconv.FormatInt(f.value, 10))...
should be :
data, _ := hex.DecodeString(strconv.FormatInt(f.value, 10))
I know that you can set the Encoder in spec to BCD. but I dont see the deference between using a String Field and Numeric Field.