@mojaloop/sdk-scheme-adapter 11.18.9 → 12.0.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [12.0.0](https://github.com/mojaloop/sdk-scheme-adapter/compare/v11.18.12...v12.0.0) (2022-03-18)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * update typescript interfaces using latest api-snippets (#297)
11
+
12
+ ### Refactors
13
+
14
+ * update typescript interfaces using latest api-snippets ([#297](https://github.com/mojaloop/sdk-scheme-adapter/issues/297)) ([9a72083](https://github.com/mojaloop/sdk-scheme-adapter/commit/9a7208372976297a307a57478fb339b4ebbdc790))
15
+
16
+ ### [11.18.12](https://github.com/mojaloop/sdk-scheme-adapter/compare/v11.18.11...v11.18.12) (2022-02-15)
17
+
18
+
19
+ ### Chore
20
+
21
+ * add config option for mismatch id's ([#291](https://github.com/mojaloop/sdk-scheme-adapter/issues/291)) ([8e9717a](https://github.com/mojaloop/sdk-scheme-adapter/commit/8e9717a02c6d19f93b78f5b293917050be0ade84))
22
+
23
+ ### [11.18.11](https://github.com/mojaloop/sdk-scheme-adapter/compare/v11.18.9...v11.18.11) (2021-11-25)
24
+
5
25
  ### [11.18.9](https://github.com/mojaloop/sdk-scheme-adapter/compare/v11.18.8...v11.18.9) (2021-10-20)
6
26
 
7
27
  ### [11.18.8](https://github.com/mojaloop/sdk-scheme-adapter/compare/v11.18.7...v11.18.8) (2021-09-16)
@@ -83,9 +83,6 @@ export declare namespace Schemas {
83
83
  type accountsCreationState = components['schemas']['accountsCreationState'];
84
84
  type accountsResponse = components['schemas']['accountsResponse'];
85
85
  type errorAccountsResponse = components['schemas']['errorAccountsResponse'];
86
- type AccountAddress = components['schemas']['AccountAddress'];
87
- type Account = components['schemas']['Account'];
88
- type AccountList = components['schemas']['AccountList'];
89
86
  type PartyIdInfo = components['schemas']['PartyIdInfo'];
90
87
  type PartyName = components['schemas']['PartyName'];
91
88
  type PartyComplexName = components['schemas']['PartyComplexName'];
@@ -101,17 +98,4 @@ export declare namespace Schemas {
101
98
  type simpleTransfersPostRequest = components['schemas']['simpleTransfersPostRequest'];
102
99
  type simpleTransfersPostResponse = components['schemas']['simpleTransfersPostResponse'];
103
100
  type errorSimpleTransfersResponse = components['schemas']['errorSimpleTransfersResponse'];
104
- type AuthorizationChannelType = components['schemas']['AuthorizationChannelType'];
105
- type Integer = components['schemas']['Integer'];
106
- type AuthorizationsPostRequest = components['schemas']['AuthorizationsPostRequest'];
107
- type authorizationsPostRequest = components['schemas']['authorizationsPostRequest'];
108
- type OtpValue = components['schemas']['OtpValue'];
109
- type QRCODE = components['schemas']['QRCODE'];
110
- type U2FPIN = components['schemas']['U2FPIN'];
111
- type U2FPinValue = components['schemas']['U2FPinValue'];
112
- type AuthenticationValue = components['schemas']['AuthenticationValue'];
113
- type AuthenticationInfo = components['schemas']['AuthenticationInfo'];
114
- type AuthorizationResponseType = components['schemas']['AuthorizationResponseType'];
115
- type authorizationsPostResponse = components['schemas']['authorizationsPostResponse'];
116
- type errorAuthorizationsResponse = components['schemas']['errorAuthorizationsResponse'];
117
- }
101
+ }
@@ -7,7 +7,7 @@ items:
7
7
  properties:
8
8
  idType:
9
9
  $ref: >-
10
- ../../../../node_modules/@mojaloop/api-snippets/thirdparty/openapi3/components/schemas/PartyIdType.yaml
10
+ ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml
11
11
  idValue:
12
12
  $ref: >-
13
13
  ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml
@@ -8,7 +8,7 @@ items:
8
8
  properties:
9
9
  idType:
10
10
  $ref: >-
11
- ../../../../node_modules/@mojaloop/api-snippets/thirdparty/openapi3/components/schemas/PartyIdType.yaml
11
+ ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml
12
12
  idValue:
13
13
  $ref: >-
14
14
  ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml
@@ -4,10 +4,10 @@
4
4
  properties:
5
5
  party:
6
6
  $ref: >-
7
- ../../../../node_modules/@mojaloop/api-snippets/thirdparty/openapi3/components/schemas/Party.yaml
7
+ ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/Party.yaml
8
8
  description: Information regarding the requested Party.
9
9
  currentState:
10
10
  $ref: ../schemas/async2SyncCurrentState.yaml
11
11
  required:
12
12
  - party
13
- - currentState
13
+ - currentState
@@ -1,13 +1,13 @@
1
1
  title: QuotesPostRequest
2
2
  type: object
3
3
  properties:
4
- fspId:
4
+ fspId:
5
5
  title: destination DFSP requested to calculate the quote
6
6
  $ref: >-
7
7
  ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml
8
8
  quotesPostRequest:
9
9
  $ref: >-
10
- ../../../../node_modules/@mojaloop/api-snippets/thirdparty/openapi3/components/schemas/QuotesPostRequest.yaml
11
- required:
10
+ ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/QuotesPostRequest.yaml
11
+ required:
12
12
  - fspId
13
13
  - quotesPostRequest
@@ -8,7 +8,7 @@ properties:
8
8
  ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml
9
9
  idType:
10
10
  $ref: >-
11
- ../../../../node_modules/@mojaloop/api-snippets/thirdparty/openapi3/components/schemas/PartyIdType.yaml
11
+ ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml
12
12
  idValue:
13
13
  $ref: >-
14
14
  ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml
@@ -138,6 +138,257 @@
138
138
  "decision": "ignore",
139
139
  "madeAt": 1634716081521,
140
140
  "expiresAt": 1637308004771
141
+ },
142
+ "1004946|@mojaloop/event-sdk>@grpc/proto-loader>yargs>string-width>strip-ansi>ansi-regex": {
143
+ "decision": "ignore",
144
+ "madeAt": 1644879175753,
145
+ "expiresAt": 1647471172307
146
+ },
147
+ "1004946|@mojaloop/central-services-shared>widdershins>oas-resolver>yargs>string-width>strip-ansi>ansi-regex": {
148
+ "decision": "ignore",
149
+ "madeAt": 1644879175753,
150
+ "expiresAt": 1647471172307
151
+ },
152
+ "1004946|@mojaloop/central-services-shared>widdershins>oas-resolver>yargs>cliui>string-width>strip-ansi>ansi-regex": {
153
+ "decision": "ignore",
154
+ "madeAt": 1644879175753,
155
+ "expiresAt": 1647471172307
156
+ },
157
+ "1004946|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-resolver>yargs>cliui>string-width>strip-ansi>ansi-regex": {
158
+ "decision": "ignore",
159
+ "madeAt": 1644879175753,
160
+ "expiresAt": 1647471172307
161
+ },
162
+ "1004946|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>cliui>string-width>strip-ansi>ansi-regex": {
163
+ "decision": "ignore",
164
+ "madeAt": 1644879175754,
165
+ "expiresAt": 1647471172307
166
+ },
167
+ "1004946|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>cliui>wrap-ansi>string-width>strip-ansi>ansi-regex": {
168
+ "decision": "ignore",
169
+ "madeAt": 1644879175754,
170
+ "expiresAt": 1647471172307
171
+ },
172
+ "1004946|@mojaloop/event-sdk>@grpc/proto-loader>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
173
+ "decision": "ignore",
174
+ "madeAt": 1644879175754,
175
+ "expiresAt": 1647471172307
176
+ },
177
+ "1004946|@mojaloop/central-services-shared>widdershins>oas-resolver>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
178
+ "decision": "ignore",
179
+ "madeAt": 1644879175754,
180
+ "expiresAt": 1647471172307
181
+ },
182
+ "1004946|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-resolver>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
183
+ "decision": "ignore",
184
+ "madeAt": 1644879175754,
185
+ "expiresAt": 1647471172307
186
+ },
187
+ "1004946|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
188
+ "decision": "ignore",
189
+ "madeAt": 1644879175754,
190
+ "expiresAt": 1647471172307
191
+ },
192
+ "1004946|@mojaloop/event-sdk>@grpc/proto-loader>yargs>cliui>strip-ansi>ansi-regex": {
193
+ "decision": "ignore",
194
+ "madeAt": 1644879175754,
195
+ "expiresAt": 1647471172307
196
+ },
197
+ "1004854|@mojaloop/central-services-shared>widdershins>openapi-sampler>json-pointer": {
198
+ "decision": "ignore",
199
+ "madeAt": 1644879153322,
200
+ "expiresAt": 1647471110577
201
+ },
202
+ "1004869|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
203
+ "decision": "ignore",
204
+ "madeAt": 1644879154472,
205
+ "expiresAt": 1647471110577
206
+ },
207
+ "1004869|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
208
+ "decision": "ignore",
209
+ "madeAt": 1644879154472,
210
+ "expiresAt": 1647471110577
211
+ },
212
+ "1004946|@mojaloop/central-services-shared>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
213
+ "decision": "ignore",
214
+ "madeAt": 1644879155619,
215
+ "expiresAt": 1647471110577
216
+ },
217
+ "1004946|@mojaloop/central-services-shared>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
218
+ "decision": "ignore",
219
+ "madeAt": 1644879155619,
220
+ "expiresAt": 1647471110577
221
+ },
222
+ "1005383|@mojaloop/central-services-shared>shins>sanitize-html": {
223
+ "decision": "ignore",
224
+ "madeAt": 1644879156746,
225
+ "expiresAt": 1647471110577
226
+ },
227
+ "1005384|@mojaloop/central-services-shared>shins>sanitize-html": {
228
+ "decision": "ignore",
229
+ "madeAt": 1644879156746,
230
+ "expiresAt": 1647471110577
231
+ },
232
+ "1005534|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
233
+ "decision": "ignore",
234
+ "madeAt": 1644879157837,
235
+ "expiresAt": 1647471110577
236
+ },
237
+ "1006865|axios>follow-redirects": {
238
+ "decision": "fix",
239
+ "madeAt": 1644879138577
240
+ },
241
+ "1006865|@mojaloop/central-services-shared>axios>follow-redirects": {
242
+ "decision": "fix",
243
+ "madeAt": 1644879138577
244
+ },
245
+ "1007023|axios>follow-redirects": {
246
+ "decision": "fix",
247
+ "madeAt": 1644879138577
248
+ },
249
+ "1007023|@mojaloop/central-services-shared>axios>follow-redirects": {
250
+ "decision": "fix",
251
+ "madeAt": 1644879138577
252
+ },
253
+ "1006899|@mojaloop/central-services-shared>widdershins>node-fetch": {
254
+ "decision": "fix",
255
+ "madeAt": 1644879149946
256
+ },
257
+ "1006899|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>node-fetch": {
258
+ "decision": "fix",
259
+ "madeAt": 1644879149946
260
+ },
261
+ "1006846|@mojaloop/central-services-shared>shins>sanitize-html>postcss": {
262
+ "decision": "ignore",
263
+ "madeAt": 1644879158938,
264
+ "expiresAt": 1647471110577
265
+ },
266
+ "1006886|@mojaloop/central-services-shared>shins>markdown-it": {
267
+ "decision": "ignore",
268
+ "madeAt": 1644879160175,
269
+ "expiresAt": 1647471110577
270
+ },
271
+ "1007017|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
272
+ "decision": "ignore",
273
+ "madeAt": 1644879161354,
274
+ "expiresAt": 1647471110577
275
+ },
276
+ "1064587|@mojaloop/central-services-shared>widdershins>urijs": {
277
+ "decision": "fix",
278
+ "madeAt": 1647565572809
279
+ },
280
+ "1064606|@mojaloop/central-services-shared>widdershins>urijs": {
281
+ "decision": "fix",
282
+ "madeAt": 1647565572809
283
+ },
284
+ "1067233|@mojaloop/central-services-shared>widdershins>urijs": {
285
+ "decision": "fix",
286
+ "madeAt": 1647565572809
287
+ },
288
+ "1064843|@mojaloop/event-sdk>@grpc/proto-loader>yargs>string-width>strip-ansi>ansi-regex": {
289
+ "decision": "ignore",
290
+ "madeAt": 1647565608486,
291
+ "expiresAt": 1650157604921
292
+ },
293
+ "1064843|@mojaloop/central-services-shared>widdershins>oas-resolver>yargs>string-width>strip-ansi>ansi-regex": {
294
+ "decision": "ignore",
295
+ "madeAt": 1647565608486,
296
+ "expiresAt": 1650157604921
297
+ },
298
+ "1064843|@mojaloop/central-services-shared>widdershins>oas-resolver>yargs>cliui>string-width>strip-ansi>ansi-regex": {
299
+ "decision": "ignore",
300
+ "madeAt": 1647565608486,
301
+ "expiresAt": 1650157604921
302
+ },
303
+ "1064843|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-resolver>yargs>cliui>string-width>strip-ansi>ansi-regex": {
304
+ "decision": "ignore",
305
+ "madeAt": 1647565608486,
306
+ "expiresAt": 1650157604921
307
+ },
308
+ "1064843|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>cliui>string-width>strip-ansi>ansi-regex": {
309
+ "decision": "ignore",
310
+ "madeAt": 1647565608486,
311
+ "expiresAt": 1650157604921
312
+ },
313
+ "1064843|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>cliui>wrap-ansi>string-width>strip-ansi>ansi-regex": {
314
+ "decision": "ignore",
315
+ "madeAt": 1647565608486,
316
+ "expiresAt": 1650157604921
317
+ },
318
+ "1064843|@mojaloop/event-sdk>@grpc/proto-loader>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
319
+ "decision": "ignore",
320
+ "madeAt": 1647565608486,
321
+ "expiresAt": 1650157604921
322
+ },
323
+ "1064843|@mojaloop/central-services-shared>widdershins>oas-resolver>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
324
+ "decision": "ignore",
325
+ "madeAt": 1647565608486,
326
+ "expiresAt": 1650157604921
327
+ },
328
+ "1064843|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-resolver>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
329
+ "decision": "ignore",
330
+ "madeAt": 1647565608486,
331
+ "expiresAt": 1650157604921
332
+ },
333
+ "1064843|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
334
+ "decision": "ignore",
335
+ "madeAt": 1647565608487,
336
+ "expiresAt": 1650157604921
337
+ },
338
+ "1064843|@mojaloop/event-sdk>@grpc/proto-loader>yargs>cliui>strip-ansi>ansi-regex": {
339
+ "decision": "ignore",
340
+ "madeAt": 1647565608487,
341
+ "expiresAt": 1650157604921
342
+ },
343
+ "1064661|@mojaloop/central-services-shared>shins>markdown-it": {
344
+ "decision": "ignore",
345
+ "madeAt": 1647565592292,
346
+ "expiresAt": 1650157555692
347
+ },
348
+ "1064744|@mojaloop/central-services-shared>widdershins>openapi-sampler>json-pointer": {
349
+ "decision": "ignore",
350
+ "madeAt": 1647565593879,
351
+ "expiresAt": 1650157555692
352
+ },
353
+ "1064761|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
354
+ "decision": "ignore",
355
+ "madeAt": 1647565594838,
356
+ "expiresAt": 1650157555692
357
+ },
358
+ "1064761|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
359
+ "decision": "ignore",
360
+ "madeAt": 1647565594838,
361
+ "expiresAt": 1650157555692
362
+ },
363
+ "1064843|@mojaloop/central-services-shared>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
364
+ "decision": "ignore",
365
+ "madeAt": 1647565599016,
366
+ "expiresAt": 1650157555692
367
+ },
368
+ "1064843|@mojaloop/central-services-shared>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
369
+ "decision": "ignore",
370
+ "madeAt": 1647565599016,
371
+ "expiresAt": 1650157555692
372
+ },
373
+ "1065159|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
374
+ "decision": "ignore",
375
+ "madeAt": 1647565600359,
376
+ "expiresAt": 1650157555692
377
+ },
378
+ "1065367|@mojaloop/central-services-shared>shins>sanitize-html": {
379
+ "decision": "ignore",
380
+ "madeAt": 1647565601450,
381
+ "expiresAt": 1650157555692
382
+ },
383
+ "1065368|@mojaloop/central-services-shared>shins>sanitize-html": {
384
+ "decision": "ignore",
385
+ "madeAt": 1647565601450,
386
+ "expiresAt": 1650157555692
387
+ },
388
+ "1065523|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
389
+ "decision": "ignore",
390
+ "madeAt": 1647565602524,
391
+ "expiresAt": 1650157555692
141
392
  }
