Skip to content
ShareTempus API wrapper for node.js
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
tests
.babelrc
.eslintrc.js
.gitignore
.travis.yml
LICENSE
README.md
package.json

README.md

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
You can’t perform that action at this time.