@mojaloop/sdk-scheme-adapter 24.2.0-csi-1210.4 → 24.2.0-csi-1210.6

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.
Binary file
@@ -73,7 +73,7 @@
73
73
  "@mojaloop/logging-bc-client-lib": "0.5.8",
74
74
  "@mojaloop/ml-schema-transformer-lib": "2.5.6",
75
75
  "@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
76
- "@mojaloop/sdk-standard-components": "v19.9.0-snapshot.2",
76
+ "@mojaloop/sdk-standard-components": "v19.9.0",
77
77
  "ajv": "8.17.1",
78
78
  "axios": "1.8.1",
79
79
  "body-parser": "1.20.3",
@@ -212,16 +212,21 @@ class InboundTransfersModel {
212
212
  // have a record of the request in the cache.
213
213
  await this._save();
214
214
 
215
+ const log = this._logger.push({
216
+ transferId: this.data.transferId,
217
+ quoteId: quoteRequest.quoteId
218
+ });
219
+
215
220
  try {
216
221
  const internalForm = shared.mojaloopQuoteRequestToInternal(quoteRequest);
217
222
 
218
223
  // Check the transactionRequestId exists in cache
219
224
  if(quoteRequest.transactionRequestId) {
220
225
  const previousTxnReq = await this._cache.get(`txnReqModel_${quoteRequest.transactionRequestId}`);
221
- if(previousTxnReq) {
226
+ if (previousTxnReq) {
222
227
  internalForm.homeR2PTransactionId = previousTxnReq.homeR2PTransactionId;
223
228
  } else {
224
- this._logger.isErrorEnabled && this._logger.error(`No previous transactionRequest found in cache with transactionRequestId: ${quoteRequest.transactionRequestId}. Unable to fetch homeR2PTransactionId.`);
229
+ log.isErrorEnabled && log.error(`No previous transactionRequest found in cache with transactionRequestId: ${quoteRequest.transactionRequestId}. Unable to fetch homeR2PTransactionId.`);
225
230
  }
226
231
  }
227
232
 
@@ -263,18 +268,18 @@ class InboundTransfersModel {
263
268
  const res = await this._mojaloopRequests.putQuotes(quoteRequest.quoteId, mojaloopResponse, sourceFspId, headers, { isoPostQuote: request.isoPostQuote });
264
269
 
265
270
  this.data.quoteResponse = {
266
- headers: res.originalRequest.headers,
271
+ headers: res.originalRequest?.headers,
267
272
  body: mojaloopResponse,
268
273
  };
269
274
  this.data.currentState = SDKStateEnum.WAITING_FOR_QUOTE_ACCEPTANCE;
270
-
271
275
  await this._save();
276
+
277
+ log.isInfoEnabled && log.info('quoteRequest is done');
272
278
  return res;
273
- }
274
- catch (err) {
275
- this._logger.push({ err }).error('Error in quoteRequest');
279
+ } catch (err) {
280
+ log.push({ err }).error('Error in quoteRequest');
276
281
  const mojaloopError = await this._handleError(err);
277
- this._logger.isInfoEnabled && this._logger.push({ mojaloopError }).info(`Sending error response to ${sourceFspId}`);
282
+ log.isInfoEnabled && log.push({ mojaloopError }).info(`Sending error response to ${sourceFspId}`);
278
283
  return this._mojaloopRequests.putQuotesError(quoteRequest.quoteId, mojaloopError, sourceFspId, headers);
279
284
  }
280
285
  }
@@ -307,7 +312,7 @@ class InboundTransfersModel {
307
312
  // make a call to the backend about this notification anyway
308
313
  await this._backendRequests.putRequestToPayNotification(internalForm, transactionRequestId);
309
314
  }
310
- catch(err) {
315
+ catch (err) {
311
316
  this._logger.push({ err, transactionRequestId }).error('Error in putTransactionRequest');
312
317
  const mojaloopError = await this._handleError(err);
313
318
  this._logger.isInfoEnabled && this._logger.push({ mojaloopError }).info(`Sending error response to ${sourceFspId}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter",
3
- "version": "24.2.0-csi-1210.4",
3
+ "version": "24.2.0-csi-1210.6",
4
4
  "description": "mojaloop sdk-scheme-adapter",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/mojaloop/sdk-scheme-adapter",