Skip to content

feat(iso): add MessageErrorIndicator for DE-018 wire encoding#684

Merged
ar merged 1 commit intomainfrom
feat/message-error-indicator
Mar 28, 2026
Merged

feat(iso): add MessageErrorIndicator for DE-018 wire encoding#684
ar merged 1 commit intomainfrom
feat/message-error-indicator

Conversation

@ar-agt
Copy link
Copy Markdown
Collaborator

@ar-agt ar-agt commented Mar 28, 2026

Introduces MessageErrorIndicator in org.jpos.iso for structured encode/decode of the ISO 8583 DE-018 (Message Error Indicator) field.

API

MessageErrorIndicator mei = new MessageErrorIndicator()
    .add(FieldError.primitiveError(ErrorCode.REQUIRED_MISSING, 37))
    .add(FieldError.compositeError(ErrorCode.INVALID_VALUE, 55, 0x37, 0x9F26));

msg.set(new ISOBinaryField(18, mei.pack()));

Inner types

  • ErrorCode — ISO 8583:2023 Table D.15 codes 0001–0013; of(int) for private/national-use codes
  • SeverityREJECTED (00) / WARNING (01)
  • FieldError — one 14-byte error set with factory methods for primitive, constructed, and composite DE errors

Wire format

14 bytes per error set: N2 severity + N4 error code + N3 DE number + N2 sub-element + B1 dataset id + B2 dataset bit/tag. Up to 10 sets, up to 140 bytes total.

Tests

15 unit tests covering all error types, severity, round-trips, edge cases, and ISOMsg integration.

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
@ar ar merged commit 9223a34 into main Mar 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants