dwolla-ruby 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +8 -0
 - data/Gemfile +2 -0
 - data/README.md +15 -58
 - data/Rakefile +8 -4
 - data/dwolla-ruby.gemspec +4 -1
 - data/examples/balance.rb +2 -3
 - data/examples/contacts.rb +12 -6
 - data/examples/fundingSources.rb +4 -6
 - data/examples/oauth.rb +1 -1
 - data/examples/transactions.rb +4 -6
 - data/examples/{accountInfo.rb → users.rb} +0 -0
 - data/gemfiles/json.gemfile +3 -0
 - data/lib/dwolla/version.rb +1 -1
 - data/test/test_dwolla.rb +198 -0
 - data/test/test_helper.rb +424 -0
 - metadata +59 -4
 
    
        data/.travis.yml
    ADDED
    
    
    
        data/Gemfile
    ADDED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,8 +1,10 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # dwolla-ruby: Ruby Wrapper for Dwolla's API
         
     | 
| 
       2 
2 
     | 
    
         
             
            =================================================================================
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
      
 4 
     | 
    
         
            +
            [](https://travis-ci.org/Dwolla/dwolla-ruby)
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
       4 
6 
     | 
    
         
             
            ## Version
         
     | 
| 
       5 
     | 
    
         
            -
            1.0 
     | 
| 
      
 7 
     | 
    
         
            +
            2.1.0
         
     | 
| 
       6 
8 
     | 
    
         | 
| 
       7 
9 
     | 
    
         
             
            ## Requirements
         
     | 
| 
       8 
10 
     | 
    
         
             
            - [Ruby](http://www.ruby-lang.org/)
         
     | 
| 
         @@ -16,84 +18,39 @@ The recommended way to install dwolla-ruby is through RubyGems: 
     | 
|
| 
       16 
18 
     | 
    
         | 
| 
       17 
19 
     | 
    
         
             
              gem install dwolla-ruby
         
     | 
| 
       18 
20 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
            ## Usage
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
21 
     | 
    
         
             
            ## Examples / Quickstart
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
            This repo includes various usage examples, including:
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
25 
     | 
    
         
             
            * Authenticating with OAuth [oauth.rb]
         
     | 
| 
       26 
26 
     | 
    
         
             
            * Sending money [send.rb]
         
     | 
| 
       27 
     | 
    
         
            -
            * Fetching  
     | 
| 
      
 27 
     | 
    
         
            +
            * Fetching user information [users.rb]
         
     | 
| 
       28 
28 
     | 
    
         
             
            * Grabbing a user's contacts [contacts.rb]
         
     | 
| 
       29 
29 
     | 
    
         
             
            * Listing a user's funding sources [fundingSources.rb]
         
     | 
| 
       30 
     | 
    
         
            -
            *  
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
            ## Methods
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
            Authentication Methods:
         
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
                getAuthUrl()        ==> (string) OAuth permissions page URL
         
     | 
| 
       37 
     | 
    
         
            -
                requestToken($code) ==> (string) a never-expiring OAuth access token
         
     | 
| 
       38 
     | 
    
         
            -
                setToken($token)    ==> (bool) was token saved?
         
     | 
| 
       39 
     | 
    
         
            -
                getToken()          ==> (string) current OAuth token
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
            Users Methods:
         
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
                me()                ==> (array) the user entity associated with the token
         
     | 
| 
       44 
     | 
    
         
            -
                getUser($user_id)   ==> (array) the user entity for {$user_id}
         
     | 
| 
       45 
     | 
    
         
            -
                
         
     | 
| 
       46 
     | 
    
         
            -
            Register Methods:
         
     | 
| 
      
 30 
     | 
    
         
            +
            * Transacting money [transactions.rb]
         
     | 
| 
      
 31 
     | 
    
         
            +
            * Getting a user's balance [balance.rb]
         
     | 
| 
       47 
32 
     | 
    
         | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
                
         
     | 
| 
       50 
     | 
    
         
            -
            Contacts Methods:
         
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
                contacts([$search, $types, $limit])         ==> (array) list of contacts matching the search criteria
         
     | 
| 
       53 
     | 
    
         
            -
                nearbyContacts([$search, $types, $limit])   ==> (array) list of nearby spots matching the search criteria
         
     | 
| 
       54 
     | 
    
         
            -
                
         
     | 
| 
       55 
     | 
    
         
            -
            Funding Sources Methods:
         
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
                fundingSources()    ==> (array) a list of funding sources associated with the token
         
     | 
| 
       58 
     | 
    
         
            -
                fundingSource($id)  ==> (array) information about the {$id} funding source
         
     | 
| 
       59 
     | 
    
         
            -
                
         
     | 
| 
       60 
     | 
    
         
            -
            Balance Methods:
         
     | 
| 
      
 33 
     | 
    
         
            +
            ## Changelog
         
     | 
| 
       61 
34 
     | 
    
         | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
                
         
     | 
| 
       64 
     | 
    
         
            -
            Transactions Methods:
         
     | 
| 
      
 35 
     | 
    
         
            +
            2.1.0
         
     | 
| 
       65 
36 
     | 
    
         | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
       67 
     | 
    
         
            -
                request($pin, $sourceId, $amount[, $sourceType, $notes, $facilitatorAmount])                        ==> (string) request ID
         
     | 
| 
       68 
     | 
    
         
            -
                transaction($transactionId)                     ==> (array) transaction details
         
     | 
| 
       69 
     | 
    
         
            -
                listings([$sinceDate, $types, $limit, $skip])   ==> (array) a list of recent transactions matching the search criteria
         
     | 
| 
       70 
     | 
    
         
            -
                stats([$types, $sinceDate, $endDate])           ==> (array) statistics about the account associated with the token
         
     | 
| 
       71 
     | 
    
         
            -
                
         
     | 
| 
       72 
     | 
    
         
            -
            Offsite Gateway Methods:
         
     | 
| 
      
 37 
     | 
    
         
            +
            * Add tests! (OMG WOOT JK </LOL>)
         
     | 
| 
       73 
38 
     | 
    
         | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
                addGatewayProduct($name, $amount[, $quantity, $description])    ==> (bool) was product added?
         
     | 
| 
       76 
     | 
    
         
            -
                verifyGatewaySignature($signature, $checkoutId, $amount)        ==> (bool) is signature valid?
         
     | 
| 
       77 
     | 
    
         
            -
                getGatewayURL($destinationId[, $orderId, $discount, $shipping, $tax, $notes, $callback])    ==> (string) checkout URL
         
     | 
| 
       78 
     | 
    
         
            -
                
         
     | 
| 
       79 
     | 
    
         
            -
            Helper Methods:
         
     | 
| 
      
 39 
     | 
    
         
            +
            2.0.0
         
     | 
| 
       80 
40 
     | 
    
         | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
       82 
     | 
    
         
            -
                parseDwollaID($id)  ==> (bool) is valid Dwolla ID?
         
     | 
| 
       83 
     | 
    
         
            -
                setMode($mode)      ==> (bool) did mode change?
         
     | 
| 
      
 41 
     | 
    
         
            +
            * Reworked Gem.
         
     | 
| 
       84 
42 
     | 
    
         | 
| 
       85 
     | 
    
         
            -
            ##  
     | 
| 
      
 43 
     | 
    
         
            +
            ## Testing
         
     | 
| 
       86 
44 
     | 
    
         | 
| 
       87 
     | 
    
         
            -
             
     | 
| 
      
 45 
     | 
    
         
            +
            To run the gem's tests:
         
     | 
| 
       88 
46 
     | 
    
         | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
      
 47 
     | 
    
         
            +
            	bundle exec rake test
         
     | 
| 
       90 
48 
     | 
    
         | 
| 
       91 
49 
     | 
    
         
             
            ## Credits
         
     | 
| 
       92 
50 
     | 
    
         | 
| 
       93 
     | 
    
         
            -
            This wrapper is  
     | 
| 
      
 51 
     | 
    
         
            +
            This wrapper is heavily based off Stripe's Ruby Gem
         
     | 
| 
       94 
52 
     | 
    
         | 
| 
       95 
53 
     | 
    
         
             
            - Michael Schonfeld <michael@dwolla.com>
         
     | 
| 
       96 
     | 
    
         
            -
            - Jefferson Gir�o <contato@jefferson.eti.br>
         
     | 
| 
       97 
54 
     | 
    
         | 
| 
       98 
55 
     | 
    
         
             
            ## Support
         
     | 
| 
       99 
56 
     | 
    
         | 
    
        data/Rakefile
    CHANGED
    
    
    
        data/dwolla-ruby.gemspec
    CHANGED
    
    | 
         @@ -13,12 +13,15 @@ Gem::Specification.new do |s| 
     | 
|
| 
       13 
13 
     | 
    
         
             
                s.rubyforge_project = "dwolla-ruby"
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
                s.files         = `git ls-files`.split("\n")
         
     | 
| 
       16 
     | 
    
         
            -
                s. 
     | 
| 
      
 16 
     | 
    
         
            +
                s.test_files    = `git ls-files -- test/*`.split("\n")
         
     | 
| 
       17 
17 
     | 
    
         
             
                s.require_paths = %w{lib}
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                s.add_dependency('rest-client', '~> 1.4')
         
     | 
| 
       20 
20 
     | 
    
         
             
                s.add_dependency('multi_json', '>= 1.0.4', '< 2')
         
     | 
| 
       21 
21 
     | 
    
         
             
                s.add_dependency('addressable', '>= 2')
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
      
 23 
     | 
    
         
            +
                s.add_development_dependency('mocha')
         
     | 
| 
      
 24 
     | 
    
         
            +
                s.add_development_dependency('shoulda')
         
     | 
| 
      
 25 
     | 
    
         
            +
                s.add_development_dependency('test-unit')
         
     | 
| 
       23 
26 
     | 
    
         
             
                s.add_development_dependency('rake')
         
     | 
| 
       24 
27 
     | 
    
         
             
            end
         
     | 
    
        data/examples/balance.rb
    CHANGED
    
    | 
         @@ -4,7 +4,7 @@ require 'pp' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            require 'dwolla'
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            # Include any required keys
         
     | 
| 
       7 
     | 
    
         
            -
            require '_keys.rb'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require './_keys.rb'
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            # Instantiate a new Dwolla User client
         
     | 
| 
       10 
10 
     | 
    
         
             
            # And, seed a previously generated access token
         
     | 
| 
         @@ -13,5 +13,4 @@ Dwolla::token = @token 
     | 
|
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
            # EXAMPLE 1: 
         
     | 
| 
       15 
15 
     | 
    
         
             
            #   Get the balance of the authenticated user
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
            pp balance
         
     | 
| 
      
 16 
     | 
    
         
            +
            pp Dwolla::Balance.get
         
     | 
    
        data/examples/contacts.rb
    CHANGED
    
    | 
         @@ -4,24 +4,30 @@ require 'pp' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            require 'dwolla'
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            # Include any required keys
         
     | 
| 
       7 
     | 
    
         
            -
            require '_keys.rb'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require './_keys.rb'
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            # Instantiate a new Dwolla User client
         
     | 
| 
       10 
10 
     | 
    
         
             
            # And, seed a previously generated access token
         
     | 
| 
       11 
     | 
    
         
            -
            Dwolla::token =  
     | 
| 
      
 11 
     | 
    
         
            +
            Dwolla::token = @token
         
     | 
| 
      
 12 
     | 
    
         
            +
            Dwolla::api_key = @api_key
         
     | 
| 
      
 13 
     | 
    
         
            +
            Dwolla::api_secret = @api_secret
         
     | 
| 
       12 
14 
     | 
    
         | 
| 
       13 
15 
     | 
    
         | 
| 
       14 
16 
     | 
    
         
             
            # EXAMPLE 1: 
         
     | 
| 
       15 
17 
     | 
    
         
             
            #   Fetch last 10 contacts from the 
         
     | 
| 
       16 
18 
     | 
    
         
             
            #   account associated with the provided
         
     | 
| 
       17 
19 
     | 
    
         
             
            #   OAuth token
         
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
            pp contacts
         
     | 
| 
      
 20 
     | 
    
         
            +
            pp Dwolla::Contacts.get
         
     | 
| 
       20 
21 
     | 
    
         | 
| 
       21 
22 
     | 
    
         | 
| 
       22 
23 
     | 
    
         
             
            # EXAMPLE 2: 
         
     | 
| 
       23 
24 
     | 
    
         
             
            #   Search through the contacts of the
         
     | 
| 
       24 
25 
     | 
    
         
             
            #   account associated with the provided
         
     | 
| 
       25 
26 
     | 
    
         
             
            #   OAuth token
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
      
 27 
     | 
    
         
            +
            pp Dwolla::Contacts.get({:search => 'Ben'})
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            # EXAMPLE 3: 
         
     | 
| 
      
 31 
     | 
    
         
            +
            #   Get a list of nearby Dwolla spots
         
     | 
| 
      
 32 
     | 
    
         
            +
            #   for a given set of coordinates
         
     | 
| 
      
 33 
     | 
    
         
            +
            pp Dwolla::Contacts.nearby({:latitude => 1, :longitude => 2})
         
     | 
    
        data/examples/fundingSources.rb
    CHANGED
    
    | 
         @@ -4,23 +4,21 @@ require 'pp' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            require 'dwolla'
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            # Include any required keys
         
     | 
| 
       7 
     | 
    
         
            -
            require '_keys.rb'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require './_keys.rb'
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            # Instantiate a new Dwolla User client
         
     | 
| 
       10 
10 
     | 
    
         
             
            # And, seed a previously generated access token
         
     | 
| 
       11 
     | 
    
         
            -
            Dwolla::token =  
     | 
| 
      
 11 
     | 
    
         
            +
            Dwolla::token = @token
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
            # EXAMPLE 1: 
         
     | 
| 
       15 
15 
     | 
    
         
             
            #   Fetch all funding sources for the
         
     | 
| 
       16 
16 
     | 
    
         
             
            #   account associated with the provided
         
     | 
| 
       17 
17 
     | 
    
         
             
            #   OAuth token
         
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
            pp sources
         
     | 
| 
      
 18 
     | 
    
         
            +
            pp Dwolla::FundingSources.get
         
     | 
| 
       20 
19 
     | 
    
         | 
| 
       21 
20 
     | 
    
         | 
| 
       22 
21 
     | 
    
         
             
            # EXAMPLE 2: 
         
     | 
| 
       23 
22 
     | 
    
         
             
            #   Fetch detailed information for the
         
     | 
| 
       24 
23 
     | 
    
         
             
            #   funding source with a specific ID
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
            pp source
         
     | 
| 
      
 24 
     | 
    
         
            +
            pp Dwolla::FundingSources.get('funding_source_id')
         
     | 
    
        data/examples/oauth.rb
    CHANGED
    
    
    
        data/examples/transactions.rb
    CHANGED
    
    | 
         @@ -4,11 +4,11 @@ require 'pp' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            require 'dwolla'
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            # Include any required keys
         
     | 
| 
       7 
     | 
    
         
            -
            require '_keys.rb'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require './_keys.rb'
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            # Instantiate a new Dwolla User client
         
     | 
| 
       10 
10 
     | 
    
         
             
            # And, seed a previously generated access token
         
     | 
| 
       11 
     | 
    
         
            -
            Dwolla::token =  
     | 
| 
      
 11 
     | 
    
         
            +
            Dwolla::token = @token
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
            # EXAMPLE 1: 
         
     | 
| 
         @@ -23,10 +23,8 @@ pp transactionId 
     | 
|
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
            # EXAMPLE 3: 
         
     | 
| 
       25 
25 
     | 
    
         
             
            #   Get details about all recent transactions
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
            pp transactions
         
     | 
| 
      
 26 
     | 
    
         
            +
            pp Dwolla::Transactions.get
         
     | 
| 
       28 
27 
     | 
    
         | 
| 
       29 
28 
     | 
    
         
             
            # EXAMPLE 4: 
         
     | 
| 
       30 
29 
     | 
    
         
             
            #   Get details about a certain Transaction
         
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
            pp transactionId
         
     | 
| 
      
 30 
     | 
    
         
            +
            pp Dwolla::Transactions.get(transactionId)
         
     | 
| 
         
            File without changes
         
     | 
    
        data/lib/dwolla/version.rb
    CHANGED
    
    
    
        data/test/test_dwolla.rb
    ADDED
    
    | 
         @@ -0,0 +1,198 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # -*- coding: utf-8 -*-
         
     | 
| 
      
 2 
     | 
    
         
            +
            require File.expand_path('../test_helper', __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'test/unit'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'shoulda'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'mocha/setup'
         
     | 
| 
      
 6 
     | 
    
         
            +
            require 'pp'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require 'rest-client'
         
     | 
| 
      
 8 
     | 
    
         
            +
            require 'cgi'
         
     | 
| 
      
 9 
     | 
    
         
            +
            require 'uri'
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            class TestDwollaRuby < Test::Unit::TestCase
         
     | 
| 
      
 12 
     | 
    
         
            +
              include Mocha
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
              context "API Wrapper" do
         
     | 
| 
      
 15 
     | 
    
         
            +
                setup do
         
     | 
| 
      
 16 
     | 
    
         
            +
                  @mock = mock
         
     | 
| 
      
 17 
     | 
    
         
            +
                  Dwolla.mock_rest_client = @mock
         
     | 
| 
      
 18 
     | 
    
         
            +
                end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                teardown do
         
     | 
| 
      
 21 
     | 
    
         
            +
                  Dwolla.mock_rest_client = nil
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                should "not specifying a token should raise an exception on user-centric calls" do
         
     | 
| 
      
 25 
     | 
    
         
            +
                  Dwolla.token = nil
         
     | 
| 
      
 26 
     | 
    
         
            +
                  assert_raises Dwolla::AuthenticationError do
         
     | 
| 
      
 27 
     | 
    
         
            +
                    Dwolla::Balance.get
         
     | 
| 
      
 28 
     | 
    
         
            +
                  end
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                should "not specifying api credentials should raise an exception on app-centric calls" do
         
     | 
| 
      
 32 
     | 
    
         
            +
                  Dwolla.api_key = nil
         
     | 
| 
      
 33 
     | 
    
         
            +
                  assert_raises Dwolla::AuthenticationError do
         
     | 
| 
      
 34 
     | 
    
         
            +
                    Dwolla::Contacts.nearby
         
     | 
| 
      
 35 
     | 
    
         
            +
                  end
         
     | 
| 
      
 36 
     | 
    
         
            +
                end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                context "with valid token" do
         
     | 
| 
      
 39 
     | 
    
         
            +
                  setup do
         
     | 
| 
      
 40 
     | 
    
         
            +
                    Dwolla.token="foo"
         
     | 
| 
      
 41 
     | 
    
         
            +
                  end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                  teardown do
         
     | 
| 
      
 44 
     | 
    
         
            +
                    Dwolla.token=nil
         
     | 
| 
      
 45 
     | 
    
         
            +
                  end
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
                  context "balance tests" do 
         
     | 
| 
      
 48 
     | 
    
         
            +
                    should "balance should be retrievable" do
         
     | 
| 
      
 49 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_balance))
         
     | 
| 
      
 50 
     | 
    
         
            +
                      balance = Dwolla::Balance.get
         
     | 
| 
      
 51 
     | 
    
         
            +
                      assert balance.kind_of? Float
         
     | 
| 
      
 52 
     | 
    
         
            +
                    end
         
     | 
| 
      
 53 
     | 
    
         
            +
                  end
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                  context "contacts tests" do
         
     | 
| 
      
 56 
     | 
    
         
            +
                    should "be able to get a user's contacts" do
         
     | 
| 
      
 57 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_contacts_array))
         
     | 
