Socket
Socket
Sign inDemoInstall

rebilly

Package Overview
Dependencies
5
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rebilly

Rebilly API wrapper


Version published
Weekly downloads
5
decreased by-37.5%
Maintainers
1
Install size
5.37 MB
Created
Weekly downloads
 

Readme

Source

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.

FAQs

Last updated on 10 Mar 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc