dwolla-ruby 2.6.8 → 2.6.9

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 +212 -209
  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 -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 +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 +110 -110
  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 +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1baee5a333b46b735ff57a94973ad4a0e40378b
4
- data.tar.gz: 08e72049df688a67ae6daa9e05245a6d368e89f3
3
+ metadata.gz: 1cc924b41b9ae01c170e349a9b4b5d5708c2f8e9
4
+ data.tar.gz: 7ebed03b426a2be043f6fde8832a6f7424e6d056
5
5
  SHA512:
6
- metadata.gz: 47387b9d0faf2e144536199375d9de487bf58e1e9675c403d281e6125442cf9331fafb68c3b6ab07251a4f90bfc99d7c0ecea00d6763e4fee29922700366c994
7
- data.tar.gz: 38636aa6250915826d80e4582a291fc9bd0c71838cbfd6eaee9058888149bd4b818c69b269228f867778c758e256630720432cf7beda1002517c7ec9f5d299dd
6
+ metadata.gz: 80e024d553c098e3f5d59786dcd6ef40553e5a005bd2f2a52c3f21b730c452fb8eeba8cd5d531c85a0169b9574027570700cc6ad221ce22ced78cf3bca4a31c4
7
+ data.tar.gz: 0b84847c9d6059a7700b7f53d7735fced50d56002d248ec297a1f916e8d6defe4b802c2bb26e00f46cc127dc4abe20a69a8e18decb69755247a3e5d8129409c4
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,209 +1,212 @@
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.6.8
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.6.8
54
- * Updated `rest_client` version constraint for better compatibility.
55
-
56
- 2.6.7
57
- * Removed `pin` as required argument for certain transactional operations due to compliance with Dwolla Direct.
58
- * Updated `rest_client` version constraint due to security concerns.
59
- * Refactored OAuth URL generation function.
60
-
61
- 2.6.6
62
- * Added new `verified_account` parameter to authorization URL.
63
-
64
- 2.6.5
65
- * Added new catalog endpoint to OAuth module + unit tests and examples.
66
- * Added new scheduled transaction endpoints to Transactions module + unit tests and examples.
67
-
68
- 2.6.4
69
- * 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.
70
-
71
- 2.6.3
72
- * Fixed webhook validation, cleaned up OpenSSL Digest calls (thanks, @michaelblinn)!
73
-
74
- 2.6.2
75
- * Fixed bug with generation of Off-Site Gateway checkout URLs
76
-
77
- 2.6.1
78
- * Minor refactoring, fixed bug that would cause crashes in certain Ruby version with checking if keys exist in hashes.
79
-
80
- 2.6.0
81
-
82
- * **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`
83
- * **BREAKING CHANGE**: Guest send has been officially deprecated and removed from this gem.
84
- * All MassPay endpoints have been included in this release for batch payment support.
85
- * Proper unit tests implemented for all endpoints.
86
-
87
- 2.5.5
88
-
89
- * Pulled in a merge request for syntax error (thanks, @mstahl)
90
-
91
- 2.5.4
92
-
93
- * Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
94
-
95
- 2.5.3
96
-
97
- * Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
98
-
99
- 2.5.2
100
-
101
- * Sandbox base URL is now HTTPS
102
-
103
- 2.5.1
104
-
105
- * Add the 'additionalFundingSources' param to the offsite gateway
106
-
107
- 2.5.0
108
-
109
- * Add refund API endpoint
110
-
111
- 2.4.7 [merge pull request by [dustMason0](https://github.com/dustMason)]
112
-
113
- * Remove debugging reference to 'pp' (thanks, dustMason)
114
-
115
- 2.4.6
116
-
117
- * Fix method double naming in the OffsiteGateway class
118
-
119
- 2.4.5 [merge pull request by [dustMason0](https://github.com/dustMason)]
120
-
121
- * Fix floating point calculation errors
122
- * Refactor the offsite gateway class
123
-
124
- 2.4.4
125
-
126
- * Globalize the OAuth scope variable
127
-
128
- 2.4.3
129
-
130
- * Add missing files [accounts.rb]
131
-
132
- 2.4.2
133
-
134
- * Fix OAuth token override
135
-
136
- 2.4.1
137
-
138
- * Show raw response on debug mode
139
- * Add support for 'Accounts' API
140
- * Raise APIError when OAuth's get_token fails
141
-
142
- 2.4.0
143
-
144
- * Added support for inline passage of OAuth tokens
145
-
146
- 2.3.0
147
-
148
- * Add support for "sandbox" / UAT mode
149
-
150
- 2.1.1
151
-
152
- * Oops. POST request wasn't actually sending any params.
153
-
154
- 2.1.0
155
-
156
- * Add tests! (OMG WOOT JK </LOL>)
157
-
158
- 2.0.0
159
-
160
- * Reworked Gem.
161
-
162
- ## Testing
163
-
164
- To run the gem's tests:
165
-
166
- bundle exec rake test
167
-
168
- ## Credits
169
-
170
- This wrapper is heavily based off Stripe's Ruby Gem
171
-
172
- - Michael Schonfeld &lt;michael@dwolla.com&gt;
173
-
174
- ## Support
175
-
176
- We highly recommend seeking support on our forums, [located here!](https://discuss.dwolla.com/category/api-support)
177
-
178
- - Dwolla API &lt;api@dwolla.com&gt;
179
- - David Stancu &lt;david@dwolla.com&gt;
180
- - Gordon Zheng &lt;gordon@dwolla.com&gt;
181
-
182
- ## References / Documentation
183
-
184
- http://developers.dwolla.com/dev
185
-
186
- ## License
187
-
188
- (The MIT License)
189
-
190
- Copyright (c) 2013 Dwolla &lt;michael@dwolla.com&gt;
191
-
192
- Permission is hereby granted, free of charge, to any person obtaining
193
- a copy of this software and associated documentation files (the
194
- 'Software'), to deal in the Software without restriction, including
195
- without limitation the rights to use, copy, modify, merge, publish,
196
- distribute, sublicense, and/or sell copies of the Software, and to
197
- permit persons to whom the Software is furnished to do so, subject to
198
- the following conditions:
199
-
200
- The above copyright notice and this permission notice shall be
201
- included in all copies or substantial portions of the Software.
202
-
203
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
204
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
205
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
206
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
207
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
208
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
209
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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.6.9
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.6.9
54
+ * Handling of network errors has improved. If there is any issue receiving an API response an `APIConnectionError` will now be thrown.
55
+
56
+ 2.6.8
57
+ * Updated `rest_client` version constraint for better compatibility.
58
+
59
+ 2.6.7
60
+ * Removed `pin` as required argument for certain transactional operations due to compliance with Dwolla Direct.
61
+ * Updated `rest_client` version constraint due to security concerns.
62
+ * Refactored OAuth URL generation function.
63
+
64
+ 2.6.6
65
+ * Added new `verified_account` parameter to authorization URL.
66
+
67
+ 2.6.5
68
+ * Added new catalog endpoint to OAuth module + unit tests and examples.
69
+ * Added new scheduled transaction endpoints to Transactions module + unit tests and examples.
70
+
71
+ 2.6.4
72
+ * 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.
73
+
74
+ 2.6.3
75
+ * Fixed webhook validation, cleaned up OpenSSL Digest calls (thanks, @michaelblinn)!
76
+
77
+ 2.6.2
78
+ * Fixed bug with generation of Off-Site Gateway checkout URLs
79
+
80
+ 2.6.1
81
+ * Minor refactoring, fixed bug that would cause crashes in certain Ruby version with checking if keys exist in hashes.
82
+
83
+ 2.6.0
84
+
85
+ * **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`
86
+ * **BREAKING CHANGE**: Guest send has been officially deprecated and removed from this gem.
87
+ * All MassPay endpoints have been included in this release for batch payment support.
88
+ * Proper unit tests implemented for all endpoints.
89
+
90
+ 2.5.5
91
+
92
+ * Pulled in a merge request for syntax error (thanks, @mstahl)
93
+
94
+ 2.5.4
95
+
96
+ * Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
97
+
98
+ 2.5.3
99
+
100
+ * Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
101
+
102
+ 2.5.2
103
+
104
+ * Sandbox base URL is now HTTPS
105
+
106
+ 2.5.1
107
+
108
+ * Add the 'additionalFundingSources' param to the offsite gateway
109
+
110
+ 2.5.0
111
+
112
+ * Add refund API endpoint
113
+
114
+ 2.4.7 [merge pull request by [dustMason0](https://github.com/dustMason)]
115
+
116
+ * Remove debugging reference to 'pp' (thanks, dustMason)
117
+
118
+ 2.4.6
119
+
120
+ * Fix method double naming in the OffsiteGateway class
121
+
122
+ 2.4.5 [merge pull request by [dustMason0](https://github.com/dustMason)]
123
+
124
+ * Fix floating point calculation errors
125
+ * Refactor the offsite gateway class
126
+
127
+ 2.4.4
128
+
129
+ * Globalize the OAuth scope variable
130
+
131
+ 2.4.3
132
+
133
+ * Add missing files [accounts.rb]
134
+
135
+ 2.4.2
136
+
137
+ * Fix OAuth token override
138
+
139
+ 2.4.1
140
+
141
+ * Show raw response on debug mode
142
+ * Add support for 'Accounts' API
143
+ * Raise APIError when OAuth's get_token fails
144
+
145
+ 2.4.0
146
+
147
+ * Added support for inline passage of OAuth tokens
148
+
149
+ 2.3.0
150
+
151
+ * Add support for "sandbox" / UAT mode
152
+
153
+ 2.1.1
154
+
155
+ * Oops. POST request wasn't actually sending any params.
156
+
157
+ 2.1.0
158
+
159
+ * Add tests! (OMG WOOT JK </LOL>)
160
+
161
+ 2.0.0
162
+
163
+ * Reworked Gem.
164
+
165
+ ## Testing
166
+
167
+ To run the gem's tests:
168
+
169
+ bundle exec rake test
170
+
171
+ ## Credits
172
+
173
+ This wrapper is heavily based off Stripe's Ruby Gem
174
+
175
+ - Michael Schonfeld &lt;michael@dwolla.com&gt;
176
+
177
+ ## Support
178
+
179
+ We highly recommend seeking support on our forums, [located here!](https://discuss.dwolla.com/category/api-support)
180
+
181
+ - Dwolla API &lt;api@dwolla.com&gt;
182
+ - David Stancu &lt;david@dwolla.com&gt;
183
+ - Gordon Zheng &lt;gordon@dwolla.com&gt;
184
+
185
+ ## References / Documentation
186
+
187
+ http://developers.dwolla.com/dev
188
+
189
+ ## License
190
+
191
+ (The MIT License)
192
+
193
+ Copyright (c) 2013 Dwolla &lt;michael@dwolla.com&gt;
194
+
195
+ Permission is hereby granted, free of charge, to any person obtaining
196
+ a copy of this software and associated documentation files (the
197
+ 'Software'), to deal in the Software without restriction, including
198
+ without limitation the rights to use, copy, modify, merge, publish,
199
+ distribute, sublicense, and/or sell copies of the Software, and to
200
+ permit persons to whom the Software is furnished to do so, subject to
201
+ the following conditions:
202
+
203
+ The above copyright notice and this permission notice shall be
204
+ included in all copies or substantial portions of the Software.
205
+
206
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
207
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
208
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
209
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
210
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
211
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
212
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.