dwolla-ruby 2.9.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -8
  3. data/.travis.yml +11 -6
  4. data/Gemfile +1 -1
  5. data/README.md +225 -222
  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 +59 -59
  12. data/examples/offsiteGateway.rb +31 -31
  13. data/examples/transactions.rb +72 -72
  14. data/examples/users.rb +30 -30
  15. data/gemfiles/json.gemfile +2 -2
  16. data/lib/dwolla.rb +319 -327
  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 +84 -84
  31. data/lib/dwolla/offsite_gateway.rb +152 -152
  32. data/lib/dwolla/requests.rb +56 -56
  33. data/lib/dwolla/transactions.rb +108 -108
  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_dwolla.rb +62 -0
  40. data/test/test_funding_sources.rb +64 -64
  41. data/test/test_masspay.rb +47 -47
  42. data/test/test_oauth.rb +36 -36
  43. data/test/test_offsite_gateway.rb +57 -57
  44. data/test/test_requests.rb +29 -29
  45. data/test/test_transactions.rb +117 -117
  46. data/test/test_users.rb +33 -33
  47. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3dbb32a480a357159786a59bc277c4928f55fdab
4
- data.tar.gz: 8365bd85790ec838d7f73a6df98de90518fc4b74
3
+ metadata.gz: 4563f288b6386fb753a8bd1fe3c36d4466534b36
4
+ data.tar.gz: 5a32d050b738a5a58bc84d74563dba4982b5d48d
5
5
  SHA512:
