Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

#PLAT-2164 Make billing account immutable at the challenge level #135

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const dataHandler = (messageSet, topic, partition) => Promise.each(messageSet, a
const m2mToken = await helper.getM2MToken()
const v5Challenge = await helper.getRequest(`${config.V5_CHALLENGE_API_URL}/${challengeUuid}`, m2mToken)
// TODO : Cleanup. Pulling the billingAccountId from the payload, it's not part of the challenge object
messageJSON.payload = { billingAccountId: messageJSON.payload.billingAccountId, ...v5Challenge.body }
const billingAccountId= _.get(v5Challenge, 'billing.billingAccountId', messageJSON.payload.billingAccountId)
messageJSON.payload = { billingAccountId, ...v5Challenge.body }
} catch (err) {
logger.debug('Failed to fetch challenge information')
logger.logFullError(err)
Expand Down