Stanbic Payment APIs Node.js sdk
Install the module by executing:
npm i stanbic_modules
---Node
const credentials ={
client_id: 'STANBIC_API_KEY',
client_secret:'STANBIC_API_SECRET'
}
// Initialize the SDK
const StanBicPayments = require('stanbic_modules')(credentials);
// Get the PAYMENTS Service
const payments= StanBicPayments.PAYMENTS;
// Get the Token Service
const token =StanBicPayments.Token;
async function STK_PUSH(){
const options ={
dbsReferenceId: '',
billAccountRef: '',
amount: '',
mobileNumber:''
}
try {
const results= await token.generateToken(credentials);
const result = await payments.processStk(options,results);
}catch(err){
console.log(err);
}
}
STK_PUSH();
mobileNumber
: customer being charged mobile numberREQUIRED
dbsReferenceId
: This is your Uniqueid reference for each requestREQUIRED
billAccountRef
: The Account number you want your customer to pay into. This is provided by the bankREQUIRED
amount
: amount being deducted from M-PesaREQUIRED
Bug reports and pull requests are welcome on GitHub at https://github.com/Antonymegar/stanbic.git