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

Commit 6794637

Browse files
authored
Merge pull request #4 from xxcxy/develop
update gross_amount
2 parents df42cd7 + fb01299 commit 6794637

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/services/paymentService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async function createPayment (payment) {
4141
try {
4242
await connection.beginTransactionAsync()
4343
const insertDetail = await prepare(connection, INSERT_PAYMENT_DETAIL)
44-
await insertDetail.executeAsync([paymentDetailId, payment.amount, payment.amount, payment.statusId, payment.modificationRationaleId, payment.desc, payment.typeId, payment.methodId, payment.projectId, payment.charityInd, payment.amount, payment.installmentNumber, payment.createUser])
44+
await insertDetail.executeAsync([paymentDetailId, payment.amount, payment.grossAmount, payment.statusId, payment.modificationRationaleId, payment.desc, payment.typeId, payment.methodId, payment.projectId, payment.charityInd, payment.amount, payment.installmentNumber, payment.createUser])
4545
const insertPayment = await prepare(connection, INSERT_PAYMENT)
4646
await insertPayment.executeAsync([paymentId, payment.memberId, paymentDetailId])
4747
const insertDetailXref = await prepare(connection, INSERT_PAYMENT_DETAIL_XREF)

src/services/processorService.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ async function processUpdate (message) {
2222
message.payload.legacyId = null
2323
}
2424
const challengeId = _.get(message, 'payload.legacyId')
25+
const grossAmount = _.sumBy(_.flatMap(message.payload.prizeSets, 'prizes'), 'value')
2526

2627
// the same properties of userPayment and copilotPayment
2728
const basePayment = {
@@ -31,7 +32,8 @@ async function processUpdate (message) {
3132
projectId: message.payload.legacyId,
3233
charityInd: config.CHARITY_IND,
3334
installmentNumber: config.INSTALLMENT_NUMBER,
34-
createUser: createUserId
35+
createUser: createUserId,
36+
grossAmount
3537
}
3638

3739
// add winner payment

0 commit comments

Comments
 (0)