Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ If you are using Maven, you need to add the following dependency:
<dependency>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-api</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
</dependency>
```

If you are using Gradle, here is the dependency to add:

`compile group: 'com.yoti', name: 'yoti-sdk-api', version: '4.3.0'`
`compile group: 'com.yoti', name: 'yoti-sdk-api', version: '4.4.0'`

You will find all classes packaged under `com.yoti.api`

Expand Down
2 changes: 1 addition & 1 deletion examples/doc-scan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-api</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk</artifactId>
<packaging>pom</packaging>
<version>4.3.0</version>
<version>4.4.0</version>
<name>Yoti SDK</name>
<description>Java SDK for simple integration with the Yoti platform</description>
<url>https://github.com/getyoti/yoti-java-sdk</url>
Expand Down
2 changes: 1 addition & 1 deletion yoti-sdk-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

/**
* Signals that a problem occurred while performing an AML check
*
* @deprecated The AML check service has been discontinued and this class is no longer used.
* This API will be removed in the next major release.
*/
@Deprecated
public class AmlException extends Exception {

private static final long serialVersionUID = 3210133542178934016L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ public ActivityDetails getActivityDetails(String encryptedYotiToken) throws Prof
*
* @throws AmlException
* aggregate exception signalling issues during the call
*
* @deprecated The AML check service has been discontinued and this call will no longer succeed.
* This API will be removed in the next major release.
*/
@Deprecated
public AmlResult performAmlCheck(AmlProfile amlProfile) throws AmlException {
LOG.debug("Performing aml check...");
return remoteAmlService.performCheck(amlProfile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* @deprecated The AML check service has been discontinued and this class is no longer used.
* This API will be removed in the next major release.
*/
@Deprecated
public class AmlAddress {

@JsonProperty("post_code")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* @deprecated The AML check service has been discontinued and this class is no longer used.
* This API will be removed in the next major release.
*/
@Deprecated
public class AmlProfile {

@JsonProperty("given_names")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

/**
* The results of the aml check.
*
* @deprecated The AML check service has been discontinued and this class is no longer used.
* This API will be removed in the next major release.
*/
@Deprecated
public class AmlResult {

@JsonProperty("on_fraud_list")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.yoti.api.client.docs.session.create;

import com.fasterxml.jackson.annotation.JsonProperty;

public class CompanyProfilePayload {

@JsonProperty("company_name")
private final String companyName;

private CompanyProfilePayload(String companyName) {
this.companyName = companyName;
}

public static Builder builder() {
return new Builder();
}

public String getCompanyName() {
return companyName;
}

public static class Builder {

private String companyName;

Builder() {}

/**
* Sets the company name to be used for the session
*
* @param companyName the company name
* @return the builder
*/
public Builder withCompanyName(String companyName) {
this.companyName = companyName;
return this;
}

public CompanyProfilePayload build() {
return new CompanyProfilePayload(companyName);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public class SessionSpec {
@JsonProperty("create_identity_profile_preview")
private final Boolean createIdentityProfilePreview;

@JsonProperty("company_profile")
private final CompanyProfilePayload companyProfile;

private SessionSpec(Integer clientSessionTokenTtl,
Integer resourcesTtl,
ImportTokenPayload importToken,
Expand All @@ -85,7 +88,8 @@ private SessionSpec(Integer clientSessionTokenTtl,
SubjectPayload subject,
ResourceCreationContainer resources,
Boolean createIdentityProfilePreview,
AdvancedIdentityProfileRequirementsPayload advancedIdentityProfileRequirements) {
AdvancedIdentityProfileRequirementsPayload advancedIdentityProfileRequirements,
CompanyProfilePayload companyProfile) {
this.clientSessionTokenTtl = clientSessionTokenTtl;
this.resourcesTtl = resourcesTtl;
this.importToken = importToken;
Expand All @@ -103,6 +107,7 @@ private SessionSpec(Integer clientSessionTokenTtl,
this.resources = resources;
this.createIdentityProfilePreview = createIdentityProfilePreview;
this.advancedIdentityProfileRequirements = advancedIdentityProfileRequirements;
this.companyProfile = companyProfile;
}

public static Builder builder() {
Expand Down Expand Up @@ -263,6 +268,15 @@ public AdvancedIdentityProfileRequirementsPayload getAdvancedIdentityProfileRequ
return advancedIdentityProfileRequirements;
}

/**
* The company profile to be used for the session
*
* @return the company profile
*/
public CompanyProfilePayload getCompanyProfile() {
return companyProfile;
}

public static class Builder {

private final List<RequestedCheck<?>> requestedChecks;
Expand All @@ -282,6 +296,7 @@ public static class Builder {
private SubjectPayload subject;
private ResourceCreationContainer resources;
private Boolean createIdentityProfilePreview;
private CompanyProfilePayload companyProfile;

private Builder() {
requestedChecks = new ArrayList<>();
Expand Down Expand Up @@ -477,6 +492,17 @@ public Builder withAdvancedIdentityProfileRequirements(AdvancedIdentityProfileRe
return this;
}

/**
* Sets the company profile to be used for the session
*
* @param companyProfile the company profile
* @return the builder
*/
public Builder withCompanyProfile(CompanyProfilePayload companyProfile) {
this.companyProfile = companyProfile;
return this;
}

/**
* Builds the {@link SessionSpec} based on the values supplied to the builder
*
Expand All @@ -500,7 +526,8 @@ public SessionSpec build() {
subject,
resources,
createIdentityProfilePreview,
advancedIdentityProfileRequirementsPayload);
advancedIdentityProfileRequirementsPayload,
companyProfile);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.yoti.api.client.docs.session.retrieve;

import com.fasterxml.jackson.annotation.JsonProperty;

public class CompanyProfileResponse {

@JsonProperty("company_name")
private String companyName;

public String getCompanyName() {
return companyName;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public class GetSessionResult {
@JsonProperty("session_id")
private String sessionId;

@JsonProperty("organisation_name")
private String organisationName;

@JsonProperty("company_profile")
private CompanyProfileResponse companyProfileResponse;

@JsonProperty("user_tracking_id")
private String userTrackingId;

Expand Down Expand Up @@ -61,6 +67,14 @@ public String getSessionId() {
return sessionId;
}

public String getOrganisationName() {
return organisationName;
}

public CompanyProfileResponse getCompanyProfile() {
return companyProfileResponse;
}

public String getUserTrackingId() {
return userTrackingId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private YotiConstants() {}
public static final String CONTENT_TYPE_JPEG = "image/jpeg";

public static final String JAVA = "Java";
public static final String SDK_VERSION = JAVA + "-4.3.0";
public static final String SDK_VERSION = JAVA + "-4.4.0";
public static final String SIGNATURE_ALGORITHM = "SHA256withRSA";
public static final String ASYMMETRIC_CIPHER = "RSA/NONE/PKCS1Padding";
public static final String SYMMETRIC_CIPHER = "AES/CBC/PKCS7Padding";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.yoti.api.client.docs.session.create;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;

import org.junit.Test;

public class CompanyProfilePayloadTest {

private static final String SOME_COMPANY_NAME = "someCompanyName";

@Test
public void shouldBuildWithCompanyName() {
CompanyProfilePayload result = CompanyProfilePayload.builder()
.withCompanyName(SOME_COMPANY_NAME)
.build();

assertThat(result.getCompanyName(), is(SOME_COMPANY_NAME));
}

@Test
public void companyName_shouldBeNullWhenNotSet() {
CompanyProfilePayload result = CompanyProfilePayload.builder()
.build();

assertThat(result.getCompanyName(), is(nullValue()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class SessionSpecTest {
@Mock ImportTokenPayload importTokenMock;
@Mock IdentityProfileRequirementsPayload identityProfileRequirementsPayloadMock;
@Mock SubjectPayload subjectPayloadMock;
@Mock CompanyProfilePayload companyProfilePayloadMock;

@Test
public void shouldBuildWithMinimalConfiguration() {
Expand All @@ -72,6 +73,7 @@ public void shouldBuildWithMinimalConfiguration() {
assertThat(result.getSubject(), is(nullValue()));
assertThat(result.getResources(), is(nullValue()));
assertThat(result.getCreateIdentityProfilePreview(), is(nullValue()));
assertThat(result.getCompanyProfile(), is(nullValue()));
}

@Test
Expand Down Expand Up @@ -252,4 +254,13 @@ public void shouldBuildWithImportToken() {
assertThat(sessionSpec.getImportToken(), is(importTokenMock));
}

@Test
public void withCompanyProfile_shouldSetTheCompanyProfile() {
SessionSpec result = SessionSpec.builder()
.withCompanyProfile(companyProfilePayloadMock)
.build();

assertThat(result.getCompanyProfile(), is(companyProfilePayloadMock));
}

}
2 changes: 1 addition & 1 deletion yoti-sdk-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions yoti-sdk-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<packaging>pom</packaging>
<version>4.3.0</version>
<version>4.4.0</version>
<name>Yoti SDK Parent Pom</name>
<description>Parent pom for the Java SDK projects</description>
<url>https://github.com/getyoti/yoti-java-sdk</url>
Expand Down Expand Up @@ -137,7 +137,7 @@

<maven-project-info-reports-plugin.version>3.9.0</maven-project-info-reports-plugin.version>

<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
<coveralls-maven-plugin.version>4.4.0</coveralls-maven-plugin.version>

<jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion yoti-sdk-sandbox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down
Loading
Loading