Extract remittance_information from Linxo transactions - #21
Open
cindyEmile1 wants to merge 5 commits into
Open
Conversation
Linxo sends a remittance_information field with each transaction: the free-text reference the counterparty attaches to the payment. It was not extracted, so consumers could only reach it through the raw payload. The exact location in the v3 payload is not confirmed yet, so it is read from the root first and from the enrichments block as a fallback: the same move happened to `notes`, which Linxo relocated into `enrichments` in v3. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The lowest dependency legs upgrade rector to its latest release while resolving php-quality-config to the ^2.2 floor. v2.2.0 still registers StaticClosureRector and StaticArrowFunctionRector, which rector 2.6.2 rejects outright, so those legs died on src/ApiClient.php before running a single check. v2.4.0 dropped both rules. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PHPUnit 13 removed support for annotation-based data providers, so the three tests using them errored with ArgumentCountError on the highest dependency legs. The attribute form works from PHPUnit 10 onwards, so both ends of the matrix are covered. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The v3 payload carries this field at the root of the transaction as an array of unstructured ISO 20022 lines, not as a string, and never inside enrichments. Assigning it to a ?string property therefore threw "Cannot assign array to property TransactionDto::$remittanceInformation" on every transaction that carried one, which failed the whole import, not just that field. The lines are now joined by a space; an absent or empty array still gives null. The phpstan type is fixed accordingly and the two tests describing the enrichments location are dropped, as that location does not exist. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
❌ The last analysis has failed. |
|
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.



Summary
remittance_informationfield with each transaction: the free-text reference the counterparty attaches to the payment (ISO 20022).TransactionDtonever extracted it, so consumers could only reach it through the raw payload withgetData().getRemittanceInformation(): ?string, the matching@phpstan-typeentries and the baseline update the shape change requires.enrichmentsblock as a fallback. The precedent isnotes, which used to sit at the root and which Linxo moved intoenrichmentswhen the API went v3 (fixed in Fix bad implement of notes property since Linxo was updated to v3 #20). Once a real payload confirms the location, the fallback should collapse to a single lookup — happy to do that here instead if a reviewer already knows the answer.The last two commits fix CI, which was red on
mainbefore this branch. They are independent of the feature and reviewable on their own:php-quality-config^2.2 → ^2.4. Thelowestlegs upgrade rector to its latest release while resolving the config to the^2.2floor. v2.2.0 still registersStaticClosureRector/StaticArrowFunctionRector, which rector 2.6.2 rejects outright, killing the run onsrc/ApiClient.phpbefore any check. v2.4.0 dropped both rules.@dataProvider→#[DataProvider]in the three tests using it. PHPUnit 13 removed annotation-based providers, so thehighestlegs errored withArgumentCountError. The attribute form works from PHPUnit 10 onwards, so both ends of the matrix are covered.Test plan
enrichmentsfallback, root-wins precedence, and the absent-field case.--prefer-lowestplus the analysis-tool upgrade, and plaininstall): phpcs, phpstan, rector and phpunit all green, 66 tests. The data-provider tests actually execute again — they were silently erroring before.Shipping
Merging this PR ships nothing: it needs a semver tag / GitHub release, then a
composer require assoconnect/linxo-client:^2.1bump PR in the backend. Two reviews total.Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com