| 
      
 58 
     | 
    
         
            +
                      contacts = Dwolla::Contacts.get
         
     | 
| 
      
 59 
     | 
    
         
            +
                      assert contacts.kind_of? Array
         
     | 
| 
      
 60 
     | 
    
         
            +
                    end
         
     | 
| 
      
 61 
     | 
    
         
            +
                  end
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
                  context "funding sources tests" do
         
     | 
| 
      
 64 
     | 
    
         
            +
                    should "should be able to get a user's funding source by its id" do
         
     | 
| 
      
 65 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_fundingsource_byid))
         
     | 
| 
      
 66 
     | 
    
         
            +
                      fundingsource = Dwolla::FundingSources.get('funding_source_id')
         
     | 
| 
      
 67 
     | 
    
         
            +
                      assert fundingsource.kind_of? Object
         
     | 
| 
      
 68 
     | 
    
         
            +
                    end
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
                    should "should be able to get a user's funding sources" do
         
     | 
| 
      
 71 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_fundingsources_array))
         
     | 
| 
      
 72 
     | 
    
         
            +
                      fundingsources = Dwolla::FundingSources.get
         
     | 
| 
      
 73 
     | 
    
         
            +
                      assert fundingsources.kind_of? Array
         
     | 
| 
      
 74 
     | 
    
         
            +
                    end
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
                    should "should be able to withdraw to a user's funding source" do
         
     | 
