0.1.0 • Published 7 years ago

kashflow v0.1.0

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

Kashflow

A wrapper for the Kashflow SOAP/WSDL API, using node-soap

Simplifies the process of creating a Kashflow client by adding Authentication to each call. Methods return Promises.

Installation

$ npm install --save kashflow

Usage

The library returns a Promise which resolves with a kashflow client object, which has Kashflow methods as its properties.

See the docs for available Kashflow methods.

const Kashflow = require('kashflow')
const { KASHFLOW_USERNAME, KASHFLOW_API_PASSWORD } = process.env
// Set up the client
Kashflow(KASHFLOW_USERNAME, KASHFLOW_API_PASSWORD).then(kashflow => {
    // call methods on the client
    return kashflow.GetInvoiceById({
        InvoiceID: '12345'
    })
    .then(res => {
        console.log(res.GetInvoiceByIdResult)
    })
})

Testing

You'll need to create a .env file in your project root as follows

KASHFLOW_USERNAME=<Your Username>
KASHFLOW_API_PASSWORD=<Your Password>

Then

npm test