dwolla-ruby 2.5.1 → 2.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +8 -8
- data/.travis.yml +7 -7
- data/Gemfile +1 -1
- data/README.md +154 -138
- data/Rakefile +8 -8
- data/dwolla-ruby.gemspec +27 -27
- data/examples/balance.rb +15 -15
- data/examples/contacts.rb +32 -32
- data/examples/fundingSources.rb +39 -39
- data/examples/oauth.rb +34 -34
- data/examples/offsiteGateway.rb +31 -31
- data/examples/transactions.rb +38 -38
- data/examples/users.rb +30 -30
- data/gemfiles/json.gemfile +2 -2
- data/lib/dwolla.rb +326 -326
- data/lib/dwolla/accounts.rb +21 -21
- data/lib/dwolla/balance.rb +15 -15
- data/lib/dwolla/contacts.rb +22 -22
- data/lib/dwolla/errors/api_connection_error.rb +3 -3
- data/lib/dwolla/errors/api_error.rb +3 -3
- data/lib/dwolla/errors/authentication_error.rb +3 -3
- data/lib/dwolla/errors/dwolla_error.rb +19 -19
- data/lib/dwolla/errors/invalid_request_error.rb +10 -10
- data/lib/dwolla/errors/missing_parameter_error.rb +3 -3
- data/lib/dwolla/exceptions.rb +4 -4
- data/lib/dwolla/funding_sources.rb +65 -65
- data/lib/dwolla/json.rb +20 -20
- data/lib/dwolla/oauth.rb +51 -51
- data/lib/dwolla/offsite_gateway.rb +152 -144
- data/lib/dwolla/register.rb +55 -55
- data/lib/dwolla/requests.rb +56 -56
- data/lib/dwolla/transactions.rb +71 -71
- data/lib/dwolla/users.rb +36 -36
- data/lib/dwolla/version.rb +3 -3
- data/test/test_dwolla.rb +197 -197
- data/test/test_helper.rb +423 -423
- metadata +17 -18
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YWE4YjYyNjliYTMwMTczNzE3ZjNkMDM3Y2U4MjY4MDg5MDJmYTNiNQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 104ede0277b152834734532009f5bfc89fc3bdaf
|
4
|
+
data.tar.gz: e06536872c2ca718fd2036c2e8fe6ec52d62103f
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
OTUxZTlkODhhNGI1N2VjNjI4NjlkYWI1MmI2YjFmNTI1ODEzNDIzNDMwZjlj
|
11
|
-
ODY0OWM4MTdlOWQ5YWM1MzA5NzhhMzI1NmIzMjg5NTAwOTcxMWE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
Y2VmMzFiYjkwZGI2NTdmY2ZhYzRjZDlkMmE3OGY1YjM0YjNiMGU3MzFmZGFj
|
14
|
-
MGE3MmQxY2ZiOGViNzk4NTBiNDE5NDkwMjlhN2VkMGVlOGFiNGJhMzQ4MjIx
|
15
|
-
M2JkZTkzYjE1NzQzMTNjNDkxNWYxODdjMTdkMmNhOGM5M2E1Njk=
|
6
|
+
metadata.gz: efd22544a62e1282ce6ae2719e3d7035ef4e205d0bcd2d15a402cf26de900ddc8bffb97dfe573a7b1f7be1edc4a45c4b764e593a351a74fd6b910237bbf0ee33
|
7
|
+
data.tar.gz: 3d52611e834a41c82ccbe07a72e2feceaaaf445df2c7938c25dddd50c37789988e29eace0e423097f6c74de6641e8908cae1c43a5109e4da6127a17f171045b5
|
data/.gitignore
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
*.swp
|
2
|
-
*.gem
|
3
|
-
.bundle
|
4
|
-
.rvmrc
|
5
|
-
Gemfile.lock
|
6
|
-
pkg/*
|
7
|
-
coverage/
|
8
|
-
examples/_keys.rb
|
1
|
+
*.swp
|
2
|
+
*.gem
|
3
|
+
.bundle
|
4
|
+
.rvmrc
|
5
|
+
Gemfile.lock
|
6
|
+
pkg/*
|
7
|
+
coverage/
|
8
|
+
examples/_keys.rb
|
data/.travis.yml
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 1.8.7
|
4
|
-
- 1.9.2
|
5
|
-
- 1.9.3
|
6
|
-
- 2.0.0
|
7
|
-
gemfile:
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 1.8.7
|
4
|
+
- 1.9.2
|
5
|
+
- 1.9.3
|
6
|
+
- 2.0.0
|
7
|
+
gemfile:
|
8
8
|
- gemfiles/json.gemfile
|
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source "https://rubygems.org"
|
1
|
+
source "https://rubygems.org"
|
2
2
|
gemspec
|
data/README.md
CHANGED
@@ -1,138 +1,154 @@
|
|
1
|
-
# dwolla-ruby
|
2
|
-
Official Ruby wrapper for Dwolla's API
|
3
|
-
|
4
|
-
## Version
|
5
|
-
2.5.
|
6
|
-
|
7
|
-
## Requirements
|
8
|
-
- [Ruby](http://www.ruby-lang.org/)
|
9
|
-
|
10
|
-
## Installation
|
11
|
-
The easiest way to install the dwolla-ruby gem for now is to use bundler and add the following line to your Gemfile:
|
12
|
-
|
13
|
-
gem 'dwolla-ruby'
|
14
|
-
|
15
|
-
The recommended way to install dwolla-ruby is through RubyGems:
|
16
|
-
|
17
|
-
gem install dwolla-ruby
|
18
|
-
|
19
|
-
## Examples / Quickstart
|
20
|
-
|
21
|
-
To use the examples in the /examples folder, first edit the _keys.rb file and add your Dwolla API application's key, and secret, along with your account's [OAuth token](https://developers.dwolla.com/dev/token), and PIN.
|
22
|
-
|
23
|
-
This repo includes various usage examples, including:
|
24
|
-
|
25
|
-
* Authenticating with OAuth [oauth.rb]
|
26
|
-
* Sending money [send.rb]
|
27
|
-
* Fetching user information [users.rb]
|
28
|
-
* Grabbing a user's contacts [contacts.rb]
|
29
|
-
* Listing a user's funding sources [fundingSources.rb]
|
30
|
-
* Transacting money [transactions.rb]
|
31
|
-
* Getting a user's balance [balance.rb]
|
32
|
-
|
33
|
-
## Changelog
|
34
|
-
|
35
|
-
2.5.
|
36
|
-
|
37
|
-
*
|
38
|
-
|
39
|
-
2.5.
|
40
|
-
|
41
|
-
*
|
42
|
-
|
43
|
-
2.
|
44
|
-
|
45
|
-
*
|
46
|
-
|
47
|
-
2.
|
48
|
-
|
49
|
-
*
|
50
|
-
|
51
|
-
2.
|
52
|
-
|
53
|
-
*
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
*
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
*
|
89
|
-
|
90
|
-
2.
|
91
|
-
|
92
|
-
*
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
1
|
+
# dwolla-ruby
|
2
|
+
Official Ruby wrapper for Dwolla's API
|
3
|
+
|
4
|
+
## Version
|
5
|
+
2.5.5
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
- [Ruby](http://www.ruby-lang.org/)
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
The easiest way to install the dwolla-ruby gem for now is to use bundler and add the following line to your Gemfile:
|
12
|
+
|
13
|
+
gem 'dwolla-ruby'
|
14
|
+
|
15
|
+
The recommended way to install dwolla-ruby is through RubyGems:
|
16
|
+
|
17
|
+
gem install dwolla-ruby
|
18
|
+
|
19
|
+
## Examples / Quickstart
|
20
|
+
|
21
|
+
To use the examples in the /examples folder, first edit the _keys.rb file and add your Dwolla API application's key, and secret, along with your account's [OAuth token](https://developers.dwolla.com/dev/token), and PIN.
|
22
|
+
|
23
|
+
This repo includes various usage examples, including:
|
24
|
+
|
25
|
+
* Authenticating with OAuth [oauth.rb]
|
26
|
+
* Sending money [send.rb]
|
27
|
+
* Fetching user information [users.rb]
|
28
|
+
* Grabbing a user's contacts [contacts.rb]
|
29
|
+
* Listing a user's funding sources [fundingSources.rb]
|
30
|
+
* Transacting money [transactions.rb]
|
31
|
+
* Getting a user's balance [balance.rb]
|
32
|
+
|
33
|
+
## Changelog
|
34
|
+
|
35
|
+
2.5.5
|
36
|
+
|
37
|
+
* Pulled in a merge request for syntax error (thanks, @mstahl)
|
38
|
+
|
39
|
+
2.5.4
|
40
|
+
|
41
|
+
* Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
|
42
|
+
|
43
|
+
2.5.3
|
44
|
+
|
45
|
+
* Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
|
46
|
+
|
47
|
+
2.5.2
|
48
|
+
|
49
|
+
* Sandbox base URL is now HTTPS
|
50
|
+
|
51
|
+
2.5.1
|
52
|
+
|
53
|
+
* Add the 'additionalFundingSources' param to the offsite gateway
|
54
|
+
|
55
|
+
2.5.0
|
56
|
+
|
57
|
+
* Add refund API endpoint
|
58
|
+
|
59
|
+
2.4.7 [merge pull request by [dustMason0](https://github.com/dustMason)]
|
60
|
+
|
61
|
+
* Remove debugging reference to 'pp' (thanks, dustMason)
|
62
|
+
|
63
|
+
2.4.6
|
64
|
+
|
65
|
+
* Fix method double naming in the OffsiteGateway class
|
66
|
+
|
67
|
+
2.4.5 [merge pull request by [dustMason0](https://github.com/dustMason)]
|
68
|
+
|
69
|
+
* Fix floating point calculation errors
|
70
|
+
* Refactor the offsite gateway class
|
71
|
+
|
72
|
+
2.4.4
|
73
|
+
|
74
|
+
* Globalize the OAuth scope variable
|
75
|
+
|
76
|
+
2.4.3
|
77
|
+
|
78
|
+
* Add missing files [accounts.rb]
|
79
|
+
|
80
|
+
2.4.2
|
81
|
+
|
82
|
+
* Fix OAuth token override
|
83
|
+
|
84
|
+
2.4.1
|
85
|
+
|
86
|
+
* Show raw response on debug mode
|
87
|
+
* Add support for 'Accounts' API
|
88
|
+
* Raise APIError when OAuth's get_token fails
|
89
|
+
|
90
|
+
2.4.0
|
91
|
+
|
92
|
+
* Added support for inline passage of OAuth tokens
|
93
|
+
|
94
|
+
2.3.0
|
95
|
+
|
96
|
+
* Add support for "sandbox" / UAT mode
|
97
|
+
|
98
|
+
2.1.1
|
99
|
+
|
100
|
+
* Oops. POST request wasn't actually sending any params.
|
101
|
+
|
102
|
+
2.1.0
|
103
|
+
|
104
|
+
* Add tests! (OMG WOOT JK </LOL>)
|
105
|
+
|
106
|
+
2.0.0
|
107
|
+
|
108
|
+
* Reworked Gem.
|
109
|
+
|
110
|
+
## Testing
|
111
|
+
|
112
|
+
To run the gem's tests:
|
113
|
+
|
114
|
+
bundle exec rake test
|
115
|
+
|
116
|
+
## Credits
|
117
|
+
|
118
|
+
This wrapper is heavily based off Stripe's Ruby Gem
|
119
|
+
|
120
|
+
- Michael Schonfeld <michael@dwolla.com>
|
121
|
+
|
122
|
+
## Support
|
123
|
+
|
124
|
+
- Dwolla API <api@dwolla.com>
|
125
|
+
- Michael Schonfeld <michael@dwolla.com>
|
126
|
+
|
127
|
+
## References / Documentation
|
128
|
+
|
129
|
+
http://developers.dwolla.com/dev
|
130
|
+
|
131
|
+
## License
|
132
|
+
|
133
|
+
(The MIT License)
|
134
|
+
|
135
|
+
Copyright (c) 2013 Dwolla <michael@dwolla.com>
|
136
|
+
|
137
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
138
|
+
a copy of this software and associated documentation files (the
|
139
|
+
'Software'), to deal in the Software without restriction, including
|
140
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
141
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
142
|
+
permit persons to whom the Software is furnished to do so, subject to
|
143
|
+
the following conditions:
|
144
|
+
|
145
|
+
The above copyright notice and this permission notice shall be
|
146
|
+
included in all copies or substantial portions of the Software.
|
147
|
+
|
148
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
149
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
150
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
151
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
152
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
153
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
154
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
task :default => [:test]
|
2
|
-
|
3
|
-
task :test do
|
4
|
-
ret = true
|
5
|
-
Dir["test/**/*.rb"].each do |f|
|
6
|
-
ret = ret && ruby(f, '')
|
7
|
-
end
|
8
|
-
exit(ret)
|
1
|
+
task :default => [:test]
|
2
|
+
|
3
|
+
task :test do
|
4
|
+
ret = true
|
5
|
+
Dir["test/**/*.rb"].each do |f|
|
6
|
+
ret = ret && ruby(f, '')
|
7
|
+
end
|
8
|
+
exit(ret)
|
9
9
|
end
|
data/dwolla-ruby.gemspec
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
2
|
-
require "dwolla/version"
|
3
|
-
|
4
|
-
Gem::Specification.new do |s|
|
5
|
-
s.name = "dwolla-ruby"
|
6
|
-
s.version = Dwolla::VERSION
|
7
|
-
s.authors = ["Michael Schonfeld"]
|
8
|
-
s.email = ["michael@dwolla.com"]
|
9
|
-
s.homepage = "https://github.com/dwolla/dwolla-ruby"
|
10
|
-
s.summary = %q{Official Ruby Wrapper for Dwolla's API}
|
11
|
-
s.description = %q{Official Ruby Wrapper for Dwolla's API. Completely re-written based on Stripe's Ruby Bindings.}
|
12
|
-
|
13
|
-
s.rubyforge_project = "dwolla-ruby"
|
14
|
-
|
15
|
-
s.files = `git ls-files`.split("\n")
|
16
|
-
s.test_files = `git ls-files -- test/*`.split("\n")
|
17
|
-
s.require_paths = %w{lib}
|
18
|
-
|
19
|
-
s.add_dependency('rest-client', '~> 1.4')
|
20
|
-
s.add_dependency('multi_json', '>= 1.0.4', '< 2')
|
21
|
-
s.add_dependency('addressable', '>= 2')
|
22
|
-
|
23
|
-
s.add_development_dependency('mocha')
|
24
|
-
s.add_development_dependency('shoulda')
|
25
|
-
s.add_development_dependency('test-unit')
|
26
|
-
s.add_development_dependency('rake')
|
27
|
-
end
|
1
|
+
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
2
|
+
require "dwolla/version"
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "dwolla-ruby"
|
6
|
+
s.version = Dwolla::VERSION
|
7
|
+
s.authors = ["Michael Schonfeld"]
|
8
|
+
s.email = ["michael@dwolla.com"]
|
9
|
+
s.homepage = "https://github.com/dwolla/dwolla-ruby"
|
10
|
+
s.summary = %q{Official Ruby Wrapper for Dwolla's API}
|
11
|
+
s.description = %q{Official Ruby Wrapper for Dwolla's API. Completely re-written based on Stripe's Ruby Bindings.}
|
12
|
+
|
13
|
+
s.rubyforge_project = "dwolla-ruby"
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- test/*`.split("\n")
|
17
|
+
s.require_paths = %w{lib}
|
18
|
+
|
19
|
+
s.add_dependency('rest-client', '~> 1.4')
|
20
|
+
s.add_dependency('multi_json', '>= 1.0.4', '< 2')
|
21
|
+
s.add_dependency('addressable', '>= 2')
|
22
|
+
|
23
|
+
s.add_development_dependency('mocha')
|
24
|
+
s.add_development_dependency('shoulda')
|
25
|
+
s.add_development_dependency('test-unit')
|
26
|
+
s.add_development_dependency('rake')
|
27
|
+
end
|
data/examples/balance.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
# Include the Dwolla gem
|
2
|
-
require 'rubygems'
|
3
|
-
require 'pp'
|
4
|
-
require 'dwolla'
|
5
|
-
|
6
|
-
# Include any required keys
|
7
|
-
require './_keys.rb'
|
8
|
-
|
9
|
-
# Instantiate a new Dwolla User client
|
10
|
-
# And, seed a previously generated access token
|
11
|
-
Dwolla::token = @token
|
12
|
-
|
13
|
-
|
14
|
-
# EXAMPLE 1:
|
15
|
-
# Get the balance of the authenticated user
|
1
|
+
# Include the Dwolla gem
|
2
|
+
require 'rubygems'
|
3
|
+
require 'pp'
|
4
|
+
require 'dwolla'
|
5
|
+
|
6
|
+
# Include any required keys
|
7
|
+
require './_keys.rb'
|
8
|
+
|
9
|
+
# Instantiate a new Dwolla User client
|
10
|
+
# And, seed a previously generated access token
|
11
|
+
Dwolla::token = @token
|
12
|
+
|
13
|
+
|
14
|
+
# EXAMPLE 1:
|
15
|
+
# Get the balance of the authenticated user
|
16
16
|
pp Dwolla::Balance.get
|