feat(iso): add LifeCycleId for DE-021 encoding and TxnId integration#685
Merged
feat(iso): add LifeCycleId for DE-021 encoding and TxnId integration#685
Conversation
added 2 commits
March 28, 2026 17:30
Introduces MessageErrorIndicator in org.jpos.iso for structured encoding/decoding of the DE-018 Message Error Indicator field. - Inner enum ErrorCode: ISO 8583:2023 Table D.15 error codes 0001-0013 - Inner enum Severity: REJECTED (00) / WARNING (01) - Inner class FieldError: one 14-byte error set with factory methods: - primitiveError() -- primitive DE errors - constructedError() -- sub-element errors in constructed DEs - compositeError() -- dataset/tag errors in composite DEs - withRawCode() -- private/national-use error codes - pack()/unpack() round-trip: byte-accurate to ISO 8583:2023 §DE-018 - Integrates with ISOMsg via ISOBinaryField(18, mei.pack()) - Full unit test suite: 15 tests covering all error types, severity, round-trips, edge cases and ISOMsg integration
LifeCycleId in org.jpos.iso provides structured pack/unpack for the ISO 8583 Transaction Life Cycle Identification Data field (DE-021). Key features: - Fluent builder: supportIndicator(), traceId(TxnId), traceId(String), sequenceNumber(), authToken() - supportIndicator(String mti) derives indicator from ISO 8583 MTI - traceId(TxnId) uses TxnId.toRrn(), right-padded to 15 chars - txnId() attempts TxnId.fromRrn() on the trace ID; returns empty Optional for external-network trace IDs (never throws) - toBuilder() copies all sub-fields — supports financial presentment echo pattern where seq/token are updated from the authorization - Wire layout: 1-byte indicator + 15-byte ASCII trace + 1-byte N2 BCD sequence number + 2-byte N4 BCD authentication token (19 bytes total) - 19 unit tests covering all sub-fields, TxnId round-trip, external trace IDs, toBuilder independence, and ISOMsg integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces two new wire-format helper classes in
org.jpos.iso:LifeCycleId— DE-021 Transaction Life Cycle Identification Data19-byte constructed field correlating messages across a transaction life cycle (authorization through presentment, reversal, chargeback).
Key features:
traceId(TxnId)— usesTxnId.toRrn(), right-padded to 15 charstxnId()— returnsOptional.empty()for external-network trace IDstoBuilder()— copies all sub-fields for the financial presentment echo patternMessageErrorIndicator— DE-018 Message Error IndicatorStructured encode/decode for DE-018. Up to 10 error sets, each exactly 14 bytes.
Inner types:
ErrorCode(ISO 8583:2023 Table D.15 codes 0001–0013),Severity,FieldErrorfactory methods (primitiveError(),constructedError(),compositeError(),withRawCode()).Tests
34 tests total — all passing.