Skip to content

Commit

Permalink
Updated MarketPay CreateAccountHolderResponse, GetAccountHolderResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
lancergr committed Aug 8, 2018
1 parent 84cd5ff commit 698b0c2
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 131 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.adyen</groupId>
<artifactId>adyen-java-api-library</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion docs/install-library.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h3><a id="Maven_86"></a>Maven</h3>
class="hljs-tag">&lt;/<span class="hljs-title">groupId</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">artifactId</span>&gt;</span>adyen-java-api-library<span
class="hljs-tag">&lt;/<span class="hljs-title">artifactId</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">version</span>&gt;</span>1.5.1<span class="hljs-tag">&lt;/<span
<span class="hljs-tag">&lt;<span class="hljs-title">version</span>&gt;</span>1.5.2<span class="hljs-tag">&lt;/<span
class="hljs-title">version</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">dependency</span>&gt;</span>
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.adyen</groupId>
<artifactId>adyen-java-api-library</artifactId>
<packaging>jar</packaging>
<version>1.5.1</version>
<version>1.5.2</version>
<name>Adyen Java API Library</name>
<description>Adyen API Client Library for Java</description>
<url>https://github.com/adyen/adyen-java-api-library</url>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/adyen/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Client {
public static final String MARKETPAY_FUND_API_VERSION = "v3";
public static final String MARKETPAY_NOTIFICATION_API_VERSION = "v1";
public static final String USER_AGENT_SUFFIX = "adyen-java-api-library/";
public static final String LIB_VERSION = "1.5.1";
public static final String LIB_VERSION = "1.5.2";
public static final String CHECKOUT_ENDPOINT_TEST = "https://checkout-test.adyen.com";
public static final String CHECKOUT_ENDPOINT_LIVE = "https://checkout-live.adyen.com";
public static final String CHECKOUT_API_VERSION = "v32";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
* CreateAccountHolderResponse
*/
public class CreateAccountHolderResponse {
@SerializedName("accountStatus")
private AccountStatus accountStatus;

@SerializedName("verification")
private KYCVerificationResult verification;

Expand Down Expand Up @@ -113,24 +110,6 @@ public LegalEntityEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName("legalEntity")
private LegalEntityEnum legalEntity = null;

public CreateAccountHolderResponse accountStatus(AccountStatus accountStatus) {
this.accountStatus = accountStatus;
return this;
}

/**
* status of created account holder
*
* @return accountStatus
**/
public AccountStatus getAccountStatus() {
return accountStatus;
}

public void setAccountStatus(AccountStatus accountStatus) {
this.accountStatus = accountStatus;
}

public CreateAccountHolderResponse submittedAsync(Boolean submittedAsync) {
this.submittedAsync = submittedAsync;
return this;
Expand Down Expand Up @@ -327,8 +306,7 @@ public boolean equals(Object o) {
return false;
}
CreateAccountHolderResponse createAccountHolderResponse = (CreateAccountHolderResponse) o;
return Objects.equals(this.accountStatus, createAccountHolderResponse.accountStatus)
&& Objects.equals(this.verification, createAccountHolderResponse.verification)
return Objects.equals(this.verification, createAccountHolderResponse.verification)
&& Objects.equals(this.submittedAsync, createAccountHolderResponse.submittedAsync)
&& Objects.equals(this.accountHolderCode, createAccountHolderResponse.accountHolderCode)
&& Objects.equals(this.accountCode, createAccountHolderResponse.accountCode)
Expand All @@ -342,8 +320,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(accountStatus,
verification,
return Objects.hash(verification,
submittedAsync,
accountHolderCode,
accountCode,
Expand All @@ -363,7 +340,6 @@ public String toString() {

StringBuilder sb = new StringBuilder();
sb.append("class CreateAccountHolderResponse {\n");
sb.append(" accountStatus: ").append(toIndentedString(accountStatus)).append("\n");
sb.append(" verification: ").append(toIndentedString(verification)).append("\n");
sb.append(" submittedAsync: ").append(toIndentedString(submittedAsync)).append("\n");
sb.append(" accountHolderCode: ").append(toIndentedString(accountHolderCode)).append("\n");
Expand Down
130 changes: 29 additions & 101 deletions src/main/java/com/adyen/model/marketpay/GetAccountHolderResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,15 @@
* GetAccountHolderResponse
*/
public class GetAccountHolderResponse {
@SerializedName("accountStatus")
private AccountStatus accountStatus = null;

@SerializedName("verificationResult")
private KYCVerificationResult verificationResult = null;
@SerializedName("verification")
private KYCVerificationResult verification = null;

@SerializedName("submittedAsync")
private Boolean submittedAsync = null;

@SerializedName("accountHolderCode")
private String accountHolderCode = null;

@SerializedName("virtualAccounts")
private List<String> virtualAccounts = new ArrayList<String>();

@SerializedName("requirementsForNextAccountState")
private List<AccountStateRequirement> requirementsForNextAccountState = new ArrayList<AccountStateRequirement>();

Expand All @@ -65,9 +59,6 @@ public class GetAccountHolderResponse {
@SerializedName("pspReference")
private String pspReference = null;

@SerializedName("kycVerificationResults")
private List<KYCVerificationResult> kycVerificationResults = new ArrayList<KYCVerificationResult>();

/**
* account holder legal entity type (Busines / Individual)
*/
Expand All @@ -94,40 +85,32 @@ public String toString() {
@SerializedName("primaryCurrency")
private String primaryCurrency = null;

public GetAccountHolderResponse accountStatus(AccountStatus accountStatus) {
this.accountStatus = accountStatus;
public GetAccountHolderResponse verificationResult(KYCVerificationResult verificationResult) {
this.verification = verificationResult;
return this;
}

/**
* account holder status
* verification result
*
* @return accountStatus
* @return verificationResult
* @deprecated
**/
public AccountStatus getAccountStatus() {
return accountStatus;
}

public void setAccountStatus(AccountStatus accountStatus) {
this.accountStatus = accountStatus;
}

public GetAccountHolderResponse verificationResult(KYCVerificationResult verificationResult) {
this.verificationResult = verificationResult;
return this;
public KYCVerificationResult getVerificationResult() {
return verification;
}

/**
* verification result
*
* @return verificationResult
* @return verification
**/
public KYCVerificationResult getVerificationResult() {
return verificationResult;
public KYCVerificationResult getVerification() {
return verification;
}

public void setVerificationResult(KYCVerificationResult verificationResult) {
this.verificationResult = verificationResult;
public void setVerification(KYCVerificationResult verification) {
this.verification = verification;
}

public GetAccountHolderResponse submittedAsync(Boolean submittedAsync) {
Expand Down Expand Up @@ -166,29 +149,6 @@ public void setAccountHolderCode(String accountHolderCode) {
this.accountHolderCode = accountHolderCode;
}

public GetAccountHolderResponse virtualAccounts(List<String> virtualAccounts) {
this.virtualAccounts = virtualAccounts;
return this;
}

public GetAccountHolderResponse addVirtualAccountsItem(String virtualAccountsItem) {
this.virtualAccounts.add(virtualAccountsItem);
return this;
}

/**
* account holder's accounts
*
* @return virtualAccounts
**/
public List<String> getVirtualAccounts() {
return virtualAccounts;
}

public void setVirtualAccounts(List<String> virtualAccounts) {
this.virtualAccounts = virtualAccounts;
}

public GetAccountHolderResponse requirementsForNextAccountState(List<AccountStateRequirement> requirementsForNextAccountState) {
this.requirementsForNextAccountState = requirementsForNextAccountState;
return this;
Expand Down Expand Up @@ -334,29 +294,6 @@ public void setPspReference(String pspReference) {
this.pspReference = pspReference;
}

public GetAccountHolderResponse kycVerificationResults(List<KYCVerificationResult> kycVerificationResults) {
this.kycVerificationResults = kycVerificationResults;
return this;
}

public GetAccountHolderResponse addKycVerificationResultsItem(KYCVerificationResult kycVerificationResultsItem) {
this.kycVerificationResults.add(kycVerificationResultsItem);
return this;
}

/**
* Get kycVerificationResults
*
* @return kycVerificationResults
**/
public List<KYCVerificationResult> getKycVerificationResults() {
return kycVerificationResults;
}

public void setKycVerificationResults(List<KYCVerificationResult> kycVerificationResults) {
this.kycVerificationResults = kycVerificationResults;
}

public GetAccountHolderResponse legalEntity(LegalEntityEnum legalEntity) {
this.legalEntity = legalEntity;
return this;
Expand Down Expand Up @@ -393,38 +330,32 @@ public boolean equals(Object o) {
return false;
}
GetAccountHolderResponse getAccountHolderResponse = (GetAccountHolderResponse) o;
return Objects.equals(this.accountStatus, getAccountHolderResponse.accountStatus)
&& Objects.equals(this.verificationResult, getAccountHolderResponse.verificationResult)
return Objects.equals(this.verification, getAccountHolderResponse.verification)
&& Objects.equals(this.submittedAsync, getAccountHolderResponse.submittedAsync)
&& Objects.equals(this.accountHolderCode, getAccountHolderResponse.accountHolderCode)
&& Objects.equals(this.virtualAccounts, getAccountHolderResponse.virtualAccounts)
&& Objects.equals(this.requirementsForNextAccountState, getAccountHolderResponse.requirementsForNextAccountState)
&& Objects.equals(this.accountHolderDetails, getAccountHolderResponse.accountHolderDetails)
&& Objects.equals(this.accountHolderStatus, getAccountHolderResponse.accountHolderStatus)
&& Objects.equals(this.accountContainers, getAccountHolderResponse.accountContainers)
&& Objects.equals(this.description, getAccountHolderResponse.description)
&& Objects.equals(this.pspReference, getAccountHolderResponse.pspReference)
&& Objects.equals(this.kycVerificationResults, getAccountHolderResponse.kycVerificationResults)
&& Objects.equals(this.legalEntity, getAccountHolderResponse.legalEntity)
&& Objects.equals(this.legalEntity, getAccountHolderResponse.primaryCurrency);
&& Objects.equals(this.primaryCurrency, getAccountHolderResponse.primaryCurrency);
}

@Override
public int hashCode() {
return Objects.hash(accountStatus,
verificationResult,
submittedAsync,
accountHolderCode,
virtualAccounts,
requirementsForNextAccountState,
accountHolderDetails,
accountHolderStatus,
accountContainers,
description,
pspReference,
kycVerificationResults,
legalEntity,
primaryCurrency);
return Objects.hash(verification,
submittedAsync,
accountHolderCode,
requirementsForNextAccountState,
accountHolderDetails,
accountHolderStatus,
accountContainers,
description,
pspReference,
legalEntity,
primaryCurrency);
}


Expand All @@ -435,20 +366,17 @@ public String toString() {

StringBuilder sb = new StringBuilder();
sb.append("class GetAccountHolderResponse {\n");

sb.append(" accountStatus: ").append(toIndentedString(accountStatus)).append("\n");
sb.append(" verificationResult: ").append(toIndentedString(verificationResult)).append("\n");
sb.append(" verification: ").append(toIndentedString(verification)).append("\n");
sb.append(" submittedAsync: ").append(toIndentedString(submittedAsync)).append("\n");
sb.append(" accountHolderCode: ").append(toIndentedString(accountHolderCode)).append("\n");
sb.append(" virtualAccounts: ").append(toIndentedString(virtualAccounts)).append("\n");
sb.append(" requirementsForNextAccountState: ").append(toIndentedString(requirementsForNextAccountState)).append("\n");
sb.append(" accountHolderDetails: ").append(toIndentedString(accountHolderDetails)).append("\n");
sb.append(" accountHolderStatus: ").append(toIndentedString(accountHolderStatus)).append("\n");
sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n");
sb.append(" kycVerificationResults: ").append(toIndentedString(kycVerificationResults)).append("\n");
sb.append(" legalEntity: ").append(toIndentedString(legalEntity)).append("\n");
sb.append(" primaryCurrency: ").append(toIndentedString(primaryCurrency)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
8 changes: 8 additions & 0 deletions src/test/java/com/adyen/MarketPayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@
import com.adyen.service.Account;
import com.adyen.service.Fund;
import com.adyen.service.Payment;
import static com.adyen.model.marketpay.KYCCheckStatusData.CheckStatusEnum.AWAITING_DATA;
import static com.adyen.model.marketpay.KYCCheckStatusData.CheckStatusEnum.PASSED;
import static com.adyen.model.marketpay.KYCCheckStatusData.CheckTypeEnum.BANK_ACCOUNT_VERIFICATION;
import static com.adyen.model.marketpay.KYCCheckStatusData.CheckTypeEnum.COMPANY_VERIFICATION;
import static com.adyen.model.marketpay.KYCCheckStatusData.CheckTypeEnum.PASSPORT_VERIFICATION;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -361,6 +364,8 @@ public void TestGetIndividualAccountHolderSuccess() throws Exception {

assertEquals("681d5df6-cf38-4557-aecd-ac8ed0c04195", getAccountHolderResponse.getAccountHolderDetails().getBankAccountDetails().get(0).getBankAccountUUID());
assertEquals("140922935", getAccountHolderResponse.getAccounts().get(0).getAccountCode());
assertEquals(PASSPORT_VERIFICATION, getAccountHolderResponse.getVerification().getAccountHolder().getChecks().get(0).getCheckType());
assertEquals(AWAITING_DATA, getAccountHolderResponse.getVerification().getAccountHolder().getChecks().get(0).getCheckStatus());
}

@Test
Expand All @@ -381,6 +386,9 @@ public void TestGetBusinessAccountHolderSuccess() throws Exception {
assertEquals("1abf8304-58c7-4a9e-8bd3-4d7eff9801e4", getAccountHolderResponse.getAccountHolderDetails().getBankAccountDetails().get(0).getBankAccountUUID());
assertEquals("67890", getAccountHolderResponse.getAccountHolderDetails().getBusinessDetails().getShareholders().get(0).getAddress().getPostalCode());
assertEquals("123370698", getAccountHolderResponse.getAccounts().get(0).getAccountCode());
assertEquals(COMPANY_VERIFICATION, getAccountHolderResponse.getVerification().getAccountHolder().getChecks().get(0).getCheckType());
assertEquals(PASSED, getAccountHolderResponse.getVerification().getAccountHolder().getChecks().get(0).getCheckStatus());
assertEquals(1602, getAccountHolderResponse.getVerification().getAccountHolder().getChecks().get(0).getSummary().getCode().intValue());
}

@Test
Expand Down

0 comments on commit 698b0c2

Please sign in to comment.