Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@govuk-pay/pay-js-commons

Package Overview
Dependencies
Maintainers
8
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@govuk-pay/pay-js-commons - npm Package Compare versions

Comparing version 6.0.1 to 6.0.2

2

package.json
{
"name": "@govuk-pay/pay-js-commons",
"version": "6.0.1",
"version": "6.0.2",
"description": "Reusable js scripts for GOV.UK Pay Node.js projects",

@@ -5,0 +5,0 @@ "engines": {

@@ -169,8 +169,24 @@ # GOV.UK Pay JS Commons

### Https base client
## Axios base client
Used in our Node.js apps to call internal APIs such as connector or ledger.
Used in our Node.js apps to call APIs such as connector or ledger.
Uses the NPM Axios library.
Uses the NPM [Axios](https://www.npmjs.com/package/axios) library.
The base client provides the following configuration options:
* onRequestStart - Callback function before starting a API request. Mainly used for logging.
* onSuccessResponse - Callback function when request has completed successfully.
* onFailureResponse - Callback function when request has failed.
* acceptAllStatusCodes - `boolean`
* By default all non 2xx responses are considered failed requests.
* Set this to `true` and all status codes are considered a successful request. You code will then need to handle the response appropriately. Currently, only `pay-frontend` requires this to be set to `true`.
### Built in in retry functionality
If a `GET` request provides a response with the error message `ECONNRESET` - the the Axios base client will automatically try that request another 2 times - 3 times in total.
By default, on each failed request, it will call the `onFailureResponse` callback.
If `acceptAllStatusCodes=true`, then it will call the `onSuccessResponse` callback.
## Releasing

@@ -177,0 +193,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc