feature/added new connector method validateChallengeAnswer2- step2

This commit is contained in:
Hongwei 2024-07-01 13:39:49 +02:00
parent b2ee741e59
commit 867e15b78d
6 changed files with 16 additions and 11 deletions

View File

@ -79,7 +79,7 @@ import code.endpointMapping.{EndpointMappingProvider, EndpointMappingT}
import code.endpointTag.EndpointTagT
import code.util.Helper.MdcLoggable
import code.views.system.AccountAccess
import com.openbankproject.commons.model.enums.SuppliedAnswerType.SuppliedAnswerType
import com.openbankproject.commons.model.enums.SuppliedAnswerType
import net.liftweb.mapper.By
object NewStyle extends MdcLoggable{
@ -1302,7 +1302,7 @@ object NewStyle extends MdcLoggable{
}
}
def validateChallengeAnswer(challengeId: String, suppliedAnswer: String, suppliedAnswerType:SuppliedAnswerType, callContext: Option[CallContext]): OBPReturnType[Boolean] =
def validateChallengeAnswer(challengeId: String, suppliedAnswer: String, suppliedAnswerType:SuppliedAnswerType.Value, callContext: Option[CallContext]): OBPReturnType[Boolean] =
Connector.connector.vend.validateChallengeAnswerV2(challengeId, suppliedAnswer, suppliedAnswerType, callContext) map { i =>
(unboxFullOrFail(i._1, callContext, s"${
InvalidChallengeAnswer
@ -1331,6 +1331,7 @@ object NewStyle extends MdcLoggable{
(unboxFullOrFail(i._1, callContext, s"$InvalidConnectorResponse() "), i._2)
}
//At moment this method is used for Berlin Group Payments
def validateChallengeAnswerC2(
challengeType: ChallengeType.Value,
transactionRequestId: Option[String],
@ -1359,6 +1360,8 @@ object NewStyle extends MdcLoggable{
}
}
}
//At moment this method is used for Berlin Group SigningBasketsApi.scala
def validateChallengeAnswerC3(
challengeType: ChallengeType.Value,
transactionRequestId: Option[String],

View File

@ -41,7 +41,7 @@ import com.openbankproject.commons.ExecutionContext.Implicits.global
import com.openbankproject.commons.dto.{CustomerAndAttribute, GetProductsParam, InBoundTrait, ProductCollectionItemsTree}
import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA
import com.openbankproject.commons.model.enums.StrongCustomerAuthenticationStatus.SCAStatus
import com.openbankproject.commons.model.enums.SuppliedAnswerType.SuppliedAnswerType
import com.openbankproject.commons.model.enums.SuppliedAnswerType
import com.openbankproject.commons.model.enums._
import com.openbankproject.commons.model.{AccountApplication, Bank, CounterpartyTrait, CustomerAddress, DirectDebitTrait, FXRate, Product, ProductCollection, ProductCollectionItem, TaxResidence, TransactionRequestStatus, TransactionRequestTypeCharge, UserAuthContext, UserAuthContextUpdate, _}
import com.openbankproject.commons.util.Functions.lazyValue
@ -438,7 +438,7 @@ trait Connector extends MdcLoggable {
@deprecated("Please use @validateChallengeAnswerV2 instead ","01.07.2024")
def validateChallengeAnswer(challengeId: String, hashOfSuppliedAnswer: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Full(true), callContext)}
def validateChallengeAnswerV2(challengeId: String, suppliedAnswer: String, suppliedAnswerType:SuppliedAnswerType, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Full(true), callContext)}
def validateChallengeAnswerV2(challengeId: String, suppliedAnswer: String, suppliedAnswerType:SuppliedAnswerType.Value, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future{(Full(true), callContext)}
def allChallengesSuccessfullyAnswered(
bankId: BankId,

View File

@ -373,6 +373,7 @@ object ConnectorBuilderUtil {
"validateAndCheckIbanNumber",
"validateChallengeAnswerC2",
"validateChallengeAnswerC3",
"validateChallengeAnswerV2",
"getCounterpartyByIbanAndBankAccountId",
).distinct

View File

@ -80,7 +80,7 @@ import com.openbankproject.commons.model.enums.ChallengeType.OBP_TRANSACTION_REQ
import com.openbankproject.commons.model.enums.DynamicEntityOperation._
import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA
import com.openbankproject.commons.model.enums.StrongCustomerAuthenticationStatus.SCAStatus
import com.openbankproject.commons.model.enums.SuppliedAnswerType.SuppliedAnswerType
import com.openbankproject.commons.model.enums.SuppliedAnswerType
import com.openbankproject.commons.model.enums.{TransactionRequestStatus, _}
import com.openbankproject.commons.model.{AccountApplication, AccountAttribute, ConsentImplicitSCAT, DirectDebitTrait, FXRate, Product, ProductAttribute, ProductCollectionItem, TaxResidence, TransactionRequestCommonBodyJSON, _}
import com.tesobe.CacheKeyFromArguments

View File

@ -27,9 +27,10 @@ TESOBE (http://www.tesobe.com/)
package com.openbankproject.commons.dto
import java.util.Date
import com.openbankproject.commons.model.enums.{CardAttributeType, ChallengeType, CustomerAttributeType, DynamicEntityOperation, StrongCustomerAuthentication, TransactionAttributeType, TransactionRequestStatus}
import com.openbankproject.commons.model.enums.{CardAttributeType, ChallengeType, CustomerAttributeType, DynamicEntityOperation, StrongCustomerAuthentication, SuppliedAnswerType, TransactionAttributeType, TransactionRequestStatus}
import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA
import com.openbankproject.commons.model.enums.StrongCustomerAuthenticationStatus.SCAStatus
import com.openbankproject.commons.model.enums.SuppliedAnswerType
import com.openbankproject.commons.model.{enums, _}
import net.liftweb.json.{JObject, JValue}
@ -863,7 +864,7 @@ case class InBoundValidateChallengeAnswer(inboundAdapterCallContext: InboundAdap
case class OutBoundValidateChallengeAnswerV2(outboundAdapterCallContext: OutboundAdapterCallContext,
challengeId: String,
suppliedAnswer: String,
suppliedAnswerType: String) extends TopicTrait
suppliedAnswerType: SuppliedAnswerType) extends TopicTrait
case class InBoundValidateChallengeAnswerV2(inboundAdapterCallContext: InboundAdapterCallContext,
status: Status,

View File

@ -229,10 +229,10 @@ object AttributeCategory extends OBPEnumeration[AttributeCategory]{
object TransactionRequest extends Value
}
object SuppliedAnswerType extends Enumeration {
type SuppliedAnswerType = Value
val PLAIN_TEXT_VALUE, HASH_VALUE = Value
sealed trait SuppliedAnswerType extends EnumValue
object SuppliedAnswerType extends OBPEnumeration[SuppliedAnswerType]{
object PLAIN_TEXT_VALUE extends Value
object HASH_VALUE extends Value
}