From b22a17c97e212b3b0d894a93e6ea080449a192ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Tue, 18 Oct 2022 10:56:42 +0200 Subject: [PATCH] feature/Tweak endpoint createConsentByConsentRequestId v5.0.0 --- obp-api/src/main/scala/code/api/util/ErrorMessages.scala | 2 +- obp-api/src/main/scala/code/api/v5_0_0/APIMethods500.scala | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala index 1f41db8ca..ce18256f4 100644 --- a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala +++ b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala @@ -499,7 +499,7 @@ object ErrorMessages { val ConsentUserCannotBeAdded = "OBP-35026: The Consent's User cannot be added." val ConsentUserAuthContextCannotBeAdded = "OBP-35027: The Consent's User Auth Context cannot be added." val ConsentRequestNotFound = "OBP-35028: Consent Request not found by CONSENT_REQUEST_ID. " - val ConsentRequestAlreadyUsed = "OBP-35029: The CONSENT_REQUEST_ID is used to create Consent. " + val ConsentRequestIsInvalid = "OBP-35029: The CONSENT_REQUEST_ID is invalid. " //Authorisations val AuthorisationNotFound = "OBP-36001: Authorisation not found. Please specify valid values for PAYMENT_ID and AUTHORISATION_ID. " diff --git a/obp-api/src/main/scala/code/api/v5_0_0/APIMethods500.scala b/obp-api/src/main/scala/code/api/v5_0_0/APIMethods500.scala index cb7551caa..6f6f04507 100644 --- a/obp-api/src/main/scala/code/api/v5_0_0/APIMethods500.scala +++ b/obp-api/src/main/scala/code/api/v5_0_0/APIMethods500.scala @@ -761,6 +761,7 @@ trait APIMethods500 { UserNotLoggedIn, $BankNotFound, InvalidJsonFormat, + ConsentRequestIsInvalid, ConsentAllowedScaMethods, RolesAllowedInConsent, ViewsAllowedInConsent, @@ -786,7 +787,7 @@ trait APIMethods500 { )) map { i => unboxFullOrFail(i,callContext, ConsentRequestNotFound) } - _ <- Helper.booleanToFuture(ConsentRequestAlreadyUsed, cc=callContext){ + _ <- Helper.booleanToFuture(ConsentRequestIsInvalid, cc=callContext){ Consents.consentProvider.vend.getConsentByConsentRequestId(consentRequestId).isEmpty } _ <- Helper.booleanToFuture(ConsentAllowedScaMethods, cc=callContext){