Add support for SubMerchants in CreatePaymentRequest and related tests#245
Closed
tl-luca-martinetti wants to merge 3 commits intomainfrom
Closed
Add support for SubMerchants in CreatePaymentRequest and related tests#245tl-luca-martinetti wants to merge 3 commits intomainfrom
tl-luca-martinetti wants to merge 3 commits intomainfrom
Conversation
…ient types with updated serialization and deserialization tests
…nt service in Preselected provider
There was a problem hiding this comment.
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. |
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.
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.