User interface app for product payments (Prototype/Demo/Ad-hoc etc) integrated with GOV.UK Pay.
- This requires the Pay CLI
- You have set up your local development environment
- Clone this repo locally.
Copy .env.example and rename to .env. This contains the environment variables required to run the app, and contains
the URLs for other microservices that products UI makes requests to, which default to the URLs that apps run using pay
local are available on.
Start the Pay local environment
pay local launch --cluster paymentlinks
Start products UI
npm install && npm run compile
npm run start:dev
Visit the site on http://127.0.0.1:3000.
- In VSCode, go to the
Debugview (on MacOS, use shortcutCMD + shift + D). - From the Run toolbar, select tne launch config
Products UI. - Add breakpoints to any file you want to debug - click in the left hand column and a red dot will appear.
- Press The
green playbutton (F5MacOS):- This will run the app in debug mode.
- Uses
nodemonso it will automatically restart on code changes.
You shouldn’t need to restart the app to see changes you make.
We use nodemon which watches for changes to files and restarts the node process.
If you’re making changes to client-side JS or Sass files (anything within /browsered/ or
/assets/) then running npm run watch-live-reload will watch for changes and recompile. Nodemon does
not do anything here as that’s not necessary.
npm run compile && npm test
- Some integration tests do not work in debug mode. This is because the tests are dependent on other tests running before hand.
- Nevertheless, it is still useful to debug tests that do work in debug mode.
- In VSCode, go to the
Debugview (on MacOS, use shortcutCMD + shift + D). - From the Run toolbar, select the launch config you want to run:
Mocha All- runs all tests.Mocha Current File- only run currently open test file.
- Add breakpoints to any file you want to debug - click in the left hand column and a red dot will appear.
- Press The
green playbutton orF5.
| Variable | Description |
|---|---|
ADMINUSERS_URL |
|
ANALYTICS_TRACKING_ID |
|
BIND_HOST |
The IP address for the application to bind to. Defaults to 127.0.0.1 |
COOKIE_MAX_AGE |
|
CORRELATION_HEADER_NAME |
Default x-request-id |
DISABLE_INTERNAL_HTTPS |
|
DISABLE_REQUEST_LOGGING |
|
NODE_ENV |
|
NODE_WORKER_COUNT |
Default 1 |
PORT |
Default 3000 |
PRODUCTS_URL |
|
PRODUCTS_UI_URL |
The HTTPS URL of the app - required when enabling the content security policy (CSP). Default '' |
SELFSERVICE_DASHBOARD_URL |
|
SELFSERVICE_DEMO_PAYMENT_RETURN_URL |
|
SESSION_ENCRYPTION_KEY |
| Variable |
|---|
LOCAL_ENV |
PACT_BROKER_PASSWORD |
PACT_BROKER_URL |
PACT_BROKER_USERNAME |
PACT_CONSUMER_TAG |
PACT_CONSUMER_VERSION |
GOV.UK Pay aims to stay secure for everyone. If you are a security researcher and have discovered a security vulnerability in this code, we appreciate your help in disclosing it to us in a responsible manner. Please refer to our vulnerability disclosure policy and our security.txt file for details.