1.0.1 • Published 6 years ago

biwse-js v1.0.1

Weekly downloads
6
License
-
Repository
github
Last release
6 years ago

biwse-js

The Biwse Javascript library provides access to the Biwse API.

Documentation

See the Biwse API docs.

Installation

Install the package with:

npm install biwse-js --save

Usage

The package needs to be configured with your application access token which is available in your Biwse Dashboard.

import BiwseAPI from 'biwse-js'

const app = new BiwseAPI('your_token...')
// Create address and subscribe for payment update.
const { address } = await app.newAddress('https://your_address...')
// Create invoice page. You can send you customer to this url.
const { url } = await app.newInvoice(address, 0.001)

Simplified example

Every method returns a Promise which can be used instead of a async/await. Below you can see simplified example without ES6 modules, async/await and destructuring assignment:

const BiwseAPI = require('biwse-js')

const app = new BiwseAPI('your_token...')

// Create address and subscribe for payment update.
app.newAddress('https://your_address...').then(function(response) {
  // Create invoice page. 
  app.newInvoice(response.address, 0.001).then(function(response) {
    // You can send you customer to this url.
    const url = response url
  })
})

The Unlicense.