feat: added transactions record keeping feature
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
const axios = require('axios');
|
||||
const {
|
||||
recordInterBankTransaction,
|
||||
} = require('../services/recordkeeping.service');
|
||||
|
||||
async function send(
|
||||
customerNo,
|
||||
fromAccount,
|
||||
toAccount,
|
||||
amount,
|
||||
@@ -8,6 +12,7 @@ async function send(
|
||||
beneficiaryName,
|
||||
remitterName
|
||||
) {
|
||||
const commission = 0;
|
||||
try {
|
||||
const response = await axios.post(
|
||||
'http://localhost:8690/kccb/Rtgsfundtransfer',
|
||||
@@ -15,7 +20,7 @@ async function send(
|
||||
stFromAcc: fromAccount,
|
||||
stToAcc: toAccount,
|
||||
stTranAmt: amount,
|
||||
stCommission: 0,
|
||||
stCommission: commission,
|
||||
stIfscCode: ifscCode,
|
||||
stFullName: remitterName,
|
||||
stBeneName: beneficiaryName,
|
||||
@@ -24,6 +29,18 @@ async function send(
|
||||
stAddress3: '',
|
||||
}
|
||||
);
|
||||
await recordInterBankTransaction(
|
||||
customerNo,
|
||||
'rtgs',
|
||||
fromAccount,
|
||||
toAccount,
|
||||
ifscCode,
|
||||
amount,
|
||||
commission,
|
||||
beneficiaryName,
|
||||
remitterName,
|
||||
response.data.status
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
|
Reference in New Issue
Block a user