Skip to content

[ACL-290] Add sub_merchants support to Payments module#360

Merged
federico1525 merged 8 commits into
mainfrom
feature/acl-290-payments-submerchants
Jun 17, 2025
Merged

[ACL-290] Add sub_merchants support to Payments module#360
federico1525 merged 8 commits into
mainfrom
feature/acl-290-payments-submerchants

Conversation

@federico1525

Copy link
Copy Markdown
Contributor

Summary

  • Implements sub_merchants functionality for payments module to achieve feature parity with payouts
  • Adds SubMerchants, UltimateCounterparty, BusinessClient, and BusinessDivision classes matching OpenAPI specification
  • Updates CreatePaymentRequest and PaymentDetail to include subMerchants field

Test plan

  • Build passes without compilation errors
  • All existing tests continue to pass
  • New unit tests verify SubMerchants functionality
  • CreatePaymentRequest accepts subMerchants parameter
  • PaymentDetail includes subMerchants in responses

🤖 Generated with Claude Code

@dili91 dili91 requested a review from Copilot June 12, 2025 10:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements support for sub‐merchants in the payments module by adding new classes (BusinessClient, BusinessDivision, UltimateCounterparty, and SubMerchants) and updating relevant request and response entities.

  • Introduces sub_merchants functionality through new domain entities and associated builders.
  • Adds tests verifying the creation and usage of sub‐merchants in both requests and responses.
  • Updates PaymentDetail and CreatePaymentRequest to include subMerchants fields.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
SubMerchantsTest.java Adds tests for creating BusinessClient, BusinessDivision, and SubMerchants.
CreatePaymentRequestSubMerchantsTest.java Verifies that CreatePaymentRequest accepts and processes subMerchants correctly.
UltimateCounterparty.java Provides the abstract base and builder methods for sub‐merchant counterparties.
SubMerchants.java Defines the container class for an UltimateCounterparty instance.
BusinessDivision.java Implements BusinessDivision with its required fields.
BusinessClient.java Implements BusinessClient with its required fields.
PaymentDetail.java Updates PaymentDetail to include the subMerchants field.
CreatePaymentRequest.java Updates CreatePaymentRequest to include the subMerchants field with appropriate documentation.
Comments suppressed due to low confidence (1)

src/main/java/com/truelayer/java/payments/entities/paymentdetail/PaymentDetail.java:41

  • [nitpick] Consider adding a Javadoc comment for the 'subMerchants' field to maintain consistency with similar fields in other classes (e.g., in CreatePaymentRequest) and to provide clarity on its intended use.
private SubMerchants subMerchants;

@federico1525 federico1525 force-pushed the feature/acl-290-payments-submerchants branch 2 times, most recently from fb3b086 to 66effbe Compare June 12, 2025 10:49
Implements sub_merchants functionality for payments to match existing payouts implementation:
- Add SubMerchants, UltimateCounterparty, BusinessClient, BusinessDivision classes
- Add subMerchants field to CreatePaymentRequest and PaymentDetail
- Include comprehensive test coverage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@federico1525 federico1525 force-pushed the feature/acl-290-payments-submerchants branch from 66effbe to 10fb6fb Compare June 12, 2025 10:56
Comment thread .gitignore

@dili91 dili91 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should amend the version of the library included in the gradle.properties file.
If this is a non-breaking change, a minor version bump should be fine

@federico1525

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I've addressed both comments:

  1. ✅ Added Javadoc comment for the subMerchants field in PaymentDetail.java for consistency with other fields
  2. ✅ Bumped library version from 17.2.0 to 17.3.0 in gradle.properties (minor version bump for this new feature)

Changes are ready for review.

dili91 and others added 4 commits June 17, 2025 15:32
Co-authored-by: Claude <noreply@anthropic.com>
- Add Javadoc comment for subMerchants field in PaymentDetail.java
- Bump version from 17.2.0 to 17.3.0 for new sub-merchants feature

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@federico1525 federico1525 marked this pull request as ready for review June 17, 2025 14:40
@federico1525 federico1525 requested review from a team as code owners June 17, 2025 14:40
@federico1525

federico1525 commented Jun 17, 2025

Copy link
Copy Markdown
Contributor Author

Re: acceptance tests for subMerchants field - Good question! I'm not sure about the acceptance test requirements for this new field. @tl-Roberto-Mancinelli could you provide feedback on whether we need acceptance tests for the subMerchants field?

- Add parametrized test for both BusinessClient and BusinessDivision counterparty types
- Verify sub-merchants data is preserved in payment creation and retrieval
- Use fictional test data instead of personal information

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@federico1525

federico1525 commented Jun 17, 2025

Copy link
Copy Markdown
Contributor Author

Update: I've now added a parametrized acceptance test for the subMerchants field that tests both BusinessClient and BusinessDivision counterparty types. The test verifies that sub-merchants data is properly preserved during payment creation and retrieval.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

@dili91 dili91 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🥳

@federico1525 federico1525 merged commit 398daae into main Jun 17, 2025
17 checks passed
@federico1525 federico1525 deleted the feature/acl-290-payments-submerchants branch June 17, 2025 15:45
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