npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

beanstream-node

v1.0.0-5-beta

Published

Beanstream NodeJS SDK

Readme

beanstream-nodejs

NodeJS integration to Beanstream API.

The Node SDK for Beanstream lets you take payments, save payment profiles, and run reports on your transactions. It's easy to get started, just follow the steps below

Get Started

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);
  });

Here is an example with a raw card number:

var cardPayment = {
  order_number: 'order-abc1234',
  amount:10.00,
  payment_method:'card',
  card:{
    name:'John Doe',
    number:'5100000010001004',
    expiry_month:'02',
    expiry_year:'19',
    cvd:'123'
  }
};
beanstream.payments.makePayment(cardPayment)
  .then(function(response){
    // successful payment
    console.log("Payment response: ", response);
  })
  .catch(function(error){
    // all errors end up here, even declined payments
    console.log(error);
  });

Note that you should tokenize cards in your client-side app in order to reduce your PCI scope. More: http://developer.beanstream.com/documentation/legato/

Step 4) Examples

Visit http://developer.beanstream.com for more code examples. You will learn how to:

  • create a card token
  • make a payment with a token
  • make a card payment
  • make a card pre-authorization and completion
  • make a payment profile
  • charge a payment profile
  • update payment profiles
  • query your transaction history using reports

Want to help improve the SDK?

Whether it is a bug fix or a new feature improvement feel free to fork the project and send us pull requests. We are always excited to work with the community to improve the project. We even have code bounties as a reward for great contributions. So never hesitate to send improvements our way!