mirror of
https://github.com/valitydev/three-ds-server-domain-lib.git
synced 2024-11-06 00:05:19 +00:00
take out 3ds-server domain classes (#1)
This commit is contained in:
parent
3ea12f794a
commit
13af2c5871
81
.gitignore
vendored
Normal file
81
.gitignore
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
.eunit
|
||||
deps
|
||||
*.o
|
||||
*.beam
|
||||
*.plt
|
||||
erl_crash.dump
|
||||
ebin/*.beam
|
||||
rel/example_project
|
||||
.concrete/DEV_MODE
|
||||
.rebar
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff:
|
||||
.idea/
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/dictionaries
|
||||
.idea/vcs.xml
|
||||
.idea/jsLibraryMappings.xml
|
||||
|
||||
# Sensitive or high-churn files:
|
||||
.idea/dataSources.ids
|
||||
.idea/dataSources.xml
|
||||
.idea/dataSources.local.xml
|
||||
.idea/sqlDataSources.xml
|
||||
.idea/dynamic.xml
|
||||
.idea/uiDesigner.xml
|
||||
|
||||
# Gradle:
|
||||
.idea/gradle.xml
|
||||
.idea/libraries
|
||||
|
||||
# Mongo Explorer plugin:
|
||||
.idea/mongoSettings.xml
|
||||
|
||||
*.iws
|
||||
*.ipr
|
||||
*.iml
|
||||
|
||||
|
||||
# IntelliJ
|
||||
/out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
*.class
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
env.list
|
||||
|
||||
# keys & certs
|
||||
src/main/resources/3ds_server_pki/
|
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
[submodule "build_utils"]
|
||||
path = build_utils
|
||||
url = git@github.com:rbkmoney/build_utils.git
|
||||
branch = master
|
13
Jenkinsfile
vendored
Normal file
13
Jenkinsfile
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
#!groovy
|
||||
build('three-ds-server-domain-lib', 'docker-host') {
|
||||
checkoutRepo()
|
||||
loadBuildUtils()
|
||||
|
||||
def javaLibPipeline
|
||||
runStage('load JavaLib pipeline') {
|
||||
javaLibPipeline = load("build_utils/jenkins_lib/pipeJavaLib.groovy")
|
||||
}
|
||||
|
||||
def buildImageTag = "fcf116dd775cc2e91bffb6a36835754e3f2d5321"
|
||||
javaLibPipeline(buildImageTag)
|
||||
}
|
1
build_utils
Submodule
1
build_utils
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit cf6578dac794859b0495c812761ce5b94c11bbaf
|
BIN
docs/v2.1.0.pdf
Normal file
BIN
docs/v2.1.0.pdf
Normal file
Binary file not shown.
BIN
docs/v2.2.0.pdf
Normal file
BIN
docs/v2.2.0.pdf
Normal file
Binary file not shown.
93
pom.xml
Normal file
93
pom.xml
Normal file
@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0.2</version>
|
||||
</parent>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<artifactId>three-ds-server-domain-lib</artifactId>
|
||||
<version>1.0.0</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>8</java.version>
|
||||
<lombok.version>1.18.4</lombok.version>
|
||||
<sonar.jacoco.reportPath>target/sites/jacoco/jacoco.exec</sonar.jacoco.reportPath>
|
||||
<sonar.cobertura.reportPath>target/site/cobertura/coverage.xml</sonar.cobertura.reportPath>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!--rbkmoney-->
|
||||
|
||||
<!--spring-->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>5.1.3.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!--third party-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.9.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>2.0.1.Final</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--test-->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<configuration>
|
||||
<destFile>${sonar.jacoco.reportPath}</destFile>
|
||||
<append>true</append>
|
||||
<excludes>
|
||||
<exclude>com/rbkmoney/threeds/server/domain/**/*</exclude>
|
||||
<exclude>com/rbkmoney/threeds/server/config/**/*</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>agent</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,34 @@
|
||||
package com.rbkmoney.threeds.server.constraint;
|
||||
|
||||
import com.rbkmoney.threeds.server.constraint.validation.*;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Constraint(
|
||||
validatedBy = {
|
||||
AResCustomValidator.class,
|
||||
CardRangeCustomValidator.class,
|
||||
ErroWrapperCustomValidator.class,
|
||||
PArqCustomValidator.class,
|
||||
PGcqCustomValidator.class,
|
||||
PPrqCustomValidator.class,
|
||||
PResCustomValidator.class,
|
||||
RReqCustomValidator.class
|
||||
}
|
||||
)
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface CustomValidation {
|
||||
|
||||
String message() default "field must be required at condition";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.rbkmoney.threeds.server.constraint.validation;
|
||||
|
||||
import com.rbkmoney.threeds.server.domain.root.emvco.ARes;
|
||||
import com.rbkmoney.threeds.server.handle.constraint.ConstraintValidationHandler;
|
||||
import com.rbkmoney.threeds.server.service.ValidatorContextEnricherService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AResCustomValidator extends CustomValidator<ARes> {
|
||||
|
||||
public AResCustomValidator(List<ConstraintValidationHandler<ARes>> constraintValidationHandlers,
|
||||
ValidatorContextEnricherService contextEnricher) {
|
||||
super(constraintValidationHandlers, contextEnricher);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.rbkmoney.threeds.server.constraint.validation;
|
||||
|
||||
import com.rbkmoney.threeds.server.domain.CardRange;
|
||||
import com.rbkmoney.threeds.server.handle.constraint.ConstraintValidationHandler;
|
||||
import com.rbkmoney.threeds.server.service.ValidatorContextEnricherService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CardRangeCustomValidator extends CustomValidator<CardRange> {
|
||||
|
||||
public CardRangeCustomValidator(List<ConstraintValidationHandler<CardRange>> constraintValidationHandlers,
|
||||
ValidatorContextEnricherService contextEnricher) {
|
||||
super(constraintValidationHandlers, contextEnricher);
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.rbkmoney.threeds.server.constraint.validation;
|
||||
|
||||
import com.rbkmoney.threeds.server.constraint.CustomValidation;
|
||||
import com.rbkmoney.threeds.server.dto.ConstraintValidationResult;
|
||||
import com.rbkmoney.threeds.server.handle.constraint.ConstraintValidationHandler;
|
||||
import com.rbkmoney.threeds.server.service.ValidatorContextEnricherService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class CustomValidator<T> implements ConstraintValidator<CustomValidation, T> {
|
||||
|
||||
private final List<ConstraintValidationHandler<T>> handlers;
|
||||
private final ValidatorContextEnricherService contextEnricher;
|
||||
|
||||
@Override
|
||||
public boolean isValid(T message, ConstraintValidatorContext ctx) {
|
||||
ConstraintValidationResult constraintValidationResult = handlers.stream()
|
||||
.filter(handler -> handler.isValidMessageVersion(message))
|
||||
.filter(handler -> handler.canHandle(message))
|
||||
.map(handler -> handler.handle(message))
|
||||
.filter(not(ConstraintValidationResult::isValid))
|
||||
.findAny()
|
||||
.orElse(ConstraintValidationResult.success());
|
||||
|
||||
if (!constraintValidationResult.isValid()) {
|
||||
contextEnricher.enrich(ctx, constraintValidationResult.getConstraintType(), constraintValidationResult.getFieldName());
|
||||
}
|
||||
|
||||
return constraintValidationResult.isValid();
|
||||
}
|
||||
|
||||
private <R> Predicate<R> not(Predicate<? super R> target) {
|
||||
Objects.requireNonNull(target);
|
||||
return (Predicate<R>) target.negate();
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.rbkmoney.threeds.server.constraint.validation;
|
||||
|
||||
import com.rbkmoney.threeds.server.domain.root.emvco.ErroWrapper;
|
||||
import com.rbkmoney.threeds.server.handle.constraint.ConstraintValidationHandler;
|
||||
import com.rbkmoney.threeds.server.service.ValidatorContextEnricherService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ErroWrapperCustomValidator extends CustomValidator<ErroWrapper> {
|
||||
|
||||
public ErroWrapperCustomValidator(List<ConstraintValidationHandler<ErroWrapper>> constraintValidationHandlers,
|
||||
ValidatorContextEnricherService contextEnricher) {
|
||||
super(constraintValidationHandlers, contextEnricher);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.rbkmoney.threeds.server.constraint.validation;
|
||||
|
||||
import com.rbkmoney.threeds.server.domain.root.proprietary.PArq;
|
||||
import com.rbkmoney.threeds.server.handle.constraint.ConstraintValidationHandler;
|
||||
import com.rbkmoney.threeds.server.service.ValidatorContextEnricherService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PArqCustomValidator extends CustomValidator<PArq> {
|
||||
|
||||
public PArqCustomValidator(List<ConstraintValidationHandler<PArq>> constraintValidationHandlers,
|
||||
ValidatorContextEnricherService contextEnricher) {
|
||||
super(constraintValidationHandlers, contextEnricher);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.rbkmoney.threeds.server.constraint.validation;
|
||||
|
||||
import com.rbkmoney.threeds.server.domain.root.proprietary.PGcq;
|
||||
import com.rbkmoney.threeds.server.handle.constraint.ConstraintValidationHandler;
|
||||
import com.rbkmoney.threeds.server.service.ValidatorContextEnricherService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PGcqCustomValidator extends CustomValidator<PGcq> {
|
||||
|
||||
public PGcqCustomValidator(List<ConstraintValidationHandler<PGcq>> constraintValidationHandlers,
|
||||
ValidatorContextEnricherService contextEnricher) {
|
||||
super(constraintValidationHandlers, contextEnricher);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.rbkmoney.threeds.server.constraint.validation;
|
||||
|
||||
import com.rbkmoney.threeds.server.domain.root.proprietary.PPrq;
|
||||
import com.rbkmoney.threeds.server.handle.constraint.ConstraintValidationHandler;
|
||||
import com.rbkmoney.threeds.server.service.ValidatorContextEnricherService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PPrqCustomValidator extends CustomValidator<PPrq> {
|
||||
|
||||
public PPrqCustomValidator(List<ConstraintValidationHandler<PPrq>> constraintValidationHandlers,
|
||||
ValidatorContextEnricherService contextEnricher) {
|
||||
super(constraintValidationHandlers, contextEnricher);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.rbkmoney.threeds.server.constraint.validation;
|
||||
|
||||
import com.rbkmoney.threeds.server.domain.root.emvco.PRes;
|
||||
import com.rbkmoney.threeds.server.handle.constraint.ConstraintValidationHandler;
|
||||
import com.rbkmoney.threeds.server.service.ValidatorContextEnricherService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PResCustomValidator extends CustomValidator<PRes> {
|
||||
|
||||
public PResCustomValidator(List<ConstraintValidationHandler<PRes>> constraintValidationHandlers,
|
||||
ValidatorContextEnricherService contextEnricher) {
|
||||
super(constraintValidationHandlers, contextEnricher);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.rbkmoney.threeds.server.constraint.validation;
|
||||
|
||||
import com.rbkmoney.threeds.server.domain.root.emvco.RReq;
|
||||
import com.rbkmoney.threeds.server.handle.constraint.ConstraintValidationHandler;
|
||||
import com.rbkmoney.threeds.server.service.ValidatorContextEnricherService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RReqCustomValidator extends CustomValidator<RReq> {
|
||||
|
||||
public RReqCustomValidator(List<ConstraintValidationHandler<RReq>> constraintValidationHandlers,
|
||||
ValidatorContextEnricherService contextEnricher) {
|
||||
super(constraintValidationHandlers, contextEnricher);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Indicates the action to take with the card range. The card ranges are processed in the order returned.
|
||||
* <p>
|
||||
* Note: If the Serial Number is not included in the PReq message, then the action is A = Add for all card ranges
|
||||
* returned (the Action Indicator is ignored in the PRes message).
|
||||
* <p>
|
||||
* Note: M (Modify the card range data) is used only to modify or update data associated with the card ranges,
|
||||
* not to modify the Start Range and End Range.
|
||||
* <p>
|
||||
* Length: 1 character
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ActionInd implements Valuable {
|
||||
|
||||
ADD_CARD_RANGE_TO_CACHE("A"),
|
||||
|
||||
DELETE_CARD_RANGE_FROM_CACHE("D"),
|
||||
|
||||
MODIFY_CARD_RANGE_DATA("M");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Indicates whether the Cardholder Shipping Address and Cardholder
|
||||
* Billing Address are the same.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum AddressMatch implements Valuable {
|
||||
|
||||
SAME_ADDRESS("Y"),
|
||||
|
||||
DIFFERENT_ADDRESS("N");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum BrowserColorDepth implements Valuable {
|
||||
|
||||
BIT_1("1"),
|
||||
BITS_4("4"),
|
||||
BITS_8("8"),
|
||||
BITS_15("15"),
|
||||
BITS_16("16"),
|
||||
BITS_24("24"),
|
||||
BITS_32("32"),
|
||||
BITS_48("48");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.constraint.CustomValidation;
|
||||
import com.rbkmoney.threeds.server.domain.acs.AcsInfoInd;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.ListWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.AcsInfoIndDeserializer;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.ActionIndDeserializer;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* The Card Range Data data element contains information returned in the PRes message to the 3DS Server from the DS that indicates the most
|
||||
* recent EMV 3-D Secure version supported by the ACS that hosts that card range. It also may optionally contain the ACS URL for the 3DS
|
||||
* Method if supported by the ACS and the DS Start and End Protocol Versions which support the card range.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@ToString(onlyExplicitlyIncluded = true)
|
||||
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
@CustomValidation
|
||||
public class CardRange {
|
||||
|
||||
private String threeDSMethodURL;
|
||||
private String acsEndProtocolVersion;
|
||||
@JsonDeserialize(using = AcsInfoIndDeserializer.class)
|
||||
private ListWrapper<EnumWrapper<AcsInfoInd>> acsInfoInd;
|
||||
private String acsStartProtocolVersion;
|
||||
@JsonDeserialize(using = ActionIndDeserializer.class)
|
||||
private EnumWrapper<ActionInd> actionInd;
|
||||
private String dsEndProtocolVersion;
|
||||
private String dsStartProtocolVersion;
|
||||
@ToString.Include
|
||||
@EqualsAndHashCode.Include
|
||||
private String endRange;
|
||||
@ToString.Include
|
||||
@EqualsAndHashCode.Include
|
||||
private String startRange;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Indicator informing the ACS and the DS that the authentication has been canceled.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ChallengeCancel implements Valuable {
|
||||
|
||||
CARDHOLDER_SELECTED_CANCEL("01"),
|
||||
|
||||
TRANSACTION_TIMED_OUT_DECOUPLED_AUTH("03"),
|
||||
|
||||
TRANSACTION_TIMED_OUT_OTHER_TIMEOUTS("04"),
|
||||
|
||||
TRANSACTION_TIMED_OUT_FIRST_CREQ_NOT_RECEIVED("05"),
|
||||
|
||||
TRANSACTION_ERROR("06"),
|
||||
|
||||
UNKNOWN("07"),
|
||||
|
||||
TRANSACTION_TIMED_OUT_AT_SDK("08");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public boolean isReservedValueForNotRelevantMessageVersion() {
|
||||
return value.equals(TRANSACTION_TIMED_OUT_DECOUPLED_AUTH.getValue());
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum ChallengeWindowSize implements Valuable {
|
||||
|
||||
VERY_LOW("01"),
|
||||
LOW("02"),
|
||||
MEDIUM("03"),
|
||||
HIGH("04"),
|
||||
FULL_SCREEN("05");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum DeliveryTimeframe implements Valuable {
|
||||
|
||||
ELECTRONIC_DELIVERY("01"),
|
||||
|
||||
SAME_DAY_SHIPPING("02"),
|
||||
|
||||
OVERNIGHT_SHIPPING("03"),
|
||||
|
||||
TWO_DAY_OR_MORE("04");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rbkmoney.threeds.server.domain.order.PreOrderPurchaseInd;
|
||||
import com.rbkmoney.threeds.server.domain.order.ReorderItemsInd;
|
||||
import com.rbkmoney.threeds.server.domain.ship.ShipIndicator;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class MerchantRiskIndicator {
|
||||
|
||||
private String deliveryEmailAddress;
|
||||
private DeliveryTimeframe deliveryTimeframe;
|
||||
private String giftCardAmount;
|
||||
private String giftCardCount;
|
||||
private String giftCardCurr;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd")
|
||||
private LocalDate preOrderDate;
|
||||
private PreOrderPurchaseInd preOrderPurchaseInd;
|
||||
private ReorderItemsInd reorderItemsInd;
|
||||
private ShipIndicator shipIndicator;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.domain.order.PreOrderPurchaseInd;
|
||||
import com.rbkmoney.threeds.server.domain.order.ReorderItemsInd;
|
||||
import com.rbkmoney.threeds.server.domain.ship.ShipIndicator;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.TemporalAccessorWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class MerchantRiskIndicatorWrapper {
|
||||
|
||||
private String deliveryEmailAddress;
|
||||
@JsonDeserialize(using = DeliveryTimeframeDeserializer.class)
|
||||
private EnumWrapper<DeliveryTimeframe> deliveryTimeframe;
|
||||
private String giftCardAmount;
|
||||
private String giftCardCount;
|
||||
private String giftCardCurr;
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDate> preOrderDate;
|
||||
@JsonDeserialize(using = PreOrderPurchaseIndDeserializer.class)
|
||||
private EnumWrapper<PreOrderPurchaseInd> preOrderPurchaseInd;
|
||||
@JsonDeserialize(using = ReorderItemsIndDeserializer.class)
|
||||
private EnumWrapper<ReorderItemsInd> reorderItemsInd;
|
||||
@JsonDeserialize(using = ShipIndicatorDeserializer.class)
|
||||
private EnumWrapper<ShipIndicator> shipIndicator;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* EMV Payment Token Source
|
||||
* This data element will be populated by the system residing in the 3-D Secure
|
||||
* domain where the detokenisation occurs.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum PayTokenSource implements Valuable {
|
||||
|
||||
THREE_DS_SERVER("01"),
|
||||
|
||||
DS("02");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
23
src/main/java/com/rbkmoney/threeds/server/domain/Phone.java
Normal file
23
src/main/java/com/rbkmoney/threeds/server/domain/Phone.java
Normal file
@ -0,0 +1,23 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Phone Number
|
||||
* Phone number provided by the Cardholder.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class Phone {
|
||||
|
||||
private String cc;
|
||||
private String subscriber;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Indicates the status of the Results Request message from the 3DS Server to provide additional data to the ACS.
|
||||
* This will indicate if the message was successfully received for further processing or will be used
|
||||
* to provide more detail on why the Challenge could not be completed from the 3DS Client to the ACS.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ResultsStatus {
|
||||
|
||||
RREQ_RECEIVED_FOR_FURTHER_PROCESSING("01"),
|
||||
|
||||
CREQ_NOT_SENT_TO_ACS("02"),
|
||||
|
||||
ARES_NOT_DELIVERED_TO_THE_3DS_REQUESTOR("03");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.rbkmoney.threeds.server.domain;
|
||||
|
||||
public interface Valuable {
|
||||
|
||||
String getValue();
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.rbkmoney.threeds.server.domain.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rbkmoney.threeds.server.domain.ship.ShipAddressUsageInd;
|
||||
import com.rbkmoney.threeds.server.domain.ship.ShipNameIndicator;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* Cardholder Account Information.
|
||||
* Additional information about the Cardholder’s account provided by the 3DS Requestor.
|
||||
* <p>
|
||||
* JSON Data Type: Object
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class AccountInfo {
|
||||
|
||||
private ChAccAgeInd chAccAgeInd;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd")
|
||||
private LocalDate chAccChange;
|
||||
private ChAccChangeInd chAccChangeInd;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd")
|
||||
private LocalDate chAccDate;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd")
|
||||
private LocalDate chAccPwChange;
|
||||
private ChAccPwChangeInd chAccPwChangeInd;
|
||||
private String nbPurchaseAccount;
|
||||
private String provisionAttemptsDay;
|
||||
private String txnActivityDay;
|
||||
private String txnActivityYear;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd")
|
||||
private LocalDate paymentAccAge;
|
||||
private PaymentAccInd paymentAccInd;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd")
|
||||
private LocalDate shipAddressUsage;
|
||||
private ShipAddressUsageInd shipAddressUsageInd;
|
||||
private ShipNameIndicator shipNameIndicator;
|
||||
private SuspiciousAccActivity suspiciousAccActivity;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.rbkmoney.threeds.server.domain.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.domain.ship.ShipAddressUsageInd;
|
||||
import com.rbkmoney.threeds.server.domain.ship.ShipNameIndicator;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.TemporalAccessorWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* Cardholder Account Information.
|
||||
* Additional information about the Cardholder’s account provided by the 3DS Requestor.
|
||||
* <p>
|
||||
* JSON Data Type: Object
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class AccountInfoWrapper {
|
||||
|
||||
@JsonDeserialize(using = ChAccAgeIndDeserializer.class)
|
||||
private EnumWrapper<ChAccAgeInd> chAccAgeInd;
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDate> chAccChange;
|
||||
@JsonDeserialize(using = ChAccChangeIndDeserializer.class)
|
||||
private EnumWrapper<ChAccChangeInd> chAccChangeInd;
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDate> chAccDate;
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDate> chAccPwChange;
|
||||
@JsonDeserialize(using = ChAccPwChangeIndDeserializer.class)
|
||||
private EnumWrapper<ChAccPwChangeInd> chAccPwChangeInd;
|
||||
private String nbPurchaseAccount;
|
||||
private String provisionAttemptsDay;
|
||||
private String txnActivityDay;
|
||||
private String txnActivityYear;
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDate> paymentAccAge;
|
||||
@JsonDeserialize(using = PaymentAccIndDeserializer.class)
|
||||
private EnumWrapper<PaymentAccInd> paymentAccInd;
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDate> shipAddressUsage;
|
||||
@JsonDeserialize(using = ShipAddressUsageIndDeserializer.class)
|
||||
private EnumWrapper<ShipAddressUsageInd> shipAddressUsageInd;
|
||||
@JsonDeserialize(using = ShipNameIndicatorDeserializer.class)
|
||||
private EnumWrapper<ShipNameIndicator> shipNameIndicator;
|
||||
@JsonDeserialize(using = SuspiciousAccActivityDeserializer.class)
|
||||
private EnumWrapper<SuspiciousAccActivity> suspiciousAccActivity;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.rbkmoney.threeds.server.domain.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Indicates the type of account. For example, for a multi-account card product.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum AccountType implements Valuable {
|
||||
|
||||
NOT_APPLICABLE("01"),
|
||||
|
||||
CREDIT("02"),
|
||||
|
||||
DEBIT("03");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.rbkmoney.threeds.server.domain.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Cardholder Account Age Indicator
|
||||
* <p>
|
||||
* Length of time that the cardholder has had the account with the 3DS Requestor.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ChAccAgeInd implements Valuable {
|
||||
|
||||
NO_ACCOUNT("01"),
|
||||
|
||||
THIS_TRANSACTION("02"),
|
||||
|
||||
LESS_THEN_30_DAYS("03"),
|
||||
|
||||
FROM_30_TO_60_DAYS("04"),
|
||||
|
||||
MORE_THAN_60_DAYS("05");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.rbkmoney.threeds.server.domain.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
||||
/**
|
||||
* Length of time since the cardholder’s account information with the 3DS Requestor was last
|
||||
* changed, including Billing or Shipping address, new payment account, or new user(s) added.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ChAccChangeInd implements Valuable {
|
||||
|
||||
THIS_TRANSACTION("01"),
|
||||
|
||||
LESS_THEN_30_DAYS("02"),
|
||||
|
||||
FROM_30_TO_60_DAYS("03"),
|
||||
|
||||
MORE_THAN_60_DAYS("04");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.rbkmoney.threeds.server.domain.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Cardholder Account Password Change Indicator
|
||||
* <p>
|
||||
* Indicates the length of time since the cardholder’s account with the 3DS Requestor
|
||||
* had a password change or account reset.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ChAccPwChangeInd implements Valuable {
|
||||
|
||||
NO_CHANGE("01"),
|
||||
|
||||
THIS_TRANSACTION("02"),
|
||||
|
||||
LESS_THEN_30_DAYS("03"),
|
||||
|
||||
FROM_30_TO_60_DAYS("04"),
|
||||
|
||||
MORE_THAN_60_DAYS("05");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.rbkmoney.threeds.server.domain.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Payment Account Age Indicator
|
||||
* Indicates the length of time that the payment account was enrolled
|
||||
* in the cardholder’s account with the 3DS Requestor.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum PaymentAccInd implements Valuable {
|
||||
|
||||
NO_ACCOUNT("01"),
|
||||
|
||||
DURING_THIS_TRANSACTION("02"),
|
||||
|
||||
LESS_THEN_30_DAYS("03"),
|
||||
|
||||
FROM_30_TO_60_DAYS("04"),
|
||||
|
||||
MORE_THAN_60_DAYS("05");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.rbkmoney.threeds.server.domain.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Suspicious Account Activity
|
||||
* Indicates whether the 3DS Requestor has experienced suspicious activity
|
||||
* (including previous fraud) on the cardholder account.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum SuspiciousAccActivity implements Valuable {
|
||||
|
||||
NO_SUSPICIOUS_ACTIVITY_OBSERVED("01"),
|
||||
|
||||
SUSPICIOUS_ACTIVITY_OBSERVED("02");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.rbkmoney.threeds.server.domain.acs;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* ACS Challenge Mandated Indicator
|
||||
* Indication of whether a challenge is required for the transaction to be
|
||||
* authorised due to local/regional mandates or other variable.
|
||||
* <p>
|
||||
* Length: 1 character
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum AcsChallengeMandated implements Valuable {
|
||||
|
||||
CHALLENGE_MANDATED("Y"),
|
||||
|
||||
CHALLENGE_IS_NOT_MANDATED("N");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.rbkmoney.threeds.server.domain.acs;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* ACS Decoupled Confirmation Indicator
|
||||
* Indicates whether the ACS confirms utilisation of Decoupled Authentication
|
||||
* and agrees to utilise Decoupled Authentication to authenticate the Cardholder.
|
||||
* <p>
|
||||
* Length: 1 character
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum AcsDecConInd implements Valuable {
|
||||
|
||||
DECOUPLED_AUTH_WILL_BE_USED("Y"),
|
||||
|
||||
DECOUPLED_AUTH_WILL_NOT_BE_USED("N");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.rbkmoney.threeds.server.domain.acs;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum AcsInfoInd implements Valuable {
|
||||
|
||||
AUTH_AVAILABLE_AT_ACS("01"),
|
||||
|
||||
ATTEMPTS_SUPPORTED_BY_ACS_OR_DS("02"),
|
||||
|
||||
DECOUPLED_AUTH_SUPPORTED("03"),
|
||||
|
||||
WHITELISTING_SUPPORTED("04");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.rbkmoney.threeds.server.domain.acs;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* ACS Interface
|
||||
* This the ACS interface that the challenge will present to the cardholder.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum AcsInterface implements Valuable {
|
||||
|
||||
NATIVE_UI("01"),
|
||||
|
||||
HTML_UI("02");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.rbkmoney.threeds.server.domain.acs;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The ACS Rendering Type contains information about the rendering type
|
||||
* that the ACS is sending for the cardholder authentication.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class AcsRenderingType {
|
||||
|
||||
private AcsInterface acsInterface;
|
||||
private AcsUiTemplate acsUiTemplate;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.rbkmoney.threeds.server.domain.acs;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.AcsInterfaceDeserializer;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.AcsUiTemplateDeserializer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The ACS Rendering Type contains information about the rendering type
|
||||
* that the ACS is sending for the cardholder authentication.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class AcsRenderingTypeWrapper {
|
||||
|
||||
@JsonDeserialize(using = AcsInterfaceDeserializer.class)
|
||||
private EnumWrapper<AcsInterface> acsInterface;
|
||||
@JsonDeserialize(using = AcsUiTemplateDeserializer.class)
|
||||
private EnumWrapper<AcsUiTemplate> acsUiTemplate;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.rbkmoney.threeds.server.domain.acs;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* ACS UI Template
|
||||
* Identifies the UI Template format that the ACS first presents to the consumer.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum AcsUiTemplate implements Valuable {
|
||||
|
||||
TEXT("01"),
|
||||
|
||||
SINGLE_SELECT("02"),
|
||||
|
||||
MULTI_SELECT("03"),
|
||||
|
||||
OOB("04"),
|
||||
|
||||
HTML_OTHER("05");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.rbkmoney.threeds.server.domain.authentication;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Authentication approach that the ACS used to authenticate the Cardholder for this specific transaction.
|
||||
* Note: This is in the RReq message from the ACS only. It is not passed to the 3DS Server URL.
|
||||
* Note: For 3RI, only present for Decoupled Authentication
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum AuthenticationMethod implements Valuable {
|
||||
|
||||
STATIC_PASSCODE("01"),
|
||||
|
||||
SMS_OTP("02"),
|
||||
|
||||
KEY_FOB_OR_EMV_CARD_READER_OTP("03"),
|
||||
|
||||
APP_OTP("04"),
|
||||
|
||||
OTP_OTHER("05"),
|
||||
|
||||
KBA("06"),
|
||||
|
||||
OOB_BIOMETRICS("07"),
|
||||
|
||||
OOB_LOGIN("08"),
|
||||
|
||||
OOB_OTHER("09"),
|
||||
|
||||
OTHER("10"),
|
||||
|
||||
PUSH_CONFIRMATION("11");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public boolean isReservedValueForNotRelevantMessageVersion() {
|
||||
return value.equals(PUSH_CONFIRMATION.getValue());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.rbkmoney.threeds.server.domain.authentication;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Indicates the type of authentication method the Issuer will use to challenge the Cardholder,
|
||||
* whether in the ARes message or what was used by the ACS when in the RReq message.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum AuthenticationType implements Valuable {
|
||||
|
||||
STATIC("01"),
|
||||
|
||||
DYNAMIC("02"),
|
||||
|
||||
OOB("03"),
|
||||
|
||||
DECOUPLED("04");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.rbkmoney.threeds.server.domain.device;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Device Channel
|
||||
* Indicates the type of channel interface being
|
||||
* used to initiate the transaction.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum DeviceChannel implements Valuable {
|
||||
|
||||
APP_BASED("01"),
|
||||
|
||||
BROWSER("02"),
|
||||
|
||||
THREE_REQUESTOR_INITIATED("03");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.rbkmoney.threeds.server.domain.device;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.rbkmoney.threeds.server.domain.sdk.SdkInterface;
|
||||
import com.rbkmoney.threeds.server.domain.sdk.SdkUiType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class DeviceRenderOptions {
|
||||
|
||||
@JsonProperty("sdkInterface")
|
||||
private SdkInterface sdkInterface;
|
||||
@JsonProperty("sdkUiType")
|
||||
private List<SdkUiType> sdkUiType;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.rbkmoney.threeds.server.domain.device;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.domain.sdk.SdkInterface;
|
||||
import com.rbkmoney.threeds.server.domain.sdk.SdkUiType;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.ListWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.SdkInterfaceDeserializer;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.SdkUiTypeDeserializer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class DeviceRenderOptionsWrapper {
|
||||
|
||||
@JsonProperty("sdkInterface")
|
||||
@JsonDeserialize(using = SdkInterfaceDeserializer.class)
|
||||
private EnumWrapper<SdkInterface> sdkInterface;
|
||||
@JsonProperty("sdkUiType")
|
||||
@JsonDeserialize(using = SdkUiTypeDeserializer.class)
|
||||
private ListWrapper<EnumWrapper<SdkUiType>> sdkUiType;
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.rbkmoney.threeds.server.domain.error;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Code indicating the type of problem identified in the message.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ErrorCode implements Valuable {
|
||||
|
||||
MESSAGE_RECEIVED_INVALID_101("101"),
|
||||
|
||||
MESSAGE_VERSION_NOT_SUPPORTED_102("102"),
|
||||
|
||||
SENT_MESSAGE_LIMIT_EXCEEDED_103("103"),
|
||||
|
||||
REQUIRED_DATA_ELEMENT_MISSING_201("201"),
|
||||
|
||||
CRITICAL_MESSAGE_EXTENSION_NOT_RECOGNISED_202("202"),
|
||||
|
||||
FORMAT_OF_DATA_ELEMENTS_INVALID_203("203"),
|
||||
|
||||
DUPLICATE_DATA_ELEMENT_204("204"),
|
||||
|
||||
TRANSACTION_ID_NOT_RECOGNISED_301("301"),
|
||||
|
||||
DATA_DECRYPTION_FAILURE_302("302"),
|
||||
|
||||
ACCESS_DENIED_OR_INVALID_ENDPOINT_303("303"),
|
||||
|
||||
ISO_CODE_INVALID_304("304"),
|
||||
|
||||
TRANSACTION_DATA_NOT_VALID_305("305"),
|
||||
|
||||
MCC_NOT_VALID_FOR_PAYMENT_SYSTEM_306("306"),
|
||||
|
||||
SERIAL_NUMBER_NOT_VALID_307("307"),
|
||||
|
||||
TRANSACTION_TIMED_OUT_402("402"),
|
||||
|
||||
TRANSIENT_SYSTEM_FAILURE_403("403"),
|
||||
|
||||
PERMANENT_SYSTEM_FAILURE_404("404"),
|
||||
|
||||
SYSTEM_CONNECTION_FAILURE_405("405");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.rbkmoney.threeds.server.domain.error;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Code indicating the 3-D Secure component that identified the error.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ErrorComponent implements Valuable {
|
||||
|
||||
THREE_DS_SDK("C"),
|
||||
|
||||
THREE_DS_SERVER("S"),
|
||||
|
||||
DS("D"),
|
||||
|
||||
ACS("A");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.rbkmoney.threeds.server.domain.message;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Message Category
|
||||
* Identifies the category of the message for a specific use case.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum MessageCategory implements Valuable {
|
||||
|
||||
PAYMENT_AUTH("01"),
|
||||
|
||||
NON_PAYMENT_AUTH("02");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.rbkmoney.threeds.server.domain.message;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Message Extensions are used to carry additional data that is not defined in the 3-D Secure Protocol
|
||||
* and Core Functions Specification.
|
||||
* The party defining the Message Extension shall define the format of the data.
|
||||
* <p>
|
||||
* JSON Data Type: Object
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class MessageExtension {
|
||||
|
||||
private String name;
|
||||
private String id;
|
||||
private Boolean criticalityIndicator;
|
||||
private Map<String, String> data;
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.rbkmoney.threeds.server.domain.message;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Identifies the type of message that is passed.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum MessageType implements Valuable {
|
||||
|
||||
ERROR("Erro"),
|
||||
|
||||
AREQ("AReq"),
|
||||
|
||||
ARES("ARes"),
|
||||
|
||||
CREQ("CReq"),
|
||||
|
||||
CRES("CRes"),
|
||||
|
||||
PREQ("PReq"),
|
||||
|
||||
PRES("PRes"),
|
||||
|
||||
RREQ("RReq"),
|
||||
|
||||
RRES("RRes"),
|
||||
|
||||
PARQ("pArq"),
|
||||
|
||||
PARS("pArs"),
|
||||
|
||||
PGCQ("pGcq"),
|
||||
|
||||
PGCS("pGcs"),
|
||||
|
||||
PIRQ("pIrq"),
|
||||
|
||||
PIRS("pIrs"),
|
||||
|
||||
PORQ("pOrq"),
|
||||
|
||||
PORS("pOrs"),
|
||||
|
||||
PPRQ("pPrq"),
|
||||
|
||||
PPRS("pPrs"),
|
||||
|
||||
PSRQ("pSrq"),
|
||||
|
||||
PSRS("pSrs"),
|
||||
|
||||
UNKN("Unkn");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.rbkmoney.threeds.server.domain.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Pre-Order Purchase Indicator
|
||||
* Indicates whether Cardholder is placing an order for
|
||||
* merchandise with a future availability or release date.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum PreOrderPurchaseInd implements Valuable {
|
||||
|
||||
MERCHANDISE_AVAILABLE("01"),
|
||||
|
||||
FUTURE_AVAILABILITY("02");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.rbkmoney.threeds.server.domain.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Reorder Items Indicator
|
||||
* Indicates whether the cardholder is reordering previously
|
||||
* purchased merchandise.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ReorderItemsInd implements Valuable {
|
||||
|
||||
FIRST_TIME_ORDERED("01"),
|
||||
|
||||
REORDERED("02");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.rbkmoney.threeds.server.domain.root;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.rbkmoney.threeds.server.domain.root.emvco.*;
|
||||
import com.rbkmoney.threeds.server.domain.root.proprietary.*;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
property = "messageType",
|
||||
visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = ErroWrapper.class, name = "Erro"),
|
||||
@JsonSubTypes.Type(value = AReq.class, name = "AReq"),
|
||||
@JsonSubTypes.Type(value = ARes.class, name = "ARes"),
|
||||
@JsonSubTypes.Type(value = PReq.class, name = "PReq"),
|
||||
@JsonSubTypes.Type(value = PRes.class, name = "PRes"),
|
||||
@JsonSubTypes.Type(value = RReq.class, name = "RReq"),
|
||||
@JsonSubTypes.Type(value = RRes.class, name = "RRes"),
|
||||
|
||||
@JsonSubTypes.Type(value = PArq.class, name = "pArq"),
|
||||
@JsonSubTypes.Type(value = PArs.class, name = "pArs"),
|
||||
@JsonSubTypes.Type(value = PGcq.class, name = "pGcq"),
|
||||
@JsonSubTypes.Type(value = PGcs.class, name = "pGcs"),
|
||||
@JsonSubTypes.Type(value = PPrq.class, name = "pPrq"),
|
||||
@JsonSubTypes.Type(value = PPrs.class, name = "pPrs"),
|
||||
})
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Data
|
||||
@ToString(onlyExplicitlyIncluded = true)
|
||||
public abstract class Message implements TransactionalMessage, RepeatableHandleMessage {
|
||||
|
||||
@ToString.Include
|
||||
private String messageVersion;
|
||||
|
||||
// 6.5.2 Test Case Identification (3ds.selftestplatform.com)
|
||||
@JsonIgnore
|
||||
private String xULTestCaseRunId;
|
||||
|
||||
@JsonIgnore
|
||||
@Nullable
|
||||
private Message requestMessage;
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isRelevantMessageVersion() {
|
||||
if (messageVersion != null) {
|
||||
return messageVersion.equals("2.2.0");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.rbkmoney.threeds.server.domain.root;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
public interface RepeatableHandleMessage {
|
||||
|
||||
default void setHandleRepetitionNeeded(boolean handleRepetitionNeeded) {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
default boolean isHandleRepetitionNeeded() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.rbkmoney.threeds.server.domain.root;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
public interface TransactionalMessage {
|
||||
|
||||
@Nullable
|
||||
default String getAcsTransID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
default String getDsTransID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
default String getThreeDSServerTransID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
default String getSdkTransID() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.emvco;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
||||
import com.rbkmoney.threeds.server.domain.*;
|
||||
import com.rbkmoney.threeds.server.domain.account.AccountInfo;
|
||||
import com.rbkmoney.threeds.server.domain.account.AccountType;
|
||||
import com.rbkmoney.threeds.server.domain.device.DeviceChannel;
|
||||
import com.rbkmoney.threeds.server.domain.device.DeviceRenderOptions;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageCategory;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.domain.threedsrequestor.*;
|
||||
import com.rbkmoney.threeds.server.domain.transaction.TransactionType;
|
||||
import com.rbkmoney.threeds.server.domain.unwrapped.Address;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatus;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatusSource;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class AReq extends Message {
|
||||
|
||||
@ToString.Include
|
||||
private ThreeDsMethodCompletionIndicator threeDSCompInd;
|
||||
@ToString.Include
|
||||
private ThreeDSRequestorAuthenticationInd threeDSRequestorAuthenticationInd;
|
||||
private ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo;
|
||||
@ToString.Include
|
||||
private ThreeDSReqAuthMethodInd threeDSReqAuthMethodInd;
|
||||
@ToString.Include
|
||||
private ThreeDSRequestorChallengeInd threeDSRequestorChallengeInd;
|
||||
@ToString.Include
|
||||
private String threeDSRequestorDecMaxTime;
|
||||
@ToString.Include
|
||||
private ThreeDSRequestorDecReqInd threeDSRequestorDecReqInd;
|
||||
@ToString.Include
|
||||
private String threeDSRequestorID;
|
||||
@ToString.Include
|
||||
private String threeDSRequestorName;
|
||||
@ToString.Include
|
||||
private ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo;
|
||||
private String threeDSRequestorURL;
|
||||
@ToString.Include
|
||||
private String threeDSServerRefNumber;
|
||||
@ToString.Include
|
||||
private String threeDSServerOperatorID;
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
@ToString.Include
|
||||
private String threeDSServerURL;
|
||||
@ToString.Include
|
||||
private ThreeRIInd threeRIInd;
|
||||
@ToString.Include
|
||||
private AccountType acctType;
|
||||
private String acquirerBIN;
|
||||
private String acquirerMerchantID;
|
||||
private AddressMatch addrMatch;
|
||||
private Object broadInfo;
|
||||
private String browserAcceptHeader;
|
||||
private String browserIP;
|
||||
private Boolean browserJavaEnabled;
|
||||
private Boolean browserJavascriptEnabled;
|
||||
private String browserLanguage;
|
||||
private BrowserColorDepth browserColorDepth;
|
||||
private String browserScreenHeight;
|
||||
private String browserScreenWidth;
|
||||
private String browserTZ;
|
||||
private String browserUserAgent;
|
||||
private String cardExpiryDate;
|
||||
private AccountInfo acctInfo;
|
||||
private String acctNumber;
|
||||
private String acctID;
|
||||
@JsonUnwrapped(prefix = "bill")
|
||||
private Address billingAddress;
|
||||
private String email;
|
||||
private Phone homePhone;
|
||||
private Phone mobilePhone;
|
||||
private String cardholderName;
|
||||
@JsonUnwrapped(prefix = "ship")
|
||||
private Address shippingAddress;
|
||||
private Phone workPhone;
|
||||
@ToString.Include
|
||||
private DeviceChannel deviceChannel;
|
||||
private String deviceInfo;
|
||||
private DeviceRenderOptions deviceRenderOptions;
|
||||
private String dsReferenceNumber;
|
||||
@ToString.Include
|
||||
private String dsTransID;
|
||||
private String dsURL;
|
||||
private Boolean payTokenInd;
|
||||
private PayTokenSource payTokenSource;
|
||||
private String purchaseInstalData;
|
||||
private String mcc;
|
||||
private String merchantCountryCode;
|
||||
private String merchantName;
|
||||
@ToString.Include
|
||||
private MerchantRiskIndicator merchantRiskIndicator;
|
||||
@ToString.Include
|
||||
private MessageCategory messageCategory;
|
||||
private List<MessageExtension> messageExtension;
|
||||
private String notificationURL;
|
||||
private String purchaseAmount;
|
||||
private String purchaseCurrency;
|
||||
private String purchaseExponent;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMddHHmmss")
|
||||
private LocalDateTime purchaseDate;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd")
|
||||
private LocalDate recurringExpiry;
|
||||
private String recurringFrequency;
|
||||
private String sdkAppID;
|
||||
private String sdkEncData;
|
||||
private Map<String, String> sdkEphemPubKey;
|
||||
private String sdkMaxTimeout;
|
||||
private String sdkReferenceNumber;
|
||||
@ToString.Include
|
||||
private String sdkTransID;
|
||||
@ToString.Include
|
||||
private TransactionType transType;
|
||||
@ToString.Include
|
||||
private WhiteListStatus whiteListStatus;
|
||||
@ToString.Include
|
||||
private WhiteListStatusSource whiteListStatusSource;
|
||||
|
||||
@JsonIgnore
|
||||
private LocalDateTime decoupledAuthMaxTime;
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.emvco;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.constraint.CustomValidation;
|
||||
import com.rbkmoney.threeds.server.domain.acs.AcsChallengeMandated;
|
||||
import com.rbkmoney.threeds.server.domain.acs.AcsDecConInd;
|
||||
import com.rbkmoney.threeds.server.domain.acs.AcsRenderingTypeWrapper;
|
||||
import com.rbkmoney.threeds.server.domain.authentication.AuthenticationType;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.domain.transaction.TransactionStatus;
|
||||
import com.rbkmoney.threeds.server.domain.transaction.TransactionStatusReason;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatus;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatusSource;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.ListWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.*;
|
||||
import lombok.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
@CustomValidation
|
||||
public class ARes extends Message {
|
||||
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = AcsChallengeMandatedDeserializer.class)
|
||||
private EnumWrapper<AcsChallengeMandated> acsChallengeMandated;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = AcsDecConIndDeserializer.class)
|
||||
private EnumWrapper<AcsDecConInd> acsDecConInd;
|
||||
private String acsOperatorID;
|
||||
private String acsReferenceNumber;
|
||||
private AcsRenderingTypeWrapper acsRenderingType;
|
||||
private String acsSignedContent;
|
||||
@ToString.Include
|
||||
private String acsTransID;
|
||||
private String acsURL;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = AuthenticationTypeDeserializer.class)
|
||||
private EnumWrapper<AuthenticationType> authenticationType;
|
||||
private String authenticationValue;
|
||||
private Object broadInfo;
|
||||
private String cardholderInfo;
|
||||
private String dsReferenceNumber;
|
||||
@ToString.Include
|
||||
private String dsTransID;
|
||||
private String eci;
|
||||
@JsonDeserialize(using = MessageExtensionDeserializer.class)
|
||||
private ListWrapper<MessageExtension> messageExtension;
|
||||
@ToString.Include
|
||||
private String sdkTransID;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = TransactionStatusDeserializer.class)
|
||||
private EnumWrapper<TransactionStatus> transStatus;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = TransactionStatusReasonDeserializer.class)
|
||||
private EnumWrapper<TransactionStatusReason> transStatusReason;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = WhiteListStatusDeserializer.class)
|
||||
private EnumWrapper<WhiteListStatus> whiteListStatus;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = WhiteListStatusSourceDeserializer.class)
|
||||
private EnumWrapper<WhiteListStatusSource> whiteListStatusSource;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.emvco;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rbkmoney.threeds.server.domain.error.ErrorCode;
|
||||
import com.rbkmoney.threeds.server.domain.error.ErrorComponent;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* Error message
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class Erro extends Message {
|
||||
|
||||
@ToString.Include
|
||||
private ErrorCode errorCode;
|
||||
@ToString.Include
|
||||
private ErrorComponent errorComponent;
|
||||
@ToString.Include
|
||||
private String errorDescription;
|
||||
@ToString.Include
|
||||
private String errorDetail;
|
||||
@ToString.Include
|
||||
private String errorMessageType;
|
||||
@ToString.Include
|
||||
private String sdkTransID;
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
@ToString.Include
|
||||
private String dsTransID;
|
||||
@ToString.Include
|
||||
private String acsTransID;
|
||||
|
||||
@JsonIgnore
|
||||
private boolean handleRepetitionNeeded = false;
|
||||
@JsonIgnore
|
||||
private boolean notifyDsAboutError = true;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.emvco;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.constraint.CustomValidation;
|
||||
import com.rbkmoney.threeds.server.domain.error.ErrorCode;
|
||||
import com.rbkmoney.threeds.server.domain.error.ErrorComponent;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.ErrorCodeDeserializer;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.ErrorComponentDeserializer;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* Error message
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
@CustomValidation
|
||||
public class ErroWrapper extends Message {
|
||||
|
||||
@JsonDeserialize(using = ErrorCodeDeserializer.class)
|
||||
private EnumWrapper<ErrorCode> errorCode;
|
||||
@JsonDeserialize(using = ErrorComponentDeserializer.class)
|
||||
private EnumWrapper<ErrorComponent> errorComponent;
|
||||
private String errorDescription;
|
||||
private String errorDetail;
|
||||
private String errorMessageType;
|
||||
private String sdkTransID;
|
||||
private String threeDSServerTransID;
|
||||
private String dsTransID;
|
||||
private String acsTransID;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.emvco;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class PReq extends Message {
|
||||
|
||||
@ToString.Include
|
||||
private String threeDSServerRefNumber;
|
||||
@ToString.Include
|
||||
private String threeDSServerOperatorID;
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
private List<MessageExtension> messageExtension;
|
||||
@ToString.Include
|
||||
private String serialNum;
|
||||
|
||||
@ToString.Include
|
||||
private String threeDSRequestorURL;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.emvco;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.constraint.CustomValidation;
|
||||
import com.rbkmoney.threeds.server.domain.CardRange;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.serialization.ListWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.CardRangeDataDeserializer;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.MessageExtensionDeserializer;
|
||||
import lombok.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
@CustomValidation
|
||||
public class PRes extends Message {
|
||||
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = CardRangeDataDeserializer.class)
|
||||
private ListWrapper<CardRange> cardRangeData;
|
||||
private String dsEndProtocolVersion;
|
||||
private String dsStartProtocolVersion;
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
@ToString.Include
|
||||
private String dsTransID;
|
||||
@JsonDeserialize(using = MessageExtensionDeserializer.class)
|
||||
private ListWrapper<MessageExtension> messageExtension;
|
||||
@ToString.Include
|
||||
private String serialNum;
|
||||
|
||||
private boolean handleRepetitionNeeded = false;
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.emvco;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.constraint.CustomValidation;
|
||||
import com.rbkmoney.threeds.server.domain.ChallengeCancel;
|
||||
import com.rbkmoney.threeds.server.domain.acs.AcsRenderingTypeWrapper;
|
||||
import com.rbkmoney.threeds.server.domain.authentication.AuthenticationMethod;
|
||||
import com.rbkmoney.threeds.server.domain.authentication.AuthenticationType;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageCategory;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.domain.transaction.TransactionStatus;
|
||||
import com.rbkmoney.threeds.server.domain.transaction.TransactionStatusReason;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatus;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatusSource;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.ListWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.*;
|
||||
import lombok.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
@CustomValidation
|
||||
public class RReq extends Message {
|
||||
|
||||
@ToString.Include
|
||||
private AcsRenderingTypeWrapper acsRenderingType;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = AuthenticationMethodDeserializer.class)
|
||||
private EnumWrapper<AuthenticationMethod> authenticationMethod;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = AuthenticationTypeDeserializer.class)
|
||||
private EnumWrapper<AuthenticationType> authenticationType;
|
||||
private String authenticationValue;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = ChallengeCancelDeserializer.class)
|
||||
private EnumWrapper<ChallengeCancel> challengeCancel;
|
||||
private String eci;
|
||||
private String interactionCounter;
|
||||
@JsonDeserialize(using = MessageCategoryDeserializer.class)
|
||||
private EnumWrapper<MessageCategory> messageCategory;
|
||||
@JsonDeserialize(using = MessageExtensionDeserializer.class)
|
||||
private ListWrapper<MessageExtension> messageExtension;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = TransactionStatusDeserializer.class)
|
||||
private EnumWrapper<TransactionStatus> transStatus;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = TransactionStatusReasonDeserializer.class)
|
||||
private EnumWrapper<TransactionStatusReason> transStatusReason;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = WhiteListStatusDeserializer.class)
|
||||
private EnumWrapper<WhiteListStatus> whiteListStatus;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = WhiteListStatusSourceDeserializer.class)
|
||||
private EnumWrapper<WhiteListStatusSource> whiteListStatusSource;
|
||||
@ToString.Include
|
||||
private String sdkTransID;
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
@ToString.Include
|
||||
private String dsTransID;
|
||||
@ToString.Include
|
||||
private String acsTransID;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.emvco;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rbkmoney.threeds.server.domain.ResultsStatus;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class RRes extends Message {
|
||||
|
||||
@ToString.Include
|
||||
private ResultsStatus resultsStatus;
|
||||
@ToString.Include
|
||||
private String sdkTransID;
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
@ToString.Include
|
||||
private String dsTransID;
|
||||
@ToString.Include
|
||||
private String acsTransID;
|
||||
private List<MessageExtension> messageExtension;
|
||||
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.proprietary;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.constraint.CustomValidation;
|
||||
import com.rbkmoney.threeds.server.domain.*;
|
||||
import com.rbkmoney.threeds.server.domain.account.AccountInfoWrapper;
|
||||
import com.rbkmoney.threeds.server.domain.account.AccountType;
|
||||
import com.rbkmoney.threeds.server.domain.device.DeviceChannel;
|
||||
import com.rbkmoney.threeds.server.domain.device.DeviceRenderOptionsWrapper;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageCategory;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.domain.threedsrequestor.*;
|
||||
import com.rbkmoney.threeds.server.domain.transaction.TransactionType;
|
||||
import com.rbkmoney.threeds.server.domain.unwrapped.Address;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatus;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatusSource;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.ListWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.TemporalAccessorWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* proprietary Authentication Request
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
@CustomValidation
|
||||
public class PArq extends Message {
|
||||
|
||||
private String acctNumber;
|
||||
private String cardExpiryDate;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = DeviceChannelDeserializer.class)
|
||||
private EnumWrapper<DeviceChannel> deviceChannel;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = MessageCategoryDeserializer.class)
|
||||
private EnumWrapper<MessageCategory> messageCategory;
|
||||
private String p_messageVersion;
|
||||
@ToString.Include
|
||||
private String threeDSRequestorID;
|
||||
@ToString.Include
|
||||
private String threeDSRequestorName;
|
||||
@ToString.Include
|
||||
private String threeDSRequestorURL;
|
||||
private String acquirerBIN;
|
||||
private String acquirerMerchantID;
|
||||
@JsonDeserialize(using = AddressMatchDeserializer.class)
|
||||
private EnumWrapper<AddressMatch> addrMatch;
|
||||
@JsonUnwrapped(prefix = "bill")
|
||||
private Address billingAddress;
|
||||
private String browserAcceptHeader;
|
||||
@JsonDeserialize(using = BrowserColorDepthDeserializer.class)
|
||||
private EnumWrapper<BrowserColorDepth> browserColorDepth;
|
||||
private String browserIP;
|
||||
private Boolean browserJavaEnabled;
|
||||
private String browserLanguage;
|
||||
private String browserScreenHeight;
|
||||
private String browserScreenWidth;
|
||||
private String browserTZ;
|
||||
private String browserUserAgent;
|
||||
private String cardholderName;
|
||||
private DeviceRenderOptionsWrapper deviceRenderOptions;
|
||||
private String email;
|
||||
private Phone homePhone;
|
||||
private String mcc;
|
||||
private String merchantCountryCode;
|
||||
private String merchantName;
|
||||
private Phone mobilePhone;
|
||||
private String purchaseAmount;
|
||||
private String purchaseCurrency;
|
||||
@JsonDeserialize(using = LocalDateTimeMinuteSecondDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDateTime> purchaseDate;
|
||||
private String purchaseExponent;
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDate> recurringExpiry;
|
||||
private String recurringFrequency;
|
||||
private String sdkAppID;
|
||||
private String sdkEncData;
|
||||
private Map<String, String> sdkEphemPubKey;
|
||||
private String sdkReferenceNumber;
|
||||
@ToString.Include
|
||||
private String sdkTransID;
|
||||
@JsonUnwrapped(prefix = "ship")
|
||||
private Address shippingAddress;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = TransactionTypeDeserializer.class)
|
||||
private EnumWrapper<TransactionType> transType;
|
||||
private Phone workPhone;
|
||||
private String acctID;
|
||||
private AccountInfoWrapper acctInfo;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = AccountTypeDeserializer.class)
|
||||
private EnumWrapper<AccountType> acctType;
|
||||
private MerchantRiskIndicatorWrapper merchantRiskIndicator;
|
||||
@JsonDeserialize(using = MessageExtensionDeserializer.class)
|
||||
private ListWrapper<MessageExtension> messageExtension;
|
||||
private Boolean payTokenInd;
|
||||
private String purchaseInstalData;
|
||||
private ThreeDSRequestorAuthenticationInfoWrapper threeDSRequestorAuthenticationInfo;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = ThreeDSRequestorChallengeIndDeserializer.class)
|
||||
private EnumWrapper<ThreeDSRequestorChallengeInd> threeDSRequestorChallengeInd;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = ThreeDSRequestorAuthenticationIndDeserializer.class)
|
||||
private EnumWrapper<ThreeDSRequestorAuthenticationInd> threeDSRequestorAuthenticationInd;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = ThreeRIIndDeserializer.class)
|
||||
private EnumWrapper<ThreeRIInd> threeRIInd;
|
||||
@ToString.Include
|
||||
private ThreeDSRequestorPriorAuthenticationInfoWrapper threeDSRequestorPriorAuthenticationInfo;
|
||||
private String threeDSServerRefNumber;
|
||||
private String threeDSServerOperatorID;
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
@ToString.Include
|
||||
private String threeDSServerURL;
|
||||
private Object broadInfo;
|
||||
private String notificationURL;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = ThreeDsMethodCompletionIndicatorDeserializer.class)
|
||||
private EnumWrapper<ThreeDsMethodCompletionIndicator> threeDSCompInd;
|
||||
@ToString.Include
|
||||
private String sdkMaxTimeout;
|
||||
private String acsURL;
|
||||
@ToString.Include
|
||||
private String threeDSRequestorDecMaxTime;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = ThreeDSRequestorDecReqIndDeserializer.class)
|
||||
private EnumWrapper<ThreeDSRequestorDecReqInd> threeDSRequestorDecReqInd;
|
||||
private Boolean browserJavascriptEnabled;
|
||||
@JsonDeserialize(using = PayTokenSourceDeserializer.class)
|
||||
private EnumWrapper<PayTokenSource> payTokenSource;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = WhiteListStatusDeserializer.class)
|
||||
private EnumWrapper<WhiteListStatus> whiteListStatus;
|
||||
@ToString.Include
|
||||
@JsonDeserialize(using = WhiteListStatusSourceDeserializer.class)
|
||||
private EnumWrapper<WhiteListStatusSource> whiteListStatusSource;
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.proprietary;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rbkmoney.threeds.server.domain.acs.AcsChallengeMandated;
|
||||
import com.rbkmoney.threeds.server.domain.acs.AcsDecConInd;
|
||||
import com.rbkmoney.threeds.server.domain.acs.AcsRenderingType;
|
||||
import com.rbkmoney.threeds.server.domain.authentication.AuthenticationType;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.domain.transaction.TransactionStatus;
|
||||
import com.rbkmoney.threeds.server.domain.transaction.TransactionStatusReason;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatus;
|
||||
import com.rbkmoney.threeds.server.domain.whitelist.WhiteListStatusSource;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* proprietary Authentication Response
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class PArs extends Message {
|
||||
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
private String p_messageVersion;
|
||||
@ToString.Include
|
||||
private TransactionStatus transStatus;
|
||||
private String dsReferenceNumber;
|
||||
private String acsReferenceNumber;
|
||||
@ToString.Include
|
||||
private String acsTransID;
|
||||
@ToString.Include
|
||||
private String dsTransID;
|
||||
private String authenticationValue;
|
||||
private AcsRenderingType acsRenderingType;
|
||||
private String acsOperatorID;
|
||||
private String acsSignedContent;
|
||||
private String acsURL;
|
||||
@ToString.Include
|
||||
private AuthenticationType authenticationType;
|
||||
@ToString.Include
|
||||
private AcsChallengeMandated acsChallengeMandated;
|
||||
private String eci;
|
||||
private List<MessageExtension> messageExtension;
|
||||
@ToString.Include
|
||||
private String sdkTransID;
|
||||
@ToString.Include
|
||||
private TransactionStatusReason transStatusReason;
|
||||
private String cardholderInfo;
|
||||
private Object broadInfo;
|
||||
private AcsDecConInd acsDecConInd;
|
||||
@ToString.Include
|
||||
private WhiteListStatus whiteListStatus;
|
||||
@ToString.Include
|
||||
private WhiteListStatusSource whiteListStatusSource;
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.proprietary;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.constraint.CustomValidation;
|
||||
import com.rbkmoney.threeds.server.domain.ChallengeWindowSize;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.ChallengeWindowSizeDeserializer;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* proprietary Get Challenge Request
|
||||
* класс - костыль для тестов, который изначально не правильно работает , по идее согласно тестовой спеки ,
|
||||
* он должен возвращать сразу лабе PGcs, и там плюс должен быть сформированный html с кодированным CReq.
|
||||
* но тест при такой реализации валился с их стороны хуй знает почему.
|
||||
* но когда я стал отправлять этот PGcs в DS (DS не принимает изначально такой тип сообщения), DS стал возвращать Erro (что логично),
|
||||
* который 3дс потом редиректит лабе и тест успешно завершался, поэтому я оставил все как есть.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
@CustomValidation
|
||||
public class PGcq extends Message {
|
||||
|
||||
private String p_messageVersion;
|
||||
private String threeDSServerTransID;
|
||||
private String acsTransID;
|
||||
private String threeDSSessionData;
|
||||
@JsonDeserialize(using = ChallengeWindowSizeDeserializer.class)
|
||||
private EnumWrapper<ChallengeWindowSize> challengeWindowSize;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.proprietary;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* proprietary Get Challenge Response
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class PGcs extends Message {
|
||||
|
||||
private String p_messageVersion;
|
||||
private String htmlCreq;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.proprietary;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.constraint.CustomValidation;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.serialization.ListWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.MessageExtensionDeserializer;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* proprietary Preparation Request
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
@CustomValidation
|
||||
public class PPrq extends Message {
|
||||
|
||||
private String p_messageVersion;
|
||||
@ToString.Include
|
||||
private String threeDSRequestorID;
|
||||
@ToString.Include
|
||||
private String threeDSServerTransID;
|
||||
private String threeDSRequestorURL;
|
||||
@JsonDeserialize(using = MessageExtensionDeserializer.class)
|
||||
private ListWrapper<MessageExtension> messageExtension;
|
||||
|
||||
@ToString.Include
|
||||
private String threeDSServerOperatorID;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.rbkmoney.threeds.server.domain.root.proprietary;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageExtension;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* proprietary Preparation Response
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class PPrs extends Message {
|
||||
|
||||
private String p_messageVersion;
|
||||
private Boolean p_completed;
|
||||
private List<MessageExtension> messageExtension;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.rbkmoney.threeds.server.domain.sdk;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* SDK Interface.
|
||||
* Lists all of the SDK Interface types that the device supports for
|
||||
* displaying specific challenge user interfaces within the SDK.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum SdkInterface implements Valuable {
|
||||
|
||||
NATIVE("01"),
|
||||
|
||||
HTML("02"),
|
||||
|
||||
BOTH("03");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.rbkmoney.threeds.server.domain.sdk;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* SDK UI Type
|
||||
* Lists all UI types that the device supports for displaying specific
|
||||
* challenge user interfaces within the SDK.
|
||||
* Valid enumValues for each Interface:
|
||||
* • Native UI = 01–04
|
||||
* • HTML UI = 01–05
|
||||
* Note: Currently, all SDKs need to support all UI Types. In the
|
||||
* future, however, this may change (for example, smart watches
|
||||
* may support a UI Type not yet defined by this specification).
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: Array of String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum SdkUiType implements Valuable {
|
||||
|
||||
TEXT("01"),
|
||||
|
||||
SINGLE_SELECT("02"),
|
||||
|
||||
MULTI_SELECT("03"),
|
||||
|
||||
OOB("04"),
|
||||
|
||||
HTML_OTHER("05");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.rbkmoney.threeds.server.domain.ship;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Shipping Address Usage Indicator
|
||||
* Indicates when the shipping address used for this transaction was first used with the 3DS Requestor.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ShipAddressUsageInd implements Valuable {
|
||||
|
||||
THIS_TRANSACTION("01"),
|
||||
|
||||
LESS_THEN_30_DAYS("02"),
|
||||
|
||||
FROM_30_TO_60_DAYS("03"),
|
||||
|
||||
MORE_THAN_60_DAYS("04");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.rbkmoney.threeds.server.domain.ship;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Shipping Indicator
|
||||
* Indicates shipping method chosen for the transaction.
|
||||
* Merchants must choose the Shipping Indicator code that most
|
||||
* accurately describes the cardholder’s specific transaction, not
|
||||
* their general business.
|
||||
* If one or more items are included in the sale, use the Shipping
|
||||
* Indicator code for the physical goods, or if all digital goods,
|
||||
* use the Shipping Indicator code that describes the most
|
||||
* expensive item.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ShipIndicator implements Valuable {
|
||||
|
||||
CARDHOLDER_BILLING_ADDRESS("01"),
|
||||
|
||||
ANOTHER_VERIFIED_ADDRESS("02"),
|
||||
|
||||
DIFFERENT_FROM_CARDHOLDER_BILLING_ADDRESS("03"),
|
||||
|
||||
SHIP_TO_STORE("04"),
|
||||
|
||||
DIGITAL_GOODS("05"),
|
||||
|
||||
TRAVEL_AND_EVENT_NOT_SHIPPED("06"),
|
||||
|
||||
OTHER_NOT_SHIPPED("07");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.rbkmoney.threeds.server.domain.ship;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Shipping Name Indicator
|
||||
* Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ShipNameIndicator implements Valuable {
|
||||
|
||||
ACCOUNT_NAME_IDENTICAL("01"),
|
||||
|
||||
ACCOUNT_NAME_DIFFERENT("02");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Authentication Method
|
||||
* Mechanism used by the Cardholder to authenticate to the 3DS Requestor.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ThreeDSReqAuthMethod implements Valuable {
|
||||
|
||||
NO_AUTH_OCCURED("01"),
|
||||
|
||||
REQUESTOR_CREDENTIALS("02"),
|
||||
|
||||
FEDERATED_ID("03"),
|
||||
|
||||
ISSUER_CREDENTIALS("04"),
|
||||
|
||||
THIRD_PARTY_AUTH("05"),
|
||||
|
||||
FIDO_AUTH_UNSIGNED("06"),
|
||||
|
||||
FIDO_AUTH_SIGNED("07"),
|
||||
|
||||
SRC_ASSURANCE("08");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Authentication Method Verification Indicator
|
||||
* Value that represents the signature verification performed by the DS on the mechanism
|
||||
* (e.g., FIDO) used by the cardholder to authenticate to the 3DS Requestor.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ThreeDSReqAuthMethodInd {
|
||||
|
||||
VERIFIED("01"),
|
||||
|
||||
FAILED("02"),
|
||||
|
||||
NOT_PERFORMED("03");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Prior Transaction Authentication Method
|
||||
* <p>
|
||||
* Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ThreeDSReqPriorAuthMethod implements Valuable {
|
||||
|
||||
FRICTIONLESS_AUTH_OCCURED("01"),
|
||||
|
||||
CARDHOLDER_CHALLENGE_OCCURED("02"),
|
||||
|
||||
AVS_VERIFIED("03"),
|
||||
|
||||
OTHER_METHODS("04");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Authentication Indicator
|
||||
* <p>
|
||||
* Indicates the type of Authentication request.
|
||||
* This data element provides additional information to the ACS to determine the best
|
||||
* approach for handing an authentication request.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ThreeDSRequestorAuthenticationInd implements Valuable {
|
||||
|
||||
PAYMENT_TRANSACTION("01"),
|
||||
|
||||
RECURRING_TRANSACTION("02"),
|
||||
|
||||
INSTALMENT_TRANSACTION("03"),
|
||||
|
||||
ADD_CARD("04"),
|
||||
|
||||
MAINTAIN_CARD("05"),
|
||||
|
||||
CARDHOLDER_VERIFICATION("06");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Authentication Information
|
||||
* Information about how the 3DS Requestor authenticated the cardholder
|
||||
* before or during the transaction.
|
||||
* <p>
|
||||
* Length: Variable
|
||||
* <p>
|
||||
* JSON Data Type: Object
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class ThreeDSRequestorAuthenticationInfo {
|
||||
|
||||
private ThreeDSReqAuthMethod threeDSReqAuthMethod;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMddHHmm")
|
||||
private LocalDateTime threeDSReqAuthTimestamp;
|
||||
private String threeDSReqAuthData;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.TemporalAccessorWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.LocalDateTimeMinuteDeserializer;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.ThreeDSReqAuthMethodDeserializer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Authentication Information
|
||||
* Information about how the 3DS Requestor authenticated the cardholder
|
||||
* before or during the transaction.
|
||||
* <p>
|
||||
* Length: Variable
|
||||
* <p>
|
||||
* JSON Data Type: Object
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class ThreeDSRequestorAuthenticationInfoWrapper {
|
||||
|
||||
@JsonDeserialize(using = ThreeDSReqAuthMethodDeserializer.class)
|
||||
private EnumWrapper<ThreeDSReqAuthMethod> threeDSReqAuthMethod;
|
||||
@JsonDeserialize(using = LocalDateTimeMinuteDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDateTime> threeDSReqAuthTimestamp;
|
||||
private String threeDSReqAuthData;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Challenge Indicator
|
||||
* Indicates whether a challenge is requested for this transaction.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ThreeDSRequestorChallengeInd implements Valuable {
|
||||
|
||||
NO_PREFERENCE("01"), //default
|
||||
|
||||
NO_CHALLENGE("02"),
|
||||
|
||||
CHALLENGE_REQUESTED_BY_REQUESTOR("03"),
|
||||
|
||||
CHALLENGE_REQUESTED_MANDATE("04"),
|
||||
|
||||
NO_CHALLENGE_RISK_ANALYSIS_PERFORMED("05"),
|
||||
|
||||
NO_CHALLENGE_DATA_SHARE_ONLY("06"),
|
||||
|
||||
NO_CHALLENGE_AUTH_ALREADY_PERFORMED("07"),
|
||||
|
||||
NO_CHALLENGE_UTILISE_WHITELIST_EXEMPTION("08"),
|
||||
|
||||
CHALLENGE_REQUESTED_WHITELIST_PROMPT_REQUESTED("09");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public boolean isReservedValueForNotRelevantMessageVersion() {
|
||||
return value.equals(NO_CHALLENGE_RISK_ANALYSIS_PERFORMED.getValue())
|
||||
|| value.equals(NO_CHALLENGE_DATA_SHARE_ONLY.getValue())
|
||||
|| value.equals(NO_CHALLENGE_AUTH_ALREADY_PERFORMED.getValue())
|
||||
|| value.equals(NO_CHALLENGE_UTILISE_WHITELIST_EXEMPTION.getValue())
|
||||
|| value.equals(CHALLENGE_REQUESTED_WHITELIST_PROMPT_REQUESTED.getValue());
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Decoupled Request Indicator
|
||||
* Indicates whether the 3DS Requestor requests the ACS to utilise Decoupled Authentication and agrees
|
||||
* to utilise Decoupled Authentication if the ACS confirms its use.
|
||||
* <p>
|
||||
* Length: 1 character
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ThreeDSRequestorDecReqInd implements Valuable {
|
||||
|
||||
DECOUPLED_AUTH_IS_PREFFERED("Y"),
|
||||
|
||||
DO_NOT_USE_DECOUPLED_AUTH("N"); //default
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Prior Transaction Authentication Information
|
||||
* Information about how the 3DS Requestor authenticated the cardholder as part of a previous 3DS transaction.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class ThreeDSRequestorPriorAuthenticationInfo {
|
||||
|
||||
private String threeDSReqPriorAuthData;
|
||||
private ThreeDSReqPriorAuthMethod threeDSReqPriorAuthMethod;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMddHHmm")
|
||||
private LocalDateTime threeDSReqPriorAuthTimestamp;
|
||||
private String threeDSReqPriorRef;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.rbkmoney.threeds.server.serialization.EnumWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.TemporalAccessorWrapper;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.LocalDateTimeMinuteDeserializer;
|
||||
import com.rbkmoney.threeds.server.serialization.deserializer.ThreeDSReqPriorAuthMethodDeserializer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 3DS Requestor Prior Transaction Authentication Information
|
||||
* Information about how the 3DS Requestor authenticated the cardholder as part of a previous 3DS transaction.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class ThreeDSRequestorPriorAuthenticationInfoWrapper {
|
||||
|
||||
private String threeDSReqPriorAuthData;
|
||||
@JsonDeserialize(using = ThreeDSReqPriorAuthMethodDeserializer.class)
|
||||
private EnumWrapper<ThreeDSReqPriorAuthMethod> threeDSReqPriorAuthMethod;
|
||||
@JsonDeserialize(using = LocalDateTimeMinuteDeserializer.class)
|
||||
private TemporalAccessorWrapper<LocalDateTime> threeDSReqPriorAuthTimestamp;
|
||||
private String threeDSReqPriorRef;
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 3DS Method Completion Indicator
|
||||
* Indicates whether the 3DS Method successfully completed.
|
||||
* <p>
|
||||
* Length: 1 character
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
* <p>
|
||||
* Values accepted:
|
||||
* •
|
||||
* •
|
||||
* •
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ThreeDsMethodCompletionIndicator implements Valuable {
|
||||
|
||||
SUCCESSFULLY_COMPLETED("Y"),
|
||||
|
||||
FAILED("N"),
|
||||
|
||||
UNKNOWN("U");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.rbkmoney.threeds.server.domain.threedsrequestor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 3RI Indicator.
|
||||
* Indicates the type of 3RI request.
|
||||
* This data element provides additional information to the ACS
|
||||
* to determine the best approach for handing a 3RI request.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum ThreeRIInd implements Valuable {
|
||||
|
||||
RECURRING_TRANSACTION("01"),
|
||||
|
||||
INSTALMENT_TRANSACTION("02"),
|
||||
|
||||
ADD_CARD("03"),
|
||||
|
||||
MAINTAIN_CARD_INFO("04"),
|
||||
|
||||
ACCOUNT_VERIFICATION("05"),
|
||||
|
||||
SPLIT_OR_DELAYED_SHIPMENT("06"),
|
||||
|
||||
TOP_UP("07"),
|
||||
|
||||
MAIL_ORDER("08"),
|
||||
|
||||
TELEPHONE_ORDER("09"),
|
||||
|
||||
WHITELIST_STATUS_CHECK("10"),
|
||||
|
||||
OTHER_PAYMENT("11");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public boolean isReservedValueForNotRelevantMessageVersion() {
|
||||
return value.equals(SPLIT_OR_DELAYED_SHIPMENT.getValue())
|
||||
|| value.equals(TOP_UP.getValue())
|
||||
|| value.equals(MAIL_ORDER.getValue())
|
||||
|| value.equals(TELEPHONE_ORDER.getValue())
|
||||
|| value.equals(WHITELIST_STATUS_CHECK.getValue())
|
||||
|| value.equals(OTHER_PAYMENT.getValue());
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.rbkmoney.threeds.server.domain.transaction;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Indicates whether a transaction qualifies as an authenticated transaction or account verification.
|
||||
* Note: The Final CRes message can contain only a value of Y or N.
|
||||
* Note: If the 3DS Requestor Challenge Indicator = 06 (No challenge requested; Data share only),
|
||||
* then a Transaction Status of C is not valid.
|
||||
* <p>
|
||||
* Length: 1 character
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum TransactionStatus implements Valuable {
|
||||
|
||||
AUTHENTICATION_VERIFICATION_SUCCESSFUL("Y"),
|
||||
|
||||
NOT_AUTHENTICATED_DENIED("N"),
|
||||
|
||||
TECHNICAL_PROBLEM("U"),
|
||||
|
||||
NOT_AUTHENTICATED_ATTEMPTS_PERFORMED("A"),
|
||||
|
||||
CHALLENGE_REQUIRED("C"),
|
||||
|
||||
CHALLENGE_REQUIRED_DECOUPLED_AUTH("D"),
|
||||
|
||||
AUTHENTICATION_REJECTED("R"),
|
||||
|
||||
INFORMATIONAL_ONLY("I");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.rbkmoney.threeds.server.domain.transaction;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Transaction Status Reason
|
||||
* Provides information on why the Transaction Status field has the specified value.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum TransactionStatusReason implements Valuable {
|
||||
|
||||
CARD_AUTH_FAILED("01"),
|
||||
|
||||
UNKNOWN_DEVICE("02"),
|
||||
|
||||
UNSUPPORTED_DEVICE("03"),
|
||||
|
||||
EXCEEDS_AUTH_FREQUENCY_LIMIT("04"),
|
||||
|
||||
EXPIRED_CARD("05"),
|
||||
|
||||
INVALID_CARD_NUMBER("06"),
|
||||
|
||||
INVALID_TRANSACTION("07"),
|
||||
|
||||
NO_CARD_RECORD("08"),
|
||||
|
||||
SECURITY_FAILURE("09"),
|
||||
|
||||
STOLEN_CARD("10"),
|
||||
|
||||
SUSPECTED_FRAUD("11"),
|
||||
|
||||
TRANSACTION_NOT_PERMITTED("12"),
|
||||
|
||||
CARDHOLDER_NOT_ENROLLED("13"),
|
||||
|
||||
TRANSACTION_TIMED_OUT_AT_ACS("14"),
|
||||
|
||||
LOW_CONFIDENCE("15"),
|
||||
|
||||
MEDIUM_CONFIDENCE("16"),
|
||||
|
||||
HIGH_CONFIDENCE("17"),
|
||||
|
||||
VERY_HIGH_CONFIDENCE("18"),
|
||||
|
||||
EXCEEDS_ACS_MAXIMUM_CHALLENGES("19"),
|
||||
|
||||
NON_PAYMENT_TRANSACTION_NOT_SUPPORTED("20"),
|
||||
|
||||
THREE_RI_TRANSACTION_NOT_SUPPORTED("21"),
|
||||
|
||||
ACS_TECHNICAL_ISSUE("22"),
|
||||
|
||||
DECOUPLED_AUTH_REQUIRED_BUT_NOT_REQUESTED("23"),
|
||||
|
||||
REQUESTOR_DECOUPLED_MAX_EXPIRY_TIME_EXCEEDED("24"),
|
||||
|
||||
INSUFFITIENT_TIME_DECOUPLED_AUTH("25"),
|
||||
|
||||
AUTH_ATTEMPTED_BUT_NOT_PERFORMED("26");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public boolean isReservedValueForNotRelevantMessageVersion() {
|
||||
return value.equals(ACS_TECHNICAL_ISSUE.getValue())
|
||||
|| value.equals(DECOUPLED_AUTH_REQUIRED_BUT_NOT_REQUESTED.getValue())
|
||||
|| value.equals(REQUESTOR_DECOUPLED_MAX_EXPIRY_TIME_EXCEEDED.getValue())
|
||||
|| value.equals(INSUFFITIENT_TIME_DECOUPLED_AUTH.getValue())
|
||||
|| value.equals(AUTH_ATTEMPTED_BUT_NOT_PERFORMED.getValue());
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.rbkmoney.threeds.server.domain.transaction;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Transaction Type
|
||||
* Identifies the type of transaction being authenticated.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
* <p>
|
||||
* Values derived from the 8583 ISO Standard.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum TransactionType implements Valuable {
|
||||
|
||||
GOODS_OR_SERVICE_PURCHASE("01"),
|
||||
|
||||
CHECK_ACCEPTANCE("03"),
|
||||
|
||||
ACCOUNT_FUNDING("10"),
|
||||
|
||||
QUASI_CASH_TRANSACTION("11"),
|
||||
|
||||
PREPAID_ACTIVATION_AND_LOAD("28");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.rbkmoney.threeds.server.domain.unwrapped;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Aggregate class for Address information.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
public class Address {
|
||||
|
||||
@JsonProperty("AddrCity")
|
||||
private String addrCity;
|
||||
@JsonProperty("AddrCountry")
|
||||
private String addrCountry;
|
||||
@JsonProperty("AddrLine1")
|
||||
private String addrLine1;
|
||||
@JsonProperty("AddrLine2")
|
||||
private String addrLine2;
|
||||
@JsonProperty("AddrLine3")
|
||||
private String addrLine3;
|
||||
@JsonProperty("AddrPostCode")
|
||||
private String addrPostCode;
|
||||
@JsonProperty("AddrState")
|
||||
private String addrState;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.rbkmoney.threeds.server.domain.whitelist;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Whitelist Status
|
||||
* Enables the communication of trusted
|
||||
* beneficiary/whitelist status between the ACS, the DS and the 3DS Requestor.
|
||||
* <p>
|
||||
* Length: 1 character
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum WhiteListStatus implements Valuable {
|
||||
|
||||
WHITELISTED("Y"),
|
||||
|
||||
NOT_WHITELISTED("N"),
|
||||
|
||||
NOT_ELIGIBLE("E"),
|
||||
|
||||
PENDING("P"),
|
||||
|
||||
REJECTED("R"),
|
||||
|
||||
UNKNOWN("U");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.rbkmoney.threeds.server.domain.whitelist;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.rbkmoney.threeds.server.domain.Valuable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Whitelist Status Source
|
||||
* This data element will be populated by the system setting Whitelist Status.
|
||||
* <p>
|
||||
* Length: 2 characters
|
||||
* <p>
|
||||
* JSON Data Type: String
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum WhiteListStatusSource implements Valuable {
|
||||
|
||||
THREE_DS_SERVER("01"),
|
||||
|
||||
DS("02"),
|
||||
|
||||
ACS("03");
|
||||
|
||||
private final String value;
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.rbkmoney.threeds.server.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum ConstraintType {
|
||||
|
||||
AUTH_DEC_TIME_IS_EXPIRED("AuthDecTimeIsExpired"),
|
||||
OUT_OF_CARD_RANGE("OutOfCardRange"),
|
||||
NOT_NULL("NotNull"),
|
||||
NOT_BLANK("NotBlank"),
|
||||
PATTERN("Pattern"),
|
||||
ID_NOT_RECOGNISED("IdNotRecognised"),
|
||||
CRITICAL_MESSAGE_EXTENSION_NOT_RECOGNISED("CriticalMessageExtensionNotRecognised");
|
||||
|
||||
private final String value;
|
||||
|
||||
public static ConstraintType of(String value) {
|
||||
for (ConstraintType t : ConstraintType.values()) {
|
||||
if (value.equals(t.value)) return t;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Unknown constraint type: " + value);
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.rbkmoney.threeds.server.dto;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class ConstraintValidationResult {
|
||||
|
||||
private boolean isValid;
|
||||
|
||||
private ConstraintType constraintType;
|
||||
|
||||
private String fieldName;
|
||||
|
||||
public static ConstraintValidationResult success() {
|
||||
ConstraintValidationResult constraintValidationResult = new ConstraintValidationResult();
|
||||
constraintValidationResult.setValid(true);
|
||||
return constraintValidationResult;
|
||||
}
|
||||
|
||||
public static ConstraintValidationResult failure(ConstraintType constraintType, String fieldName) {
|
||||
ConstraintValidationResult constraintValidationResult = new ConstraintValidationResult();
|
||||
constraintValidationResult.setValid(false);
|
||||
constraintValidationResult.setConstraintType(constraintType);
|
||||
constraintValidationResult.setFieldName(fieldName);
|
||||
return constraintValidationResult;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.rbkmoney.threeds.server.handle;
|
||||
|
||||
public interface Handler<T, R> {
|
||||
|
||||
boolean canHandle(T o);
|
||||
|
||||
R handle(T o);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user