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

Commit 76a2666

Browse files
author
James Cori
committed
Merge branch 'develop'
2 parents 5aa5bc9 + 1d26e5a commit 76a2666

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

config/default.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ module.exports = {
4040
// Topcoder APIs
4141
TC_API: process.env.TC_API || 'https://api.topcoder-dev.com/v5',
4242

43-
PAYMENT_STATUS_ID: process.env.PAYMENT_STATUS_ID || 70,
43+
PAYMENT_STATUS_ID: process.env.PAYMENT_STATUS_ID || 55, // on hold
4444
MODIFICATION_RATIONALE_ID: process.env.MODIFICATION_RATIONALE_ID || 1,
4545
WINNER_PAYMENT_TYPE_ID: process.env.WINNER_PAYMENT_TYPE_ID || 72,
4646
COPILOT_PAYMENT_TYPE_ID: process.env.COPILOT_PAYMENT_TYPE_ID || 74,
4747

48+
V5_PAYMENT_DETAIL_STATUS_REASON_ID: process.env.V5_PAYMENT_DETAIL_STATUS_REASON_ID || 500,
49+
4850
PAYMENT_METHOD_ID: process.env.PAYMENT_METHOD_ID || 1,
4951
CHARITY_IND: process.env.CHARITY_IND || 0,
5052
INSTALLMENT_NUMBER: process.env.INSTALLMENT_NUMBER || 1,

src/services/paymentService.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
const logger = require('../common/logger')
66
const helper = require('../common/helper')
7+
const config = require('config');
78
const IDGenerator = require('../common/idGenerator')
89

910
// the paymentDetailId's generator
@@ -18,6 +19,8 @@ const INSERT_PAYMENT = 'INSERT INTO payment (payment_id, user_id, most_recent_de
1819
// the insert statement of payment detail xref
1920
const INSERT_PAYMENT_DETAIL_XREF = 'INSERT INTO payment_detail_xref (payment_id, payment_detail_id) VALUES(?,?)'
2021

22+
const INSERT_PAYMENT_STATUS_REASON_XREF = 'INSERT INTO payment_detail_status_reason_xref (payment_detail_id, payment_status_reason_id) VALUES(?,?)'
23+
2124
/**
2225
* Prepare Informix statement
2326
* @param {Object} connection the Informix connection
@@ -46,6 +49,8 @@ async function createPayment (payment) {
4649
await insertPayment.executeAsync([paymentId, payment.memberId, paymentDetailId])
4750
const insertDetailXref = await prepare(connection, INSERT_PAYMENT_DETAIL_XREF)
4851
await insertDetailXref.executeAsync([paymentId, paymentDetailId])
52+
const insertStatusXref = await prepare(connection, INSERT_PAYMENT_STATUS_REASON_XREF)
53+
await insertStatusXref.executeAsync([paymentDetailId, config.V5_PAYMENT_DETAIL_STATUS_REASON_ID])
4954
logger.info(`Payment ${paymentId} with detail ${paymentDetailId} has been inserted`)
5055
await connection.commitTransactionAsync()
5156
} catch (e) {

0 commit comments

Comments
 (0)