| 
      
 77 
     | 
    
         
            +
                      @mock.expects(:post).once.returns(test_response(test_fundingsource_withdraw))
         
     | 
| 
      
 78 
     | 
    
         
            +
                      withdraw = Dwolla::FundingSources.withdraw('funding_source_id', {:pin => '0000', :amount => '1.00'})
         
     | 
| 
      
 79 
     | 
    
         
            +
                      assert withdraw.kind_of? Object
         
     | 
| 
      
 80 
     | 
    
         
            +
                    end
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
                    should "should be able to deposit from a user's funding source" do
         
     | 
| 
      
 83 
     | 
    
         
            +
                      @mock.expects(:post).once.returns(test_response(test_fundingsource_deposit))
         
     | 
| 
      
 84 
     | 
    
         
            +
                      withdraw = Dwolla::FundingSources.withdraw('funding_source_id', {:pin => '0000', :amount => '1.00'})
         
     | 
| 
      
 85 
     | 
    
         
            +
                      assert withdraw.kind_of? Object
         
     | 
| 
      
 86 
     | 
    
         
            +
                    end
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
                    should "should be able to add a funding source for a user" do
         
     | 
| 
      
 89 
     | 
    
         
            +
             
     | 
| 
      
 90 
     | 
    
         
            +
                    end
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
                    should "should be able to verify a user's funding source" do
         
     | 
| 
      
 93 
     | 
    
         
            +
             
     | 
| 
      
 94 
     | 
    
         
            +
                    end
         
     | 
| 
      
 95 
     | 
    
         
            +
                  end
         
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
      
 97 
     | 
    
         
            +
                  context "requests tests" do
         
     | 
| 
      
 98 
     | 
    
         
            +
                    should "should be able to get a user's pending money requests" do
         
     | 
| 
      
 99 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_requests_array))
         
     | 
| 
      
 100 
     | 
    
         
            +
                      requests = Dwolla::Requests.get
         
     | 
| 
      
 101 
     | 
    
         
            +
                      assert requests.kind_of? Array
         
     | 
| 
      
 102 
     | 
    
         
            +
                    end
         
     | 
| 
      
 103 
     | 
    
         
            +
             
     | 
| 
      
 104 
     | 
    
         
            +
                    should "should be able to get a user's pending money request by its id" do
         
     | 
| 
      
 105 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_request_byid))
         
     | 
| 
      
 106 
     | 
    
         
            +
                      request = Dwolla::Requests.get('request_id')
         
     | 
| 
      
 107 
     | 
    
         
            +
                      assert request.kind_of? Object
         
     | 
| 
      
 108 
     | 
    
         
            +
                    end
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                    should "should be able to cancel a user's pending money request" do
         
     | 
| 
      
 111 
     | 
    
         
            +
                      @mock.expects(:post).once.returns(test_response(test_request_cancel))
         
     | 
| 
      
 112 
     | 
    
         
            +
                      request = Dwolla::Requests.cancel('request_id')
         
     | 
| 
      
 113 
     | 
    
         
            +
                      assert request.kind_of? String
         
     | 
| 
      
 114 
     | 
    
         
            +
                    end
         
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
      
 116 
     | 
    
         
            +
                    should "should be able to create a new money request for a user" do
         
     | 
| 
      
 117 
     | 
    
         
            +
                      @mock.expects(:post).once.returns(test_response(test_request))
         
     | 
| 
      
 118 
     | 
    
         
            +
                      request = Dwolla::Requests.request({:pin => 1111, :amount => 0.01, :sourceId => 'alex@dwolla.com'})
         
     | 
| 
      
 119 
     | 
    
         
            +
                      assert request.kind_of? Integer
         
     | 
| 
      
 120 
     | 
    
         
            +
                    end
         
     | 
| 
      
 121 
     | 
    
         
            +
             
     | 
| 
      
 122 
     | 
    
         
            +
                    should "should be a able to fulfill a user's pending money request" do
         
     | 
| 
      
 123 
     | 
    
         
            +
                      @mock.expects(:post).once.returns(test_response(test_request_fulfill))
         
     | 
| 
      
 124 
     | 
    
         
            +
                      request = Dwolla::Requests.fulfill('2219682', {:pin => 1111})
         
     | 
| 
      
 125 
     | 
    
         
            +
                      assert request.kind_of? Object
         
     | 
| 
      
 126 
     | 
    
         
            +
                    end
         
     | 
| 
      
 127 
     | 
    
         
            +
                  end
         
     | 
| 
      
 128 
     | 
    
         
            +
             
     | 
| 
      
 129 
     | 
    
         
            +
                  context "transactions tests" do
         
     | 
| 
      
 130 
     | 
    
         
            +
                    should "should be able to get a user's transaction information by its id" do
         
     | 
| 
      
 131 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_transaction_byid))
         
     | 
