school-billing-proxy

0.0.2 • Public • Published

school billing proxy

Issues Star Issues

Nodejs API Wrapper For School Billing.

NPM

Installation

npm install school-billing-proxy

Usaged

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);

Making calls to the resources

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.

Resources

  • 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
    • 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);
});

Package Sidebar

Install

npm i school-billing-proxy

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

17.8 kB

Total Files

8

Last publish

Collaborators

  • harmonizer