Skip to content

Commit

Permalink
fix: fix party lasterror logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kleyow committed Nov 9, 2022
1 parent 3e6156a commit a232def
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,22 @@ export async function handleProcessPartyInfoCallbackCmdEvt(
const individualTransferData = await bulkTransactionAgg
.getIndividualTransferById(individualTransferId);

const lastError = (
individualTransferData.partyResponse?.errorInformation && {
mojaloopError: individualTransferData.partyResponse?.errorInformation,
}) || (
individualTransferData.lastError && {
mojaloopError: individualTransferData.lastError.mojaloopError,
});

// Individual transfers where `partyResult.currentState` does
// not match SDKOutboundTransferState.COMPLETED will have no `partyResponse`
// set. `transactionId` and `homeTransaction` still need to be set.
individualTransferResults.push({
homeTransactionId: individualTransferData.request.homeTransactionId,
transactionId: individualTransferData.id,
to: individualTransferData.partyResponse?.party,
lastError: individualTransferData.lastError && {
mojaloopError: individualTransferData.lastError.mojaloopError,
},
lastError,
});
}
const sdkOutboundBulkAcceptPartyInfoRequestedDmEvt = new SDKOutboundBulkAcceptPartyInfoRequestedDmEvt({
Expand Down

0 comments on commit a232def

Please sign in to comment.