The easiest way to install the dwolla-ruby gem for now is to use bundler and add the following line to your Gemfile:
The recommended way to install dwolla-ruby is through RubyGems:
gem install dwolla-ruby
Examples / Quickstart
To use the examples in the /examples folder, first edit the _keys.rb file and add your Dwolla API application's key, and secret, along with your account's OAuth token, and PIN.
This repo includes various usage examples, including:
- Authenticating with OAuth [oauth.rb]
- Fetching user information [users.rb]
- Grabbing a user's contacts [contacts.rb]
- Listing a user's funding sources [fundingSources.rb]
- Transacting money (includes sending) [transactions.rb]
- Getting a user's balance [balance.rb]
If making requests using any background processing library such as
Resque, we recommend that you manually pass in tokens to functions which take an OAuth token.
For example, we can do this with the
# Include the Dwolla gem require 'rubygems' require 'pp' require 'dwolla' Dwolla::Contacts.get(nil, "your_token")
rest_clientversion constraint for better compatibility.
pinas required argument for certain transactional operations due to compliance with Dwolla Direct.
rest_clientversion constraint due to security concerns.
- Refactored OAuth URL generation function.
- Added new
verified_accountparameter to authorization URL.
- Added new catalog endpoint to OAuth module + unit tests and examples.
- Added new scheduled transaction endpoints to Transactions module + unit tests and examples.
- Fixed bug with refresh token call. Parameters were not being JSON encoded. Now OAuth
refresh_authcalls use POST instead of GET.
- Fixed webhook validation, cleaned up OpenSSL Digest calls (thanks, @michaelblinn)!
- Fixed bug with generation of Off-Site Gateway checkout URLs
- Minor refactoring, fixed bug that would cause crashes in certain Ruby version with checking if keys exist in hashes.
- BREAKING CHANGE: OAuth access tokens now expire. Instead of a string,
Dwolla::OAuth::get_tokennow returns a hash with an
refresh_token, and expiration times in seconds for both. In order to refresh authorization, use
- BREAKING CHANGE: Guest send has been officially deprecated and removed from this gem.
- All MassPay endpoints have been included in this release for batch payment support.
- Proper unit tests implemented for all endpoints.
- Pulled in a merge request for syntax error (thanks, @mstahl)
- Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
- Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
- Sandbox base URL is now HTTPS
- Add the 'additionalFundingSources' param to the offsite gateway
- Add refund API endpoint
2.4.7 [merge pull request by dustMason0]
- Remove debugging reference to 'pp' (thanks, dustMason)
- Fix method double naming in the OffsiteGateway class
2.4.5 [merge pull request by dustMason0]
- Fix floating point calculation errors
- Refactor the offsite gateway class
- Globalize the OAuth scope variable
- Add missing files [accounts.rb]
- Fix OAuth token override
- Show raw response on debug mode
- Add support for 'Accounts' API
- Raise APIError when OAuth's get_token fails
- Added support for inline passage of OAuth tokens
- Add support for "sandbox" / UAT mode
- Oops. POST request wasn't actually sending any params.
- Add tests! (OMG WOOT JK )
- Reworked Gem.
To run the gem's tests:
bundle exec rake test
This wrapper is heavily based off Stripe's Ruby Gem
- Michael Schonfeld <email@example.com>
We highly recommend seeking support on our forums, located here!
References / Documentation
(The MIT License)
Copyright (c) 2013 Dwolla <firstname.lastname@example.org>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.