Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ShareTempus API for node.js

Installation

npm install sharetempus --save

Documentation

Documentation is available at http://docs.sharetempus.com

API Overview

Every element is accessed via your sharetempus instance:

var ShareTempus = require('sharetempus')('your sharetempus API key');
// ShareTempus.{ ELEMENT_NAME }.{ METHOD_NAME }

Every element method accepts an optional callback as the last argument:

ShareTempus.customers.create({
    "email": "email@test.com",
    "legalEntity": {
        "type": "individual",
        "firstName": "Trenton",
        "lastName": "Large",
        "birthdate": 637124400000,
        "ssnLast4": "1234",
        "address": {
            "city": "New York City",
            "country": "US",
            "line1": "East 169th Street",
            "line2": "Apt. 2A Bronx",
            "postalCode": "10456",
            "state": "New York"
        }
    }
}, function(error, customer) {
    if(!error) {
        console.log(customer);
    }
});

Additionally, every element method returns a promise, so you don't have to use the regular callback. E.g.

ShareTempus.customers.create({
    "email": "email@test.com",
    "legalEntity": {
        "type": "individual",
        "firstName": "Trenton",
        "lastName": "Large",
        "birthdate": 637124400000,
        "ssnLast4": "1234",
        "address": {
            "city": "New York City",
            "country": "US",
            "line1": "East 169th Street",
            "line2": "Apt. 2A Bronx",
            "postalCode": "10456",
            "state": "New York"
        }
    }
}).then(function(customer) {
    console.log(customer);
}).catch(function(error) {
    console.log(error);
});

Development

Run the tests using npm:

$ npm install
$ npm test

About

ShareTempus API wrapper for NodeJS

Topics

Resources

License

Releases

No releases published

Packages

No packages published