Node JS SDK is released!

Payments in Node For Javascript lovers

We are pleased to announce the new Node JS SDK to join our lineup. This SDK is the latest addition to Beanstream’s suite of SDKs, rounding out the server-side toolset for developers. The SDK provides easy hooks to our APIs so you can:
  • make credit card payments
  • get payments
  • return or void payments
  • pre-authorize and capture payments
  • search payments
  • store payment information in secure payment profiles
  • tokenize payments
  • and much more
The SDK is released under the MIT license, so you can feel free to modify and use it as you please. If you find any bugs or want to make improvements, please do not hesitate to submit a pull request or post in the issue tracker on GitHub.

Install the SDK

The SDK is easy to install; with a few steps you can be up and running taking credit card payments from your customers.

Step 1) Install the module using NPM

Import the project directly from NPM: npm install beanstream-node

Step 2) Import the module to your project

var beanstream = require('beanstream-node')
('merchantId', 'Payments API key', 'Profiles API key', 'Reporting API key');

Supply your merchant ID, payments API Key, Profiles API key (optional), and Reporting API key (optional).

Step 3) Make a Payment

The Beanstream SDK uses promises to handle asynchronous calls to the server. You will get your results in a Promise object. Here is an example:
var tokenPayment = {
  order_number: 'order-abc1234',
  amount:10.00,
  payment_method:'card',
  token:{
     name:'John Doe',
    code: 'token-string',
    complete: true
  }
};
beanstream.payments.makePayment(tokenPayment)
  .then(function(response){
    // successful payment
    console.log("Payment response: ", response);
  })
  .catch(function(error){
    // all errors end up here, even declined payments
    console.log(error);
  });
Brent Owens

Brent Owens

Brent is our open source software enthusiast and developer advocate. When he is not commuting between Nanaimo and Victoria, he can be found in front of a monitor, working on open source projects. With a software background in enterprise systems and architecture, geographic information systems, emergency management systems, video game engines, and payments he can confuse the best of us with developer jargon. When he wants a break from the blue light, he can be spotted hiking, surfing or fishing with a six-pack of his home-brewed craft beer.
Brent Owens