0.2.17 • Published 8 years ago

bitnet-checkout-core v0.2.17

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Bitnet Checkout Core version Build Status

Bitnet Checkout Core is a client library for interacting with the Bitnet Websocket Gateway. This library enables you to create a fully customized checkout experience.

Installation

npm install bitnet-checkout-core --save

Usage

var BitnetCheckoutCore = require('bitnet-checkout-core');

// Pass in the environment, TEST or LIVE
var co = new BitnetCheckoutCore('TEST');

// Set the invoice ID, as retrieved from the *Bitnet RESTful API (see below for a link)
co.setInvoiceId('91c82239-1d93-4c29-8427-fe10a50e2907');

// See below for a full list of Lifecycle Hooks
co.onInvoiceFullyPaid(function(invoice) {
  console.log(invoice);
});

// This will initiate the connection of the websocket
co.connect();

// ...

// This will disconnect the websocket
co.disconnect();

* You can find the Bitnet RESTful API here (referenced in the comment above).

Lifecycle Hooks

You can hook into several points throughout the lifecycle of an invoices state. You've already seen one in the 'usage' example above, onInvoiceFullyPaid. Here is a full list of the available lifecycle hooks:

Building

$ npm i -g webpack
$ npm build

Testing

$ npm test

Licensing

ASL 2.0

0.2.17

8 years ago

0.2.15

8 years ago

0.2.14

8 years ago

0.1.14-6

9 years ago