New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

beanstream

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beanstream

Node library for Beanstream

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Node-Beanstream

A Node.JS library for communicating with the Beanstream API.

Currently only supports these actions of the Transactions API:

  • Card Purchase & Pre-Authorization
  • Return
  • Pre-Authorization Completion
  • Void Purchase & Void Return

Installation

npm install --save beanstream

Usage

Constructor

var Beanstream = require("beanstream");
var beanstream = new Beanstream(options);
  • options object
    • merchant_id string
    • passcode string
    • username string
    • password string
    • version number / string; optional, defaults to 1

Credentials for authenticating with Beanstream. Provide username + password, or merchant_id + passcode. merchant_id is required regardless.

cardPurchase

beanstream.cardPurchase(card, order, callback);
  • card object
    • see Card Object
  • order object
  • callback function
    • callback gets passed two arguments: error and data. Data contains to JSON response from Beanstream.

preAuthorization

beanstream.preAuthorization(card, order, callback);
  • card object
  • order object
  • callback function
    • callback gets passed two arguments: error and data. Data contains to JSON response from Beanstream.

This creates a pre-auth charge by automatically setting card.complete to false. See completePreAuthorization for completing the pre-auth transaction.

completePreAuthorization

beanstream.completePreAuthorization(transaction_id, options, callback);
  • transaction_id string
  • options object
    • amount number
    • order_number string; optional
  • callback function
    • callback gets passed two arguments: error and data. Data contains to JSON response from Beanstream.

This completes a pre-auth charge.

return

beanstream.return(transaction_id, options, callback);
  • transaction_id string
  • options object
    • amount number
    • order_number string; optional
  • callback function
    • callback gets passed two arguments: error and data. Data contains to JSON response from Beanstream.

This creates a return transaction.

void

beanstream.void(transaction_id, options, callback);
  • transaction_id string
  • options object
    • amount number
    • order_number string; optional
  • callback function
    • callback gets passed two arguments: error and data. Data contains to JSON response from Beanstream.

This creates a void transaction.

Objects

Card Object

  • complete boolean; optional, defaults to true
  • name string
  • number string
  • expiry_month number / string
  • expiry_year number / string
  • cvd string

Order Object

  • order_number string,
  • amount number,
  • comments string; optional
  • billing object; optional
    • name "Beanstream Internet Commerce",
    • address_line1 string
    • address_line2 string; optional
    • city string
    • province string
    • country string
    • postal_code string
    • phone_number string
    • email_address string
  • language string; optional, defaults to "eng"
  • customer_ip: string; optional
  • term_url string; optional

Tests

Follow the instructions in test/credentials_template.js, then run tests with npm test

Keywords

Beanstream

FAQs

Package last updated on 23 Mar 2015

Did you know?

Socket

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