clt-api
v1.3.1
Published
A nodejs wrapper for President Collect Service API
Downloads
13
Readme
A nodejs wrapper for President Collect Service API
Unofficial JavaScript implementation of the CLT SDK for Node.js.
Installing
The preferred way to install the CLT SDK for Node.js is to use the npm package manager for Node.js. Simply type the following into a terminal window:
npm install clt-api
Usage
After you've installed the SDK, you can require the CLT package in your node
application using require
:
var CLT = require('clt-api');
Here is a quick example that makes some requests against CLT CVS with the SDK:
// Load the CLT SDK for Node.js
var CLT = require('clt-api');
/**
* Don't hard-code your password!
* Load them from disk or your environment instead.
*/
// CLT.config.update({
// cvsCustId: 'YOUR_CVS_CUST_ID',
// cvsCustPassword: 'YOUR_CVS_CUST_PASSWORD',
// cocsLinkId: 'YOUR_COCS_LINK_ID',
// cocsHashBase: 'YOUR_COCS_HASH_BASE'
// });
// Instead, do this:
CLT.config.loadFromPath('./path/to/config.json');
// Query order information.
var cvs = CLT.CVS;
cvs.orderQuery({
UpdateTimeBegin: 'YYYY-MM-DD HH:mm:ss',
UpdateTimeEnd: 'YYYY-MM-DD HH:mm:ss'
}, function (err, callback) {
if (err) {
console.log(err);
} else {
console.log(callback);
}
});
Supported Services
The SDK currently supports the following services: