dwolla-ruby 2.6.4 → 2.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +8 -8
  3. data/.travis.yml +6 -6
  4. data/Gemfile +1 -1
  5. data/README.md +198 -192
  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 -50
  12. data/examples/offsiteGateway.rb +31 -31
  13. data/examples/transactions.rb +72 -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 +83 -75
  31. data/lib/dwolla/offsite_gateway.rb +152 -152
  32. data/lib/dwolla/requests.rb +56 -56
  33. data/lib/dwolla/transactions.rb +111 -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 +36 -30
  42. data/test/test_offsite_gateway.rb +57 -57
  43. data/test/test_requests.rb +29 -29
  44. data/test/test_transactions.rb +117 -51
  45. data/test/test_users.rb +33 -33
  46. metadata +21 -21
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MDY2YmU4NzA4ZDQyNmFjMjlmNjAyOWM2MDYzYzNkNTQ1NDAwYjY5Ng==
5
- data.tar.gz: !binary |-
6
- NzcyMTVmZjU2NzkwOTI4YzFiODJiODcwODMwZmJjMjI0MDY3NTliYg==
2
+ SHA1:
3
+ metadata.gz: 9176fa57c8caecbc6e02a750078ce8f83b08a2a5
4
+ data.tar.gz: 7f26451d6ae7a23adf719c488d7ecdeec3e9bb01
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MjQxYWRjMTgwNjQ2YjYzNDUxOWYyZjhiODk3ODU5ZDM0ODA0N2EwN2MzZmIy
10
- NGFmM2VmMzkxYmJjYWE5ZDQ5Yzc3NmU3ZGEyMjczNzAyOGNjMjY2ZmUzMTRi
11
- ODMyNGQzOGVmODQ0ODZlZWVhYTAwZDkyYzA3YzE0MGIwNGI1ODk=
12
- data.tar.gz: !binary |-
13
- Nzc2OWM4NzVjYzk3NTI1YmM1ZjNhM2VkMWI3YjViMjA0MzBiYWJjMWU5ZTBj
14
- MmMzZGQxZjJiMGQwYzFlMzM2OGZjNTY4MTkwNmI1YzA1Y2NmOWMwYjFjM2Uz
15
- OTQ4MjYzNzQwMWVlNGY4NDE3MmJhYmMwOGQzMTViZWE5NTRjN2U=
6
+ metadata.gz: 31953951b18d0bf35572151175d97591141d3c84835c4d7e4f37f97f1ce7fea63dd37e83add57a8fd8962de4b586acee8a33cdcf75a2aed07f4cc4db7225a98a
7
+ data.tar.gz: 383dd7c0e2664a14847e26b6abf61d436d69f60ea4aef422d84752f37500deb7869628b8ecf0fb107a9169b55b860fe4bb11beb64af7f693cc03a8d166a6d201
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,192 +1,198 @@
1
- # dwolla-ruby
2
- Official Ruby wrapper for Dwolla's API
3
-
4
- ## Version
5
- 2.6.4
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
- ## Concurrent requests
35
-
36
- 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.
37
-
38
- For example, we can do this with the `Contacts` class:
39
-
40
- ```ruby
41
- # Include the Dwolla gem
42
- require 'rubygems'
43
- require 'pp'
44
- require 'dwolla'
45
-
46
- Dwolla::Contacts.get(nil, "your_token")
47
- ```
48
-
49
- ## Changelog
50
-
51
- 2.6.4
52
- * 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.
53
-
54
- 2.6.3
55
- * Fixed webhook validation, cleaned up OpenSSL Digest calls (thanks, @michaelblinn)!
56
-
57
- 2.6.2
58
- * Fixed bug with generation of Off-Site Gateway checkout URLs
59
-
60
- 2.6.1
61
- * Minor refactoring, fixed bug that would cause crashes in certain Ruby version with checking if keys exist in hashes.
62
-
63
- 2.6.0
64
-
65
- * **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`
66
- * **BREAKING CHANGE**: Guest send has been officially deprecated and removed from this gem.
67
- * All MassPay endpoints have been included in this release for batch payment support.
68
- * Proper unit tests implemented for all endpoints.
69
-
70
- 2.5.5
71
-
72
- * Pulled in a merge request for syntax error (thanks, @mstahl)
73
-
74
- 2.5.4
75
-
76
- * Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
77
-
78
- 2.5.3
79
-
80
- * Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
81
-
82
- 2.5.2
83
-
84
- * Sandbox base URL is now HTTPS
85
-
86
- 2.5.1
87
-
88
- * Add the 'additionalFundingSources' param to the offsite gateway
89
-
90
- 2.5.0
91
-
92
- * Add refund API endpoint
93
-
94
- 2.4.7 [merge pull request by [dustMason0](https://github.com/dustMason)]
95
-
96
- * Remove debugging reference to 'pp' (thanks, dustMason)
97
-
98
- 2.4.6
99
-
100
- * Fix method double naming in the OffsiteGateway class
101
-
102
- 2.4.5 [merge pull request by [dustMason0](https://github.com/dustMason)]
103
-
104
- * Fix floating point calculation errors
105
- * Refactor the offsite gateway class
106
-
107
- 2.4.4
108
-
109
- * Globalize the OAuth scope variable
110
-
111
- 2.4.3
112
-
113
- * Add missing files [accounts.rb]
114
-
115
- 2.4.2
116
-
117
- * Fix OAuth token override
118
-
119
- 2.4.1
120
-
121
- * Show raw response on debug mode
122
- * Add support for 'Accounts' API
123
- * Raise APIError when OAuth's get_token fails
124
-
125
- 2.4.0
126
-
127
- * Added support for inline passage of OAuth tokens
128
-
129
- 2.3.0
130
-
131
- * Add support for "sandbox" / UAT mode
132
-
133
- 2.1.1
134
-
135
- * Oops. POST request wasn't actually sending any params.
136
-
137
- 2.1.0
138
-
139
- * Add tests! (OMG WOOT JK </LOL>)
140
-
141
- 2.0.0
142
-
143
- * Reworked Gem.
144
-
145
- ## Testing
146
-
147
- To run the gem's tests:
148
-
149
- bundle exec rake test
150
-
151
- ## Credits
152
-
153
- This wrapper is heavily based off Stripe's Ruby Gem
154
-
155
- - Michael Schonfeld &lt;michael@dwolla.com&gt;
156
-
157
- ## Support
158
-
159
- We highly recommend seeking support on our forums, [located here!](https://discuss.dwolla.com/category/api-support)
160
-
161
- - Dwolla API &lt;api@dwolla.com&gt;
162
- - David Stancu &lt;david@dwolla.com&gt;
163
- - Gordon Zheng &lt;gordon@dwolla.com&gt;
164
-
165
- ## References / Documentation
166
-
167
- http://developers.dwolla.com/dev
168
-
169
- ## License
170
-
171
- (The MIT License)
172
-
173
- Copyright (c) 2013 Dwolla &lt;michael@dwolla.com&gt;
174
-
175
- Permission is hereby granted, free of charge, to any person obtaining
176
- a copy of this software and associated documentation files (the
177
- 'Software'), to deal in the Software without restriction, including
178
- without limitation the rights to use, copy, modify, merge, publish,
179
- distribute, sublicense, and/or sell copies of the Software, and to
180
- permit persons to whom the Software is furnished to do so, subject to
181
- the following conditions:
182
-
183
- The above copyright notice and this permission notice shall be
184
- included in all copies or substantial portions of the Software.
185
-
186
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
187
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
188
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
189
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
190
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
191
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
192
- 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.5
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.5
54
+ * Added new catalog endpoint to OAuth module + unit tests and examples.
55
+ * Added new scheduled transaction endpoints to Transactions module + unit tests and examples.
56
+
57
+ 2.6.4
58
+ * 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.
59
+
60
+ 2.6.3
61
+ * Fixed webhook validation, cleaned up OpenSSL Digest calls (thanks, @michaelblinn)!
62
+
63
+ 2.6.2
64
+ * Fixed bug with generation of Off-Site Gateway checkout URLs
65
+
66
+ 2.6.1
67
+ * Minor refactoring, fixed bug that would cause crashes in certain Ruby version with checking if keys exist in hashes.
68
+
69
+ 2.6.0
70
+
71
+ * **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`
72
+ * **BREAKING CHANGE**: Guest send has been officially deprecated and removed from this gem.
73
+ * All MassPay endpoints have been included in this release for batch payment support.
74
+ * Proper unit tests implemented for all endpoints.
75
+
76
+ 2.5.5
77
+
78
+ * Pulled in a merge request for syntax error (thanks, @mstahl)
79
+
80
+ 2.5.4
81
+
82
+ * Fixed offsite gateway URL (www.uat.dwolla.com is invalid whereas uat.dwolla.com is not).
83
+
84
+ 2.5.3
85
+
86
+ * Updated offsite gateway to support UAT URL return when sandbox flag is toggled.
87
+
88
+ 2.5.2
89
+
90
+ * Sandbox base URL is now HTTPS
91
+
92
+ 2.5.1
93
+
94
+ * Add the 'additionalFundingSources' param to the offsite gateway
95
+
96
+ 2.5.0
97
+
98
+ * Add refund API endpoint
99
+
100
+ 2.4.7 [merge pull request by [dustMason0](https://github.com/dustMason)]
101
+
102
+ * Remove debugging reference to 'pp' (thanks, dustMason)
103
+
104
+ 2.4.6
105
+
106
+ * Fix method double naming in the OffsiteGateway class
107
+
108
+ 2.4.5 [merge pull request by [dustMason0](https://github.com/dustMason)]
109
+
110
+ * Fix floating point calculation errors
111
+ * Refactor the offsite gateway class
112
+
113
+ 2.4.4
114
+
115
+ * Globalize the OAuth scope variable
116
+
117
+ 2.4.3
118
+
119
+ * Add missing files [accounts.rb]
120
+
121
+ 2.4.2
122
+
123
+ * Fix OAuth token override
124
+
125
+ 2.4.1
126
+
127
+ * Show raw response on debug mode
128
+ * Add support for 'Accounts' API
129
+ * Raise APIError when OAuth's get_token fails
130
+
131
+ 2.4.0
132
+
133
+ * Added support for inline passage of OAuth tokens
134
+
135
+ 2.3.0
136
+
137
+ * Add support for "sandbox" / UAT mode
138
+
139
+ 2.1.1
140
+
141
+ * Oops. POST request wasn't actually sending any params.
142
+
143
+ 2.1.0
144
+
145
+ * Add tests! (OMG WOOT JK </LOL>)
146
+
147
+ 2.0.0
148
+
149
+ * Reworked Gem.
150
+
151
+ ## Testing
152
+
153
+ To run the gem's tests:
154
+
155
+ bundle exec rake test
156
+
157
+ ## Credits
158
+
159
+ This wrapper is heavily based off Stripe's Ruby Gem
160
+
161
+ - Michael Schonfeld &lt;michael@dwolla.com&gt;
162
+
163
+ ## Support
164
+
165
+ We highly recommend seeking support on our forums, [located here!](https://discuss.dwolla.com/category/api-support)
166
+
167
+ - Dwolla API &lt;api@dwolla.com&gt;
168
+ - David Stancu &lt;david@dwolla.com&gt;
169
+ - Gordon Zheng &lt;gordon@dwolla.com&gt;
170
+
171
+ ## References / Documentation
172
+
173
+ http://developers.dwolla.com/dev
174
+
175
+ ## License
176
+
177
+ (The MIT License)
178
+
179
+ Copyright (c) 2013 Dwolla &lt;michael@dwolla.com&gt;
180
+
181
+ Permission is hereby granted, free of charge, to any person obtaining
182
+ a copy of this software and associated documentation files (the
183
+ 'Software'), to deal in the Software without restriction, including
184
+ without limitation the rights to use, copy, modify, merge, publish,
185
+ distribute, sublicense, and/or sell copies of the Software, and to
186
+ permit persons to whom the Software is furnished to do so, subject to
187
+ the following conditions:
188
+
189
+ The above copyright notice and this permission notice shall be
190
+ included in all copies or substantial portions of the Software.
191
+
192
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
193
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
194
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
195
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
196
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
197
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
198
+ 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