37 lines
748 B
JavaScript
37 lines
748 B
JavaScript
const axios = require('axios');
|
|
|
|
async function send(
|
|
fromAccount,
|
|
toAccount,
|
|
amount,
|
|
ifscCode,
|
|
beneficiaryName,
|
|
remitterName
|
|
) {
|
|
try {
|
|
const response = await axios.post(
|
|
'http://localhost:8690/kccb/Rtgsfundtransfer',
|
|
{
|
|
stFromAcc: fromAccount,
|
|
stToAcc: toAccount,
|
|
stTranAmt: amount,
|
|
stCommission: 0,
|
|
stIfscCode: ifscCode,
|
|
stFullName: remitterName,
|
|
stBeneName: beneficiaryName,
|
|
stAddress1: '',
|
|
stAddress2: '',
|
|
stAddress3: '',
|
|
}
|
|
);
|
|
return response.data;
|
|
} catch (error) {
|
|
throw new Error(
|
|
'API call to CBS failed' +
|
|
(error.response?.data?.message || error.message)
|
|
);
|
|
}
|
|
}
|
|
|
|
module.exports = { send };
|