From 0ac8b935320ad35fab9902a67d112bc70a882fee Mon Sep 17 00:00:00 2001 From: Iqbal AHmed Date: Tue, 27 Feb 2024 09:48:49 +0000 Subject: [PATCH] PP-12295 Add new Stripe terms and conditions page - This page will contain the latest Stripe terms and conditons. - This page will be on a brand new URL: /policy/stripe-terms-and-conditions - Intend to put this live but hidden from real users. - This will allow the team to review the content and request updates. - We expect there to be some late edits as we are working with the legal team to finalise the content. - This page is implemented differently from the other /policy/ pages: - The other pages generate a 1 hour link to a policy PDF file and follow a specific page layout. - This new page will look different and we need to release it quickly. - Making this work with the existing code would have required too much effort. - Therefore, this was implemented differently as a static page - which is quicker to implement without affecting the existing policy pages. --- .../stripeTermsAndConditions.controller.js | 7 +++++ ...tripeTermsAndConditions.controller.test.js | 14 ++++++++++ app/paths.js | 1 + app/routes.js | 5 ++++ app/utils/display-converter.js | 3 ++- .../stripe-terms-and-conditions.njk | 27 +++++++++++++++++++ 6 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 app/controllers/stripeTermsAndConditions.controller.js create mode 100644 app/controllers/stripeTermsAndConditions.controller.test.js create mode 100644 app/views/policy/stripe-terms-and-conditions/stripe-terms-and-conditions.njk diff --git a/app/controllers/stripeTermsAndConditions.controller.js b/app/controllers/stripeTermsAndConditions.controller.js new file mode 100644 index 0000000000..0cf4daf755 --- /dev/null +++ b/app/controllers/stripeTermsAndConditions.controller.js @@ -0,0 +1,7 @@ +'use strict' + +const { response } = require('../utils/response') + +module.exports.get = function (req, res) { + return response(req, res, 'policy/stripe-terms-and-conditions/stripe-terms-and-conditions') +} diff --git a/app/controllers/stripeTermsAndConditions.controller.test.js b/app/controllers/stripeTermsAndConditions.controller.test.js new file mode 100644 index 0000000000..48308a9ddc --- /dev/null +++ b/app/controllers/stripeTermsAndConditions.controller.test.js @@ -0,0 +1,14 @@ +const controller = require('./stripeTermsAndConditions.controller') +const sinon = require('sinon') + +const req = {} +const res = { + render: sinon.spy() +} + +describe('Stripe terms and conditions controller', function () { + it('should render page', function () { + controller.get(req, res) + sinon.assert.calledWith(res.render, 'policy/stripe-terms-and-conditions/stripe-terms-and-conditions') + }) +}) diff --git a/app/paths.js b/app/paths.js index 7a150b0e17..8f153c78e6 100644 --- a/app/paths.js +++ b/app/paths.js @@ -254,6 +254,7 @@ module.exports = { feedback: '/feedback', generateRoute: generateRoute, formattedPathFor: formattedPathFor, + stripeTermsAndConditions: '/policy/stripe-terms-and-conditions', policyPage: '/policy/:key', payouts: { list: '/payments-to-your-bank-account', diff --git a/app/routes.js b/app/routes.js index 12ba9a48cf..a25b1863e9 100644 --- a/app/routes.js +++ b/app/routes.js @@ -62,6 +62,7 @@ const requestToGoLiveOrganisationAddressController = require('./controllers/requ const requestToGoLiveChooseHowToProcessPaymentsController = require('./controllers/request-to-go-live/choose-how-to-process-payments') const requestToGoLiveChooseTakesPaymentsOverPhoneController = require('./controllers/request-to-go-live/choose-takes-payments-over-phone') const requestToGoLiveAgreementController = require('./controllers/request-to-go-live/agreement') +const stripeTermsAndConditionsController = require('./controllers/stripeTermsAndConditions.controller.js') const policyDocumentsController = require('./controllers/policy') const stripeSetupBankDetailsController = require('./controllers/stripe-setup/bank-details') const stripeSetupCheckOrgDetailsController = require('./controllers/stripe-setup/check-org-details') @@ -94,6 +95,7 @@ const { demoPaymentFwd, index, invite, + stripeTermsAndConditions, policyPage, payouts, register, @@ -238,6 +240,9 @@ module.exports.bind = function (app) { app.get(payouts.list, userIsAuthorised, payoutsController.listAllServicesPayouts) app.get(payouts.listStatusFilter, userIsAuthorised, payoutsController.listAllServicesPayouts) + // Stripe terms and conditions + app.get(stripeTermsAndConditions, userIsAuthorised, stripeTermsAndConditionsController.get) + // Policy document downloads app.get(policyPage, userIsAuthorised, policyDocumentsController.get) diff --git a/app/utils/display-converter.js b/app/utils/display-converter.js index a279ac19dd..8860a97d2b 100644 --- a/app/utils/display-converter.js +++ b/app/utils/display-converter.js @@ -17,7 +17,8 @@ const hideServiceHeaderTemplates = [ 'policy/document/stripe-connected-account-agreement', 'policy/document/v2/contract-for-non-crown-bodies', 'policy/document/v2/memorandum-of-understanding-for-crown-bodies', - 'policy/document/v2/stripe-connected-account-agreement' + 'policy/document/v2/stripe-connected-account-agreement', + 'policy/stripe-terms-and-conditions/stripe-terms-and-conditions' ] const hideServiceNavTemplates = [ diff --git a/app/views/policy/stripe-terms-and-conditions/stripe-terms-and-conditions.njk b/app/views/policy/stripe-terms-and-conditions/stripe-terms-and-conditions.njk new file mode 100644 index 0000000000..ccdbd0e9df --- /dev/null +++ b/app/views/policy/stripe-terms-and-conditions/stripe-terms-and-conditions.njk @@ -0,0 +1,27 @@ +{% extends "../../layout.njk" %} + +{% block pageTitle %} + Stripe terms and conditions - GOV.UK Pay +{% endblock %} + + +{% block mainContent %} +
+

+ Stripe terms and conditions +

+ +

+ Last updated: 15 Dec 2023 +

+ + +
+{% endblock %}