Nodejs API Wrapper For School Billing.
npm install school-billing-proxy
var url = "endpoint";
// Require the library
var billing = require('school-billing-proxy')(process.env.APP_ID, process.env.APP_KEY, process.env.SCHOOL_CODE, url);
The resource methods accepts are promisified, but can receive optional callback as the last argument.
// billing.{resource}
billing.school.getSchools({})
.then((body)=> {
console.log(body);
})
.catch((error)=> {
console.log(error);
});
For all resource methods, the JSON body can be passed as the argument.
- school
- getSchools
- getActiveSession
- sendOtp
- sendSms
- verifyOtp
- buyVoucher
- verifyVoucher
- getDepartments
- getForms
- getClass
- getLevels
- getSemesters
- getCourses
- getAdmission
- submitApplication
- changePin
- getStudent
- getStudentBills
- getStudentBillsUssd
- getStudentWallet
- studentTopup
- walletTopup
- getStudentMessage
- postMessage
- getFeeTypes
- getNotifications
- getNotificationById
- recentPayments
- requestFeePayment
- payBills
- paymentReport
- verifyPayment
Method to purchase Voucher
billing.school.buyVoucher({
name: 'Firstname Lastname',
mobile: '+233540000000',
mobile_network: 'MTN || AIRTEL || TIGO || VODAFONE',
email: 'harmony.alabi@cross-switch.com',
code: '+233540000000',
formCode: '',
amount: 1,
}).then((body)=> {
console.log(body);
}).catch((error)=> {
console.log(error);
});
Method to Verify voucher.
billing.school.verifyVoucher({code: code })
.then((body)=> {
console.log(body);
}).catch((error)=> {
console.log(error);
});
Method to Verify Transaction status.
billing.school.verifyPayment({
order_id: `${transactionid}`,
}).then((body)=> {
console.log(body);
}).catch((error)=> {
console.log(error);
});