Skip to content

feat(ACL-390): Add new data fields required for cVRP payments across all payment products#389

Merged
tl-tai-tang merged 18 commits into
mainfrom
ACL-390_add_new_cvrp_data_fields
May 15, 2026
Merged

feat(ACL-390): Add new data fields required for cVRP payments across all payment products#389
tl-tai-tang merged 18 commits into
mainfrom
ACL-390_add_new_cvrp_data_fields

Conversation

@tl-tai-tang
Copy link
Copy Markdown
Contributor

@tl-tai-tang tl-tai-tang commented May 13, 2026

Description

  • Add new data fields required for cVRP payments across all payment products.
  • The use_case, use_cases and user_interaction fields are for commercial VRP only.
  • Add the new mandatory ID field to business_client submerchant account model and fix the acceptance test (Not related to this feature)

Provider

  • Update GET payments-providers/{id} to return providers with use cases
  • Update GET payments-providers/search to filter and return providers with use cases

Mandate

  • Update POST mandates/{id} to accept use case
  • Update GET mandates/{id} to return use case
  • Update GET mandates to return use case for mandates

Payment

  • Update POST payments/{id} to accept user interaction
  • Update GET payments/{id} to return user interaction

Type of change

Please select multiple options if required.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have updated the gradle.properties file with the new version
  • I have updated the CHANGELOG.md file with the details of the new version
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the relevant documentation

@tl-tai-tang tl-tai-tang marked this pull request as ready for review May 14, 2026 16:00
@tl-tai-tang tl-tai-tang requested review from a team as code owners May 14, 2026 16:00
Comment thread src/main/java/com/truelayer/java/payments/entities/UserInteraction.java Outdated
tl-tai-tang and others added 3 commits May 15, 2026 10:58
@tl-tai-tang tl-tai-tang requested a review from tl-luca-baggi May 15, 2026 10:18
Updated version number to 17.6.0 and added new fields for payment API.
tl-luca-baggi
tl-luca-baggi previously approved these changes May 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_cases support for commercial VRP mandates and provider capabilities (including search filtering model).
  • Add user_interaction support for mandate-backed payments.
  • Add mandatory id to business_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 concrete MandateDetail subtypes use Lombok-generated equals/hashCode that ignore inherited fields (the base MandateDetail doesn't implement equals). To ensure this test actually covers the new functionality, add explicit assertions for response.getData().getType() and getUseCase() (and/or implement equals/hashCode in MandateDetail and 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.

Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Comment thread src/test/resources/__files/mandates/200.list_mandates.json
Comment thread CHANGELOG.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@tl-tai-tang tl-tai-tang requested a review from tl-luca-baggi May 15, 2026 12:14
@tl-tai-tang
Copy link
Copy Markdown
Contributor Author

We have decided to keep the two new fields as enums for consistency.

@tl-tai-tang tl-tai-tang merged commit d4173ee into main May 15, 2026
17 checks passed
@tl-tai-tang tl-tai-tang deleted the ACL-390_add_new_cvrp_data_fields branch May 15, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants