Code Monkey home page Code Monkey logo

node-billplz's Introduction

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 = require('billplz')
const billplz = new Billplz('your-api-key')
Optional parameter (if needed)
const billplz = new Billplz({
  'key': 'your-api-key',
  'endpoint': 'https://www.billplz.com/api/v3/',
  'sandbox': true
})

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': '[email protected]',
  '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);
});

node-billplz's People

Contributors

suhz avatar akim95 avatar

Stargazers

syukranDev avatar Ibrahim Yaacob avatar dalila avatar Hafiz Hanif avatar aiman anderil avatar Ericson avatar Muhaimin CS avatar Muhammad Nur'Ihsan Bin Berahim avatar  avatar

Watchers

James Cloos avatar Asyrani Azni avatar Suhaimi avatar

node-billplz's Issues

Billplz nestjs issue

Hey,
I was currently working with this npm package and came across an issue, it says -
"TypeError: billplz_1.default is not a constructor"

Can you please guide me through this, it would be really helpful.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.