Files
yume_js/src/controllers/neft.controller.js
2025-08-25 11:45:23 +05:30

38 lines
741 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/Neftfundtransfer',
{
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 failed: ' + (error.response?.data?.message || error.message)
);
}
}
module.exports = { send };