Merge pull request #1374 from constantine2nd/develop

PSD2 roles
This commit is contained in:
Simon Redfern 2019-07-10 12:44:07 +02:00 committed by GitHub
commit c38216b6b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 2 deletions

View File

@ -2621,9 +2621,23 @@ Returns a string showed to the developer
else
first+ "***" + "***" + second
}
/**
* This endpoint returns BIC on an bank according to next rules:
* 1st try - Inspect bank routing
* 2nd ry - get deprecated field "swiftBic"
* @param bankId The BANK_ID specified at an endpoint's path
* @return BIC of the Bank
*/
def getBicFromBankId(bankId: String)= {
Connector.connector.vend.getBankLegacy(BankId(bankId), None).map(_._1.swiftBic).getOrElse("")
Connector.connector.vend.getBankLegacy(BankId(bankId), None) match {
case Full((bank, _)) =>
bank.bankRoutingScheme match {
case "BIC" => bank.bankRoutingAddress
case _ => bank.swiftBic
}
case _ => ""
}
}
/**

View File

@ -308,6 +308,7 @@ object ErrorMessages {
val ConsentAllowedScaMethods = "OBP-35009: Only SMS and EMAIL are supported as SCA methods. "
val SmsServerNotResponding = "OBP-35010: SMS server is not working or SMS server can not send the message to the phone number: "
val AuthorizationNotFound = "OBP-35011: Resource identification of the related Consent authorisation sub-resource not found by AUTHORIZATION_ID. "
val ConsentAlreadyRevoked = "OBP-35012: Consent is already revoked. "
//Authorisations
val AuthorisationNotFound = "OBP-36001: Authorisation not found. Please specify valid values for PAYMENT_ID and AUTHORISATION_ID. "

View File

@ -88,6 +88,8 @@ object MappedConsentProvider extends ConsentProvider {
}
override def revoke(consentId: String): Box[MappedConsent] = {
MappedConsent.find(By(MappedConsent.mConsentId, consentId)) match {
case Full(consent) if consent.status == ConsentStatus.REVOKED.toString =>
Failure(ErrorMessages.ConsentAlreadyRevoked)
case Full(consent) =>
tryo(consent
.mStatus(ConsentStatus.REVOKED.toString)