Skip to content

Add support for SubMerchants in CreatePaymentRequest and related tests#245

Closed
tl-luca-martinetti wants to merge 3 commits intomainfrom
feat-submerchants
Closed

Add support for SubMerchants in CreatePaymentRequest and related tests#245
tl-luca-martinetti wants to merge 3 commits intomainfrom
feat-submerchants

Conversation

@tl-luca-martinetti
Copy link
Contributor

Introduce SubMerchants and UltimateCounterparty models to enhance payment requests for marketplace and platform payments. Update CreatePaymentRequest to include sub-merchant information and implement tests to validate the new functionality.

@tl-luca-martinetti tl-luca-martinetti requested review from a team as code owners May 30, 2025 15:23
…ient types with updated serialization and deserialization tests
Copy link

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

This PR enhances the payment request functionality by introducing support for sub-merchant information via new SubMerchants and UltimateCounterparty models.

  • Introduces the SubMerchants record and associated UltimateCounterparty union types (BusinessDivision and BusinessClient).
  • Adds serialization, deserialization, and validation tests for the new models.
  • Updates CreatePaymentRequest and acceptance tests to integrate sub-merchant support.

Reviewed Changes

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

Show a summary per file
File Description
test/TrueLayer.Tests/Serialization/SerializationTests.cs Added tests for proper JSON serialization/deserialization of SubMerchants with BusinessDivision and BusinessClient.
test/TrueLayer.Tests/Payments/Model/SubMerchantsTests.cs Introduced comprehensive tests covering SubMerchants creation and validation for both counterparty types.
test/TrueLayer.Tests/Payments/CreatePaymentRequestTests.cs Added tests verifying CreatePaymentRequest accepts SubMerchants correctly.
test/TrueLayer.AcceptanceTests/RequestBuilders.cs Added a new test builder method for creating payment requests with sub-merchant details.
test/TrueLayer.AcceptanceTests/PaymentTests.cs Included an integration test to verify the payment creation flow with sub-merchant data.
src/TrueLayer/Payments/Model/SubMerchants.cs Implements the SubMerchants record along with BusinessDivision and BusinessClient types with validation.
src/TrueLayer/Payments/Model/CreatePaymentRequest.cs Updated CreatePaymentRequest to include an optional subMerchants parameter.

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