paybillplz
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

node-billplz

license img

Billplz API wrapper for nodejs. This module supports only Billplz API V3.

API Reference: https://www.billplz.com/api

NPM

Usage

Install

npm install billplz

Create a client

const billplz = new Billplz({
  'key': 'your-api-key',
  'sandbox': true,
  'xSignatureKey': 'your-xSignatureKey',
})

Create a collection

billplz.create_collection({
  'title': 'My Noodle Shop'
}, function(err, res) {
  if (err) {
    //handle http client error
  }

  //success, do your stuff here
  console.log(res)
})

Create an open collection

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

Create a bill

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

Retrieve a bill

billplz.get_bill('your-bill-id', function(err, res) {
  console.log(res)
})

Delete a bill

billplz.delete_bill('your-bill-id', function(err, res) {
  console.log(res)
})

Change a collection status

// activate or deactivate
billplz.change_collection_status('your-collection-id', 'status-here', function(err, res) {
  console.log(err);
})

Registration check

billplz.registration_check('your-bank-account-number', function(err, res) {
  console.log(res.name);
});

Verify Signature

const isVerified = billplz.verifySignature(request.body, request.body.x_signature);

Readme

Keywords

Package Sidebar

Install

npm i paybillplz

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

9.57 kB

Total Files

6

Last publish

Collaborators

  • adlrz