mirror of
https://github.com/valitydev/three-ds-server-domain-lib.git
synced 2024-11-06 00:05:19 +00:00
add MessageTypeUtils (#19)
This commit is contained in:
parent
a7b8260081
commit
a8a467ef14
2
pom.xml
2
pom.xml
@ -12,7 +12,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<artifactId>three-ds-server-domain-lib</artifactId>
|
||||
<version>1.1.7</version>
|
||||
<version>1.1.8</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
@ -0,0 +1,73 @@
|
||||
package com.rbkmoney.threeds.server.utils;
|
||||
|
||||
import com.rbkmoney.threeds.server.domain.message.MessageType;
|
||||
import com.rbkmoney.threeds.server.domain.root.Message;
|
||||
import com.rbkmoney.threeds.server.domain.root.emvco.*;
|
||||
import com.rbkmoney.threeds.server.domain.root.proprietary.*;
|
||||
import com.rbkmoney.threeds.server.domain.root.rbkmoney.*;
|
||||
|
||||
public class MessageTypeUtils {
|
||||
|
||||
public static MessageType resolve(Message message) {
|
||||
Class<? extends Message> aClass = message.getClass();
|
||||
if (aClass.equals(ErroWrapper.class) || aClass.equals(Erro.class)) {
|
||||
return MessageType.ERRO;
|
||||
}
|
||||
if (aClass.equals(AReq.class)) {
|
||||
return MessageType.AREQ;
|
||||
}
|
||||
if (aClass.equals(ARes.class)) {
|
||||
return MessageType.ARES;
|
||||
}
|
||||
if (aClass.equals(PReq.class)) {
|
||||
return MessageType.PREQ;
|
||||
}
|
||||
if (aClass.equals(PRes.class)) {
|
||||
return MessageType.PRES;
|
||||
}
|
||||
if (aClass.equals(RReq.class)) {
|
||||
return MessageType.RREQ;
|
||||
}
|
||||
if (aClass.equals(RRes.class)) {
|
||||
return MessageType.RRES;
|
||||
}
|
||||
if (aClass.equals(PArq.class)) {
|
||||
return MessageType.PARQ;
|
||||
}
|
||||
if (aClass.equals(PArs.class)) {
|
||||
return MessageType.PARS;
|
||||
}
|
||||
if (aClass.equals(PGcq.class)) {
|
||||
return MessageType.PGCQ;
|
||||
}
|
||||
if (aClass.equals(PGcs.class)) {
|
||||
return MessageType.PGCS;
|
||||
}
|
||||
if (aClass.equals(PPrq.class)) {
|
||||
return MessageType.PPRQ;
|
||||
}
|
||||
if (aClass.equals(PPrs.class)) {
|
||||
return MessageType.PPRS;
|
||||
}
|
||||
if (aClass.equals(RBKMoneyAuthenticationRequest.class)) {
|
||||
return MessageType.RBKMONEY_AUTHENTICATION_REQUEST;
|
||||
}
|
||||
if (aClass.equals(RBKMoneyAuthenticationResponse.class)) {
|
||||
return MessageType.RBKMONEY_AUTHENTICATION_RESPONSE;
|
||||
}
|
||||
if (aClass.equals(RBKMoneyPreparationRequest.class)) {
|
||||
return MessageType.RBKMONEY_PREPARATION_REQUEST;
|
||||
}
|
||||
if (aClass.equals(RBKMoneyPreparationResponse.class)) {
|
||||
return MessageType.RBKMONEY_PREPARATION_RESPONSE;
|
||||
}
|
||||
if (aClass.equals(RBKMoneyGetChallengeRequest.class)) {
|
||||
return MessageType.RBKMONEY_GET_CHALLENGE_REQUEST;
|
||||
}
|
||||
if (aClass.equals(RBKMoneyGetChallengeResponse.class)) {
|
||||
return MessageType.RBKMONEY_GET_CHALLENGE_RESPONSE;
|
||||
}
|
||||
|
||||
return MessageType.UNKN;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user