ml-testing-toolkit 18.17.0-snapshot.4 → 18.17.0-snapshot.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ml-testing-toolkit",
3
3
  "description": "Testing Toolkit for Mojaloop implementations",
4
- "version": "18.17.0-snapshot.4",
4
+ "version": "18.17.0-snapshot.6",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Vijaya Kumar Guthi, ModusBox Inc. ",
7
7
  "contributors": [
@@ -143,6 +143,7 @@ const handleTransferIlp = (context, response) => {
143
143
 
144
144
  customLogger.logMessage('debug', 'Generated callback body', { additionalData: { context, response }, request: context.request })
145
145
  if (context.request.method === 'get' && response.method === 'put' && pathMatch.test(response.path)) {
146
+ customLogger.logMessage('debug', 'success', { additionalData: { context, response }, request: context.request })
146
147
  const transferId = response.path.match(pathMatch)[1]
147
148
  const storedTransfer = context.storedTransfers?.[transferId]
148
149
 
@@ -319,15 +319,15 @@ const generateAsyncCallback = async (item, context, req) => {
319
319
  }
320
320
  } else {
321
321
  // Store transfers early - right after validation
322
- const transferPathMatch = /\/transfers\/([^/]+)$/
323
- const fxTransferPathMatch = /\/fxTransfers\/([^/]+)$/
322
+ const transferPathMatch = /\/transfers(?:\/([^/]+))?$/
323
+ const fxTransferPathMatch = /\/fxTransfers(?:\/([^/]+))?$/
324
324
  customLogger.logMessage('debug', 'Processing transfer request', { additionalData: { method: req.method, path: req.path }, request: req })
325
325
  if (req.method === 'post' && (transferPathMatch.test(req.path) || fxTransferPathMatch.test(req.path))) {
326
326
  if (!context.storedTransfers) {
327
327
  context.storedTransfers = {}
328
328
  }
329
329
  const isFxTransfer = fxTransferPathMatch.test(req.path)
330
- const transferId = req.path.match(isFxTransfer ? fxTransferPathMatch : transferPathMatch)[1]
330
+ const transferId = (req.payload && req.payload.transferId) || (req.payload && req.payload.commitRequestId)
331
331
  customLogger.logMessage('debug', 'Storing transfer for validation', { additionalData: { transferId }, request: req })
332
332
 
333
333
  context.storedTransfers[transferId] = {