-
Notifications
You must be signed in to change notification settings - Fork 16
feat(ACL-248)(ACL-291): Add support for polish payouts and sub merchant field #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
aea2ec1
feat: [ACL-248] Add support for polish payouts
tl-Roberto-Mancinelli 42228c3
feat: [ACL-291] Add support for sub_merchants field in create payment…
tl-Roberto-Mancinelli 730cb67
Merge branch 'main' into ACL-248
tl-Roberto-Mancinelli f5831d6
fix typo
tl-Roberto-Mancinelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| using OneOf; | ||
| using TrueLayer.Common; | ||
| using TrueLayer.Serialization; | ||
|
|
||
| namespace TrueLayer.Payments.Model | ||
| { | ||
| using UltimateCounterpartyUnion = OneOf<SubMerchants.BusinessDivision, SubMerchants.BusinessClient>; | ||
|
|
||
| /// <summary> | ||
| /// Represents sub-merchants information for payment requests | ||
| /// </summary> | ||
| public class SubMerchants | ||
| { | ||
| /// <summary> | ||
| /// Creates a new <see cref="SubMerchants"/> instance | ||
| /// </summary> | ||
| /// <param name="ultimateCounterparty">The ultimate counterparty information</param> | ||
| public SubMerchants(UltimateCounterpartyUnion ultimateCounterparty) | ||
| { | ||
| UltimateCounterparty = ultimateCounterparty; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the ultimate counterparty information | ||
| /// </summary> | ||
| public UltimateCounterpartyUnion UltimateCounterparty { get; } | ||
|
|
||
| /// <summary> | ||
| /// Represents a business division counterparty | ||
| /// </summary> | ||
| [JsonDiscriminator("business_division")] | ||
| public class BusinessDivision | ||
| { | ||
| /// <summary> | ||
| /// Creates a new <see cref="BusinessDivision"/> instance | ||
| /// </summary> | ||
| /// <param name="id">UUID generated by you</param> | ||
| /// <param name="name">Name of the division</param> | ||
| public BusinessDivision(string id, string name) | ||
| { | ||
| Type = "business_division"; | ||
| Id = id.NotNullOrWhiteSpace(nameof(id)); | ||
| Name = name.NotNullOrWhiteSpace(nameof(name)); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the type of the counterparty | ||
| /// </summary> | ||
| public string Type { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the UUID generated by you | ||
| /// </summary> | ||
| public string Id { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the name of the division | ||
| /// </summary> | ||
| public string Name { get; } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Represents a business client counterparty | ||
| /// </summary> | ||
| [JsonDiscriminator("business_client")] | ||
| public class BusinessClient | ||
| { | ||
| /// <summary> | ||
| /// Creates a new <see cref="BusinessClient"/> instance | ||
| /// </summary> | ||
| /// <param name="tradingName">Trading name of the merchant</param> | ||
| /// <param name="commercialName">Commercial name different from trading name (optional)</param> | ||
| /// <param name="url">Business website URL (optional)</param> | ||
| /// <param name="mcc">Merchant category code (optional)</param> | ||
| /// <param name="registrationNumber">Business registration number (optional if address provided)</param> | ||
| /// <param name="address">Business address (optional)</param> | ||
| public BusinessClient( | ||
| string tradingName, | ||
| string? commercialName = null, | ||
| string? url = null, | ||
| string? mcc = null, | ||
| string? registrationNumber = null, | ||
| Address? address = null) | ||
| { | ||
| Type = "business_client"; | ||
| TradingName = tradingName.NotNullOrWhiteSpace(nameof(tradingName)); | ||
| CommercialName = commercialName.NotEmptyOrWhiteSpace(nameof(commercialName)); | ||
| Url = url.NotEmptyOrWhiteSpace(nameof(url)); | ||
| Mcc = mcc.NotEmptyOrWhiteSpace(nameof(mcc)); | ||
| RegistrationNumber = registrationNumber.NotEmptyOrWhiteSpace(nameof(registrationNumber)); | ||
| Address = address; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the type of the counterparty | ||
| /// </summary> | ||
| public string Type { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the trading name of the merchant | ||
| /// </summary> | ||
| public string TradingName { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the commercial name different from trading name | ||
| /// </summary> | ||
| public string? CommercialName { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the business website URL | ||
| /// </summary> | ||
| public string? Url { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the merchant category code | ||
| /// </summary> | ||
| public string? Mcc { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the business registration number | ||
| /// </summary> | ||
| public string? RegistrationNumber { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the business address | ||
| /// </summary> | ||
| public Address? Address { get; } | ||
| } | ||
| } | ||
| } |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be using the new Nrb type here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately we can't yet, thread