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