| 
      
 132 
     | 
    
         
            +
                      transactions = Dwolla::Transactions.get('transaction_id')
         
     | 
| 
      
 133 
     | 
    
         
            +
                      assert transactions.kind_of? Object
         
     | 
| 
      
 134 
     | 
    
         
            +
                    end
         
     | 
| 
      
 135 
     | 
    
         
            +
             
     | 
| 
      
 136 
     | 
    
         
            +
                    should "should be able to get a user's transaction history" do
         
     | 
| 
      
 137 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_transactions_array))
         
     | 
| 
      
 138 
     | 
    
         
            +
                      transactions = Dwolla::Transactions.get
         
     | 
| 
      
 139 
     | 
    
         
            +
                      assert transactions.kind_of? Array
         
     | 
| 
      
 140 
     | 
    
         
            +
                    end
         
     | 
| 
      
 141 
     | 
    
         
            +
             
     | 
| 
      
 142 
     | 
    
         
            +
                    should "should be able to get a user's transaction statistics" do
         
     | 
| 
      
 143 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_transactions_stats))
         
     | 
| 
      
 144 
     | 
    
         
            +
                      stats = Dwolla::Transactions.stats
         
     | 
| 
      
 145 
     | 
    
         
            +
                      assert stats.kind_of? Object
         
     | 
| 
      
 146 
     | 
    
         
            +
                    end
         
     | 
| 
      
 147 
     | 
    
         
            +
             
     | 
| 
      
 148 
     | 
    
         
            +
                    should "should be able to send money from a user's account" do
         
     | 
| 
      
 149 
     | 
    
         
            +
                      @mock.expects(:post).once.returns(test_response(test_send))
         
     | 
| 
      
 150 
     | 
    
         
            +
                      send = Dwolla::Transactions.send({:pin => 1111, :destinationId => '812-734-7288', :amount => 0.01})
         
     | 
| 
      
 151 
     | 
    
         
            +
                      assert send.kind_of? Integer
         
     | 
| 
      
 152 
     | 
    
         
            +
                    end
         
     | 
| 
      
 153 
     | 
    
         
            +
                  end
         
     | 
| 
      
 154 
     | 
    
         
            +
             
     | 
| 
      
 155 
     | 
    
         
            +
                  context "users tests" do
         
     | 
| 
      
 156 
     | 
    
         
            +
                    should "should be able to get a user's information" do
         
     | 
| 
      
 157 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_user_self))
         
     | 
| 
      
 158 
     | 
    
         
            +
                      user = Dwolla::Users.me
         
     | 
| 
      
 159 
     | 
    
         
            +
                      assert user.kind_of? Object
         
     | 
| 
      
 160 
     | 
    
         
            +
                    end
         
     | 
| 
      
 161 
     | 
    
         
            +
                  end
         
     | 
| 
      
 162 
     | 
    
         
            +
                end
         
     | 
| 
      
 163 
     | 
    
         
            +
             
     | 
| 
      
 164 
     | 
    
         
            +
                context "with valid app credentials" do
         
     | 
| 
      
 165 
     | 
    
         
            +
                  setup do
         
     | 
| 
      
 166 
     | 
    
         
            +
                    Dwolla.api_key="foo"
         
     | 
| 
      
 167 
     | 
    
         
            +
                    Dwolla.api_secret="bar"
         
     | 
| 
      
 168 
     | 
    
         
            +
                  end
         
     | 
| 
      
 169 
     | 
    
         
            +
             
     | 
| 
      
 170 
     | 
    
         
            +
                  teardown do
         
     | 
| 
      
 171 
     | 
    
         
            +
                    Dwolla.api_key=nil
         
     | 
| 
      
 172 
     | 
    
         
            +
                    Dwolla.api_secret=nil
         
     | 
| 
      
 173 
     | 
    
         
            +
                  end
         
     | 
| 
      
 174 
     | 
    
         
            +
             
     | 
| 
      
 175 
     | 
    
         
            +
                  context "contacts tests" do
         
     | 
| 
      
 176 
     | 
    
         
            +
                    should "be able to get a list of nearby spots" do
         
     | 
| 
      
 177 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_contacts_array))
         
     | 
| 
      
 178 
     | 
    
         
            +
                      spots = Dwolla::Contacts.nearby
         
     | 
| 
      
 179 
     | 
    
         
            +
                      assert spots.kind_of? Array
         
     | 
| 
      
 180 
     | 
    
         
            +
                    end
         
     | 
| 
      
 181 
     | 
    
         
            +
                  end
         
     | 
| 
      
 182 
     | 
    
         
            +
             
     | 
| 
      
 183 
     | 
    
         
            +
                  context "users tests" do
         
     | 
| 
      
 184 
     | 
    
         
            +
                    should "should be able to get any user's information" do
         
     | 
| 
      
 185 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_user_byid))
         
     | 
| 
      
 186 
     | 
    
         
            +
                      user = Dwolla::Users.get('alex@dwolla.com')
         
     | 
| 
      
 187 
     | 
    
         
            +
                      assert user.kind_of? Object
         
     | 
| 
      
 188 
     | 
    
         
            +
                    end
         
     | 
| 
      
 189 
     | 
    
         
            +
             
     | 
| 
      
 190 
     | 
    
         
            +
                    should "should be able to get a list of nearby users" do
         
     | 
| 
      
 191 
     | 
    
         
            +
                      @mock.expects(:get).once.returns(test_response(test_users_array))
         
     | 
| 
      
 192 
     | 
    
         
            +
                      users = Dwolla::Users.nearby
         
     | 
| 
      
 193 
     | 
    
         
            +
                      assert users.kind_of? Array
         
     | 
| 
      
 194 
     | 
    
         
            +
                    end
         
     | 
| 
      
 195 
     | 
    
         
            +
                  end
         
     | 
| 
      
 196 
     | 
    
         
            +
                end
         
     | 
| 
      
 197 
     | 
    
         
            +
              end
         
     | 
| 
      
 198 
     | 
    
         
            +
            end
         
     | 
    
        data/test/test_helper.rb
    ADDED
    
    | 
         @@ -0,0 +1,424 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'stringio'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'test/unit'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'dwolla'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'mocha/setup'
         
     | 
| 
      
 5 
     | 
    
         
            +
            include Mocha
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            #monkeypatch request methods
         
     | 
| 
      
 8 
     | 
    
         
            +
            module Dwolla
         
     | 
| 
      
 9 
     | 
    
         
            +
              @mock_rest_client = nil
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              def self.mock_rest_client=(mock_client)
         
     | 
| 
      
 12 
     | 
    
         
            +
                @mock_rest_client = mock_client
         
     | 
| 
      
 13 
     | 
    
         
            +
              end
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              def self.execute_request(opts)
         
     | 
| 
      
 16 
     | 
    
         
            +
                get_params = (opts[:headers] || {})[:params]
         
     | 
| 
      
 17 
     | 
    
         
            +
                post_params = opts[:payload]
         
     | 
| 
      
 18 
     | 
    
         
            +
                
         
     | 
| 
      
 19 
     | 
    
         
            +
                case opts[:method]
         
     | 
| 
      
 20 
     | 
    
         
            +
                  when :get then @mock_rest_client.get opts[:url], get_params, post_params
         
     | 
| 
      
 21 
     | 
    
         
            +
                  when :post then @mock_rest_client.post opts[:url], get_params, post_params
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
            end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
            def test_response(body, code=200)
         
     | 
| 
      
 27 
     | 
    
         
            +
              # When an exception is raised, restclient clobbers method_missing.  Hence we
         
     | 
| 
      
 28 
     | 
    
         
            +
              # can't just use the stubs interface.
         
     | 
| 
      
 29 
     | 
    
         
            +
              body = MultiJson.dump(body) if !(body.kind_of? String)
         
     | 
| 
      
 30 
     | 
    
         
            +
              m = mock  
         
     | 
| 
      
 31 
     | 
    
         
            +
              m.instance_variable_set('@dwolla_values', { :body => body, :code => code })
         
     | 
| 
      
 32 
     | 
    
         
            +
              def m.body; @dwolla_values[:body]; end
         
     | 
| 
      
 33 
     | 
    
         
            +
              def m.code; @dwolla_values[:code]; end
         
     | 
| 
      
 34 
     | 
    
         
            +
              m
         
     | 
| 
      
 35 
     | 
    
         
            +
            end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            def test_transaction_byid(params={})
         
     | 