6
- metadata.gz: ed8096922df563aa8d34d4953573ab88c6ba50c33bd1a35f921ec6114910af66c96bc62707e636639db2c8ae22d4bd431e5d7e23378a3f8b3f7259b70cbd42cc
7
- data.tar.gz: 2844086c17986ea7acf9940733404419ec1be3cdb6d69be7da5439a1f49973a18ecbf738ab2124e022d36fa5755137aa63b2fadc132f1158ba0ad6a9bbb975fd
6
+ metadata.gz: e7c7c0f78acd641150b1b5ecf3322178021a78e53b8b3dc0dfd3eb364d3da12da0c37f2d5016b6d114b4a5961da2be0086fdc4573ad579aab9f9baab2684428e
7
+ data.tar.gz: 074f0d7c4d137e7010d121c91f508f97c4d0ced84e84006d898e5940b7139415a148b5858f418fdbdb975941feb868d84205df405c1e6d890f61b1c6ae10bd43
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
@@ -1,6 +1,11 @@
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
+ - 2.0.0
4
+ gemfile:
5
+ - gemfiles/json.gemfile
6
+ matrix:
7
+ allow_failures:
8
+ - rvm: 1.9.3
9
+ - rvm: rbx-2
10
+ - rvm: jruby
11
+ fast_finish: true
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,222 +1,225 @@
1
- # dwolla-ruby
2
-
3
- Official Ruby wrapper for Dwolla's v1 API
4
-
5
- ## Deprecation warning
6
- This repository is for an old version of our API and is no longer actively maintained. Please use our [new SDKs](https://developers.dwolla.com/pages/sdks.html).
7
-
8
- [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
9
-
10
- ## Version
11
- 2.9.0
12
-
13
- [![Build Status](https://travis-ci.org/Dwolla/dwolla-ruby.svg?branch=master)](https://travis-ci.org/Dwolla/dwolla-ruby)
14
-
15
- ## Requirements
16
- - [Ruby](http://www.ruby-lang.org/)
17
-
18
- ## Installation
19
- The easiest way to install the dwolla-ruby gem for now is to use bundler and add the following line to your Gemfile:
20
-
21
- `gem 'dwolla-ruby'`
22
-
23
- The recommended way to install dwolla-ruby is through RubyGems:
24
-
25
- `gem install dwolla-ruby`
26
-
27
- ## Examples / Quickstart
28
-
29
- 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.
30
-
31
- This repo includes various usage examples, including:
32
-
33
- * Authenticating with OAuth [oauth.rb]
34
- * Fetching user information [users.rb]
35
- * Grabbing a user's contacts [contacts.rb]
36
- * Listing a user's funding sources [fundingSources.rb]
37
- * Transacting money (includes sending) [transactions.rb]
38
- * Getting a user's balance [balance.rb]
39
-
40
- ## Concurrent requests
41
-
42
- If making requests using any background processing library such as `Sidkiq` or `Resque`, we recommend that you manually pass in tokens to functions which take an OAuth token.
43
-
44
- For example, we can do this with the `Contacts` class:
45
-
46
- ```ruby
47
- # Include the Dwolla gem
48
- require 'rubygems'
49
- require 'pp'
50
- require 'dwolla'
51
-
52
- Dwolla::Contacts.get(nil, "your_token")
53
- ```
54
-
55
- ## Changelog
56
-
57
- 2.9.0
58
- * Add deprecation warning.
59
-
60
- 2.7.0
61
- * Fix loss of filter parameters issue in `Transactions#get`. (thanks, @jackchang!)
62
-
63
- 2.6.9
64
- * Handling of network errors has improved. If there is any issue receiving an API response an `APIConnectionError` will now be thrown.
65
-
66
- 2.6.8
67
- * Updated `rest_client` version constraint for better compatibility.
68
-
69
- 2.6.7
70
- * Removed `pin` as required argument for certain transactional operations due to compliance with Dwolla Direct.
71
- * Updated `rest_client` version constraint due to security concerns.
72
- * Refactored OAuth URL generation function.
73
-
74
- 2.6.6
75
- * Added new `verified_account` parameter to authorization URL.
76
-
77
- 2.6.5
78
- * Added new catalog endpoint to OAuth module + unit tests and examples.
79
- * Added new scheduled transaction endpoints to Transactions module + unit tests and examples.
80
-
81
- 2.6.4
82
- * Fixed bug with refresh token call. Parameters were not being JSON encoded. Now OAuth `get_token` and `refresh_auth` calls use POST instead of GET.
83
-
84
- 2.6.3
85
- * Fixed webhook validation, cleaned up OpenSSL Digest calls (thanks, @michaelblinn)!
86
-
87
- 2.6.2
88
- * Fixed bug with generation of Off-Site Gateway checkout URLs
89
-
90
- 2.6.1
91
- * Minor refactoring, fixed bug that would cause crashes in certain Ruby version with checking if keys exist in hashes.
92
-
93
- 2.6.0
94
-
95
- * **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`
96
- * **BREAKING CHANGE**: Guest send has been officially deprecated and removed from this gem.
97
- * All MassPay endpoints have been included in this release for batch payment support.
98
- * Proper unit tests implemented for all endpoints.
99
-
100
- 2.5.5
101
-
102
- * Pulled in a merge request for syntax error (thanks, @mstahl)
103
-
104
- 2.5.4
105
-
106
- * Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
107
-
108
- 2.5.3
109
-
110
- * Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
111
-
112
- 2.5.2
113
-
114
- * Sandbox base URL is now HTTPS
115
-
116
- 2.5.1
117
-
118
- * Add the 'additionalFundingSources' param to the offsite gateway
119
-
120
- 2.5.0
121
-
122
- * Add refund API endpoint
123
-
124
- 2.4.7 [merge pull request by [dustMason0](https://github.com/dustMason)]
125
-
126
- * Remove debugging reference to 'pp' (thanks, dustMason)
127
-
128
- 2.4.6
129
-
130
- * Fix method double naming in the OffsiteGateway class
131
-
132
- 2.4.5 [merge pull request by [dustMason0](https://github.com/dustMason)]
133
-
134
- * Fix floating point calculation errors
135
- * Refactor the offsite gateway class
136
-
137
- 2.4.4
138
-
139
- * Globalize the OAuth scope variable
140
-
141
- 2.4.3
142
-
143
- * Add missing files [accounts.rb]
144
-
145
- 2.4.2
146
-
147
- * Fix OAuth token override
148
-
149
- 2.4.1
150
-
151
- * Show raw response on debug mode
152
- * Add support for 'Accounts' API
153
- * Raise APIError when OAuth's get_token fails
154
-
155
- 2.4.0
156
-
157
- * Added support for inline passage of OAuth tokens
158
-
159
- 2.3.0
160
-
161
- * Add support for "sandbox" / UAT mode
162
-
163
- 2.1.1
164
-
165
- * Oops. POST request wasn't actually sending any params.
166
-
167
- 2.1.0
168
-
169
- * Add tests! (OMG WOOT JK </LOL>)
170
-
171
- 2.0.0
172
-
173
- * Reworked Gem.
174
-
175
- ## Testing
176
-
177
- To run the gem's tests:
178
-
179
- bundle exec rake test
180
-
181
- ## Credits
182
-
183
- This wrapper is heavily based off Stripe's Ruby Gem
184
-
185
- - Michael Schonfeld &lt;michael@dwolla.com&gt;
186
-
187
- ## Support
188
-
189
- We highly recommend seeking support on our forums, [located here!](https://discuss.dwolla.com/category/api-support)
190
-
191
- - Dwolla API &lt;api@dwolla.com&gt;
192
- - David Stancu &lt;david@dwolla.com&gt;
193
- - Gordon Zheng &lt;gordon@dwolla.com&gt;
194
-
195
- ## References / Documentation
196
-
197
- http://developers.dwolla.com/dev
198
-
199
- ## License
200
-
201
- (The MIT License)
202
-
203
- Copyright (c) 2013 Dwolla &lt;michael@dwolla.com&gt;
204
-
205
- Permission is hereby granted, free of charge, to any person obtaining
206
- a copy of this software and associated documentation files (the
207
- 'Software'), to deal in the Software without restriction, including
208
- without limitation the rights to use, copy, modify, merge, publish,
209
- distribute, sublicense, and/or sell copies of the Software, and to
210
- permit persons to whom the Software is furnished to do so, subject to
211
- the following conditions:
212
-
213
- The above copyright notice and this permission notice shall be
214
- included in all copies or substantial portions of the Software.
215
-
216
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
217
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
218
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
219
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
220
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
221
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
222
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ # dwolla-ruby
2
+
3
+ Official Ruby wrapper for Dwolla's v1 API
4
+
5
+ ## Deprecation warning
6
+ This repository is for an old version of our API and is no longer actively maintained. Please use our [new SDKs](https://developers.dwolla.com/pages/sdks.html).
7
+
8
+ [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
9
+
10
+ ## Version
11
+ 3.0.0
12
+
13
+ [![Build Status](https://travis-ci.org/Dwolla/dwolla-ruby.svg?branch=master)](https://travis-ci.org/Dwolla/dwolla-ruby)
14
+
15
+ ## Requirements
16
+ - [Ruby](http://www.ruby-lang.org/)
17
+
18
+ ## Installation
19
+ The easiest way to install the dwolla-ruby gem for now is to use bundler and add the following line to your Gemfile:
20
+
21
+ `gem 'dwolla-ruby'`
22
+
23
+ The recommended way to install dwolla-ruby is through RubyGems:
24
+
25
+ `gem install dwolla-ruby`
26
+
27
+ ## Examples / Quickstart
28
+
29
+ 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.
30
+
31
+ This repo includes various usage examples, including:
32
+
33
+ * Authenticating with OAuth [oauth.rb]
34
+ * Fetching user information [users.rb]
35
+ * Grabbing a user's contacts [contacts.rb]
36
+ * Listing a user's funding sources [fundingSources.rb]
37
+ * Transacting money (includes sending) [transactions.rb]
38
+ * Getting a user's balance [balance.rb]
39
+
40
+ ## Concurrent requests
41
+
42
+ If making requests using any background processing library such as `Sidkiq` or `Resque`, we recommend that you manually pass in tokens to functions which take an OAuth token.
43
+
44
+ For example, we can do this with the `Contacts` class:
45
+
46
+ ```ruby
47
+ # Include the Dwolla gem
48
+ require 'rubygems'
49
+ require 'pp'
50
+ require 'dwolla'
51
+
52
+ Dwolla::Contacts.get(nil, "your_token")
53
+ ```
54
+
55
+ ## Changelog
56
+
57
+ 3.0.0
58
+ * Pass token in Authorization header
59
+
60
+ 2.9.0
61
+ * Add deprecation warning.
62
+
63
+ 2.7.0
64
+ * Fix loss of filter parameters issue in `Transactions#get`. (thanks, @jackchang!)
65
+
66
+ 2.6.9
67
+ * Handling of network errors has improved. If there is any issue receiving an API response an `APIConnectionError` will now be thrown.
68
+
69
+ 2.6.8
70
+ * Updated `rest_client` version constraint for better compatibility.
71
+
72
+ 2.6.7
73
+ * Removed `pin` as required argument for certain transactional operations due to compliance with Dwolla Direct.
74
+ * Updated `rest_client` version constraint due to security concerns.
75
+ * Refactored OAuth URL generation function.
76
+
77
+ 2.6.6
78
+ * Added new `verified_account` parameter to authorization URL.
79
+
80
+ 2.6.5
81
+ * Added new catalog endpoint to OAuth module + unit tests and examples.
82
+ * Added new scheduled transaction endpoints to Transactions module + unit tests and examples.
83
+
84
+ 2.6.4
85
+ * Fixed bug with refresh token call. Parameters were not being JSON encoded. Now OAuth `get_token` and `refresh_auth` calls use POST instead of GET.
86
+
87
+ 2.6.3
88
+ * Fixed webhook validation, cleaned up OpenSSL Digest calls (thanks, @michaelblinn)!
89
+
90
+ 2.6.2
91
+ * Fixed bug with generation of Off-Site Gateway checkout URLs
92
+
93
+ 2.6.1
94
+ * Minor refactoring, fixed bug that would cause crashes in certain Ruby version with checking if keys exist in hashes.
95
+
96
+ 2.6.0
97
+
98
+ * **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`
99
+ * **BREAKING CHANGE**: Guest send has been officially deprecated and removed from this gem.
100
+ * All MassPay endpoints have been included in this release for batch payment support.
101
+ * Proper unit tests implemented for all endpoints.
102
+
103
+ 2.5.5
104
+
105
+ * Pulled in a merge request for syntax error (thanks, @mstahl)
106
+
107
+ 2.5.4
108
+
109
+ * Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
110
+
111
+ 2.5.3
112
+
113
+ * Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
114
+
115
+ 2.5.2
116
+
117
+ * Sandbox base URL is now HTTPS
118
+
119
+ 2.5.1
120
+
121
+ * Add the 'additionalFundingSources' param to the offsite gateway
122
+
123
+ 2.5.0
124
+
125
+ * Add refund API endpoint
126
+
127
+ 2.4.7 [merge pull request by [dustMason0](https://github.com/dustMason)]
128
+
129
+ * Remove debugging reference to 'pp' (thanks, dustMason)
130
+
131
+ 2.4.6
132
+
133
+ * Fix method double naming in the OffsiteGateway class
134
+
135
+ 2.4.5 [merge pull request by [dustMason0](https://github.com/dustMason)]
136
+
137
+ * Fix floating point calculation errors
138
+ * Refactor the offsite gateway class
139
+
140
+ 2.4.4
141
+
142
+ * Globalize the OAuth scope variable
143
+
144
+ 2.4.3
145
+
146
+ * Add missing files [accounts.rb]
147
+
148
+ 2.4.2
149
+
150
+ * Fix OAuth token override
151
+
152
+ 2.4.1
153
+
154
+ * Show raw response on debug mode
155
+ * Add support for 'Accounts' API
156
+ * Raise APIError when OAuth's get_token fails
157
+
158
+ 2.4.0
159
+
160
+ * Added support for inline passage of OAuth tokens
161
+
162
+ 2.3.0
163
+
164
+ * Add support for "sandbox" / UAT mode
165
+
166
+ 2.1.1
167
+
168
+ * Oops. POST request wasn't actually sending any params.
169
+
170
+ 2.1.0
171
+
172
+ * Add tests! (OMG WOOT JK </LOL>)
173
+
174
+ 2.0.0
175
+
176
+ * Reworked Gem.
177
+
178
+ ## Testing
179
+
180
+ To run the gem's tests:
181
+
182
+ bundle exec rake test
183
+
184
+ ## Credits
185
+
186
+ This wrapper is heavily based off Stripe's Ruby Gem
187
+
188
+ - Michael Schonfeld &lt;michael@dwolla.com&gt;
189
+
190
+ ## Support
191
+
192
+ We highly recommend seeking support on our forums, [located here!](https://discuss.dwolla.com/category/api-support)
193
+
194
+ - Dwolla API &lt;api@dwolla.com&gt;
195
+ - David Stancu &lt;david@dwolla.com&gt;
196
+ - Gordon Zheng &lt;gordon@dwolla.com&gt;
197
+
198
+ ## References / Documentation
199
+
200
+ http://developers.dwolla.com/dev
201
+
202
+ ## License
203
+
204
+ (The MIT License)
205
+
206
+ Copyright (c) 2013 Dwolla &lt;michael@dwolla.com&gt;
207
+
208
+ Permission is hereby granted, free of charge, to any person obtaining
209
+ a copy of this software and associated documentation files (the
210
+ 'Software'), to deal in the Software without restriction, including
211
+ without limitation the rights to use, copy, modify, merge, publish,
212
+ distribute, sublicense, and/or sell copies of the Software, and to
213
+ permit persons to whom the Software is furnished to do so, subject to
214
+ the following conditions:
215
+
216
+ The above copyright notice and this permission notice shall be
217
+ included in all copies or substantial portions of the Software.
218
+
219
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
220
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
221
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
222
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
223
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
224
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
225
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.