From f0526b868a49dbd994f806214da153819d574e6b Mon Sep 17 00:00:00 2001 From: Jake Barnes <33868990+barnesjake@users.noreply.github.com> Date: Fri, 1 Nov 2024 09:29:19 +0000 Subject: [PATCH] [JB][OPS-12927] wire up card fees page for sa origins (#13) --- .../config/AppConfig.scala | 7 +- .../controllers/FeesController.scala | 63 ++- .../controllers/PaymentFailedController.scala | 3 +- .../DefaultExtendedOrigin.scala | 2 +- .../extendedorigins/ExtendedBtaSa.scala | 2 + .../models/extendedorigins/ExtendedItSa.scala | 2 + .../extendedorigins/ExtendedOrigin.scala | 2 + .../extendedorigins/ExtendedPfP800.scala | 3 +- .../models/extendedorigins/ExtendedPfSa.scala | 4 +- .../extendedorigins/ExtendedPfVat.scala | 4 +- .../extendedorigins/ExtendedPtaSa.scala | 2 + .../utils/OriginExtraInfo.scala | 27 +- .../views/FeesPage.scala.html | 8 +- conf/app.routes | 2 + conf/application.conf | 9 + conf/messages | 11 +- conf/messages.cy | 5 + .../controllers/FeesControllerSpec.scala | 480 +++++++++++++++++- 18 files changed, 602 insertions(+), 34 deletions(-) diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/config/AppConfig.scala b/app/uk/gov/hmrc/cardpaymentfrontend/config/AppConfig.scala index dab422f..97cd458 100755 --- a/app/uk/gov/hmrc/cardpaymentfrontend/config/AppConfig.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/config/AppConfig.scala @@ -22,9 +22,14 @@ import uk.gov.hmrc.play.bootstrap.config.ServicesConfig @Singleton class AppConfig @Inject() (config: Configuration, servicesConfig: ServicesConfig) { - val welshLanguageSupportEnabled: Boolean = config.getOptional[Boolean]("features.welsh-language-support").getOrElse(false) + val payAnotherWayLink: String = config.get[String]("urls.govuk.pay-another-way") val payApiBaseUrl: String = servicesConfig.baseUrl("pay-api") + val payFrontendBaseUrl: String = servicesConfig.baseUrl("pay-frontend") + "/pay" + + val bankTransferRelativeUrl: String = config.get[String]("urls.pay-frontend.bank-transfer") + val oneOffDirectDebitRelativeUrl: String = config.get[String]("urls.pay-frontend.one-off-direct-debit") + } diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/controllers/FeesController.scala b/app/uk/gov/hmrc/cardpaymentfrontend/controllers/FeesController.scala index b0f6535..573f2cd 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/controllers/FeesController.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/controllers/FeesController.scala @@ -18,8 +18,12 @@ package uk.gov.hmrc.cardpaymentfrontend.controllers import payapi.corcommon.model.{Origin, Origins} import play.api.mvc.{Action, AnyContent, Call, MessagesControllerComponents} +import uk.gov.hmrc.cardpaymentfrontend.actions.{Actions, JourneyRequest} +import uk.gov.hmrc.cardpaymentfrontend.config.AppConfig import uk.gov.hmrc.cardpaymentfrontend.models.Link -import uk.gov.hmrc.cardpaymentfrontend.utils.OriginExtraInfo +import uk.gov.hmrc.cardpaymentfrontend.models.extendedorigins.ExtendedOrigin +import uk.gov.hmrc.cardpaymentfrontend.requests.RequestSupport +import uk.gov.hmrc.cardpaymentfrontend.utils.{OriginExtraInfo, PaymentMethod, PaymentMethods} import uk.gov.hmrc.cardpaymentfrontend.views.html.FeesPage import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController @@ -27,10 +31,14 @@ import javax.inject.{Inject, Singleton} @Singleton class FeesController @Inject() ( - originExtraInfo: OriginExtraInfo, + actions: Actions, + appConfig: AppConfig, + feesPage: FeesPage, mcc: MessagesControllerComponents, - feesPage: FeesPage + originExtraInfo: OriginExtraInfo, + requestSupport: RequestSupport ) extends FrontendController(mcc) { + private[controllers] def twoDirectDebitsPrimaryLink(origin: Origin): Option[Link] = { origin match { case Origins.BtaEpayeBill => Some(Link( @@ -128,4 +136,53 @@ class FeesController @Inject() ( // Two kinds of DD with secondary link def renderPage5(): Action[AnyContent] = renderPage(Origins.PfMgd) + import requestSupport._ + + def renderPageNew(): Action[AnyContent] = actions.journeyAction { implicit journeyRequest: JourneyRequest[AnyContent] => + val altPayments = linksAvailableOnFeesPage(journeyRequest.journey.origin) + if (altPayments.isEmpty) Redirect("http://nextpage.html") + else Ok(feesPage(altPayments)) + } + + def submit: Action[AnyContent] = actions.journeyAction { _ => + Redirect(routes.EmailAddressController.renderPage) + } + + private[controllers] def paymentMethodToBeShown(paymentMethod: PaymentMethod, paymentMethods: Set[PaymentMethod]): Boolean = paymentMethods.contains(paymentMethod) + + private[controllers] def linksAvailableOnFeesPage(origin: Origin): Seq[Link] = { + + val extendedOrigin: ExtendedOrigin = originExtraInfo.lift(origin) + val paymentMethodsToShow: Set[PaymentMethod] = extendedOrigin.cardFeesPagePaymentMethods + val showOpenBankingLink: Boolean = paymentMethodToBeShown(PaymentMethods.OpenBanking, paymentMethodsToShow) + val showBankTransferLink: Boolean = paymentMethodToBeShown(PaymentMethods.Bacs, paymentMethodsToShow) + val showOneOffDirectDebitLink: Boolean = paymentMethodToBeShown(PaymentMethods.OneOffDirectDebit, paymentMethodsToShow) + + val maybeOpenBankingLink = if (showOpenBankingLink) { + Seq(Link( + href = Call("GET", "https://open_banking_url_goes_here"), + linkId = "open-banking-link", + messageKey = "card-fees.para2.open-banking" + )) + } else Seq.empty[Link] + + val maybeBankTransferLink = if (showBankTransferLink) { + Seq(Link( + href = Call("GET", appConfig.payFrontendBaseUrl + appConfig.bankTransferRelativeUrl), + linkId = "bank-transfer-link", + messageKey = "card-fees.para2.bank-transfer" + )) + } else Seq.empty[Link] + + val maybeOneOffDirectDebitLink = if (showOneOffDirectDebitLink) { + Seq(Link( + href = Call("GET", appConfig.payFrontendBaseUrl + appConfig.oneOffDirectDebitRelativeUrl), + linkId = "one-off-direct-debit-link", + messageKey = "card-fees.para2.one-off-direct-debit" + )) + } else Seq.empty[Link] + + maybeOpenBankingLink ++ maybeBankTransferLink ++ maybeOneOffDirectDebitLink + } + } diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/controllers/PaymentFailedController.scala b/app/uk/gov/hmrc/cardpaymentfrontend/controllers/PaymentFailedController.scala index d24e94d..2ad393b 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/controllers/PaymentFailedController.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/controllers/PaymentFailedController.scala @@ -21,7 +21,8 @@ import play.api.data.Form import play.api.mvc.{Action, AnyContent, MessagesControllerComponents} import uk.gov.hmrc.cardpaymentfrontend.forms.ChooseAPaymentMethodForm import uk.gov.hmrc.cardpaymentfrontend.models.extendedorigins.ExtendedOrigin -import uk.gov.hmrc.cardpaymentfrontend.utils.{OpenBanking, OriginExtraInfo, PaymentMethod} +import uk.gov.hmrc.cardpaymentfrontend.utils.PaymentMethods.OpenBanking +import uk.gov.hmrc.cardpaymentfrontend.utils.{OriginExtraInfo, PaymentMethod} import uk.gov.hmrc.cardpaymentfrontend.views.html.PaymentFailedPage import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/DefaultExtendedOrigin.scala b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/DefaultExtendedOrigin.scala index c9e8058..2d70cf6 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/DefaultExtendedOrigin.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/DefaultExtendedOrigin.scala @@ -23,7 +23,7 @@ class DefaultExtendedOrigin extends ExtendedOrigin { def serviceNameMessageKey = "" def taxNameMessageKey: String = "" def reference(): String = "" + def cardFeesPagePaymentMethods: Set[PaymentMethod] = Set.empty[PaymentMethod] def paymentMethods(): Set[PaymentMethod] = Set.empty[PaymentMethod] - def checkYourAnswersRows(): Seq[CheckYourAnswersRow] = Seq.empty[CheckYourAnswersRow] } diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedBtaSa.scala b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedBtaSa.scala index f81cd9b..0909de3 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedBtaSa.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedBtaSa.scala @@ -17,12 +17,14 @@ package uk.gov.hmrc.cardpaymentfrontend.models.extendedorigins import uk.gov.hmrc.cardpaymentfrontend.models.CheckYourAnswersRow +import uk.gov.hmrc.cardpaymentfrontend.utils.PaymentMethods.{OneOffDirectDebit, OpenBanking} import uk.gov.hmrc.cardpaymentfrontend.utils._ object ExtendedBtaSa extends ExtendedOrigin { override val serviceNameMessageKey: String = "service-name.BtaSa" override val taxNameMessageKey: String = "payment-complete.tax-name.BtaSa" def reference(): String = "1097172564" //This would really come from the journey either pay-api or stored locally + def cardFeesPagePaymentMethods: Set[PaymentMethod] = Set(OpenBanking, OneOffDirectDebit) //todo add these when we do that ticket def paymentMethods(): Set[PaymentMethod] = Set.empty //todo add this when we do that ticket diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedItSa.scala b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedItSa.scala index 883953f..be083b5 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedItSa.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedItSa.scala @@ -17,12 +17,14 @@ package uk.gov.hmrc.cardpaymentfrontend.models.extendedorigins import uk.gov.hmrc.cardpaymentfrontend.models.CheckYourAnswersRow +import uk.gov.hmrc.cardpaymentfrontend.utils.PaymentMethods.Bacs import uk.gov.hmrc.cardpaymentfrontend.utils._ object ExtendedItSa extends ExtendedOrigin { override val serviceNameMessageKey: String = "service-name.ItSa" override val taxNameMessageKey: String = "payment-complete.tax-name.ItSa" def reference(): String = "1097172564" //This would really come from the journey either pay-api or stored locally + def cardFeesPagePaymentMethods: Set[PaymentMethod] = Set(Bacs) //todo add these when we do that ticket def paymentMethods(): Set[PaymentMethod] = Set.empty //todo add this when we do that ticket diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedOrigin.scala b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedOrigin.scala index a052276..cdf5676 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedOrigin.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedOrigin.scala @@ -23,6 +23,8 @@ trait ExtendedOrigin { def serviceNameMessageKey: String def taxNameMessageKey: String def reference(): String + //denotes which links/payment methods to show on the card-fees page. + def cardFeesPagePaymentMethods: Set[PaymentMethod] def paymentMethods(): Set[PaymentMethod] def checkYourAnswersRows(): Seq[CheckYourAnswersRow] } diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfP800.scala b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfP800.scala index 94a2e18..5b236e7 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfP800.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfP800.scala @@ -23,7 +23,8 @@ class ExtendedPfP800 extends ExtendedOrigin { override val serviceNameMessageKey: String = "add.message.key.here" override val taxNameMessageKey: String = "payment-complete.tax-name.PfP800" def reference(): String = "ma000003AP3022016" //This would really come from the journey either pay-api or stored locally - def paymentMethods(): Set[PaymentMethod] = Set(Card, Bacs) + def cardFeesPagePaymentMethods: Set[PaymentMethod] = Set.empty[PaymentMethod] + def paymentMethods(): Set[PaymentMethod] = Set() //Set(Card, Bacs)//todo will we use this? def checkYourAnswersRows(): Seq[CheckYourAnswersRow] = { Seq.empty diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfSa.scala b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfSa.scala index abcebbd..22afaac 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfSa.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfSa.scala @@ -18,12 +18,14 @@ package uk.gov.hmrc.cardpaymentfrontend.models.extendedorigins import play.api.mvc.Call import uk.gov.hmrc.cardpaymentfrontend.models.{CheckYourAnswersRow, Link} -import uk.gov.hmrc.cardpaymentfrontend.utils.{Bacs, Card, OneOffDirectDebit, OpenBanking, PaymentMethod} +import uk.gov.hmrc.cardpaymentfrontend.utils.PaymentMethods.{Bacs, Card, OneOffDirectDebit, OpenBanking} +import uk.gov.hmrc.cardpaymentfrontend.utils.PaymentMethod object ExtendedPfSa extends ExtendedOrigin { override val serviceNameMessageKey: String = "service-name.PfSa" override val taxNameMessageKey: String = "payment-complete.tax-name.PfSa" def reference(): String = "1097172564" //This would really come from the journey either pay-api or stored locally + def cardFeesPagePaymentMethods: Set[PaymentMethod] = Set(OpenBanking, OneOffDirectDebit) def paymentMethods(): Set[PaymentMethod] = Set(Card, OpenBanking, OneOffDirectDebit, Bacs) def checkYourAnswersRows(): Seq[CheckYourAnswersRow] = { diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfVat.scala b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfVat.scala index ecc5cec..fa5178c 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfVat.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPfVat.scala @@ -18,12 +18,14 @@ package uk.gov.hmrc.cardpaymentfrontend.models.extendedorigins import play.api.mvc.Call import uk.gov.hmrc.cardpaymentfrontend.models.{CheckYourAnswersRow, Link} -import uk.gov.hmrc.cardpaymentfrontend.utils.{Bacs, Card, OpenBanking, PaymentMethod, VariableDirectDebit} +import uk.gov.hmrc.cardpaymentfrontend.utils.PaymentMethods._ +import uk.gov.hmrc.cardpaymentfrontend.utils._ class ExtendedPfVat extends ExtendedOrigin { override val serviceNameMessageKey: String = "add.message.key.here" override val taxNameMessageKey: String = "payment-complete.tax-name.PfVat" def reference(): String = "999964805" + def cardFeesPagePaymentMethods: Set[PaymentMethod] = Set.empty[PaymentMethod] def paymentMethods(): Set[PaymentMethod] = Set(Card, OpenBanking, VariableDirectDebit, Bacs) def checkYourAnswersRows(): Seq[CheckYourAnswersRow] = { diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPtaSa.scala b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPtaSa.scala index ba610ae..9b43dc0 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPtaSa.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/models/extendedorigins/ExtendedPtaSa.scala @@ -17,12 +17,14 @@ package uk.gov.hmrc.cardpaymentfrontend.models.extendedorigins import uk.gov.hmrc.cardpaymentfrontend.models.CheckYourAnswersRow +import uk.gov.hmrc.cardpaymentfrontend.utils.PaymentMethods.{OneOffDirectDebit, OpenBanking} import uk.gov.hmrc.cardpaymentfrontend.utils._ object ExtendedPtaSa extends ExtendedOrigin { override val serviceNameMessageKey: String = "service-name.PtaSa" override val taxNameMessageKey: String = "payment-complete.tax-name.PtaSa" def reference(): String = "1097172564" //This would really come from the journey either pay-api or stored locally + def cardFeesPagePaymentMethods: Set[PaymentMethod] = Set(OpenBanking, OneOffDirectDebit) //todo add these when we do that ticket def paymentMethods(): Set[PaymentMethod] = Set.empty //todo add this when we do that ticket diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/utils/OriginExtraInfo.scala b/app/uk/gov/hmrc/cardpaymentfrontend/utils/OriginExtraInfo.scala index e8cd553..5678cd8 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/utils/OriginExtraInfo.scala +++ b/app/uk/gov/hmrc/cardpaymentfrontend/utils/OriginExtraInfo.scala @@ -18,21 +18,27 @@ package uk.gov.hmrc.cardpaymentfrontend.utils import uk.gov.hmrc.cardpaymentfrontend.models.extendedorigins.{DefaultExtendedOrigin, ExtendedBtaSa, ExtendedItSa, ExtendedOrigin, ExtendedPfP800, ExtendedPfSa, ExtendedPfVat, ExtendedPtaSa} import payapi.corcommon.model.{Origin, Origins} +import uk.gov.hmrc.cardpaymentfrontend.utils.PaymentMethods.{Bacs, Card, OneOffDirectDebit, OpenBanking, PrintableDirectDebit, VariableDirectDebit} import javax.inject.{Inject, Singleton} -trait PaymentMethod -case object Card extends PaymentMethod +//todo should probably be in it's own file. +sealed trait PaymentMethod -case object OpenBanking extends PaymentMethod +object PaymentMethods { -case object OneOffDirectDebit extends PaymentMethod + case object Card extends PaymentMethod -case object VariableDirectDebit extends PaymentMethod + case object OpenBanking extends PaymentMethod -case object PrintableDirectDebit extends PaymentMethod + case object OneOffDirectDebit extends PaymentMethod -case object Bacs extends PaymentMethod + case object VariableDirectDebit extends PaymentMethod + + case object PrintableDirectDebit extends PaymentMethod + + case object Bacs extends PaymentMethod +} //Probably a temporary class - it will be subsumed by the ExtendedOrigins in due course @@ -126,13 +132,6 @@ class OriginExtraInfo @Inject() () { def variableDirectDebitAllowed(origin: Origin): Boolean = paymentMethod(origin).contains(VariableDirectDebit) - // def lift(origin: Origin): ExtendedOrigin = { - // origin match { - // case Origins.PfSa => new ExtendedPfSa() - // case _ => new DefaultExtendedOrigin() - // } - // } - def lift(origin: Origin): ExtendedOrigin = { origin match { case Origins.PfSa => ExtendedPfSa diff --git a/app/uk/gov/hmrc/cardpaymentfrontend/views/FeesPage.scala.html b/app/uk/gov/hmrc/cardpaymentfrontend/views/FeesPage.scala.html index 30d7023..3d568cb 100644 --- a/app/uk/gov/hmrc/cardpaymentfrontend/views/FeesPage.scala.html +++ b/app/uk/gov/hmrc/cardpaymentfrontend/views/FeesPage.scala.html @@ -16,7 +16,6 @@ @import uk.gov.hmrc.cardpaymentfrontend.models.Link @import uk.gov.hmrc.cardpaymentfrontend.views.html.Layout -@import uk.gov.hmrc.cardpaymentfrontend.utils.{PaymentMethod, OpenBanking, VariableDirectDebit, OneOffDirectDebit} @import uk.gov.hmrc.govukfrontend.views.Aliases.{Button, ErrorSummary, Hint, Input, Label} @import uk.gov.hmrc.govukfrontend.views.html.components.{FormWithCSRF, GovukButton, GovukErrorSummary, GovukInput} @import uk.gov.hmrc.govukfrontend.views.Implicits.{RichFormErrors, RichInput} @@ -39,16 +38,17 @@
@messages("card-fees.para1")
@messages("card-fees.para2")
-@messages("card-fees.para3")
@messages("card-fees.para4")
- @formWithCSRF(action = uk.gov.hmrc.cardpaymentfrontend.controllers.routes.EmailAddressController.submit) { + @formWithCSRF(action = uk.gov.hmrc.cardpaymentfrontend.controllers.routes.FeesController.submit) { @govukButton(Button( id = Some("submit"), content = Text(messages("continue")) diff --git a/conf/app.routes b/conf/app.routes index daeed1c..51b7d48 100755 --- a/conf/app.routes +++ b/conf/app.routes @@ -6,6 +6,8 @@ GET /assets/*file controllers.Assets.versioned(pa GET /email-address uk.gov.hmrc.cardpaymentfrontend.controllers.EmailAddressController.renderPage POST /email-address uk.gov.hmrc.cardpaymentfrontend.controllers.EmailAddressController.submit +GET /card-fees uk.gov.hmrc.cardpaymentfrontend.controllers.FeesController.renderPageNew +POST /card-fees uk.gov.hmrc.cardpaymentfrontend.controllers.FeesController.submit GET /card-fees0 uk.gov.hmrc.cardpaymentfrontend.controllers.FeesController.renderPage0 GET /card-fees1 uk.gov.hmrc.cardpaymentfrontend.controllers.FeesController.renderPage1 GET /card-fees2 uk.gov.hmrc.cardpaymentfrontend.controllers.FeesController.renderPage2 diff --git a/conf/application.conf b/conf/application.conf index 373694f..8adde24 100755 --- a/conf/application.conf +++ b/conf/application.conf @@ -40,6 +40,11 @@ microservice { host = localhost port = 9057 } + pay-frontend { + protocol = http + host = localhost + port = 9056 + } } } @@ -62,4 +67,8 @@ urls { govuk { pay-another-way = "https://www.gov.uk/topic/dealing-with-hmrc/paying-hmrc" } + pay-frontend { + bank-transfer = "/bac" + one-off-direct-debit = "/pay-by-one-off-direct-debit" + } } diff --git a/conf/messages b/conf/messages index 2551589..0378e37 100755 --- a/conf/messages +++ b/conf/messages @@ -90,18 +90,19 @@ email-address.heading = What is your email address? (optional) email-address.hint = We’ll only use this to confirm you sent a payment email-address.error.invalid = Enter a valid email address or leave it blank -# card fees page +# Card fees page card-fees.heading = Card fees card-fees.para1 = There is a non-refundable fee if you pay by corporate credit card or corporate debit card. card-fees.para2 = There is no fee if you pay by: -card-fees.para2.bank-account = bank account -card-fees.para2.open-banking = open banking +card-fees.para2.bank-transfer = bank transfer +card-fees.para2.open-banking = bank account card-fees.para2.direct-debit = direct debit +card-fees.para2.one-off-direct-debit = Direct Debit (one-off payment) +card-fees.para2.personal-debit-card = personal debit card card-fees.para3 = You cannot pay using a personal credit card. card-fees.para4 = Allow 3 working days for your payment to reach HMRC’s bank account. -card-fees.para2.bank-account = bank account -# check your answers page +# Check your answers page # some refactoring here to consolidate common phrases check-your-answers.heading = Check your answers check-your-answers.your-ref = This payment will show in your bank as diff --git a/conf/messages.cy b/conf/messages.cy index a805300..702d8bf 100755 --- a/conf/messages.cy +++ b/conf/messages.cy @@ -93,6 +93,11 @@ email-address.error.invalid = Nodwch gyfeiriad e-bost dilys neu gadewch yn wag card-fees.heading = Ffioedd cerdyn card-fees.para1 = Bydd ffi na ellir ei had-dalu yn cael ei chodi os talwch â cherdyn credyd corfforaethol neu gerdyn debyd corfforaethol. card-fees.para2 = Nid oes ffi yn cael ei chodi os talwch drwy un o’r dulliau canlynol: +card-fees.para2.bank-transfer = drosglwyddiad banc +card-fees.para2.open-banking = cyfrif banc +card-fees.para2.direct-debit = ADD_ME +card-fees.para2.one-off-direct-debit = Debyd Uniongyrchol (taliad untro) +card-fees.para2.personal-debit-card = cerdyn debyd personol card-fees.para3 = Ni allwch dalu â cherdyn credyd personol. card-fees.para4 = Dylech ganiatáu 3 diwrnod gwaith i’ch taliad gyrraedd cyfrif banc CThEM. diff --git a/test/uk/gov/hmrc/cardpaymentfrontend/controllers/FeesControllerSpec.scala b/test/uk/gov/hmrc/cardpaymentfrontend/controllers/FeesControllerSpec.scala index dec94f3..b6df367 100644 --- a/test/uk/gov/hmrc/cardpaymentfrontend/controllers/FeesControllerSpec.scala +++ b/test/uk/gov/hmrc/cardpaymentfrontend/controllers/FeesControllerSpec.scala @@ -17,12 +17,21 @@ package uk.gov.hmrc.cardpaymentfrontend.controllers import org.jsoup.Jsoup +import org.jsoup.nodes.Document +import org.scalatest.Assertion +import payapi.corcommon.model.Origins import play.api.http.Status -import play.api.mvc.{AnyContentAsEmpty, Cookie} +import play.api.mvc.{AnyContentAsEmpty, Call, Cookie} import play.api.test.FakeRequest import play.api.test.Helpers.status import uk.gov.hmrc.cardpaymentfrontend.testsupport.ItSpec +import uk.gov.hmrc.cardpaymentfrontend.testsupport.TestOps.FakeRequestOps import play.api.test.Helpers._ +import uk.gov.hmrc.cardpaymentfrontend.models.Link +import uk.gov.hmrc.cardpaymentfrontend.testsupport.stubs.PayApiStub +import uk.gov.hmrc.cardpaymentfrontend.testsupport.testdata.TestJourneys +import uk.gov.hmrc.cardpaymentfrontend.utils.PaymentMethods + import scala.jdk.CollectionConverters.CollectionHasAsScala class FeesControllerSpec extends ItSpec { @@ -147,7 +156,7 @@ class FeesControllerSpec extends ItSpec { val result = systemUnderTest.renderPage1()(fakeGetRequest1) val document = Jsoup.parse(contentAsString(result)) val bankAccountLink = document.select("#open-banking-link") - bankAccountLink.text() shouldBe "open banking" + bankAccountLink.text() shouldBe "bank account" } "when variable direct debit is allowed and one off direct debit is not allowed (example render2) there is variable direct debit content" in { @@ -182,6 +191,473 @@ class FeesControllerSpec extends ItSpec { variableDirectDebitLink.text() shouldBe "direct debit" } + val fakeRequest = FakeRequest().withSessionId() + val fakeWelshRequest = FakeRequest().withSessionId().withLangWelsh() + + def testStaticContentEnglish(document: Document): Assertion = { + document.select("h1").text() shouldBe "Card fees" + val para1 = document.select("#para1") + para1.text() shouldBe "There is a non-refundable fee if you pay by corporate credit card or corporate debit card." + val para2 = document.select("#para2") + para2.text() shouldBe "There is no fee if you pay by:" + val para3 = document.select("#para3") + para3.text() shouldBe "You cannot pay using a personal credit card." + val para4 = document.select("#para4") + para4.text() shouldBe "Allow 3 working days for your payment to reach HMRC’s bank account." + } + + def testStaticContentWelsh(document: Document): Assertion = { + document.select("h1").text() shouldBe "Ffioedd cerdyn" + val para1 = document.select("#para1") + para1.text() shouldBe "Bydd ffi na ellir ei had-dalu yn cael ei chodi os talwch â cherdyn credyd corfforaethol neu gerdyn debyd corfforaethol." + val para2 = document.select("#para2") + para2.text() shouldBe "Nid oes ffi yn cael ei chodi os talwch drwy un o’r dulliau canlynol:" + val para3 = document.select("#para3") + para3.text() shouldBe "Ni allwch dalu â cherdyn credyd personol." + val para4 = document.select("#para4") + para4.text() shouldBe "Dylech ganiatáu 3 diwrnod gwaith i’ch taliad gyrraedd cyfrif banc CThEM." + } + + "for origin PfSa" - { + + "render the static content correctly" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + testStaticContentEnglish(document) + } + + "the static content correctly in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + testStaticContentWelsh(document) + } + + "render three options for other ways to pay" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + listOfMethods.size() shouldBe 3 + } + + "render an option for open banking" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val openBankingBullet = listOfMethods.select("#open-banking-link") + openBankingBullet.text() shouldBe "bank account" + openBankingBullet.attr("href") shouldBe "https://open_banking_url_goes_here" + } + + "render an option for open banking in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val openBankingBullet = listOfMethods.select("#open-banking-link") + openBankingBullet.text() shouldBe "cyfrif banc" + openBankingBullet.attr("href") shouldBe "https://open_banking_url_goes_here" + } + + "render an option for one off direct debit" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val oneOffDirectDebitBullet = listOfMethods.select("#one-off-direct-debit-link") + oneOffDirectDebitBullet.text() shouldBe "Direct Debit (one-off payment)" + oneOffDirectDebitBullet.attr("href") shouldBe "http://localhost:9056/pay/pay-by-one-off-direct-debit" + } + + "render an option for one off direct debit in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val oneOffDirectDebitBullet = listOfMethods.select("#one-off-direct-debit-link") + oneOffDirectDebitBullet.text() shouldBe "Debyd Uniongyrchol (taliad untro)" + oneOffDirectDebitBullet.attr("href") shouldBe "http://localhost:9056/pay/pay-by-one-off-direct-debit" + } + + "render an option for personal debit card" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val cardBullet = listOfMethods.select("#personal-debit-card") + cardBullet.text() shouldBe "personal debit card" + } + + "render an option for personal debit card in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val cardBullet = listOfMethods.select("#personal-debit-card") + cardBullet.text() shouldBe "cerdyn debyd personol" + } + } + + "for origin BtaSa" - { + + "render the static content correctly" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.BtaSa.testBtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + testStaticContentEnglish(document) + } + + "the static content correctly in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.BtaSa.testBtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + testStaticContentWelsh(document) + } + + "render three options for other ways to pay" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.BtaSa.testBtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + listOfMethods.size() shouldBe 3 + } + + "render an option for open banking" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.BtaSa.testBtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val openBankingBullet = listOfMethods.select("#open-banking-link") + openBankingBullet.text() shouldBe "bank account" + openBankingBullet.attr("href") shouldBe "https://open_banking_url_goes_here" + } + + "render an option for open banking in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.BtaSa.testBtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val openBankingBullet = listOfMethods.select("#open-banking-link") + openBankingBullet.text() shouldBe "cyfrif banc" + openBankingBullet.attr("href") shouldBe "https://open_banking_url_goes_here" + } + + "render an option for one off direct debit" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.BtaSa.testBtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val oneOffDirectDebitBullet = listOfMethods.select("#one-off-direct-debit-link") + oneOffDirectDebitBullet.text() shouldBe "Direct Debit (one-off payment)" + oneOffDirectDebitBullet.attr("href") shouldBe "http://localhost:9056/pay/pay-by-one-off-direct-debit" + } + + "render an option for one off direct debit in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.BtaSa.testBtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val oneOffDirectDebitBullet = listOfMethods.select("#one-off-direct-debit-link") + oneOffDirectDebitBullet.text() shouldBe "Debyd Uniongyrchol (taliad untro)" + oneOffDirectDebitBullet.attr("href") shouldBe "http://localhost:9056/pay/pay-by-one-off-direct-debit" + } + + "render an option for personal debit card" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.BtaSa.testBtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val cardBullet = listOfMethods.select("#personal-debit-card") + cardBullet.text() shouldBe "personal debit card" + } + + "render an option for personal debit card in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.BtaSa.testBtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val cardBullet = listOfMethods.select("#personal-debit-card") + cardBullet.text() shouldBe "cerdyn debyd personol" + } + } + + "for origin PtaSa" - { + + "render the static content correctly" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PtaSa.testPtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + testStaticContentEnglish(document) + } + + "the static content correctly in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PtaSa.testPtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + testStaticContentWelsh(document) + } + + "render three options for other ways to pay" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PtaSa.testPtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + listOfMethods.size() shouldBe 3 + } + + "render an option for open banking" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PtaSa.testPtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val openBankingBullet = listOfMethods.select("#open-banking-link") + openBankingBullet.text() shouldBe "bank account" + openBankingBullet.attr("href") shouldBe "https://open_banking_url_goes_here" + } + + "render an option for open banking in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PtaSa.testPtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val openBankingBullet = listOfMethods.select("#open-banking-link") + openBankingBullet.text() shouldBe "cyfrif banc" + openBankingBullet.attr("href") shouldBe "https://open_banking_url_goes_here" + } + + "render an option for one off direct debit" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PtaSa.testPtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val oneOffDirectDebitBullet = listOfMethods.select("#one-off-direct-debit-link") + oneOffDirectDebitBullet.text() shouldBe "Direct Debit (one-off payment)" + oneOffDirectDebitBullet.attr("href") shouldBe "http://localhost:9056/pay/pay-by-one-off-direct-debit" + } + + "render an option for one off direct debit in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PtaSa.testPtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val oneOffDirectDebitBullet = listOfMethods.select("#one-off-direct-debit-link") + oneOffDirectDebitBullet.text() shouldBe "Debyd Uniongyrchol (taliad untro)" + oneOffDirectDebitBullet.attr("href") shouldBe "http://localhost:9056/pay/pay-by-one-off-direct-debit" + } + + "render an option for personal debit card" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PtaSa.testPtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val cardBullet = listOfMethods.select("#personal-debit-card") + cardBullet.text() shouldBe "personal debit card" + } + + "render an option for personal debit card in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PtaSa.testPtaSaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val cardBullet = listOfMethods.select("#personal-debit-card") + cardBullet.text() shouldBe "cerdyn debyd personol" + } + } + + "for origin ItSa" - { + + "render the static content correctly" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.ItSa.testItsaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + testStaticContentEnglish(document) + } + + "the static content correctly in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.ItSa.testItsaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + testStaticContentWelsh(document) + } + + "render two options for other ways to pay" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.ItSa.testItsaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + listOfMethods.size() shouldBe 2 + } + + "render an option for bank transfer" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.ItSa.testItsaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val openBankingBullet = listOfMethods.select("#bank-transfer-link") + openBankingBullet.text() shouldBe "bank transfer" + openBankingBullet.attr("href") shouldBe "http://localhost:9056/pay/bac" + } + + "render an option for bank transfer in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.ItSa.testItsaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val openBankingBullet = listOfMethods.select("#bank-transfer-link") + openBankingBullet.text() shouldBe "drosglwyddiad banc" + openBankingBullet.attr("href") shouldBe "http://localhost:9056/pay/bac" + } + + "render an option for personal debit card" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.ItSa.testItsaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val cardBullet = listOfMethods.select("#personal-debit-card") + cardBullet.text() shouldBe "personal debit card" + } + + "render an option for personal debit card in welsh" in { + PayApiStub.stubForFindBySessionId2xx(TestJourneys.ItSa.testItsaJourneySuccessDebit) + val result = systemUnderTest.renderPageNew()(fakeWelshRequest) + val document = Jsoup.parse(contentAsString(result)) + val listOfMethods = document.select("#payment-type-list").select("li") + val cardBullet = listOfMethods.select("#personal-debit-card") + cardBullet.text() shouldBe "cerdyn debyd personol" + } + } + } + + "POST /card-fees" - { + "should redirect to the enter email address page" in { + val fakeRequest: FakeRequest[AnyContentAsEmpty.type] = FakeRequest("POST", "/card-fees").withSessionId() + PayApiStub.stubForFindBySessionId2xx(TestJourneys.PfSa.testPfSaJourneyCreated) + val result = systemUnderTest.submit(fakeRequest) + redirectLocation(result) shouldBe Some("/pay-by-card/email-address") + } + } + + "paymentMethodToBeShown" - { + "should return true if the payment method passed in is within the list of provided payment methods" in { + val result = systemUnderTest.paymentMethodToBeShown( + PaymentMethods.OpenBanking, Set(PaymentMethods.OneOffDirectDebit, PaymentMethods.OpenBanking) + ) + result shouldBe true + } + "should return false if the payment method passed in is not within the list of provided payment methods" in { + val result = systemUnderTest.paymentMethodToBeShown( + PaymentMethods.OpenBanking, Set(PaymentMethods.OneOffDirectDebit, PaymentMethods.Card) + ) + result shouldBe false + } + } + + "linksAvailableOnFeesPage" - { + + val expectedOpenBankingLink = Link( + href = Call("GET", "https://open_banking_url_goes_here"), + linkId = "open-banking-link", + messageKey = "card-fees.para2.open-banking" + ) + + val expectedBankTransferLink = Link( + href = Call("GET", "http://localhost:9056/pay/bac"), + linkId = "bank-transfer-link", + messageKey = "card-fees.para2.bank-transfer" + ) + + val expectedOneOffDirectDebitLink = Link( + href = Call("GET", "http://localhost:9056/pay/pay-by-one-off-direct-debit"), + linkId = "one-off-direct-debit-link", + messageKey = "card-fees.para2.one-off-direct-debit" + ) + + "should return the correct links for each origin" in { + Origins.values.foreach { origin => + val expectedLinks = origin match { + case Origins.PfSa => Seq(expectedOpenBankingLink, expectedOneOffDirectDebitLink) + case Origins.BtaSa => Seq(expectedOpenBankingLink, expectedOneOffDirectDebitLink) + case Origins.PtaSa => Seq(expectedOpenBankingLink, expectedOneOffDirectDebitLink) + case Origins.ItSa => Seq(expectedBankTransferLink) + case Origins.PfVat => Seq.empty + case Origins.PfCt => Seq.empty + case Origins.PfEpayeNi => Seq.empty + case Origins.PfEpayeLpp => Seq.empty + case Origins.PfEpayeSeta => Seq.empty + case Origins.PfEpayeLateCis => Seq.empty + case Origins.PfEpayeP11d => Seq.empty + case Origins.PfSdlt => Seq.empty + case Origins.PfCds => Seq.empty + case Origins.PfOther => Seq.empty + case Origins.PfP800 => Seq.empty + case Origins.PtaP800 => Seq.empty + case Origins.PfClass2Ni => Seq.empty + case Origins.PfInsurancePremium => Seq.empty + case Origins.PfPsAdmin => Seq.empty + case Origins.AppSa => Seq.empty + case Origins.BtaVat => Seq.empty + case Origins.BtaEpayeBill => Seq.empty + case Origins.BtaEpayePenalty => Seq.empty + case Origins.BtaEpayeInterest => Seq.empty + case Origins.BtaEpayeGeneral => Seq.empty + case Origins.BtaClass1aNi => Seq.empty + case Origins.BtaCt => Seq.empty + case Origins.BtaSdil => Seq.empty + case Origins.BcPngr => Seq.empty + case Origins.Parcels => Seq.empty + case Origins.DdVat => Seq.empty + case Origins.DdSdil => Seq.empty + case Origins.VcVatReturn => Seq.empty + case Origins.VcVatOther => Seq.empty + case Origins.Amls => Seq.empty + case Origins.Ppt => Seq.empty + case Origins.PfCdsCash => Seq.empty + case Origins.PfPpt => Seq.empty + case Origins.PfSpiritDrinks => Seq.empty + case Origins.PfInheritanceTax => Seq.empty + case Origins.Mib => Seq.empty + case Origins.PfClass3Ni => Seq.empty + case Origins.PfWineAndCider => Seq.empty + case Origins.PfBioFuels => Seq.empty + case Origins.PfAirPass => Seq.empty + case Origins.PfMgd => Seq.empty + case Origins.PfBeerDuty => Seq.empty + case Origins.PfGamingOrBingoDuty => Seq.empty + case Origins.PfGbPbRgDuty => Seq.empty + case Origins.PfLandfillTax => Seq.empty + case Origins.PfSdil => Seq.empty + case Origins.PfAggregatesLevy => Seq.empty + case Origins.PfClimateChangeLevy => Seq.empty + case Origins.PfSimpleAssessment => Seq.empty + case Origins.PtaSimpleAssessment => Seq.empty + case Origins.AppSimpleAssessment => Seq.empty + case Origins.PfTpes => Seq.empty + case Origins.CapitalGainsTax => Seq.empty + case Origins.EconomicCrimeLevy => Seq.empty + case Origins.PfEconomicCrimeLevy => Seq.empty + case Origins.PfJobRetentionScheme => Seq.empty + case Origins.JrsJobRetentionScheme => Seq.empty + case Origins.PfImportedVehicles => Seq.empty + case Origins.PfChildBenefitRepayments => Seq.empty + case Origins.NiEuVatOss => Seq.empty + case Origins.PfNiEuVatOss => Seq.empty + case Origins.NiEuVatIoss => Seq.empty + case Origins.PfNiEuVatIoss => Seq.empty + case Origins.PfAmls => Seq.empty + case Origins.PfAted => Seq.empty + case Origins.PfCdsDeferment => Seq.empty + case Origins.PfTrust => Seq.empty + case Origins.PtaClass3Ni => Seq.empty + case Origins.AlcoholDuty => Seq.empty + case Origins.PfAlcoholDuty => Seq.empty + case Origins.VatC2c => Seq.empty + } + systemUnderTest.linksAvailableOnFeesPage(origin) shouldBe expectedLinks withClue s"links did not match expected for origin: ${origin.entryName}" + } + } } } }