biwse-js
v1.0.1
Published
The Biwse Javascript library provides access to the Biwse API.
Downloads
3
Maintainers
Readme
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
})
})