-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: get beta up to date with main, with additional documentation a…
…nd dependency resolutions (#1154) * feat: add more feeOptions - prevent auto submission (#1141) * add more feeOptions * fix schema * change tests for new feeOptions * custom error message * renaming to maxAttempts * Removed extra space --------- Co-authored-by: Luke Zigler <[email protected]> * Added README for submitter * Added docs for enabling the queue service from the runner side * Updated dependencies * More dependency updates * Updated babel dependencies across project * Updated babel-jest packages * Added resolution for babel core * Updated lockfile * Added resolution for babel traverse * Allowed postcss GHSA to avoid upgrading webpack * Fixed md table formatting * fix: change customPayErrorMessage type to string --------- Co-authored-by: Luke Zigler <[email protected]>
- Loading branch information
1 parent
f14b884
commit 56559bb
Showing
27 changed files
with
1,082 additions
and
933 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Fee options | ||
|
||
`feeOptions` is a top level property in a form json. Fee options are used to configure API keys for GOV.UK Pay, and the behaviour of retrying payments. | ||
|
||
|
||
```.json5 | ||
{ | ||
// pages, sections, conditions etc .. | ||
"feeOptions": { | ||
/** | ||
* If a payment is required, but the user fails, allow the user to skip payment | ||
* and submit the form. this is the default behaviour. | ||
* | ||
* Any versions AFTER (and not including) v3.25.68-rc.927 allows this behaviour | ||
* to be configurable. If you do not want payment to be skippable, set | ||
* `allowSubmissionWithoutPayment: false` | ||
*/ | ||
"allowSubmissionWithoutPayment": true, | ||
|
||
/** | ||
* The maximum number of times a user can attempt to pay before the form is auto submitted. | ||
* There is no limit when allowSubmissionWithoutPayment is false. (The user can retry as many times as they like). | ||
*/ | ||
"maxAttempts": 3, | ||
|
||
/** | ||
* A supplementary error message (`customPayErrorMessage`) | ||
*/ | ||
"customPayErrorMessage": "Custom error message", | ||
} | ||
} | ||
``` | ||
|
||
As a failsafe, if a user was not able to pay, we will allow them to try up to 3 times (`maxAttempts`), then auto submit (`"allowSubmissionWithoutPayment": true`). | ||
This is the default behaviour. Makes sure you check your organisations policy or legislative requirements. You must ensure there is a process to remediate payment failures. | ||
|
||
When a user fails a payment, they will see the page [pay-error](./../../runner/src/server/views/pay-error.html). | ||
|
||
When `allowSubmissionWithoutPayment` is true, the user will also see a link which allows them to skip payment. | ||
|
||
|
||
## Recommendations | ||
|
||
If your service does not allow submission without payment, set | ||
`allowSubmissionWithoutPayment: false`. `maxAttempts` will have no effect. The user will be able to retry as many times as they like. | ||
You can provide them with `customPayErrorMessage` to provide them with another route to payment. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Submission queue | ||
|
||
The runner can be configured to add new submissions to a queue, and for this queue to be processed by the submitter module. | ||
|
||
By enabling the queue service this will change the webhook process, so that the runner will push the submission to a specified database, and will await a response from the submitter for a few seconds before returning the success screen to the user. | ||
|
||
## Setup | ||
|
||
Before enabling the queue service you will need a database instance set up which the runner can access. Once your database is set up, you can enable the queue service by configuring the following environment variables: | ||
|
||
| Variable name | Definition | Default | Example | | ||
| ------------------------------ | ---------------------------------------------------------------------------------------- | ------- | ------------------------------------------- | | ||
| ENABLE_QUEUE_SERVICE | Whether the queue service is enabled or not | `false` | | | ||
| QUEUE_DATABASE_URL | Used for configuring the endpoint of the database instance | | mysql://username:password@endpoint/database | | ||
| QUEUE_DATABASE_USERNAME | Used for configuring the user being used to access the database | | root | | ||
| QUEUE_DATABASE_PASSWORD | Used for configuring the password used for accessing the database | | password | | ||
| QUEUE_SERVICE_POLLING_INTERVAL | The amount of time, in milliseconds, between poll requests for updates from the database | 500 | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.