dwolla_v2 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/README.md +15 -3
- data/lib/dwolla_v2/auth.rb +6 -2
- data/lib/dwolla_v2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2136413b79e36bd7a47c757c07263e02d6327743
|
4
|
+
data.tar.gz: 1f9402a2f54a49b3dedb02261cca46872765c333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75d20991e87f530cf5d1c446fdcc9952822686aeb328859eb9b3d7ece362bba50f9e57ab323f42c7fe8b75def5bcf2425cbb01abed109c3408760d86596e7dc9
|
7
|
+
data.tar.gz: 2203d6fea7f248a228cd25958f31e7a619ef82bda2d088adaab68650129c80c27163870ffdeee83868871a586d4afd00c64965b234ebd4eeb1f7eba39f1cb87d
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -99,6 +99,10 @@ Application tokens are used to access the API on behalf of a consumer applicatio
|
|
99
99
|
belong to an application include: `webhook-subscriptions`, `events`, and `webhooks`. Application
|
100
100
|
tokens can be created using the [`client_credentials`][client_credentials] OAuth grant type:
|
101
101
|
|
102
|
+
**Note:** If an application has the `ManageCustomers` scope enabled, it can also be used to access
|
103
|
+
the API for White Label Customer related endpoints. Keep in mind, the application must belong to
|
104
|
+
same Dwolla account that will be used when creating and managing White Label Customers in the API.
|
105
|
+
|
102
106
|
[client_credentials]: https://tools.ietf.org/html/rfc6749#section-4.4
|
103
107
|
|
104
108
|
```ruby
|
@@ -139,7 +143,7 @@ class YourAuthController < ApplicationController
|
|
139
143
|
redirect_to auth.url
|
140
144
|
end
|
141
145
|
|
142
|
-
# https://yoursite.com/callback
|
146
|
+
# https://yoursite.com/callback?code=...&state=...
|
143
147
|
def callback
|
144
148
|
# exchange the code for a token
|
145
149
|
token = auth.callback(params)
|
@@ -152,7 +156,9 @@ class YourAuthController < ApplicationController
|
|
152
156
|
def auth
|
153
157
|
$dwolla.auths.new redirect_uri: "https://yoursite.com/callback",
|
154
158
|
scope: "ManageCustomers|Funding",
|
155
|
-
state: session[:state] ||= SecureRandom.hex(8)
|
159
|
+
state: session[:state] ||= SecureRandom.hex(8), # optional
|
160
|
+
verified_account: true, # optional
|
161
|
+
dwolla_landing: "register" # optional
|
156
162
|
end
|
157
163
|
end
|
158
164
|
```
|
@@ -167,7 +173,7 @@ refreshed_token = $dwolla.auths.refresh(expired_token)
|
|
167
173
|
# => #<DwollaV2::Token client=#<DwollaV2::Client id="..." secret="..." environment=:sandbox> access_token="..." refresh_token="..." expires_in=3600 scope="ManageCustomers|Funding" account_id="...">
|
168
174
|
```
|
169
175
|
|
170
|
-
### Initializing tokens:
|
176
|
+
### Initializing pre-existing tokens:
|
171
177
|
|
172
178
|
`DwollaV2::Token`s can be initialized with the following attributes:
|
173
179
|
|
@@ -180,6 +186,11 @@ $dwolla.tokens.new access_token: "...",
|
|
180
186
|
#<DwollaV2::Token client=#<DwollaV2::Client id="..." secret="..." environment=:sandbox> access_token="..." refresh_token="..." expires_in=123 scope="..." account_id="...">
|
181
187
|
```
|
182
188
|
|
189
|
+
```ruby
|
190
|
+
token_data = YourTokenData.first
|
191
|
+
$dwolla.tokens.new(token_data)
|
192
|
+
```
|
193
|
+
|
183
194
|
## Requests
|
184
195
|
|
185
196
|
`DwollaV2::Token`s can make requests using the `#get`, `#post`, `#put`, and `#delete` methods.
|
@@ -323,6 +334,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
323
334
|
|
324
335
|
## Changelog
|
325
336
|
|
337
|
+
- **1.1.2** - Add support for `verified_account` and `dwolla_landing` auth flags.
|
326
338
|
- **1.1.1** - Add `TooManyRequestsError` and `ConflictError` classes.
|
327
339
|
- **1.1.0** - Support setting headers on a per-request basis.
|
328
340
|
- **1.0.1** - Set user agent header.
|
data/lib/dwolla_v2/auth.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module DwollaV2
|
2
2
|
class Auth
|
3
|
-
attr_reader :client, :redirect_uri, :scope, :state
|
3
|
+
attr_reader :client, :redirect_uri, :scope, :state, :verified_account, :dwolla_landing
|
4
4
|
|
5
5
|
def self.client client, params = {}
|
6
6
|
request_token client, {:grant_type => :client_credentials}.merge(params)
|
@@ -17,6 +17,8 @@ module DwollaV2
|
|
17
17
|
@redirect_uri = params[:redirect_uri]
|
18
18
|
@scope = params[:scope]
|
19
19
|
@state = params[:state]
|
20
|
+
@verified_account = params[:verified_account]
|
21
|
+
@dwolla_landing = params[:dwolla_landing]
|
20
22
|
freeze
|
21
23
|
end
|
22
24
|
|
@@ -40,7 +42,9 @@ module DwollaV2
|
|
40
42
|
:client_id => client.id,
|
41
43
|
:redirect_uri => redirect_uri,
|
42
44
|
:scope => scope,
|
43
|
-
:state => state
|
45
|
+
:state => state,
|
46
|
+
:verified_account => verified_account,
|
47
|
+
:dwolla_landing => dwolla_landing
|
44
48
|
}.reject {|k,v| v.nil? }
|
45
49
|
end
|
46
50
|
|
data/lib/dwolla_v2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dwolla_v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Ausman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|