diff --git a/app/uk/gov/hmrc/helptosavestub/controllers/BARSController.scala b/app/uk/gov/hmrc/helptosavestub/controllers/BARSController.scala index fa00bbb..3c2d67e 100644 --- a/app/uk/gov/hmrc/helptosavestub/controllers/BARSController.scala +++ b/app/uk/gov/hmrc/helptosavestub/controllers/BARSController.scala @@ -47,7 +47,7 @@ object BARSController { case class BankDetails(sortCode: String, accountNumber: String) - case class BARSResponse(accountNumberWithSortCodeIsValid: Boolean, sortCodeIsPresentOnEISCD: String) + case class BARSResponse(accountNumberWithSortCodeIsValid: String, sortCodeIsPresentOnEISCD: String) implicit val reads: Reads[BankDetails] = Json.reads[BankDetails] diff --git a/app/uk/gov/hmrc/helptosavestub/controllers/BankDetailsBehaviour.scala b/app/uk/gov/hmrc/helptosavestub/controllers/BankDetailsBehaviour.scala index 66640aa..ec3aec2 100644 --- a/app/uk/gov/hmrc/helptosavestub/controllers/BankDetailsBehaviour.scala +++ b/app/uk/gov/hmrc/helptosavestub/controllers/BankDetailsBehaviour.scala @@ -29,11 +29,11 @@ trait BankDetailsBehaviour { def getBankProfile(bankDetails: BankDetails): Profile = { val accountNumberWithSortCodeIsValid = bankDetails match { - case BankDetails(_, accountNumber) if accountNumber.startsWith("9") => Some(false) + case BankDetails(_, accountNumber) if accountNumber.startsWith("9") => Some("no") case BankDetails(_, accountNumber) if accountNumber.startsWith("5") => None - case BankDetails(sortCode, _) if !validateSortCode(sortCode) => Some(false) - case BankDetails(_, accountNumber) if !validateAccountNumber(accountNumber) => Some(false) - case _ => Some(true) + case BankDetails(sortCode, _) if !validateSortCode(sortCode) => Some("no") + case BankDetails(_, accountNumber) if !validateAccountNumber(accountNumber) => Some("no") + case _ => Some("yes") } val sortCodeIsPresentOnEISCD = diff --git a/conf/prod.routes b/conf/prod.routes index 3077d25..a2dad5b 100644 --- a/conf/prod.routes +++ b/conf/prod.routes @@ -21,7 +21,7 @@ GET /hmrc-healthcheck uk.gov.hmrc.helptosavestub GET /pay-as-you-earn/02.00.00/individuals/:nino uk.gov.hmrc.helptosavestub.controllers.PayePersonalDetailsController.getPayeDetails(nino) # Bank Account Reputation Service (BARS) -POST /validateBankDetails uk.gov.hmrc.helptosavestub.controllers.BARSController.validateBankDetails +POST /v2/validateBankDetails uk.gov.hmrc.helptosavestub.controllers.BARSController.validateBankDetails GET /admin/metrics com.kenshoo.play.metrics.MetricsController.metrics -> /help-to-save-stub app.Routes