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

Commit 7768881

Browse files
author
James Cori
committed
Updating payment status for pacts updates
1 parent 73257d1 commit 7768881

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

config/default.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ module.exports = {
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_ID: process.env.V5_PAYMENT_DETAIL_STATUS_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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const INSERT_PAYMENT = 'INSERT INTO payment (payment_id, user_id, most_recent_de
1818
// the insert statement of payment detail xref
1919
const INSERT_PAYMENT_DETAIL_XREF = 'INSERT INTO payment_detail_xref (payment_id, payment_detail_id) VALUES(?,?)'
2020

21+
const INSERT_PAYMENT_STATUS_REASON_XREF = 'INSERT INTO payment_status_reason_xref (payment_detail_id, payment_status_reason_id) VALUES(?,?)'
22+
2123
/**
2224
* Prepare Informix statement
2325
* @param {Object} connection the Informix connection
@@ -46,6 +48,8 @@ async function createPayment (payment) {
4648
await insertPayment.executeAsync([paymentId, payment.memberId, paymentDetailId])
4749
const insertDetailXref = await prepare(connection, INSERT_PAYMENT_DETAIL_XREF)
4850
await insertDetailXref.executeAsync([paymentId, paymentDetailId])
51+
const insertStatusXref = await prepare(connection, INSERT_PAYMENT_STATUS_REASON_XREF)
52+
await insertStatusXref.executeAsync([paymentDetailId, V5_PAYMENT_DETAIL_STATUS_ID])
4953
logger.info(`Payment ${paymentId} with detail ${paymentDetailId} has been inserted`)
5054
await connection.commitTransactionAsync()
5155
} catch (e) {

0 commit comments

Comments
 (0)