Skip to content

Commit

Permalink
Fix notification error (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
oderayi authored Jul 16, 2020
1 parent a9d3669 commit 0c246fc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
43 changes: 36 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/bulk-api-adapter",
"version": "10.6.0",
"version": "10.6.1",
"description": "Mojaloop Bulk API Adapter",
"license": "Apache-2.0",
"author": "ModusBox",
Expand Down Expand Up @@ -28,7 +28,7 @@
"@mojaloop/central-services-health": "10.6.0",
"@mojaloop/central-services-logger": "10.6.0",
"@mojaloop/central-services-metrics": "9.5.0",
"@mojaloop/central-services-shared": "10.6.1",
"@mojaloop/central-services-shared": "10.6.2",
"@mojaloop/central-services-stream": "10.6.0",
"@mojaloop/event-sdk": "10.6.0",
"@now-ims/hapi-now-auth": "2.0.2",
Expand Down
6 changes: 2 additions & 4 deletions src/handlers/notification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,10 @@ const processMessage = async (msg, span) => {

if (actionLower === ENUM.Events.Event.Action.BULK_GET && statusLower === ENUM.Events.EventStatus.SUCCESS.status) {
const responsePayload = JSON.parse(payloadForCallback)
id = responsePayload.bulkTransferId
id = responsePayload.bulkTransferId || content.uriParams.id
delete responsePayload.bulkTransferId
const callbackURLTo = await Participant.getEndpoint(to, ENUM.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT, id)
const bulkResponseMessage = await BulkTransfer.getBulkTransferResultByMessageIdDestination(messageId, to)
responsePayload.individualTransferResults = bulkResponseMessage.individualTransferResults
callbackHeaders = createCallbackHeaders({ dfspId: to, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.BULK_TRANSFERS_PUT })
callbackHeaders = createCallbackHeaders({ dfspId: to, bulkTransferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.BULK_TRANSFERS_PUT })
Logger.debug(`Notification::processMessage - Callback.sendRequest(${callbackURLTo}, ${ENUM.Http.RestMethods.PUT}, ${JSON.stringify(callbackHeaders)}, ${JSON.stringify(responsePayload)}, ${id}, ${from}, ${to})`)
return Util.Request.sendRequest(callbackURLTo, callbackHeaders, from, to, ENUM.Http.RestMethods.PUT, responsePayload)
}
Expand Down

0 comments on commit 0c246fc

Please sign in to comment.