| 
      
 38 
     | 
    
         
            +
              {
         
     | 
| 
      
 39 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 40 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 41 
     | 
    
         
            +
                :Response => {
         
     | 
| 
      
 42 
     | 
    
         
            +
                  :Id => 2834469,
         
     | 
| 
      
 43 
     | 
    
         
            +
                  :Amount => 1,
         
     | 
| 
      
 44 
     | 
    
         
            +
                  :Date => "05/02/2013 17:18:09",
         
     | 
| 
      
 45 
     | 
    
         
            +
                  :Type => "withdrawal",
         
     | 
| 
      
 46 
     | 
    
         
            +
                  :UserType => "Dwolla",
         
     | 
| 
      
 47 
     | 
    
         
            +
                  :DestinationId => "XXX80-1",
         
     | 
| 
      
 48 
     | 
    
         
            +
                  :DestinationName => "Veridian Credit Union",
         
     | 
| 
      
 49 
     | 
    
         
            +
                  :SourceId => "812-734-7288",
         
     | 
| 
      
 50 
     | 
    
         
            +
                  :SourceName => "Michael Schonfeld",
         
     | 
| 
      
 51 
     | 
    
         
            +
                  :ClearingDate => "5/2/2013",
         
     | 
| 
      
 52 
     | 
    
         
            +
                  :Status => "processed",
         
     | 
| 
      
 53 
     | 
    
         
            +
                  :Notes => nil,
         
     | 
| 
      
 54 
     | 
    
         
            +
                  :Fees => nil
         
     | 
| 
      
 55 
     | 
    
         
            +
                }
         
     | 
| 
      
 56 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 57 
     | 
    
         
            +
            end
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
            def test_transactions_array(params={})  
         
     | 
| 
      
 60 
     | 
    
         
            +
              {
         
     | 
| 
      
 61 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 62 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 63 
     | 
    
         
            +
                :Response => [
         
     | 
| 
      
 64 
     | 
    
         
            +
                  {
         
     | 
| 
      
 65 
     | 
    
         
            +
                    :Id => 2834469,
         
     | 
| 
      
 66 
     | 
    
         
            +
                    :Amount => 1,
         
     | 
| 
      
 67 
     | 
    
         
            +
                    :Date => "05/02/2013 17:18:09",
         
     | 
| 
      
 68 
     | 
    
         
            +
                    :Type => "withdrawal",
         
     | 
| 
      
 69 
     | 
    
         
            +
                    :UserType => "Dwolla",
         
     | 
| 
      
 70 
     | 
    
         
            +
                    :DestinationId => "XXX80-1",
         
     | 
| 
      
 71 
     | 
    
         
            +
                    :DestinationName => "Veridian Credit Union",
         
     | 
| 
      
 72 
     | 
    
         
            +
                    :SourceId => "812-734-7288",
         
     | 
| 
      
 73 
     | 
    
         
            +
                    :SourceName => "Michael Schonfeld",
         
     | 
| 
      
 74 
     | 
    
         
            +
                    :ClearingDate => "5/2/2013",
         
     | 
| 
      
 75 
     | 
    
         
            +
                    :Status => "processed",
         
     | 
| 
      
 76 
     | 
    
         
            +
                    :Notes => nil,
         
     | 
| 
      
 77 
     | 
    
         
            +
                    :Fees => nil
         
     | 
| 
      
 78 
     | 
    
         
            +
                  },
         
     | 
| 
      
 79 
     | 
    
         
            +
                  {
         
     | 
| 
      
 80 
     | 
    
         
            +
                    :Id => 2834457,
         
     | 
| 
      
 81 
     | 
    
         
            +
                    :Amount => 1,
         
     | 
| 
      
 82 
     | 
    
         
            +
                    :Date => "05/02/2013 17:17:02",
         
     | 
| 
      
 83 
     | 
    
         
            +
                    :Type => "deposit",
         
     | 
| 
      
 84 
     | 
    
         
            +
                    :UserType => "Dwolla",
         
     | 
| 
      
 85 
     | 
    
         
            +
                    :DestinationId => "812-734-7288",
         
     | 
| 
      
 86 
     | 
    
         
            +
                    :DestinationName => "Michael Schonfeld",
         
     | 
| 
      
 87 
     | 
    
         
            +
                    :SourceId => "XXX80-1",
         
     | 
| 
      
 88 
     | 
    
         
            +
                    :SourceName => "Veridian Credit Union",
         
     | 
| 
      
 89 
     | 
    
         
            +
                    :ClearingDate => "5/2/2013",
         
     | 
| 
      
 90 
     | 
    
         
            +
                    :Status => "processed",
         
     | 
| 
      
 91 
     | 
    
         
            +
                    :Notes => nil,
         
     | 
| 
      
 92 
     | 
    
         
            +
                    :Fees => nil
         
     | 
| 
      
 93 
     | 
    
         
            +
                  }
         
     | 
| 
      
 94 
     | 
    
         
            +
                ]
         
     | 
| 
      
 95 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 96 
     | 
    
         
            +
            end
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
            def test_transactions_stats(params={})  
         
     | 
| 
      
 99 
     | 
    
         
            +
              {
         
     | 
| 
      
 100 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 101 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 102 
     | 
    
         
            +
                :Response => [
         
     | 
| 
      
 103 
     | 
    
         
            +
                  {
         
     | 
| 
      
 104 
     | 
    
         
            +
                    :TransactionsCount => 3,
         
     | 
| 
      
 105 
     | 
    
         
            +
                    :TransactionsTotal => 0.03
         
     | 
| 
      
 106 
     | 
    
         
            +
                  }
         
     | 
| 
      
 107 
     | 
    
         
            +
                ]
         
     | 
| 
      
 108 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 109 
     | 
    
         
            +
            end
         
     | 
| 
      
 110 
     | 
    
         
            +
             
     | 
| 
      
 111 
     | 
    
         
            +
            def test_balance(params={})
         
     | 
| 
      
 112 
     | 
    
         
            +
              {
         
     | 
| 
      
 113 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 114 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 115 
     | 
    
         
            +
                :Response => 10.00
         
     | 
| 
      
 116 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 117 
     | 
    
         
            +
            end
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
            def test_send(params={})
         
     | 
| 
      
 120 
     | 
    
         
            +
              {
         
     | 
| 
      
 121 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 122 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 123 
     | 
    
         
            +
                :Response => 2834853
         
     | 
| 
      
 124 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 125 
     | 
    
         
            +
            end
         
     | 
| 
      
 126 
     | 
    
         
            +
             
     | 
| 
      
 127 
     | 
    
         
            +
            def test_request(params={})
         
     | 
| 
      
 128 
     | 
    
         
            +
              {
         
     | 
| 
      
 129 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 130 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 131 
     | 
    
         
            +
                :Response => 2221134
         
     | 
| 
      
 132 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 133 
     | 
    
         
            +
            end
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
      
 135 
     | 
    
         
            +
            def test_request_byid(params={})
         
     | 
| 
      
 136 
     | 
    
         
            +
              {
         
     | 
| 
      
 137 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 138 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 139 
     | 
    
         
            +
                :Response => {
         
     | 
| 
      
 140 
     | 
    
         
            +
                  :Id => 2209516,
         
     | 
| 
      
 141 
     | 
    
         
            +
                  :Source => {
         
     | 
| 
      
 142 
     | 
    
         
            +
                    :Id => "812-734-7288",
         
     | 
| 
      
 143 
     | 
    
         
            +
                    :Name => "Michael Schonfeld",
         
     | 
| 
      
 144 
     | 
    
         
            +
                    :Type => "Dwolla",
         
     | 
| 
      
 145 
     | 
    
         
            +
                    :Image => nil
         
     | 
| 
      
 146 
     | 
    
         
            +
                  },
         
     | 
| 
      
 147 
     | 
    
         
            +
                  :Destination => {
         
     | 
| 
      
 148 
     | 
    
         
            +
                    :Id => "812-552-5325",
         
     | 
| 
      
 149 
     | 
    
         
            +
                    :Name => "Mark Littlewood",
         
     | 
| 
      
 150 
     | 
    
         
            +
                    :Type => "Dwolla",
         
     | 
| 
      
 151 
     | 
    
         
            +
                    :Image => nil
         
     | 
| 
      
 152 
     | 
    
         
            +
                  },
         
     | 
| 
      
 153 
     | 
    
         
            +
                  :Amount => 8,
         
     | 
| 
      
 154 
     | 
    
         
            +
                  :DateRequested => "8/15/2012 10:18:46 PM",
         
     | 
| 
      
 155 
     | 
    
         
            +
                  :Status => "Pending",
         
     | 
| 
      
 156 
     | 
    
         
            +
                  :Transaction => nil
         
     | 
| 
      
 157 
     | 
    
         
            +
                }
         
     | 
| 
      
 158 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 159 
     | 
    
         
            +
            end
         
     | 
| 
      
 160 
     | 
    
         
            +
             
     | 
| 
      
 161 
     | 
    
         
            +
            def test_requests_array(params={})
         
     | 
| 
      
 162 
     | 
    
         
            +
              {
         
     | 
| 
      
 163 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 164 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 165 
     | 
    
         
            +
                :Response => [
         
     | 
| 
      
 166 
     | 
    
         
            +
                  {
         
     | 
| 
      
 167 
     | 
    
         
            +
                    :Id => 2209516,
         
     | 
| 
      
 168 
     | 
    
         
            +
                    :Source => {
         
     | 
| 
      
 169 
     | 
    
         
            +
                      :Id => "812-734-7288",
         
     | 
| 
      
 170 
     | 
    
         
            +
                      :Name => "Michael Schonfeld",
         
     | 
| 
      
 171 
     | 
    
         
            +
                      :Type => "Dwolla",
         
     | 
| 
      
 172 
     | 
    
         
            +
                      :Image => nil
         
     | 
| 
      
 173 
     | 
    
         
            +
                    },
         
     | 
| 
      
 174 
     | 
    
         
            +
                    :Destination => {
         
     | 
| 
      
 175 
     | 
    
         
            +
                      :Id => "812-552-5325",
         
     | 
| 
      
 176 
     | 
    
         
            +
                      :Name => "Mark Littlewood",
         
     | 
| 
      
 177 
     | 
    
         
            +
                      :Type => "Dwolla",
         
     | 
| 
      
 178 
     | 
    
         
            +
                      :Image => nil
         
     | 
| 
      
 179 
     | 
    
         
            +
                    },
         
     | 
| 
      
 180 
     | 
    
         
            +
                    :Amount => 8,
         
     | 
| 
      
 181 
     | 
    
         
            +
                    :DateRequested => "8/15/2012 10:18:46 PM",
         
     | 
| 
      
 182 
     | 
    
         
            +
                    :Status => "Pending",
         
     | 
| 
      
 183 
     | 
    
         
            +
                    :Transaction => nil
         
     | 
| 
      
 184 
     | 
    
         
            +
                  },
         
     | 
| 
      
 185 
     | 
    
         
            +
                  {
         
     | 
| 
      
 186 
     | 
    
         
            +
                    :Id => 2213417,
         
     | 
| 
      
 187 
     | 
    
         
            +
                    :Source => {
         
     | 
| 
      
 188 
     | 
    
         
            +
                      :Id => "812-713-9234",
         
     | 
| 
      
 189 
     | 
    
         
            +
                      :Name => "Dwolla",
         
     | 
| 
      
 190 
     | 
    
         
            +
                      :Type => "Dwolla",
         
     | 
| 
      
 191 
     | 
    
         
            +
                      :Image => nil
         
     | 
| 
      
 192 
     | 
    
         
            +
                    },
         
     | 
| 
      
 193 
     | 
    
         
            +
                    :Destination => {
         
     | 
| 
      
 194 
     | 
    
         
            +
                      :Id => "812-734-7288",
         
     | 
| 
      
 195 
     | 
    
         
            +
                      :Name => "Michael Schonfeld",
         
     | 
| 
      
 196 
     | 
    
         
            +
                      :Type => "Dwolla",
         
     | 
| 
      
 197 
     | 
    
         
            +
                      :Image => nil
         
     | 
| 
      
 198 
     | 
    
         
            +
                    },
         
     | 
| 
      
 199 
     | 
    
         
            +
                    :Amount => 0.1,
         
     | 
| 
      
 200 
     | 
    
         
            +
                    :DateRequested => "12/4/2012 5:20:38 PM",
         
     | 
| 
      
 201 
     | 
    
         
            +
                    :Status => "Pending",
         
     | 
| 
      
 202 
     | 
    
         
            +
                    :Transaction => nil
         
     | 
| 
      
 203 
     | 
    
         
            +
                  }
         
     | 
| 
      
 204 
     | 
    
         
            +
                ]
         
     | 
| 
      
 205 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 206 
     | 
    
         
            +
            end
         
     | 
| 
      
 207 
     | 
    
         
            +
             
     | 
| 
      
 208 
     | 
    
         
            +
            def test_request_cancel(params={})
         
     | 
| 
      
 209 
     | 
    
         
            +
              {
         
     | 
| 
      
 210 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 211 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 212 
     | 
    
         
            +
                :Response => ''
         
     | 
| 
      
 213 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 214 
     | 
    
         
            +
            end
         
     | 
| 
      
 215 
     | 
    
         
            +
             
     | 
| 
      
 216 
     | 
    
         
            +
            def test_request_fulfill(params={})
         
     | 
| 
      
 217 
     | 
    
         
            +
              {
         
     | 
| 
      
 218 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 219 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 220 
     | 
    
         
            +
                :Response => {
         
     | 
| 
      
 221 
     | 
    
         
            +
                  :Id => 2844131,
         
     | 
| 
      
 222 
     | 
    
         
            +
                  :RequestId => 2219682,
         
     | 
| 
      
 223 
     | 
    
         
            +
                  :Source => {
         
     | 
| 
      
 224 
     | 
    
         
            +
                    :Id => "812-734-7288",
         
     | 
| 
      
 225 
     | 
    
         
            +
                    :Name => "Michael Schonfeld",
         
     | 
| 
      
 226 
     | 
    
         
            +
                    :Type => "Dwolla",
         
     | 
| 
      
 227 
     | 
    
         
            +
                    :Image => nil
         
     | 
| 
      
 228 
     | 
    
         
            +
                  },
         
     | 
| 
      
 229 
     | 
    
         
            +
                  :Destination => {
         
     | 
| 
      
 230 
     | 
    
         
            +
                    :Id => "812-726-8148",
         
     | 
| 
      
 231 
     | 
    
         
            +
                    :Name => "Paul Liberman",
         
     | 
| 
      
 232 
     | 
    
         
            +
                    :Type => "Dwolla",
         
     | 
| 
      
 233 
     | 
    
         
            +
                    :Image => nil
         
     | 
| 
      
 234 
     | 
    
         
            +
                  },
         
     | 
| 
      
 235 
     | 
    
         
            +
                  :Amount => 1,
         
     | 
| 
      
 236 
     | 
    
         
            +
                  :SentDate => "5/3/2013 10:55:56 AM",
         
     | 
| 
      
 237 
     | 
    
         
            +
                  :ClearingDate => "5/3/2013 10:55:56 AM",
         
     | 
| 
      
 238 
     | 
    
         
            +
                  :Status => "processed"
         
     | 
| 
      
 239 
     | 
    
         
            +
                }
         
     | 
| 
      
 240 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 241 
     | 
    
         
            +
            end
         
     | 
| 
      
 242 
     | 
    
         
            +
             
     | 
| 
      
 243 
     | 
    
         
            +
            def test_fundingsource_byid(params={})
         
     | 
| 
      
 244 
     | 
    
         
            +
              {
         
     | 
| 
      
 245 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 246 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 247 
     | 
    
         
            +
                :Response => {
         
     | 
| 
      
 248 
     | 
    
         
            +
                  :Balance => 7.74,
         
     | 
| 
      
 249 
     | 
    
         
            +
                  :Id => "a4946ae2d2b7f1f880790f31a36887f5",
         
     | 
| 
      
 250 
     | 
    
         
            +
                  :Name => "Veridian Credit Union - Savings",
         
     | 
| 
      
 251 
     | 
    
         
            +
                  :Type => "Savings",
         
     | 
| 
      
 252 
     | 
    
         
            +
                  :Verified => true,
         
     | 
| 
      
 253 
     | 
    
         
            +
                  :ProcessingType => "FiSync"
         
     | 
| 
      
 254 
     | 
    
         
            +
                }
         
     | 
| 
      
 255 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 256 
     | 
    
         
            +
            end
         
     | 
| 
      
 257 
     | 
    
         
            +
             
     | 
| 
      
 258 
     | 
    
         
            +
            def test_fundingsources_array(params={})
         
     | 
| 
      
 259 
     | 
    
         
            +
              {
         
     | 
| 
      
 260 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 261 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 262 
     | 
    
         
            +
                :Response => [
         
     | 
| 
      
 263 
     | 
    
         
            +
                  {
         
     | 
| 
      
 264 
     | 
    
         
            +
                    :Id => "a4946ae2d2b7f1f880790f31a36887f5",
         
     | 
| 
      
 265 
     | 
    
         
            +
                    :Name => "Veridian Credit Union - Savings",
         
     | 
| 
      
 266 
     | 
    
         
            +
                    :Type => "Savings",
         
     | 
| 
      
 267 
     | 
    
         
            +
                    :Verified => true,
         
     | 
| 
      
 268 
     | 
    
         
            +
                    :ProcessingType => "FiSync"
         
     | 
| 
      
 269 
     | 
    
         
            +
                  },
         
     | 
| 
      
 270 
     | 
    
         
            +
                  {
         
     | 
| 
      
 271 
     | 
    
         
            +
                    :Id => "c21012f98742d4b0affcd8aeabefb369",
         
     | 
| 
      
 272 
     | 
    
         
            +
                    :Name => "My Checking Account - Checking",
         
     | 
| 
      
 273 
     | 
    
         
            +
                    :Type => "Checking",
         
     | 
| 
      
 274 
     | 
    
         
            +
                    :Verified => true,
         
     | 
| 
      
 275 
     | 
    
         
            +
                    :ProcessingType => "ACH"
         
     | 
| 
      
 276 
     | 
    
         
            +
                  }
         
     | 
| 
      
 277 
     | 
    
         
            +
                ]
         
     | 
| 
      
 278 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 279 
     | 
    
         
            +
            end
         
     | 
| 
      
 280 
     | 
    
         
            +
             
     | 
| 
      
 281 
     | 
    
         
            +
            def test_fundingsource_withdraw(params={})
         
     | 
| 
      
 282 
     | 
    
         
            +
              {
         
     | 
| 
      
 283 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 284 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 285 
     | 
    
         
            +
                :Response => {
         
     | 
| 
      
 286 
     | 
    
         
            +
                  :Id => 2834469,
         
     | 
| 
      
 287 
     | 
    
         
            +
                  :Amount => 1,
         
     | 
| 
      
 288 
     | 
    
         
            +
                  :Date => "5/2/2013 9:18:09 PM",
         
     | 
| 
      
 289 
     | 
    
         
            +
                  :Type => "withdrawal",
         
     | 
| 
      
 290 
     | 
    
         
            +
                  :UserType => "Dwolla",
         
     | 
| 
      
 291 
     | 
    
         
            +
                  :DestinationId => "XXX80-1",
         
     | 
| 
      
 292 
     | 
    
         
            +
                  :DestinationName => "Veridian Credit Union",
         
     | 
| 
      
 293 
     | 
    
         
            +
                  :SourceId => "812-734-7288",
         
     | 
| 
      
 294 
     | 
    
         
            +
                  :SourceName => "Michael Schonfeld",
         
     | 
| 
      
 295 
     | 
    
         
            +
                  :ClearingDate => "5/2/2013",
         
     | 
| 
      
 296 
     | 
    
         
            +
                  :Status => "pending",
         
     | 
| 
      
 297 
     | 
    
         
            +
                  :Notes => nil,
         
     | 
| 
      
 298 
     | 
    
         
            +
                  :Fees => nil
         
     | 
| 
      
 299 
     | 
    
         
            +
                }
         
     | 
| 
      
 300 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 301 
     | 
    
         
            +
            end
         
     | 
| 
      
 302 
     | 
    
         
            +
             
     | 
| 
      
 303 
     | 
    
         
            +
            def test_fundingsource_deposit(params={})
         
     | 
| 
      
 304 
     | 
    
         
            +
              {
         
     | 
| 
      
 305 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 306 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 307 
     | 
    
         
            +
                :Response => {
         
     | 
| 
      
 308 
     | 
    
         
            +
                  :Id => 2834457,
         
     | 
| 
      
 309 
     | 
    
         
            +
                  :Amount => 1,
         
     | 
| 
      
 310 
     | 
    
         
            +
                  :Date => "5/2/2013 9:17:02 PM",
         
     | 
| 
      
 311 
     | 
    
         
            +
                  :Type => "deposit",
         
     | 
| 
      
 312 
     | 
    
         
            +
                  :UserType => "Dwolla",
         
     | 
| 
      
 313 
     | 
    
         
            +
                  :DestinationId => "812-734-7288",
         
     | 
| 
      
 314 
     | 
    
         
            +
                  :DestinationName => "Michael Schonfeld",
         
     | 
| 
      
 315 
     | 
    
         
            +
                  :SourceId => "XXX80-1",
         
     | 
| 
      
 316 
     | 
    
         
            +
                  :SourceName => "Veridian Credit Union",
         
     | 
| 
      
 317 
     | 
    
         
            +
                  :ClearingDate => "5/2/2013",
         
     | 
| 
      
 318 
     | 
    
         
            +
                  :Status => "pending",
         
     | 
| 
      
 319 
     | 
    
         
            +
                  :Notes => nil,
         
     | 
| 
      
 320 
     | 
    
         
            +
                  :Fees => nil
         
     | 
| 
      
 321 
     | 
    
         
            +
                }
         
     | 
| 
      
 322 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 323 
     | 
    
         
            +
            end
         
     | 
| 
      
 324 
     | 
    
         
            +
             
     | 
| 
      
 325 
     | 
    
         
            +
            def test_user_self(params={})
         
     | 
| 
      
 326 
     | 
    
         
            +
              {
         
     | 
| 
      
 327 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 328 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 329 
     | 
    
         
            +
                :Response => {
         
     | 
| 
      
 330 
     | 
    
         
            +
                  :City => "Paris",
         
     | 
| 
      
 331 
     | 
    
         
            +
                  :State => "TN",
         
     | 
| 
      
 332 
     | 
    
         
            +
                  :Type => "Personal",
         
     | 
| 
      
 333 
     | 
    
         
            +
                  :Id => "812-629-2658",
         
     | 
| 
      
 334 
     | 
    
         
            +
                  :Name => "Codeacademy Course",
         
     | 
| 
      
 335 
     | 
    
         
            +
                  :Latitude => 0,
         
     | 
| 
      
 336 
     | 
    
         
            +
                  :Longitude => 0
         
     | 
| 
      
 337 
     | 
    
         
            +
                }
         
     | 
| 
      
 338 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 339 
     | 
    
         
            +
            end
         
     | 
| 
      
 340 
     | 
    
         
            +
             
     | 
| 
      
 341 
     | 
    
         
            +
            def test_user_byid(params={})
         
     | 
| 
      
 342 
     | 
    
         
            +
              {
         
     | 
| 
      
 343 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 344 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 345 
     | 
    
         
            +
                :Response => {
         
     | 
| 
      
 346 
     | 
    
         
            +
                  :Name => "Alex Hart",
         
     | 
| 
      
 347 
     | 
    
         
            +
                  :Id => "812-499-5823",
         
     | 
| 
      
 348 
     | 
    
         
            +
                  :Type => "Dwolla",
         
     | 
| 
      
 349 
     | 
    
         
            +
                  :Image => "https://www.dwolla.com/avatars/812-499-5823",
         
     | 
| 
      
 350 
     | 
    
         
            +
                  :City => nil,
         
     | 
| 
      
 351 
     | 
    
         
            +
                  :State => nil
         
     | 
| 
      
 352 
     | 
    
         
            +
                }
         
     | 
| 
      
 353 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 354 
     | 
    
         
            +
            end
         
     | 
| 
      
 355 
     | 
    
         
            +
             
     | 
| 
      
 356 
     | 
    
         
            +
            def test_users_array(params={})
         
     | 
| 
      
 357 
     | 
    
         
            +
              {
         
     | 
| 
      
 358 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 359 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 360 
     | 
    
         
            +
                :Response => [
         
     | 
| 
      
 361 
     | 
    
         
            +
                  {
         
     | 
| 
      
 362 
     | 
    
         
            +
                    :Name => "Alex Hart",
         
     | 
| 
      
 363 
     | 
    
         
            +
                    :Id => "812-499-5823",
         
     | 
| 
      
 364 
     | 
    
         
            +
                    :Type => "Dwolla",
         
     | 
| 
      
 365 
     | 
    
         
            +
                    :Image => "https://www.dwolla.com/avatars/812-499-5823",
         
     | 
| 
      
 366 
     | 
    
         
            +
                    :City => nil,
         
     | 
| 
      
 367 
     | 
    
         
            +
                    :State => nil
         
     | 
| 
      
 368 
     | 
    
         
            +
                  },
         
     | 
| 
      
 369 
     | 
    
         
            +
                  {
         
     | 
| 
      
 370 
     | 
    
         
            +
                    :Name => "Alexander Taub",
         
     | 
| 
      
 371 
     | 
    
         
            +
                    :Id => "812-626-8794",
         
     | 
| 
      
 372 
     | 
    
         
            +
                    :Type => "Dwolla",
         
     | 
| 
      
 373 
     | 
    
         
            +
                    :Image => "https://www.dwolla.com/avatars/812-626-8794",
         
     | 
| 
      
 374 
     | 
    
         
            +
                    :City => nil,
         
     | 
| 
      
 375 
     | 
    
         
            +
                    :State => nil
         
     | 
| 
      
 376 
     | 
    
         
            +
                  }
         
     | 
| 
      
 377 
     | 
    
         
            +
                ]
         
     | 
| 
      
 378 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 379 
     | 
    
         
            +
            end
         
     | 
| 
      
 380 
     | 
    
         
            +
             
     | 
| 
      
 381 
     | 
    
         
            +
            def test_contacts_array(params={})
         
     | 
| 
      
 382 
     | 
    
         
            +
              {
         
     | 
| 
      
 383 
     | 
    
         
            +
                :Success => true,
         
     | 
| 
      
 384 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 385 
     | 
    
         
            +
                :Response => [
         
     | 
| 
      
 386 
     | 
    
         
            +
                  {
         
     | 
| 
      
 387 
     | 
    
         
            +
                    :Name => "Pinnacle Marketing",
         
     | 
| 
      
 388 
     | 
    
         
            +
                    :Id => "812-464-9495",
         
     | 
| 
      
 389 
     | 
    
         
            +
                    :Type => "Dwolla",
         
     | 
| 
      
 390 
     | 
    
         
            +
                    :Image => "https://www.dwolla.com/avatars/812-464-9495",
         
     | 
| 
      
 391 
     | 
    
         
            +
                    :Latitude => 0,
         
     | 
| 
      
 392 
     | 
    
         
            +
                    :Longitude => 0,
         
     | 
| 
      
 393 
     | 
    
         
            +
                    :Address => "Box 311\n134 Moore Hill Road",
         
     | 
| 
      
 394 
     | 
    
         
            +
                    :City => "Newbury",
         
     | 
| 
      
 395 
     | 
    
         
            +
                    :State => "VT",
         
     | 
| 
      
 396 
     | 
    
         
            +
                    :PostalCode => "05051",
         
     | 
| 
      
 397 
     | 
    
         
            +
                    :Group => "812-534-7970,812-530-2592,812-451-7983,812-554-6122,812-499-3232,812-475-9151,812-568-7828,812-518-8055,812-514-9530",
         
     | 
| 
      
 398 
     | 
    
         
            +
                    :Delta => 0
         
     | 
| 
      
 399 
     | 
    
         
            +
                  },
         
     | 
| 
      
 400 
     | 
    
         
            +
                  {
         
     | 
| 
      
 401 
     | 
    
         
            +
                    :Name => "CMS Plus Hosting LLC",
         
     | 
| 
      
 402 
     | 
    
         
            +
                    :Id => "812-534-7970",
         
     | 
| 
      
 403 
     | 
    
         
            +
                    :Type => "Dwolla",
         
     | 
| 
      
 404 
     | 
    
         
            +
                    :Image => "https://www.dwolla.com/avatars/812-534-7970",
         
     | 
| 
      
 405 
     | 
    
         
            +
                    :Latitude => 0,
         
     | 
| 
      
 406 
     | 
    
         
            +
                    :Longitude => 0,
         
     | 
| 
      
 407 
     | 
    
         
            +
                    :Address => "20 E BEECH\nPO BOX 47",
         
     | 
| 
      
 408 
     | 
    
         
            +
                    :City => "Cedar Springs",
         
     | 
| 
      
 409 
     | 
    
         
            +
                    :State => "MI",
         
     | 
| 
      
 410 
     | 
    
         
            +
                    :PostalCode => "49319",
         
     | 
| 
      
 411 
     | 
    
         
            +
                    :Group => "812-464-9495,812-530-2592,812-451-7983,812-554-6122,812-499-3232,812-475-9151,812-568-7828,812-518-8055,812-514-9530",
         
     | 
| 
      
 412 
     | 
    
         
            +
                    :Delta => 0
         
     | 
| 
      
 413 
     | 
    
         
            +
                  }
         
     | 
| 
      
 414 
     | 
    
         
            +
                ]
         
     | 
| 
      
 415 
     | 
    
         
            +
              }.merge(params)
         
     | 
| 
      
 416 
     | 
    
         
            +
            end
         
     | 
| 
      
 417 
     | 
    
         
            +
             
     | 
| 
      
 418 
     | 
    
         
            +
            def test_api_error
         
     | 
| 
      
 419 
     | 
    
         
            +
              {
         
     | 
| 
      
 420 
     | 
    
         
            +
                :Success => false,
         
     | 
| 
      
 421 
     | 
    
         
            +
                :Message => 'Success',
         
     | 
| 
      
 422 
     | 
    
         
            +
                :Response => ''
         
     | 
| 
      
 423 
     | 
    
         
            +
              }
         
     | 
| 
      
 424 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: dwolla-ruby
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.1.0
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2013- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2013-05-03 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: rest-client
         
     | 
| 
         @@ -65,6 +65,54 @@ dependencies: 
     | 
|
| 
       65 
65 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
       66 
66 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       67 
67 
     | 
    
         
             
                    version: '2'
         
     | 
| 
      
 68 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 69 
     | 
    
         
            +
              name: mocha
         
     | 
| 
      
 70 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 71 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 72 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 73 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 74 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 75 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 76 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 77 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 78 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 79 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 80 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 81 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 82 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 83 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 84 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 85 
     | 
    
         
            +
              name: shoulda
         
     | 
| 
      
 86 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 87 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 88 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 89 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 90 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 91 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 92 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 93 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 94 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 95 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 96 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 97 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 98 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 99 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 100 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 101 
     | 
    
         
            +
              name: test-unit
         
     | 
| 
      
 102 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 103 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 104 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 105 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 106 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 107 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 108 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 109 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 110 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 111 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 112 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 113 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 114 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 115 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
       68 
116 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       69 
117 
     | 
    
         
             
              name: rake
         
     | 
| 
       70 
118 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -90,17 +138,20 @@ extensions: [] 
     | 
|
| 
       90 
138 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       91 
139 
     | 
    
         
             
            files:
         
     | 
| 
       92 
140 
     | 
    
         
             
            - .gitignore
         
     | 
| 
      
 141 
     | 
    
         
            +
            - .travis.yml
         
     | 
| 
      
 142 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
       93 
143 
     | 
    
         
             
            - README.md
         
     | 
| 
       94 
144 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       95 
145 
     | 
    
         
             
            - dwolla-ruby.gemspec
         
     | 
| 
       96 
146 
     | 
    
         
             
            - examples/_keys.rb
         
     | 
| 
       97 
     | 
    
         
            -
            - examples/accountInfo.rb
         
     | 
| 
       98 
147 
     | 
    
         
             
            - examples/balance.rb
         
     | 
| 
       99 
148 
     | 
    
         
             
            - examples/contacts.rb
         
     | 
| 
       100 
149 
     | 
    
         
             
            - examples/fundingSources.rb
         
     | 
| 
       101 
150 
     | 
    
         
             
            - examples/oauth.rb
         
     | 
| 
       102 
151 
     | 
    
         
             
            - examples/offsiteGateway.rb
         
     | 
| 
       103 
152 
     | 
    
         
             
            - examples/transactions.rb
         
     | 
| 
      
 153 
     | 
    
         
            +
            - examples/users.rb
         
     | 
| 
      
 154 
     | 
    
         
            +
            - gemfiles/json.gemfile
         
     | 
| 
       104 
155 
     | 
    
         
             
            - lib/dwolla.rb
         
     | 
| 
       105 
156 
     | 
    
         
             
            - lib/dwolla/balance.rb
         
     | 
| 
       106 
157 
     | 
    
         
             
            - lib/dwolla/contacts.rb
         
     | 
| 
         @@ -119,6 +170,8 @@ files: 
     | 
|
| 
       119 
170 
     | 
    
         
             
            - lib/dwolla/transactions.rb
         
     | 
| 
       120 
171 
     | 
    
         
             
            - lib/dwolla/users.rb
         
     | 
| 
       121 
172 
     | 
    
         
             
            - lib/dwolla/version.rb
         
     | 
| 
      
 173 
     | 
    
         
            +
            - test/test_dwolla.rb
         
     | 
| 
      
 174 
     | 
    
         
            +
            - test/test_helper.rb
         
     | 
| 
       122 
175 
     | 
    
         
             
            homepage: https://github.com/dwolla/dwolla-ruby
         
     | 
| 
       123 
176 
     | 
    
         
             
            licenses: []
         
     | 
| 
       124 
177 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
         @@ -143,4 +196,6 @@ rubygems_version: 1.8.24 
     | 
|
| 
       143 
196 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       144 
197 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       145 
198 
     | 
    
         
             
            summary: Official Ruby Wrapper for Dwolla's API
         
     | 
| 
       146 
     | 
    
         
            -
            test_files: 
     | 
| 
      
 199 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 200 
     | 
    
         
            +
            - test/test_dwolla.rb
         
     | 
| 
      
 201 
     | 
    
         
            +
            - test/test_helper.rb
         
     |