142
393
  },
143
394
  "rules": {},
package/config.js CHANGED
@@ -154,5 +154,10 @@ module.exports = {
154
154
  proxyConfig: env.get('PROXY_CONFIG_PATH').asYamlConfig(),
155
155
  reserveNotification: env.get('RESERVE_NOTIFICATION').default('false').asBool(),
156
156
  // resourceVersions config should be string in format: "resouceOneName=1.0,resourceTwoName=1.1"
157
- resourceVersions: env.get('RESOURCE_VERSIONS').default('').asResourceVersions()
157
+ resourceVersions: env.get('RESOURCE_VERSIONS').default('').asResourceVersions(),
158
+
159
+ // in 3PPI DFSP's generate their own `transferId` which is associated with
160
+ // a transactionRequestId. this option decodes the ilp packet for
161
+ // the `transactionId` to retrieve the quote from cache
162
+ allowDifferentTransferTransactionId: env.get('ALLOW_DIFFERENT_TRANSFER_TRANSACTION_ID').default('false').asBool(),
158
163
  };
@@ -34,6 +34,7 @@ class InboundTransfersModel {
34
34
  this._rejectTransfersOnExpiredQuotes = config.rejectTransfersOnExpiredQuotes;
35
35
  this._allowTransferWithoutQuote = config.allowTransferWithoutQuote;
36
36
  this._reserveNotification = config.reserveNotification;
37
+ this._allowDifferentTransferTransactionId = config.allowDifferentTransferTransactionId;
37
38
 
38
39
  this._mojaloopRequests = new MojaloopRequests({
39
40
  logger: this._logger,
@@ -175,7 +176,7 @@ class InboundTransfersModel {
175
176
  response.expiration = new Date(expiration).toISOString();
176
177
  }
177
178
 
178
- // project our internal quote reponse into mojaloop quote response form
179
+ // project our internal quote response into mojaloop quote response form
179
180
  const mojaloopResponse = shared.internalQuoteResponseToMojaloop(response);
180
181
 
181
182
  // create our ILP packet and condition and tag them on to our internal quote response
@@ -193,7 +194,7 @@ class InboundTransfersModel {
193
194
  fulfilment: fulfilment
194
195
  });
195
196
 
196
- // now store the quoteRespnse data against the quoteId in our cache to be sent as a response to GET /quotes/{ID}
197
+ // now store the quoteResponse data against the quoteId in our cache to be sent as a response to GET /quotes/{ID}
197
198
  await this._cache.set(`quoteResponse_${quoteRequest.quoteId}`, mojaloopResponse);
198
199
 
199
200
  // make a callback to the source fsp with the quote response
@@ -209,21 +210,21 @@ class InboundTransfersModel {
209
210
  }
210
211
 
211
212
  /**
212
- * This is executed as when GET /quotes/{ID} request is made to get the response of a previous POST /quotes request.
213
+ * This is executed as when GET /quotes/{ID} request is made to get the response of a previous POST /quotes request.
213
214
  * Gets the quoteResponse from the cache and makes a callback to the originator with result
214
215
  */
215
216
  async getQuoteRequest(quoteId, sourceFspId) {
216
217
  try {
217
218
  // Get the quoteRespnse data for the quoteId from the cache to be sent as a response to GET /quotes/{ID}
218
219
  const quoteResponse = await this._cache.get(`quoteResponse_${quoteId}`);
219
-
220
+
220
221
  // If no quoteResponse is found in the cache, make an error callback to the source fsp
221
222
  if (!quoteResponse) {
222
223
  const err = new Error('Quote Id not found');
223
224
  const mojaloopError = await this._handleError(err, Errors.MojaloopApiErrorCodes.QUOTE_ID_NOT_FOUND);
224
225
  this._logger.push({ mojaloopError }).log(`Sending error response to ${sourceFspId}`);
225
226
  return await this._mojaloopRequests.putQuotesError(quoteId,
226
- mojaloopError, sourceFspId);
227
+ mojaloopError, sourceFspId);
227
228
  }
228
229
  // Make a PUT /quotes/{ID} callback to the source fsp with the quote response
229
230
  return this._mojaloopRequests.putQuotes(quoteId, quoteResponse, sourceFspId);
@@ -270,14 +271,20 @@ class InboundTransfersModel {
270
271
 
271
272
 
272
273
  /**
273
- * Validates an incoming transfer prepare request and makes a callback to the originator with
274
+ * Validates an incoming transfer prepare request and makes a callback to the originator with
274
275
  * the result
275
276
  */
276
277
  async prepareTransfer(prepareRequest, sourceFspId) {
277
278
  try {
278
-
279
279
  // retrieve our quote data
280
- const quote = await this._cache.get(`quote_${prepareRequest.transferId}`);
280
+ let quote;
281
+
282
+ if (this._allowDifferentTransferTransactionId) {
283
+ const transactionId = this._ilp.getTransactionObject(prepareRequest.ilpPacket).transactionId;
284
+ quote = await this._cache.get(`quote_${transactionId}`);
285
+ } else {
286
+ quote = await this._cache.get(`quote_${prepareRequest.transferId}`);
287
+ }
281
288
 
282
289
  if(!quote) {
283
290
  // Check whether to allow transfers without a previous quote.
@@ -703,7 +710,7 @@ class InboundTransfersModel {
703
710
  }
704
711
 
705
712
  /**
706
- * Forwards Switch notification for fulfiled transfer to the DFSP backend, when acting as a payee
713
+ * Forwards Switch notification for fulfiled transfer to the DFSP backend, when acting as a payee
707
714
  */
708
715
  async sendNotificationToPayee(body, transferId) {
709
716
  try {
@@ -44,6 +44,7 @@ class OutboundBulkQuotesModel {
44
44
  jwsSign: config.jwsSign,
45
45
  jwsSigningKey: config.jwsSigningKey,
46
46
  wso2: config.wso2,
47
+ resourceVersions: config.resourceVersions,
47
48
  });
48
49
  }
49
50
 
@@ -43,6 +43,7 @@ class OutboundBulkTransfersModel {
43
43
  jwsSignPutParties: config.jwsSignPutParties,
44
44
  jwsSigningKey: config.jwsSigningKey,
45
45
  wso2: config.wso2,
46
+ resourceVersions: config.resourceVersions,
46
47
  });
47
48
  }
48
49
 
@@ -56,6 +56,7 @@ class OutboundTransfersModel {
56
56
  jwsSignPutParties: config.jwsSignPutParties,
57
57
  jwsSigningKey: config.jwsSigningKey,
58
58
  wso2: config.wso2,
59
+ resourceVersions: config.resourceVersions,
59
60
  });
60
61
 
61
62
  this._ilp = new Ilp({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter",
3
- "version": "11.18.9",
3
+ "version": "12.0.0",
4
4
  "description": "An adapter for connecting to Mojaloop API enabled switches.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -49,6 +49,12 @@
49
49
  "type": "git",
50
50
  "url": "git@github.com:mojaloop/sdk-scheme-adapter.git"
51
51
  },
52
+ "@comment dependencies": [
53
+ "koa2-oauth-server is an old unmaintained repo. It uses the now unsupported git protocol.",
54
+ "Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.",
55
+ "If you regenerate package-lock.json, you will manually have to update `git://` to `https://` on its",
56
+ "dependencies."
57
+ ],
52
58
  "dependencies": {
53
59
  "@koa/cors": "^3.1.0",
54
60
  "@mojaloop/central-services-error-handling": "11.3.0",
@@ -57,7 +63,7 @@
57
63
  "@mojaloop/central-services-metrics": "11.0.0",
58
64
  "@mojaloop/central-services-shared": "14.0.0",
59
65
  "@mojaloop/event-sdk": "10.7.1",
60
- "@mojaloop/sdk-standard-components": "15.13.0",
66
+ "@mojaloop/sdk-standard-components": "^16.0.0",
61
67
  "ajv": "8.6.3",
62
68
  "ajv-keywords": "5.0.0",
63
69
  "axios": "^0.21.4",
@@ -79,7 +85,7 @@
79
85
  "devDependencies": {
80
86
  "@babel/core": "^7.15.5",
81
87
  "@babel/preset-env": "^7.15.6",
82
- "@mojaloop/api-snippets": "^13.0.3",
88
+ "@mojaloop/api-snippets": "^13.0.9",
83
89
  "@redocly/openapi-cli": "^1.0.0-beta.59",
84
90
  "@types/jest": "^27.0.1",
85
91
  "babel-jest": "^27.2.0",
@@ -21,6 +21,7 @@ const mockTxnReqquestsArguments = require('./data/mockTxnRequestsArguments');
21
21
  const { MojaloopRequests, Ilp, Logger } = require('@mojaloop/sdk-standard-components');
22
22
  const { BackendRequests, HTTPResponseError } = require('../../../../lib/model/lib/requests');
23
23
  const Cache = require('../../../../lib/cache');
24
+ const shared = require('../../../../lib/model/lib/shared');
24
25
 
25
26
  const getTransfersBackendResponse = require('./data/getTransfersBackendResponse');
26
27
  const getTransfersMojaloopResponse = require('./data/getTransfersMojaloopResponse');
@@ -232,9 +233,9 @@ describe('inboundModel', () => {
232
233
 
233
234
  test('calls `mojaloopRequests.putAuthorizations` with the expected arguments.', async () => {
234
235
  await model.getAuthorizations('123456', mockTxnReqArgs.fspId);
235
-
236
+
236
237
  expect(MojaloopRequests.__putAuthorizations).toHaveBeenCalledTimes(1);
237
-
238
+
238
239
  });
239
240
 
240
241
 
@@ -406,6 +407,43 @@ describe('inboundModel', () => {
406
407
  expect(BackendRequests.__postTransfers).toHaveBeenCalledTimes(1);
407
408
  expect(MojaloopRequests.__putTransfers).toHaveBeenCalledTimes(1);
408
409
  });
410
+
411
+ test('allow different transfer and transaction id', async () => {
412
+ const transactionId = 'mockTransactionId';
413
+ const TRANSFER_ID = 'transfer-id';
414
+ shared.mojaloopPrepareToInternalTransfer = jest.fn().mockReturnValueOnce({});
415
+
416
+ cache.set(`quote_${transactionId}`, {
417
+ fulfilment: '',
418
+ mojaloopResponse: {
419
+ response: ''
420
+ }
421
+ });
422
+
423
+ const args = {
424
+ transferId: TRANSFER_ID,
425
+ amount: {
426
+ currency: 'USD',
427
+ amount: 20.13
428
+ },
429
+ ilpPacket: 'mockIlpPacket',
430
+ condition: 'mockGeneratedCondition'
431
+ };
432
+
433
+ const model = new Model({
434
+ ...config,
435
+ cache,
436
+ logger,
437
+ allowDifferentTransferTransactionId: true,
438
+ checkIlp: false,
439
+ });
440
+
441
+ await model.prepareTransfer(args, mockArgs.fspId);
442
+
443
+ expect(MojaloopRequests.__putTransfersError).toHaveBeenCalledTimes(0);
444
+ expect(BackendRequests.__postTransfers).toHaveBeenCalledTimes(1);
445
+ expect(MojaloopRequests.__putTransfers).toHaveBeenCalledTimes(1);
446
+ });
409
447
  });
410
448
 
411
449
  describe('prepareBulkTransfer:', () => {
@@ -574,7 +612,7 @@ describe('inboundModel', () => {
574
612
  }
575
613
  ]
576
614
  };
577
-
615
+
578
616
  const model = new Model({
579
617
  ...config,
580
618
  cache,
@@ -595,7 +633,7 @@ describe('inboundModel', () => {
595
633
  const transferId = '1234';
596
634
  let cache;
597
635
 
598
- beforeEach(async () => {
636
+ beforeEach(async () => {
599
637
  cache = new Cache({
600
638
  host: 'dummycachehost',
601
639
  port: 1234,