implemented RTGS payment feature
This commit is contained in:
36
src/controllers/rtgs.controller.js
Normal file
36
src/controllers/rtgs.controller.js
Normal file
@@ -0,0 +1,36 @@
|
||||
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 };
|
Reference in New Issue
Block a user