diff --git a/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SdkConfig.java b/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SdkConfig.java index 63fedf3a..0d02f9f6 100644 --- a/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SdkConfig.java +++ b/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SdkConfig.java @@ -36,6 +36,9 @@ public class SdkConfig { @JsonProperty(Property.PRIVACY_POLICY_URL) private final String privacyPolicyUrl; + @JsonProperty(Property.BRAND_ID) + private final String brandId; + @JsonProperty(Property.ALLOW_HANDOFF) private final Boolean allowHandoff; @@ -51,6 +54,7 @@ public class SdkConfig { String successUrl, String errorUrl, String privacyPolicyUrl, + String brandId, Boolean allowHandoff, AttemptsConfiguration attemptsConfiguration) { this.allowedCaptureMethods = allowedCaptureMethods; @@ -62,6 +66,7 @@ public class SdkConfig { this.successUrl = successUrl; this.errorUrl = errorUrl; this.privacyPolicyUrl = privacyPolicyUrl; + this.brandId = brandId; this.allowHandoff = allowHandoff; this.attemptsConfiguration = attemptsConfiguration; } @@ -151,6 +156,15 @@ public String getPrivacyPolicyUrl() { return privacyPolicyUrl; } + /** + * The brand ID + * + * @return the brand ID + */ + public String getBrandId() { + return brandId; + } + /** * If mobile handoff is allowed in the session * @@ -183,6 +197,7 @@ public static class Builder { private String successUrl; private String errorUrl; private String privacyPolicyUrl; + private String brandId; private Boolean allowHandoff; private AttemptsConfiguration attemptsConfiguration; @@ -305,6 +320,17 @@ public Builder withPrivacyPolicyUrl(String privacyPolicyUrl) { return this; } + /** + * Sets the brand ID + * + * @param brandId the brand ID + * @return the builder + */ + public Builder withBrandId(String brandId) { + this.brandId = brandId; + return this; + } + /** * Sets if the user is allowed to perform mobile handoff * @@ -343,6 +369,7 @@ public SdkConfig build() { successUrl, errorUrl, privacyPolicyUrl, + brandId, allowHandoff, attemptsConfiguration ); @@ -360,6 +387,7 @@ private static final class Property { private static final String SUCCESS_URL = "success_url"; private static final String ERROR_URL = "error_url"; private static final String PRIVACY_POLICY_URL = "privacy_policy_url"; + private static final String BRAND_ID = "brand_id"; private static final String ALLOW_HANDOFF = "allow_handoff"; private static final String ATTEMPTS_CONFIGURATION = "attempts_configuration"; diff --git a/yoti-sdk-api/src/test/java/com/yoti/api/client/docs/session/create/SdkConfigTest.java b/yoti-sdk-api/src/test/java/com/yoti/api/client/docs/session/create/SdkConfigTest.java index d8b78737..1a9acf09 100644 --- a/yoti-sdk-api/src/test/java/com/yoti/api/client/docs/session/create/SdkConfigTest.java +++ b/yoti-sdk-api/src/test/java/com/yoti/api/client/docs/session/create/SdkConfigTest.java @@ -17,6 +17,7 @@ public class SdkConfigTest { private static final String SOME_FONT_COLOUR = "#b40c12"; private static final String SOME_LOCALE = "en"; private static final String SOME_PRESET_ISSUING_COUNTRY = "USA"; + private static final String SOME_BRAND_ID = "someBrandId"; private static final String SOME_SUCCESS_URL = "https://yourdomain.com/some/success/endpoint"; private static final String SOME_ERROR_URL = "https://yourdomain.com/some/error/endpoint"; @@ -36,6 +37,7 @@ public void shouldBuildSimpleSdkConfigWithAllOptions() { .withSuccessUrl(SOME_SUCCESS_URL) .withErrorUrl(SOME_ERROR_URL) .withPrivacyPolicyUrl(SOME_PRIVACY_POLICY_URL) + .withBrandId(SOME_BRAND_ID) .withAllowHandoff(true) .withAttemptsConfiguration(attemptsConfigurationMock) .build(); @@ -51,6 +53,7 @@ public void shouldBuildSimpleSdkConfigWithAllOptions() { assertThat(result.getSuccessUrl(), is(SOME_SUCCESS_URL)); assertThat(result.getErrorUrl(), is(SOME_ERROR_URL)); assertThat(result.getPrivacyPolicyUrl(), is(SOME_PRIVACY_POLICY_URL)); + assertThat(result.getBrandId(), is(SOME_BRAND_ID)); assertThat(result.getAllowHandoff(), is(true)); assertThat(result.getAttemptsConfiguration(), is(attemptsConfigurationMock)); }