0.0.8 • Published 8 years ago

rebilly v0.0.8

Weekly downloads
37
License
-
Repository
github
Last release
8 years ago

Rebilly node.js bindings Build Status

(Inspired by stripe-node)

Installation

npm install rebilly

Documentation

Documentation is available at https://www.rebilly.com/api/documentation/v2.1/.

API Overview

Every resource is accessed via your rebilly instance:

var rebilly = require('rebilly')(' your rebilly API key ');
// rebilly.{ RESOURCE_NAME }.{ METHOD_NAME }

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

rebilly.customers.create(
  { email: 'customer@example.com' },
  function(err, customer) {
    err; // null if no error occurred
    customer; // the created customer object
  }
);

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

// Create a new customer and then a new charge for that customer:
rebilly.customers.create({
  email: 'name@company.com'
}).then(function(customer) {
  return rebilly.customers.update(customer.id, {
    defaultCard: '4242'
  });
}).then(function(charge) {
  // New charge created on a new customer
}, function(err) {
  // Deal with an error
});

Available resources & methods

Where you see params it is a plain JavaScript object, e.g. { email: 'name@company.com' }

Configuration

  • rebilly.setApiKey(' your secret api key ');
  • rebilly.setTimeout(20000); // in ms (default is node's default: 120000ms)

Development

To run the tests you'll need a Rebilly Sandbox API key (from your Rebilly Dashboard):

$ npm install -g mocha
$ npm test

Note: On Windows use SET instead of export for setting the REBILLY_TEST_API_KEY environment variable.

Author

Originally by Pedro Sampaio. Development was sponsored by Greenlamp.

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago