Skip to content

Commit

Permalink
Improve formatting and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gcatanese committed Sep 26, 2024
1 parent 8e2f5f2 commit 44b0eae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ public LegalEntity create(OrganisationSignup organisationSignup) {
*/
public BusinessLine createBusinessLine(String legalEntityId) {

BusinessLine businessLine = null;
BusinessLine businessLine;

try {
BusinessLineInfo businessLineInfo = new BusinessLineInfo();
businessLineInfo
.legalEntityId(legalEntityId)
.industryCode("722513") // 'Limited-service restaurants', seehttps://docs.adyen.com/platforms/verification-requirements/reference-additional-products/#list-industry-codes
.industryCode("722513") // 'Limited-service restaurants', see https://docs.adyen.com/platforms/verification-requirements/reference-additional-products/#list-industry-codes
.salesChannels(List.of("eCommerce", "payByLink"))
.service(BusinessLineInfo.ServiceEnum.PAYMENTPROCESSING)
.webData(List.of(new WebData()
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/adyen/service/ManagementAPIService.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class ManagementAPIService {
* @return
*/
public Store createStore(StoreConfiguration storeConfiguration) {
Store store = null;
Store store;

try {

Expand Down Expand Up @@ -103,15 +103,14 @@ SplitConfiguration getDefaultSplitConfiguration() {
*/
public SplitConfiguration createSplitConfiguration(String merchantAccount, SplitConfiguration splitConfigurationInfo) {

SplitConfiguration splitConfiguration = null;
SplitConfiguration splitConfiguration;

try {
splitConfiguration = splitConfigurationMerchantLevelApi().createSplitConfiguration(
merchantAccount, splitConfigurationInfo);
log.info("SplitConfiguration created id:{}, description:'{}'",
splitConfiguration.getSplitConfigurationId(), splitConfiguration.getDescription());


} catch (Exception e) {
log.error(e.toString(), e);
throw new RuntimeException("Cannot create SplitConfiguration: " + e.getMessage());
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/com/adyen/service/SignupService.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public AccountHolder signup(SoleProprietorshipSignup soleProprietorshipSignup) {

/**
* Complete the signup after AccountHolder onboarding is completed
*
* This is triggered when the webhook event `balancePlatform.accountHolder.updated`
* is received
* @param accountHolderId
*/
public void completeSignup(String accountHolderId) {
Expand All @@ -89,9 +92,10 @@ public void completeSignup(String accountHolderId) {
}

AccountHolder accountHolder = optionalAccountHolder.get();
AccountHolderStatus status = getConfigurationAPIService().getAccountHolderStatus(accountHolder);

if(getConfigurationAPIService().getAccountHolderStatus(accountHolder).equals(AccountHolderStatus.VALID)) {
// Onboarding is completed: complete signup
if(status.equals(AccountHolderStatus.VALID)) {
// Onboarding is completed and AccountHolder status is now valid
LegalEntity legalEntity = getLegalEntityManagementAPIService().get(accountHolder.getLegalEntityId());

// create Business Line
Expand Down Expand Up @@ -124,6 +128,8 @@ public void completeSignup(String accountHolderId) {
log.info("Signup completed for legalEntityId:{}",
legalEntity.getId());

} else {
log.info("Cannot complete signup - The AccountHolder status is {}", status);
}
}

Expand Down

0 comments on commit 44b0eae

Please sign in to comment.