|
@ -21,8 +21,13 @@ function getHashCode(investor_id, request_id) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getReqAndInvId = ((req, res) => { |
|
|
|
|
|
getReqAndInvIdFun(); |
|
|
|
|
|
res.send("in procress"); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
//get Request_Id and Investor_Id....
|
|
|
//get Request_Id and Investor_Id....
|
|
|
const getReqAndInvId = async () => { |
|
|
|
|
|
|
|
|
const getReqAndInvIdFun = async () => { |
|
|
let allInvestorId = await db.investorSummary.findAll({ |
|
|
let allInvestorId = await db.investorSummary.findAll({ |
|
|
attributes: ['investor_id', 'request_id'] |
|
|
attributes: ['investor_id', 'request_id'] |
|
|
}); |
|
|
}); |
|
@ -37,9 +42,9 @@ const fetchReqAndInvId = async (sendId) => { |
|
|
let checkInvestorId = data[i].investor_id; |
|
|
let checkInvestorId = data[i].investor_id; |
|
|
let checkRequestId = data[i].request_id; |
|
|
let checkRequestId = data[i].request_id; |
|
|
if (checkInvestorId && checkRequestId) { |
|
|
if (checkInvestorId && checkRequestId) { |
|
|
setTimeout(() => { |
|
|
|
|
|
getTransactionById(checkInvestorId, checkRequestId) |
|
|
|
|
|
}, 10); |
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
await getTransactionById(checkInvestorId, checkRequestId) |
|
|
|
|
|
// }, 10);
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -61,12 +66,12 @@ const getTransactionById = (checkInvestorId, checkRequestId) => { |
|
|
request_id: checkRequestId.toString() |
|
|
request_id: checkRequestId.toString() |
|
|
}) |
|
|
}) |
|
|
}; |
|
|
}; |
|
|
request(options, function (error, response) { |
|
|
|
|
|
|
|
|
request(options, async function (error, response) { |
|
|
if (error) throw new Error(error); |
|
|
if (error) throw new Error(error); |
|
|
if (response.body) { |
|
|
if (response.body) { |
|
|
setTimeout(() => { |
|
|
|
|
|
fetchTransactionId(response.body); |
|
|
|
|
|
}, 10); |
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
await fetchTransactionId(response.body); |
|
|
|
|
|
// }, 10);
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} catch (err) { |
|
|
} catch (err) { |
|
@ -105,8 +110,7 @@ const fetchTransactionId = async (data) => { |
|
|
item.ext_transaction_date = trnId.ext_transaction_date, |
|
|
item.ext_transaction_date = trnId.ext_transaction_date, |
|
|
item.source_payment = trnId.source_payment, |
|
|
item.source_payment = trnId.source_payment, |
|
|
item.last_updatedAt = getCurrentDateTime() |
|
|
item.last_updatedAt = getCurrentDateTime() |
|
|
|
|
|
|
|
|
let isRecordPresent = await getInvTransIdQuery(item); |
|
|
|
|
|
|
|
|
let isRecordPresent = await getInvTransIdQuery(item.request_id); |
|
|
if (isRecordPresent.length) { |
|
|
if (isRecordPresent.length) { |
|
|
await db.transactionById.update(item, { |
|
|
await db.transactionById.update(item, { |
|
|
where: { |
|
|
where: { |
|
|