dwolla_v2 1.2.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/README.md +14 -7
- data/dwolla_v2.gemspec +0 -1
- data/lib/dwolla_v2/response.rb +10 -3
- data/lib/dwolla_v2/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e574c96fed50363e9fcdec5288f31df261b25a1b
|
4
|
+
data.tar.gz: 2080ba7cda54511bfd2c692db0795acdb99f0348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 810a4d8b011ce4bb027c79be84601c88e7934ea4a8e6180f7c6390c94d3831a3982ab92dd4b5ac0b9a8dd08fb65774182d8088d5459e0093b34e098168258a28
|
7
|
+
data.tar.gz: 9d152fde10b2c8b990b518ac7179d6d00bdeb646e41c781ba4f615e27c3d016c1696c62d2404721e1cfa054fc70b067907737796ab53a07bd8086f50ddb3ca8e
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Dwolla V2 Ruby client. For the V1 Ruby client see [Dwolla/dwolla-ruby](https://g
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem 'dwolla_v2', '~>
|
14
|
+
gem 'dwolla_v2', '~> 2.0'
|
15
15
|
```
|
16
16
|
|
17
17
|
And then execute:
|
@@ -241,12 +241,12 @@ Requests return a `DwollaV2::Response`.
|
|
241
241
|
|
242
242
|
```ruby
|
243
243
|
res = token.get "/"
|
244
|
-
# => #<DwollaV2::Response
|
244
|
+
# => #<DwollaV2::Response response_status=200 response_headers={"server"=>"cloudflare-nginx", "date"=>"Mon, 28 Mar 2016 15:30:23 GMT", "content-type"=>"application/vnd.dwolla.v1.hal+json; charset=UTF-8", "content-length"=>"150", "connection"=>"close", "set-cookie"=>"__cfduid=d9dcd0f586c166d36cbd45b992bdaa11b1459179023; expires=Tue, 28-Mar-17 15:30:23 GMT; path=/; domain=.dwolla.com; HttpOnly", "x-request-id"=>"69a4e612-5dae-4c52-a6a0-2f921e34a88a", "cf-ray"=>"28ac1f81875941e3-MSP"} {"_links"=>{"events"=>{"href"=>"https://api-sandbox.dwolla.com/events"}, "webhook-subscriptions"=>{"href"=>"https://api-sandbox.dwolla.com/webhook-subscriptions"}}}>
|
245
245
|
|
246
|
-
res.
|
246
|
+
res.response_status
|
247
247
|
# => 200
|
248
248
|
|
249
|
-
res.
|
249
|
+
res.response_headers
|
250
250
|
# => {"server"=>"cloudflare-nginx", "date"=>"Mon, 28 Mar 2016 15:30:23 GMT", "content-type"=>"application/vnd.dwolla.v1.hal+json; charset=UTF-8", "content-length"=>"150", "connection"=>"close", "set-cookie"=>"__cfduid=d9dcd0f586c166d36cbd45b992bdaa11b1459179023; expires=Tue, 28-Mar-17 15:30:23 GMT; path=/; domain=.dwolla.com; HttpOnly", "x-request-id"=>"69a4e612-5dae-4c52-a6a0-2f921e34a88a", "cf-ray"=>"28ac1f81875941e3-MSP"}
|
251
251
|
|
252
252
|
res._links.events.href
|
@@ -263,12 +263,12 @@ begin
|
|
263
263
|
token.get "/not-found"
|
264
264
|
rescue DwollaV2::NotFoundError => e
|
265
265
|
e
|
266
|
-
# => #<DwollaV2::NotFoundError
|
266
|
+
# => #<DwollaV2::NotFoundError response_status=404 response_headers={"server"=>"cloudflare-nginx", "date"=>"Mon, 28 Mar 2016 15:35:32 GMT", "content-type"=>"application/vnd.dwolla.v1.hal+json; profile=\"http://nocarrier.co.uk/profiles/vnd.error/\"; charset=UTF-8", "content-length"=>"69", "connection"=>"close", "set-cookie"=>"__cfduid=da1478bfdf3e56275cd8a6a741866ccce1459179332; expires=Tue, 28-Mar-17 15:35:32 GMT; path=/; domain=.dwolla.com; HttpOnly", "access-control-allow-origin"=>"*", "x-request-id"=>"667fca74-b53d-43db-bddd-50426a011881", "cf-ray"=>"28ac270abca64207-MSP"} {"code"=>"NotFound", "message"=>"The requested resource was not found."}>
|
267
267
|
|
268
|
-
e.
|
268
|
+
e.response_status
|
269
269
|
# => 404
|
270
270
|
|
271
|
-
e.
|
271
|
+
e.response_headers
|
272
272
|
# => {"server"=>"cloudflare-nginx", "date"=>"Mon, 28 Mar 2016 15:35:32 GMT", "content-type"=>"application/vnd.dwolla.v1.hal+json; profile=\"http://nocarrier.co.uk/profiles/vnd.error/\"; charset=UTF-8", "content-length"=>"69", "connection"=>"close", "set-cookie"=>"__cfduid=da1478bfdf3e56275cd8a6a741866ccce1459179332; expires=Tue, 28-Mar-17 15:35:32 GMT; path=/; domain=.dwolla.com; HttpOnly", "access-control-allow-origin"=>"*", "x-request-id"=>"667fca74-b53d-43db-bddd-50426a011881", "cf-ray"=>"28ac270abca64207-MSP"}
|
273
273
|
|
274
274
|
e.code
|
@@ -334,6 +334,10 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
334
334
|
|
335
335
|
## Changelog
|
336
336
|
|
337
|
+
- **2.0.0**
|
338
|
+
- Rename `DwollaV2::Response` `#status` => `#response_status`, `#headers` => `#response_headers` to prevent
|
339
|
+
[conflicts with response body properties][response-conflicts].
|
340
|
+
- Remove support for Ruby versions < 2 ([Bump public_suffix dependency version][public-suffix]).
|
337
341
|
- **1.2.3** - Implement `#empty?` on `DwollaV2::Token` to allow it to be passed to ActiveRecord constructor.
|
338
342
|
- **1.2.2** - Strip domain from URLs provided to `token.*` methods.
|
339
343
|
- **1.2.1** - Update sandbox URLs from uat => sandbox.
|
@@ -348,3 +352,6 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
348
352
|
- **0.3.0** - ISO8601 values in response body are converted to `Time` objects
|
349
353
|
- **0.2.0** - Works with `attr_encrypted`
|
350
354
|
- **0.1.1** - Handle 500 error with HTML response body when requesting a token
|
355
|
+
|
356
|
+
[response-conflicts]: https://discuss.dwolla.com/t/document-change-or-more-clarifiation/3964
|
357
|
+
[public-suffix]: https://github.com/Dwolla/dwolla-v2-ruby/pull/18#discussion_r108028135
|
data/dwolla_v2.gemspec
CHANGED
@@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "rspec", "~> 3.0"
|
25
25
|
spec.add_development_dependency "webmock", "~> 1.22"
|
26
26
|
|
27
|
-
spec.add_dependency "public_suffix", "~> 1.4.6"
|
28
27
|
spec.add_dependency "hashie", "~> 3.4"
|
29
28
|
spec.add_dependency "faraday", "~> 0.9"
|
30
29
|
spec.add_dependency "faraday_middleware", "~> 0.10"
|
data/lib/dwolla_v2/response.rb
CHANGED
@@ -2,14 +2,17 @@ module DwollaV2
|
|
2
2
|
class Response
|
3
3
|
extend Forwardable
|
4
4
|
|
5
|
-
delegate [:status] => :@response
|
6
5
|
delegate [:to_s, :to_json] => :response_body
|
7
6
|
|
8
7
|
def initialize response
|
9
8
|
@response = response
|
10
9
|
end
|
11
10
|
|
12
|
-
def
|
11
|
+
def response_status
|
12
|
+
@response.status
|
13
|
+
end
|
14
|
+
|
15
|
+
def response_headers
|
13
16
|
if @response.respond_to? :response_headers
|
14
17
|
@response.response_headers
|
15
18
|
elsif @response.respond_to? :headers
|
@@ -42,7 +45,11 @@ module DwollaV2
|
|
42
45
|
end
|
43
46
|
|
44
47
|
def inspect
|
45
|
-
Util.pretty_inspect
|
48
|
+
Util.pretty_inspect(
|
49
|
+
self.class.name,
|
50
|
+
{ response_status: status, response_headers: headers },
|
51
|
+
response_body
|
52
|
+
)
|
46
53
|
end
|
47
54
|
|
48
55
|
private
|
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:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Ausman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.22'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: public_suffix
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 1.4.6
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 1.4.6
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: hashie
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|