-
Notifications
You must be signed in to change notification settings - Fork 36
feature/INT-1692 - Top-up instructions and amount allocations #664
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
2 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package com.checkout.balances; | ||
|
|
||
| import lombok.Data; | ||
|
|
||
| /** | ||
| * The bank details for each available funding rail. | ||
| * Both {@code domestic} and {@code international} are optional, and their availability depends on | ||
| * the sub-account's holding currency, jurisdiction, and banking partner. Do not assume that both | ||
| * rails are always available. | ||
| */ | ||
| @Data | ||
| public final class TopUpBankDetails { | ||
|
|
||
| /** | ||
| * The bank details for the domestic funding rail. | ||
| * [Optional] | ||
| */ | ||
| private TopUpFundingDetails domestic; | ||
|
|
||
| /** | ||
| * The bank details for the international funding rail. | ||
| * [Optional] | ||
| */ | ||
| private TopUpFundingDetails international; | ||
|
|
||
| } |
68 changes: 68 additions & 0 deletions
68
src/main/java/com/checkout/balances/TopUpFundingDetails.java
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,68 @@ | ||
| package com.checkout.balances; | ||
|
|
||
| import lombok.Data; | ||
|
|
||
| /** | ||
| * The bank details for a single funding rail. | ||
| * {@code beneficiaryAccountName} and {@code bankName} are the only fields always returned. The | ||
| * remaining fields vary by rail and the receiving bank's jurisdiction, and are omitted when they | ||
| * do not apply. | ||
| */ | ||
| @Data | ||
| public final class TopUpFundingDetails { | ||
|
|
||
| /** | ||
| * The name of the account that receives the funds. | ||
| * [Required] | ||
| */ | ||
| private String beneficiaryAccountName; | ||
|
|
||
| /** | ||
| * The address of the beneficiary, if the rail requires it. | ||
| * [Optional] | ||
| */ | ||
| private String beneficiaryAddress; | ||
|
|
||
| /** | ||
| * The name of the bank that receives the funds. | ||
| * [Required] | ||
| */ | ||
| private String bankName; | ||
|
|
||
| /** | ||
| * The address of the receiving bank, if the rail requires it. | ||
| * [Optional] | ||
| */ | ||
| private String bankAddress; | ||
|
|
||
| /** | ||
| * The account number of the receiving account. | ||
| * [Optional] | ||
| */ | ||
| private String accountNumber; | ||
|
|
||
| /** | ||
| * The sort code of the receiving bank. Returned for United Kingdom domestic transfers. | ||
| * [Optional] | ||
| */ | ||
| private String sortCode; | ||
|
|
||
| /** | ||
| * The routing number of the receiving bank. Returned for United States domestic transfers. | ||
| * [Optional] | ||
| */ | ||
| private String routingNumber; | ||
|
|
||
| /** | ||
| * The International Bank Account Number of the receiving account. | ||
| * [Optional] | ||
| */ | ||
| private String iban; | ||
|
|
||
| /** | ||
| * The SWIFT or BIC code of the receiving bank. Returned for international transfers. | ||
| * [Optional] | ||
| */ | ||
| private String swiftCode; | ||
|
|
||
| } |
42 changes: 42 additions & 0 deletions
42
src/main/java/com/checkout/balances/TopUpInstructionsResponse.java
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,42 @@ | ||
| package com.checkout.balances; | ||
|
|
||
| import com.checkout.HttpMetadata; | ||
| import com.checkout.common.Currency; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
|
|
||
| /** | ||
| * The bank details and payment reference used to top up a sub-account. | ||
| */ | ||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public final class TopUpInstructionsResponse extends HttpMetadata { | ||
|
|
||
| /** | ||
| * The unique identifier of the sub-account that the instructions apply to. | ||
| * [Required] | ||
| */ | ||
| private String currencyAccountId; | ||
|
|
||
| /** | ||
| * The currency that funds must be sent in, as a three-letter ISO 4217 currency code. | ||
| * This is the sub-account's holding currency, returned as {@code holding_currency} by the | ||
| * Retrieve entity balances endpoint. | ||
| * [Required] | ||
| */ | ||
| private Currency currency; | ||
|
|
||
| /** | ||
| * The reference that must be quoted on the payment. It is how an incoming payment is | ||
| * attributed to the sub-account. A payment sent without this reference may not be credited. | ||
| * [Required] | ||
| */ | ||
| private String paymentReference; | ||
|
|
||
| /** | ||
| * The bank details for each available funding rail. | ||
| * [Required] | ||
| */ | ||
| private TopUpBankDetails bankDetails; | ||
|
|
||
| } | ||
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,26 @@ | ||
| package com.checkout; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| class OAuthScopeTest { | ||
|
|
||
| /** | ||
| * The enum constant's String is the only place a scope's wire value is written down, and | ||
| * OAuthSdkCredentials builds the token request from getScope() rather than from the constant | ||
| * name. A typo is therefore invisible at compile time and surfaces only at the token endpoint, | ||
| * which rejects the whole request when one requested scope is undefined -- so a caller would | ||
| * lose every scope it asked for alongside the bad one. | ||
| * | ||
| * Values come from components.securitySchemes.OAuth.flows.clientCredentials.scopes in | ||
| * shared/swagger-latest.json. | ||
| */ | ||
| @Test | ||
| void shouldExposeDocumentedBalancesScopeValues() { | ||
| assertEquals("balances", OAuthScope.BALANCES.getScope()); | ||
| assertEquals("balances:view", OAuthScope.BALANCES_VIEW.getScope()); | ||
| assertEquals("balances:top-up-instructions", OAuthScope.BALANCES_TOP_UP_INSTRUCTIONS.getScope()); | ||
| } | ||
|
|
||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.