@defra-fish/connectors-lib 1.57.0-rc.0 → 1.57.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra-fish/connectors-lib",
3
- "version": "1.57.0-rc.0",
3
+ "version": "1.57.0-rc.10",
4
4
  "description": "Shared connectors",
5
5
  "type": "module",
6
6
  "engines": {
@@ -41,5 +41,5 @@
41
41
  "node-fetch": "^2.6.7",
42
42
  "redlock": "^4.2.0"
43
43
  },
44
- "gitHead": "7f632526e47173f4d8846cab393db6b487abf398"
44
+ "gitHead": "ba4d1da026e5943f37b404b8bf8f47c829b9da54"
45
45
  }
@@ -120,10 +120,10 @@ describe('govuk-pay-api-connector', () => {
120
120
  })
121
121
  })
122
122
 
123
- describe('createRecurringPayment', () => {
123
+ describe('createRecurringPaymentAgreement', () => {
124
124
  it('creates new payments', async () => {
125
125
  fetch.mockReturnValue({ ok: true, status: 200 })
126
- await expect(govUkPayApi.createRecurringPayment({ cost: 0 })).resolves.toEqual({ ok: true, status: 200 })
126
+ await expect(govUkPayApi.createRecurringPaymentAgreement({ cost: 0 })).resolves.toEqual({ ok: true, status: 200 })
127
127
  expect(fetch).toHaveBeenCalledWith('http://0.0.0.0/agreement', {
128
128
  body: JSON.stringify({ cost: 0 }),
129
129
  headers: recurringHeaders,
@@ -137,7 +137,7 @@ describe('govuk-pay-api-connector', () => {
137
137
  fetch.mockImplementation(() => {
138
138
  throw new Error('')
139
139
  })
140
- expect(govUkPayApi.createRecurringPayment({ reference: '123' })).rejects.toEqual(Error(''))
140
+ expect(govUkPayApi.createRecurringPaymentAgreement({ reference: '123' })).rejects.toEqual(Error(''))
141
141
  expect(fetch).toHaveBeenCalledWith('http://0.0.0.0/agreement', {
142
142
  body: JSON.stringify({ reference: '123' }),
143
143
  headers: recurringHeaders,
@@ -15,7 +15,7 @@ const headers = recurring => ({
15
15
  * @param preparedPayment - see the GOV.UK pay API reference for details
16
16
  * @returns {Promise<*>}
17
17
  */
18
- export const createRecurringPayment = async preparedPayment => {
18
+ export const createRecurringPaymentAgreement = async preparedPayment => {
19
19
  try {
20
20
  return fetch(process.env.GOV_PAY_RCP_API_URL, {
21
21
  headers: headers(true),