@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.
- package/.yarn/cache/{@mojaloop-sdk-standard-components-npm-19.9.0-snapshot.2-0f7ee02ccc-9986c1c680.zip → @mojaloop-sdk-standard-components-npm-19.9.0-54f15be12d-042cb3fccc.zip} +0 -0
- package/.yarn/install-state.gz +0 -0
- package/modules/api-svc/package.json +1 -1
- package/modules/api-svc/src/lib/model/InboundTransfersModel.js +14 -9
- package/package.json +1 -1
|
Binary file
|
package/.yarn/install-state.gz
CHANGED
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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