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.
- checksums.yaml +4 -4
- data/.gitignore +8 -8
- data/.travis.yml +11 -6
- data/Gemfile +1 -1
- data/README.md +225 -222
- 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 -59
- data/examples/offsiteGateway.rb +31 -31
- data/examples/transactions.rb +72 -72
- data/examples/users.rb +30 -30
- data/gemfiles/json.gemfile +2 -2
- data/lib/dwolla.rb +319 -327
- 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 +84 -84
- data/lib/dwolla/offsite_gateway.rb +152 -152
- data/lib/dwolla/requests.rb +56 -56
- data/lib/dwolla/transactions.rb +108 -108
- 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_dwolla.rb +62 -0
- data/test/test_funding_sources.rb +64 -64
- data/test/test_masspay.rb +47 -47
- data/test/test_oauth.rb +36 -36
- data/test/test_offsite_gateway.rb +57 -57
- data/test/test_requests.rb +29 -29
- data/test/test_transactions.rb +117 -117
- data/test/test_users.rb +33 -33
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4563f288b6386fb753a8bd1fe3c36d4466534b36
|
4
|
+
data.tar.gz: 5a32d050b738a5a58bc84d74563dba4982b5d48d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/.travis.yml
CHANGED
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
|
-
|
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
|
-
|
58
|
-
*
|
59
|
-
|
60
|
-
2.
|
61
|
-
*
|
62
|
-
|
63
|
-
2.
|
64
|
-
*
|
65
|
-
|
66
|
-
2.6.
|
67
|
-
*
|
68
|
-
|
69
|
-
2.6.
|
70
|
-
*
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
*
|
76
|
-
|
77
|
-
2.6.
|
78
|
-
* Added new
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
*
|
83
|
-
|
84
|
-
2.6.
|
85
|
-
* Fixed
|
86
|
-
|
87
|
-
2.6.
|
88
|
-
* Fixed
|
89
|
-
|
90
|
-
2.6.
|
91
|
-
*
|
92
|
-
|
93
|
-
2.6.
|
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
|
-
|
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
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
the
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
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 <michael@dwolla.com>
|
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 <api@dwolla.com>
|
195
|
+
- David Stancu <david@dwolla.com>
|
196
|
+
- Gordon Zheng <gordon@dwolla.com>
|
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 <michael@dwolla.com>
|
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.
|