Add RemittanceInformationFull field to capture all remittance information lines - fixes #6 #10
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.
Fixes #6 by adding a new
RemittanceInformationFullfield that captures all<Ustrd>elements from CAMT.053 remittance information sections, while maintaining backward compatibility.Problem
The current implementation only extracts the first
<Ustrd>element from<RmtInf>sections usingfind(), missing important remittance information that spans multiple lines. This is particularly problematic for international transactions where banks often include detailed transaction information across multiple unstructured remittance lines.For example, with this XML structure:
Previously only
"Ref.. 1234567890123456"was captured, losing critical transaction details.Solution
Added a new
RemittanceInformationFullfield alongside the existingRemittanceInformationfield:RemittanceInformation: Unchanged - contains only the first<Ustrd>element (backward compatibility)RemittanceInformationFull: New - contains all<Ustrd>elements joined with spacesThe implementation uses
findall()to collect all unstructured remittance elements, strips whitespace, filters out empty elements, and joins them with spaces for a clean, comprehensive result.Changes
_extract_transaction_details()inpycamt/parser.pyto add the new fieldBackward Compatibility
✅ Fully backward compatible - all existing code continues to work unchanged. The original
RemittanceInformationfield is preserved with identical behavior. All existing tests pass without modification.Example Usage
This enhancement is particularly valuable for international transactions and banks that don't fully support structured CAMT.053 formats, ensuring no critical transaction information is lost during parsing.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.