feat(ACL-390): Add new data fields required for cVRP payments across all payment products#389
Merged
Merged
Conversation
…tion.java Co-authored-by: Luca Baggi <74901945+tl-luca-baggi@users.noreply.github.com>
Updated version number to 17.6.0 and added new fields for payment API.
tl-luca-baggi
previously approved these changes
May 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SDK support for new cVRP/commercial-VRP fields across mandates, payments, and providers, plus introduces a mandatory id field for business_client sub-merchants and updates fixtures/tests accordingly.
Changes:
- Add
use_case/use_casessupport for commercial VRP mandates and provider capabilities (including search filtering model). - Add
user_interactionsupport for mandate-backed payments. - Add mandatory
idtobusiness_client(ultimate counterparty) and update acceptance/integration tests & WireMock fixtures.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/truelayer/java/entities/UseCase.java | Introduces UseCase enum for commercial VRP use cases. |
| src/main/java/com/truelayer/java/mandates/entities/mandate/VRPCommercialMandate.java | Adds useCase to commercial mandate creation model. |
| src/main/java/com/truelayer/java/mandates/entities/mandatedetail/MandateDetail.java | Adds useCase and type to mandate detail responses. |
| src/main/java/com/truelayer/java/payments/entities/UserInteraction.java | Introduces UserInteraction enum for mandate payments. |
| src/main/java/com/truelayer/java/payments/entities/paymentmethod/Mandate.java | Adds userInteraction to mandate payment method model. |
| src/main/java/com/truelayer/java/payments/entities/submerchants/BusinessClient.java | Adds mandatory id field to business_client ultimate counterparty. |
| src/main/java/com/truelayer/java/paymentsproviders/entities/VrpCommercialCapabilities.java | Adds useCases to commercial VRP provider capabilities (GET provider/search response model). |
| src/main/java/com/truelayer/java/paymentsproviders/entities/searchproviders/VrpCommercialCapabilities.java | Adds useCases for filtering provider search requests. |
| src/test/java/com/truelayer/java/acceptance/MandatesAcceptanceTests.java | Extends mandate acceptance tests to pass useCase and userInteraction where relevant. |
| src/test/java/com/truelayer/java/acceptance/PaymentsAcceptanceTests.java | Updates sub-merchant acceptance scenario to include business_client.id. |
| src/test/java/com/truelayer/java/integration/MandatesIntegrationTests.java | Adds integration test and fixture coverage for commercial mandate detail. |
| src/test/java/com/truelayer/java/integration/PaymentSubMerchantsIntegrationTest.java | Asserts business_client.id is deserialized correctly. |
| src/test/java/com/truelayer/java/payments/entities/submerchants/SubMerchantsTest.java | Updates unit test builder usage for business_client.id. |
| src/test/resources/__files/mandates/200.get_commercial_mandate_by_id.json | New WireMock response fixture for commercial mandate detail (incl. use_case). |
| src/test/resources/__files/mandates/200.get_mandate_by_id.authorization_required.json | Adds type field to mandate detail fixture. |
| src/test/resources/__files/mandates/200.get_mandate_by_id.authorized.json | Adds type field to mandate detail fixture. |
| src/test/resources/__files/mandates/200.get_mandate_by_id.authorizing.json | Adds type field to mandate detail fixture. |
| src/test/resources/__files/mandates/200.get_mandate_by_id.failed.json | Adds type field to mandate detail fixture. |
| src/test/resources/__files/mandates/200.get_mandate_by_id.revoked.json | Adds type field to mandate detail fixture. |
| src/test/resources/__files/mandates/200.list_mandates.json | Updates list mandates fixture to include type and commercial use_case. |
| src/test/resources/__files/payments/200.get_payment_by_id.mandate.executed.json | Adds user_interaction to mandate payment fixture. |
| src/test/resources/__files/payments/200.get_payment_by_id.mandate.failed.json | Adds user_interaction to mandate payment fixture. |
| src/test/resources/__files/payments/200.get_payment_by_id.with_submerchants.json | Adds business_client.id in sub-merchant fixture. |
| src/test/resources/__files/payments_providers/200.get_payments_provider.json | Adds use_cases array to provider GET fixture. |
| src/test/resources/__files/payments_providers/200.search_payments_providers.json | Adds use_cases array to provider search fixture. |
| CHANGELOG.md | Adds 17.6.0 changelog entry for new fields. |
| gradle.properties | Bumps version to 17.6.0. |
Comments suppressed due to low confidence (1)
src/test/java/com/truelayer/java/integration/MandatesIntegrationTests.java:169
assertEquals(expected, response.getData())does not currently validate the newly-added base fields (type,useCase) because the concreteMandateDetailsubtypes use Lombok-generatedequals/hashCodethat ignore inherited fields (the baseMandateDetaildoesn't implementequals). To ensure this test actually covers the new functionality, add explicit assertions forresponse.getData().getType()andgetUseCase()(and/or implementequals/hashCodeinMandateDetailand include it from subtypes).
ApiResponse<MandateDetail> response =
tlClient.mandates().getMandate(A_MANDATE_ID).get();
verifyGeneratedToken(Collections.singletonList(RECURRING_PAYMENTS_SWEEPING));
MandateDetail expected = deserializeJsonFileTo(jsonResponseFile, MandateDetail.class);
assertEquals(expected, response.getData());
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
tl-luca-baggi
approved these changes
May 15, 2026
Contributor
Author
|
We have decided to keep the two new fields as enums for consistency. |
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.
Description
use_case,use_casesanduser_interactionfields are for commercial VRP only.business_clientsubmerchant account model and fix the acceptance test (Not related to this feature)Provider
GET payments-providers/{id}to return providers with use casesGET payments-providers/searchto filter and return providers with use casesMandate
POST mandates/{id}to accept use caseGET mandates/{id}to return use caseGET mandatesto return use case for mandatesPayment
POST payments/{id}to accept user interactionGET payments/{id}to return user interactionType of change
Please select multiple options if required.
Checklist:
gradle.propertiesfile with the new versionCHANGELOG.mdfile with the details of the new version