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

cybersource-api

v1.0.8

Published

Module for connect with CyberSource by soap methods.

Readme

Cybersource API :)

NodeJs module for connect to cybersource using soap, with predefined functions.

Features

  • Very simple API
  • Using asyncronous functions for requesting
  • WS-Security inserted in soap

Install

Install with npm:

  npm install cybersource-api

How it works

Instantiate CybersourceApi

To start using this module it is only necessary to import and instantiate a CybersourceApi object, for versions check https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor/.

const CybersourceApi = require('cybersource-api');
let password = "<password provided by cybersource>";
let merchantID = "<merchandID provided by cybersource>";
let enviroment = "<enviroment for test or production>"; //use "production" or "development"
let language = "<language for message from api>"; // use "es" or "en"
let version = "<soap url version of cybersource>"; // ej: "1.151". check  https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor/ for versions
let currency = "<currency definition for transactions>";

let cybersourceApi = new CybersourceApi(password,merchantID,enviroment,language,version,currency);

Type of transactions

Authorize and Capture Transaction

For authorize charge use next example, this will return an authorization that will be used later to capture

// Create object of type BillTo with required data
let billTo = new cybersourceApi.Models.BillTo("firstName","lastName","address","city","state","postalCode","country","email");

//Create object of type Card with required data
let card = new cybersourceApi.Models.Card("4111111111111111","02","2020","001");

//Create object of type AuthorizationRequest with previus objects created
let authorizationRequest = new cybersourceApi.Models.AuthorizationRequest("referenceCode",billTo,card);

//Call method authorizeCharge parsing the authorizationRequest object and amount to authorize
cybersourceApi.authorizeCharge(authorizationRequest,200).then(res=>{
  console.log("Authorization Response: ",res);
  /*
  res = { 
    message: 'Success',
    code: 100,
    authorization: '5543146435356332104008' // <== save this for capture amount after
  }
  */
}).catch(e=>{
  console.log("Authorization Reqest: ",e);
  /*
  e = { 
    message: <message error>,
    code: <code error>,
    data: <object with more error info>
  }
  */
});

For capture charge use next example, use authorization obtained in the previous step

let authorization = "1232313123123123";// authorization obtained in authorizationRequest
let captureRequest = new cybersourceApi.Models.CaptureRequest("referenceCode",authorization);
  cybersourceApi.captureCharge(captureRequest,200).then(resCapture=>
    console.log("Capture Request: ",resCapture)
    /*
    resCapture = { 
      message: 'Success',
      code: 100
    }
    */
  ).catch(e=>{
    console.log("Capture Request: ",e);
    /*
    e = { 
      message: <message error>,
      code: <code error>,
      data: <object with more error info>
    }
    */
  });

Charge card

// Create object of type BillTo with required data
let billTo = new cybersourceApi.Models.BillTo("firstName","lastName","address","city","state","postalCode","country","email");

//Create object of type Card with required data
let card = new cybersourceApi.Models.Card("4111111111111111","02","2020","001");

//Create object of type ChargeRequest with previus objects created
let chargeRequest = new cybersourceApi.Models.ChargeRequest("referenceCode",billTo,card);

//Call method chargeCard parsing the chargeRequest object and amount to charge
cybersourceApi.chargeCard(chargeRequest,200).then(res=>{
  console.log("Charge Card Response: ",res);
  /*
  res = { 
    message: 'Success',
    code: 100
  }
  */
}).catch(e=>{
  console.log("Authorization Reqest: ",e);
  /*
  e = { 
    message: <message error>,
    code: <code error>,
    data: <object with more error info>
  }
  */
});