dwolla-ruby 2.6.1 → 2.6.2

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.
Files changed (46) hide show
  1. checksums.yaml +13 -5
  2. data/.gitignore +8 -8
  3. data/.travis.yml +6 -6
  4. data/Gemfile +1 -1
  5. data/README.md +171 -168
  6. data/Rakefile +8 -8
  7. data/dwolla-ruby.gemspec +27 -27
  8. data/examples/balance.rb +15 -15
  9. data/examples/contacts.rb +32 -32
  10. data/examples/fundingSources.rb +39 -39
  11. data/examples/oauth.rb +50 -50
  12. data/examples/offsiteGateway.rb +31 -31
  13. data/examples/transactions.rb +38 -38
  14. data/examples/users.rb +30 -30
  15. data/gemfiles/json.gemfile +2 -2
  16. data/lib/dwolla.rb +326 -326
  17. data/lib/dwolla/accounts.rb +27 -27
  18. data/lib/dwolla/balance.rb +15 -15
  19. data/lib/dwolla/contacts.rb +30 -30
  20. data/lib/dwolla/errors/api_connection_error.rb +3 -3
  21. data/lib/dwolla/errors/api_error.rb +3 -3
  22. data/lib/dwolla/errors/authentication_error.rb +3 -3
  23. data/lib/dwolla/errors/dwolla_error.rb +19 -19
  24. data/lib/dwolla/errors/invalid_request_error.rb +10 -10
  25. data/lib/dwolla/errors/missing_parameter_error.rb +3 -3
  26. data/lib/dwolla/exceptions.rb +4 -4
  27. data/lib/dwolla/funding_sources.rb +65 -65
  28. data/lib/dwolla/json.rb +20 -20
  29. data/lib/dwolla/masspay.rb +52 -52
  30. data/lib/dwolla/oauth.rb +75 -75
  31. data/lib/dwolla/offsite_gateway.rb +154 -154
  32. data/lib/dwolla/requests.rb +56 -56
  33. data/lib/dwolla/transactions.rb +56 -56
  34. data/lib/dwolla/users.rb +39 -39
  35. data/lib/dwolla/version.rb +3 -3
  36. data/test/test_accounts.rb +18 -18
  37. data/test/test_balance.rb +9 -9
  38. data/test/test_contacts.rb +19 -19
  39. data/test/test_funding_sources.rb +64 -64
  40. data/test/test_masspay.rb +47 -47
  41. data/test/test_oauth.rb +30 -30
  42. data/test/test_offsite_gateway.rb +57 -57
  43. data/test/test_requests.rb +29 -29
  44. data/test/test_transactions.rb +51 -51
  45. data/test/test_users.rb +33 -33
  46. metadata +15 -15
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 14d533bc256b6023f513ab20ca894ce2ad0d0e7d
4
- data.tar.gz: f4b6625811d35cb7abf8fe37293ac132720541b7
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YzJhM2M5ZDI1ZmIxODI2YTkwMDdiYmQ5NWIyNzgxYzFhNGU1ZjhhNw==
5
+ data.tar.gz: !binary |-
6
+ YzhjNDNhNmY3ZGY2ZGU2ZTA5ZTYxYWQ5NTU4MDI1OTM5YmM4YTVhOA==
5
7
  SHA512:
