Billplz API wrapper for nodejs. This module supports only Billplz API V3.
API Reference: https://www.billplz.com/api
npm install billplz
const billplz = new Billplz({
'key': 'your-api-key',
'sandbox': true,
'xSignatureKey': 'your-xSignatureKey',
})
billplz.create_collection({
'title': 'My Noodle Shop'
}, function(err, res) {
if (err) {
//handle http client error
}
//success, do your stuff here
console.log(res)
})
billplz.create_collectionOpen({
'title': 'Noodle Exhibition Ticket',
'description': 'VVIP Ticket to Noodle Exhibition!',
'amount': 25550, //RM255.50
'reference_1_label': 'MyKAD',
'reference_2_label': 'First Name'
}, function(err, res) {
console.log(res)
})
billplz.create_bill({
'collection_id': 'your-collection-id',
'description': 'Mee Segera Sedap 200g',
'email': 'sukamakan@meesegera.com',
'name': 'Ahmad Segera',
'amount': 550, //RM5.50
'callback_url': "http://example.com/webhook/",
'redirect_url': "http://example.com/thank-you",
'due_at': '2016-08-31'
}, function(err, res) {
console.log(res)
})
billplz.get_bill('your-bill-id', function(err, res) {
console.log(res)
})
billplz.delete_bill('your-bill-id', function(err, res) {
console.log(res)
})
// activate or deactivate
billplz.change_collection_status('your-collection-id', 'status-here', function(err, res) {
console.log(err);
})
billplz.registration_check('your-bank-account-number', function(err, res) {
console.log(res.name);
});
const isVerified = billplz.verifySignature(request.body, request.body.x_signature);