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.
- checksums.yaml +5 -13
- data/.gitignore +8 -8
- data/.travis.yml +6 -6
- data/Gemfile +1 -1
- data/README.md +198 -192
- data/Rakefile +8 -8
- data/dwolla-ruby.gemspec +27 -27
- data/examples/balance.rb +15 -15
- data/examples/contacts.rb +32 -32
- data/examples/fundingSources.rb +39 -39
- data/examples/oauth.rb +59 -50
- data/examples/offsiteGateway.rb +31 -31
- data/examples/transactions.rb +72 -38
- data/examples/users.rb +30 -30
- data/gemfiles/json.gemfile +2 -2
- data/lib/dwolla.rb +326 -326
- data/lib/dwolla/accounts.rb +27 -27
- data/lib/dwolla/balance.rb +15 -15
- data/lib/dwolla/contacts.rb +30 -30
- data/lib/dwolla/errors/api_connection_error.rb +3 -3
- data/lib/dwolla/errors/api_error.rb +3 -3
- data/lib/dwolla/errors/authentication_error.rb +3 -3
- data/lib/dwolla/errors/dwolla_error.rb +19 -19
- data/lib/dwolla/errors/invalid_request_error.rb +10 -10
- data/lib/dwolla/errors/missing_parameter_error.rb +3 -3
- data/lib/dwolla/exceptions.rb +4 -4
- data/lib/dwolla/funding_sources.rb +65 -65
- data/lib/dwolla/json.rb +20 -20
- data/lib/dwolla/masspay.rb +52 -52
- data/lib/dwolla/oauth.rb +83 -75
- data/lib/dwolla/offsite_gateway.rb +152 -152
- data/lib/dwolla/requests.rb +56 -56
- data/lib/dwolla/transactions.rb +111 -56
- data/lib/dwolla/users.rb +39 -39
- data/lib/dwolla/version.rb +3 -3
- data/test/test_accounts.rb +18 -18
- data/test/test_balance.rb +9 -9
- data/test/test_contacts.rb +19 -19
- data/test/test_funding_sources.rb +64 -64
- data/test/test_masspay.rb +47 -47
- data/test/test_oauth.rb +36 -30
- data/test/test_offsite_gateway.rb +57 -57
- data/test/test_requests.rb +29 -29
- data/test/test_transactions.rb +117 -51
- data/test/test_users.rb +33 -33
- metadata +21 -21
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NzcyMTVmZjU2NzkwOTI4YzFiODJiODcwODMwZmJjMjI0MDY3NTliYg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9176fa57c8caecbc6e02a750078ce8f83b08a2a5
|
4
|
+
data.tar.gz: 7f26451d6ae7a23adf719c488d7ecdeec3e9bb01
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
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
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
*
|
30
|
-
*
|
31
|
-
*
|
32
|
-
*
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
require '
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
*
|
56
|
-
|
57
|
-
2.6.
|
58
|
-
* Fixed bug with
|
59
|
-
|
60
|
-
2.6.
|
61
|
-
*
|
62
|
-
|
63
|
-
2.6.
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
*
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
*
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
*
|
124
|
-
|
125
|
-
2.4.
|
126
|
-
|
127
|
-
*
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
##
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
##
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
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 <michael@dwolla.com>
|
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 <api@dwolla.com>
|
168
|
+
- David Stancu <david@dwolla.com>
|
169
|
+
- Gordon Zheng <gordon@dwolla.com>
|
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 <michael@dwolla.com>
|
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
|