6
- metadata.gz: 651068aedd00095349efd91a26036c1787b75104802e3885100527e4a237c6b4a492ff1cb1568645a286e311c8d0db02dadf3ac88dbb6aaba5c1b104701828a6
7
- data.tar.gz: 5860ce246cd7f430ffc214f83bf26bbabdc4b9e7a46d5e7c61d81940e7d6f41f2de95bc8c66e6667425ece56b03ea1db5cf95406a927c951c1b414f7d0f0c4b2
8
+ metadata.gz: !binary |-
9
+ MjIwYzFjMmE2NWQ3NzExYTliMDA1YzBjOWRkNmRlY2M3MGJmZjg0NzI2YzQ0
10
+ ZWRlZjk3ZjEzNzczZjZmYTRmNmE0NWQ4NWY4MTAwNmQ3MmE4MDZjODE2ZmEy
11
+ ZGVmNDNiYTM1ODdmYjA2YWYzM2EyODQ4N2Q2ZGMzNWM3ZTI4MDI=
12
+ data.tar.gz: !binary |-
13
+ YzYwNTNiZTFiNzFkZDI0OTZjZmJjYjlkYzBmZjc4MzZiYmM5MTBkY2JiMDZk
14
+ N2E5MDdkYmY1NTJmZGJmYWQxZjZkYmJkYzlhZmI4YTBmY2QyZTYxOThjMzZi
15
+ MTYyNjQxOGZhMWJkZTE0NGQzZDA5MzJkZDg2N2QwZDZmNTgxN2M=
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,6 +1,6 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- gemfile:
6
- - gemfiles/json.gemfile
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ gemfile:
6
+ - 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,168 +1,171 @@
1
- # dwolla-ruby
2
- Official Ruby wrapper for Dwolla's API
3
-
4
- ## Version
5
- 2.6.1
6
-
7
- [![Build Status](https://travis-ci.org/Dwolla/dwolla-ruby.svg?branch=master)](https://travis-ci.org/Dwolla/dwolla-ruby)
8
-
9
- ## Requirements
10
- - [Ruby](http://www.ruby-lang.org/)
11
-
12
- ## Installation
13
- The easiest way to install the dwolla-ruby gem for now is to use bundler and add the following line to your Gemfile:
14
-
15
- `gem 'dwolla-ruby'`
16
-
17
- The recommended way to install dwolla-ruby is through RubyGems:
18
-
19
- `gem install dwolla-ruby`
20
-
21
- ## Examples / Quickstart
22
-
23
- 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.
24
-
25
- This repo includes various usage examples, including:
26
-
27
- * Authenticating with OAuth [oauth.rb]
28
- * Fetching user information [users.rb]
29
- * Grabbing a user's contacts [contacts.rb]
30
- * Listing a user's funding sources [fundingSources.rb]
31
- * Transacting money (includes sending) [transactions.rb]
32
- * Getting a user's balance [balance.rb]
33
-
34
- ## Changelog
35
-
36
- 2.6.1
37
- * Minor refactoring, fixed bug that would cause crashes in certain Ruby version with checking if keys exist in hashes.
38
-
39
- 2.6.0
40
-
41
- * **BREAKING CHANGE**: OAuth access tokens now expire. Instead of a string, `Dwolla::OAuth::get_token` now returns a hash with an `access_token`, `refresh_token`, and expiration times in seconds for both. In order to refresh authorization, use `Dwolla::OAuth.refresh_auth`
42
- * **BREAKING CHANGE**: Guest send has been officially deprecated and removed from this gem.
43
- * All MassPay endpoints have been included in this release for batch payment support.
44
- * Proper unit tests implemented for all endpoints.
45
-
46
- 2.5.5
47
-
48
- * Pulled in a merge request for syntax error (thanks, @mstahl)
49
-
50
- 2.5.4
51
-
52
- * Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
53
-
54
- 2.5.3
55
-
56
- * Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
57
-
58
- 2.5.2
59
-
60
- * Sandbox base URL is now HTTPS
61
-
62
- 2.5.1
63
-
64
- * Add the 'additionalFundingSources' param to the offsite gateway
65
-
66
- 2.5.0
67
-
68
- * Add refund API endpoint
69
-
70
- 2.4.7 [merge pull request by [dustMason0](https://github.com/dustMason)]
71
-
72
- * Remove debugging reference to 'pp' (thanks, dustMason)
73
-
74
- 2.4.6
75
-
76
- * Fix method double naming in the OffsiteGateway class
77
-
78
- 2.4.5 [merge pull request by [dustMason0](https://github.com/dustMason)]
79
-
80
- * Fix floating point calculation errors
81
- * Refactor the offsite gateway class
82
-
83
- 2.4.4
84
-
85
- * Globalize the OAuth scope variable
86
-
87
- 2.4.3
88
-
89
- * Add missing files [accounts.rb]
90
-
91
- 2.4.2
92
-
93
- * Fix OAuth token override
94
-
95
- 2.4.1
96
-
97
- * Show raw response on debug mode
98
- * Add support for 'Accounts' API
99
- * Raise APIError when OAuth's get_token fails
100
-
101
- 2.4.0
102
-
103
- * Added support for inline passage of OAuth tokens
104
-
105
- 2.3.0
106
-
107
- * Add support for "sandbox" / UAT mode
108
-
109
- 2.1.1
110
-
111
- * Oops. POST request wasn't actually sending any params.
112
-
113
- 2.1.0
114
-
115
- * Add tests! (OMG WOOT JK </LOL>)
116
-
117
- 2.0.0
118
-
119
- * Reworked Gem.
120
-
121
- ## Testing
122
-
123
- To run the gem's tests:
124
-
125
- bundle exec rake test
126
-
127
- ## Credits
128
-
129
- This wrapper is heavily based off Stripe's Ruby Gem
130
-
131
- - Michael Schonfeld &lt;michael@dwolla.com&gt;
132
-
133
- ## Support
134
-
135
- We highly recommend seeking support on our forums, [located here!](https://discuss.dwolla.com/category/api-support)
136
-
137
- - Dwolla API &lt;api@dwolla.com&gt;
138
- - David Stancu &lt;david@dwolla.com&gt;
139
- - Gordon Zheng &lt;gordon@dwolla.com&gt;
140
-
141
- ## References / Documentation
142
-
143
- http://developers.dwolla.com/dev
144
-
145
- ## License
146
-
147
- (The MIT License)
148
-
149
- Copyright (c) 2013 Dwolla &lt;michael@dwolla.com&gt;
150
-
151
- Permission is hereby granted, free of charge, to any person obtaining
152
- a copy of this software and associated documentation files (the
153
- 'Software'), to deal in the Software without restriction, including
154
- without limitation the rights to use, copy, modify, merge, publish,
155
- distribute, sublicense, and/or sell copies of the Software, and to
156
- permit persons to whom the Software is furnished to do so, subject to
157
- the following conditions:
158
-
159
- The above copyright notice and this permission notice shall be
160
- included in all copies or substantial portions of the Software.
161
-
162
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
163
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
164
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
165
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
166
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
167
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
168
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ # dwolla-ruby
2
+ Official Ruby wrapper for Dwolla's API
3
+
4
+ ## Version
5
+ 2.6.2
6
+
7
+ [![Build Status](https://travis-ci.org/Dwolla/dwolla-ruby.svg?branch=master)](https://travis-ci.org/Dwolla/dwolla-ruby)
8
+
9
+ ## Requirements
10
+ - [Ruby](http://www.ruby-lang.org/)
11
+
12
+ ## Installation
13
+ The easiest way to install the dwolla-ruby gem for now is to use bundler and add the following line to your Gemfile:
14
+
15
+ `gem 'dwolla-ruby'`
16
+
17
+ The recommended way to install dwolla-ruby is through RubyGems:
18
+
19
+ `gem install dwolla-ruby`
20
+
21
+ ## Examples / Quickstart
22
+
23
+ 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.
24
+
25
+ This repo includes various usage examples, including:
26
+
27
+ * Authenticating with OAuth [oauth.rb]
28
+ * Fetching user information [users.rb]
29
+ * Grabbing a user's contacts [contacts.rb]
30
+ * Listing a user's funding sources [fundingSources.rb]
31
+ * Transacting money (includes sending) [transactions.rb]
32
+ * Getting a user's balance [balance.rb]
33
+
34
+ ## Changelog
35
+
36
+ 2.6.2
37
+ * Fixed bug with generation of Off-Site Gateway checkout URLs
38
+
39
+ 2.6.1
40
+ * Minor refactoring, fixed bug that would cause crashes in certain Ruby version with checking if keys exist in hashes.
41
+
42
+ 2.6.0
43
+
44
+ * **BREAKING CHANGE**: OAuth access tokens now expire. Instead of a string, `Dwolla::OAuth::get_token` now returns a hash with an `access_token`, `refresh_token`, and expiration times in seconds for both. In order to refresh authorization, use `Dwolla::OAuth.refresh_auth`
45
+ * **BREAKING CHANGE**: Guest send has been officially deprecated and removed from this gem.
46
+ * All MassPay endpoints have been included in this release for batch payment support.
47
+ * Proper unit tests implemented for all endpoints.
48
+
49
+ 2.5.5
50
+
51
+ * Pulled in a merge request for syntax error (thanks, @mstahl)
52
+
53
+ 2.5.4
54
+
55
+ * Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
56
+
57
+ 2.5.3
58
+
59
+ * Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
60
+
61
+ 2.5.2
62
+
63
+ * Sandbox base URL is now HTTPS
64
+
65
+ 2.5.1
66
+
67
+ * Add the 'additionalFundingSources' param to the offsite gateway
68
+
69
+ 2.5.0
70
+
71
+ * Add refund API endpoint
72
+
73
+ 2.4.7 [merge pull request by [dustMason0](https://github.com/dustMason)]
74
+
75
+ * Remove debugging reference to 'pp' (thanks, dustMason)
76
+
77
+ 2.4.6
78
+
79
+ * Fix method double naming in the OffsiteGateway class
80
+
81
+ 2.4.5 [merge pull request by [dustMason0](https://github.com/dustMason)]
82
+
83
+ * Fix floating point calculation errors
84
+ * Refactor the offsite gateway class
85
+
86
+ 2.4.4
87
+
88
+ * Globalize the OAuth scope variable
89
+
90
+ 2.4.3
91
+
92
+ * Add missing files [accounts.rb]
93
+
94
+ 2.4.2
95
+
96
+ * Fix OAuth token override
97
+
98
+ 2.4.1
99
+
100
+ * Show raw response on debug mode
101
+ * Add support for 'Accounts' API
102
+ * Raise APIError when OAuth's get_token fails
103
+
104
+ 2.4.0
105
+
106
+ * Added support for inline passage of OAuth tokens
107
+
108
+ 2.3.0
109
+
110
+ * Add support for "sandbox" / UAT mode
111
+
112
+ 2.1.1
113
+
114
+ * Oops. POST request wasn't actually sending any params.
115
+
116
+ 2.1.0
117
+
118
+ * Add tests! (OMG WOOT JK </LOL>)
119
+
120
+ 2.0.0
121
+
122
+ * Reworked Gem.
123
+
124
+ ## Testing
125
+
126
+ To run the gem's tests:
127
+
128
+ bundle exec rake test
129
+
130
+ ## Credits
131
+
132
+ This wrapper is heavily based off Stripe's Ruby Gem
133
+
134
+ - Michael Schonfeld &lt;michael@dwolla.com&gt;
135
+
136
+ ## Support
137
+
138
+ We highly recommend seeking support on our forums, [located here!](https://discuss.dwolla.com/category/api-support)
139
+
140
+ - Dwolla API &lt;api@dwolla.com&gt;
141
+ - David Stancu &lt;david@dwolla.com&gt;
142
+ - Gordon Zheng &lt;gordon@dwolla.com&gt;
143
+
144
+ ## References / Documentation
145
+
146
+ http://developers.dwolla.com/dev
147
+
148
+ ## License
149
+
150
+ (The MIT License)
151
+
152
+ Copyright (c) 2013 Dwolla &lt;michael@dwolla.com&gt;
153
+
154
+ Permission is hereby granted, free of charge, to any person obtaining
155
+ a copy of this software and associated documentation files (the
156
+ 'Software'), to deal in the Software without restriction, including
157
+ without limitation the rights to use, copy, modify, merge, publish,
158
+ distribute, sublicense, and/or sell copies of the Software, and to
159
+ permit persons to whom the Software is furnished to do so, subject to
160
+ the following conditions:
161
+
162
+ The above copyright notice and this permission notice shall be
163
+ included in all copies or substantial portions of the Software.
164
+
165
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
166
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
167
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
168
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
169
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
170
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
171
+ 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
- s.license = 'MIT'
13
-
14
- s.rubyforge_project = "dwolla-ruby"
15
-
16
- s.files = `git ls-files`.split("\n")
17
- s.test_files = `git ls-files -- test/*`.split("\n")
18
- s.require_paths = %w{lib}
19
-
20
- s.add_dependency('rest-client', '~> 1.4')
21
- s.add_dependency('multi_json', '>= 1.0.4', '< 2')
22
- s.add_dependency('addressable', '>= 2')
23
-
24
- s.add_development_dependency('mocha')
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
+ s.license = 'MIT'
13
+
14
+ s.rubyforge_project = "dwolla-ruby"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- test/*`.split("\n")
18
+ s.require_paths = %w{lib}
19
+
20
+ s.add_dependency('rest-client', '~> 1.4')
21
+ s.add_dependency('multi_json', '>= 1.0.4', '< 2')
22
+ s.add_dependency('addressable', '>= 2')
23
+
24
+ s.add_development_dependency('mocha')
25
+ s.add_development_dependency('test-unit')
26
+ s.add_development_dependency('rake')
27
+ end