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 🙏

© 2024 – Pkg Stats / Ryan Hefner

dwolla

v0.1.5

Published

Dwolla API for node.js

Downloads

37

Readme

Dwolla API for node.js

Dwolla Developers

NOTE: Dwolla has released an Official NodeJS Wrapper for Dwolla's API dwolla-node It is a fork of this library with significant refactoring.

Methods

Requires your Dwolla application client_id and client_secret.

  • basicAccountInfo(client_id, client_secret, id, fn)
  • nearby(client_id, client_secret, lat, lon, [, params], fn)
  • register(client_id, client_secret, userInfo, fn)

Requires a valid user OAuth2 token. Currently tokens do not expire and may be reused, however this will change March 2015.

NOTE: Dwolla has implemented a new OAuth implementation. (https://discuss.dwolla.com/t/dwolla-s-new-more-secure-implementation-of-oauth/546)

  • fullAccountInfo(oauth_token, fn)
  • balance(oauth_token, fn)
  • contacts(oauth_token[, params], fn)
  • transactions(oauth_token[, params], fn)
  • transactionById(oauth_token, id, fn)
  • transactionsStats(oauth_token[, params], fn)
  • send(oauth_token, pin, destinationId, amount[, params], fn)
  • request(oauth_token, pin, sourceId, amount[, params], fn)
  • fundingSources(oauth_token, fn)
  • fundingSourceById(oauth_token, id, fn)
  • addFundingSource(oauth_token, account_number, routing_number, account_type, name, fn)
  • verifyFundingSource(oauth_token, deposit1, deposit2, id, fn)
  • deposit(oauth_token, pin, sourceId, amount, fn)
  • fulfill(oauth_token, pin, sourceId[, params], fn)
  • pending(oauth_token, callback)
  • withdraw(oauth_token, pin, sourceId, amount, fn)

MassPay

  • createMassPayJob(oauth_token, fundsSource, pin, items[, params], fn)
  • getMassPayJob(oauth_token, job_id, fn)
  • getMassPayJobItems(oauth_token, job_id[, params], fn)

All optional parameters are passed in as an optional object before the callback.

Sandbox Support

If you desire to test your application with Dwolla's UAT sandbox, you can dynamically toggle between sandbox and production mode by toggling the sandbox flag.

dwolla = require('dwolla');
dwolla.sandbox = true;

The sandbox environment is disabled by default.

How to obtain a Dwolla OAuth2 token

To authenticate a user, follow the examples from one of the following modules.

everyauth

everyauth is an authentication and authorization module for your node.js Connect and Express apps. See http://everyauth.com/#other-modules/dwolla-oauth2

passport-dwolla

Passport is authentication middleware for Node.js, popular for being lightweight, modular, and flexible. A strategy for authenticating with Dwolla, along with an example, is available in the passport-dwolla module.

Dwolla Developer Site

The Dwolla Generate Token tool allows you create a valid OAuth token for testing purposes.

Installation

$ npm install dwolla

Example Usage

See more examples in the examples folder.

var dwolla = require('dwolla');

// use the Dwolla Sandbox environment instead of prod
dwolla.sandbox = true;

// get oauth_token, be sure to set the proper scope
// use oauth lib or everyauth to setup OAuth2
// see everyauth for example Dwolla authentication
var token = req.session.oauth_token;

dwolla.fullAccountInfo(token, function(err, data) {
  console.log("Full Account Info: " + data);
});

dwolla.transactions(token, function(err, data) {
  console.log("Transactions: " + data);
});

var params = {};
params.search = 'Ben';
params.types = 'All';
dwolla.contacts(token, params, function(err, data) {
  console.log("Contacts: " + data);
});

Tests

Tests use mocha and should.js. Tests were made only for GET requests, as tests of POST requests would be processed just like real requests. Although working examples of each POST request can be found in the examples folder.

$ npm test

or

$ mocha