clt-api

A nodejs wrapper for President Collect Service API

A nodejs wrapper for President Collect Service API

Unofficial JavaScript implementation of the CLT SDK for Node.js.

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

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 (errcallback) {
  if (err) {
    console.log(err);
  } else {
    console.log(callback);
  }
});

The SDK currently supports the following services:

Service Name Class Name
CLT Payment By CVSCLT.CVS
CLT Payment By Credit CardCLT.COCS