dwolla_v2 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2db53d14d332c6a4e13f74f7a9986e361b8509e7
4
- data.tar.gz: 2c61640b59008a32254807efcc050f6d4256b277
3
+ metadata.gz: 6908dcf033e8318ff41ebb772bbb4b456ceae2f3
4
+ data.tar.gz: 60cd8e1e175535f91e219b5b081b79db5b561c23
5
5
  SHA512:
6
- metadata.gz: 47f74c7ce9469f1b9f46422ac6339c3091784da493892e2e2a68ea9a46c6cb25082513eb7455d0d404c22934d62c8c5b967929394c1588762d23fabf3eb6007b
7
- data.tar.gz: e0117f0296365e9abec6b5caaa1ceaa3f716fb5e75c6824c35b49f851490abe48dc14fa5aa362e2490af89cbf7ca90d1c267db0d83e552859c3237ea01f851ce
6
+ metadata.gz: c4de8e933017b9576d7ca96569ae53c5db2950ddd10117e6e704aa3fefa6fbffdd5143d9aa1a264b61cba3776428837602746ac32ca3abb131c6ac1ab9021543
7
+ data.tar.gz: e089126a0030e5524cb4d94d3d958318f69480e52236a8e7033d5db3e7e1ed9ec390b67b31840c3a177507e9d516e4d707545dd795dd313b670475b97351fbfb
data/README.md CHANGED
@@ -26,6 +26,12 @@ Or install it yourself as:
26
26
 
27
27
  ### Basic usage
28
28
 
29
+ Create a client using your application's consumer key and secret found on the applications page
30
+ ([UAT][apuat], [Production][approd]).
31
+
32
+ [apuat]: https://uat.dwolla.com/applications
33
+ [approd]: https://www.dwolla.com/applications
34
+
29
35
  ```ruby
30
36
  # config/initializers/dwolla.rb
31
37
  $dwolla = DwollaV2::Client.new(id: ENV["DWOLLA_ID"], secret: ENV["DWOLLA_SECRET"])
@@ -304,6 +310,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
304
310
 
305
311
  ## Changelog
306
312
 
313
+ - **1.0.1** - Set user agent header.
307
314
  - **1.0.0** - Refactor `Error` class to be more like response, add ability to access keys using methods.
308
315
  - **0.4.0** - Refactor and document how `DwollaV2::Response` works
309
316
  - **0.3.1** - better `DwollaV2::Error` error messages
data/lib/dwolla_v2.rb CHANGED
@@ -19,6 +19,7 @@ require "dwolla_v2/error"
19
19
  require "dwolla_v2/util"
20
20
  require "dwolla_v2/super_hash"
21
21
 
22
+ require "dwolla_v2/middleware/set_user_agent"
22
23
  require "dwolla_v2/middleware/deep_parse_iso8601_response_body"
23
24
  require "dwolla_v2/middleware/deep_super_hasherize_response_body"
24
25
  require "dwolla_v2/middleware/handle_errors"
@@ -52,6 +52,7 @@ module DwollaV2
52
52
  @conn ||= Faraday.new do |f|
53
53
  f.request :basic_auth, id, secret
54
54
  f.request :url_encoded
55
+ f.use SetUserAgent
55
56
  f.use HandleErrors
56
57
  f.use DeepSuperHasherizeResponseBody
57
58
  f.use DeepParseIso8601ResponseBody
@@ -0,0 +1,16 @@
1
+ module DwollaV2
2
+ class SetUserAgent
3
+ HEADERS = {
4
+ :"user-agent" => "dwolla-v2-ruby #{VERSION}"
5
+ }
6
+
7
+ def initialize app
8
+ @app = app
9
+ end
10
+
11
+ def call request_env
12
+ request_env[:request_headers].merge! HEADERS
13
+ @app.call(request_env)
14
+ end
15
+ end
16
+ end
@@ -57,6 +57,7 @@ module DwollaV2
57
57
  f.headers[:accept] = "application/vnd.dwolla.v1.hal+json"
58
58
  f.request :multipart
59
59
  f.request :json
60
+ f.use SetUserAgent
60
61
  f.use HandleErrors
61
62
  f.use DeepSuperHasherizeResponseBody
62
63
  f.use DeepParseIso8601ResponseBody
@@ -1,3 +1,3 @@
1
1
  module DwollaV2
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
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.0.0
4
+ version: 1.0.1
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-03-28 00:00:00.000000000 Z
11
+ date: 2016-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,6 +156,7 @@ files:
156
156
  - lib/dwolla_v2/middleware/deep_parse_iso8601_response_body.rb
157
157
  - lib/dwolla_v2/middleware/deep_super_hasherize_response_body.rb
158
158
  - lib/dwolla_v2/middleware/handle_errors.rb
159
+ - lib/dwolla_v2/middleware/set_user_agent.rb
159
160
  - lib/dwolla_v2/portal.rb
160
161
  - lib/dwolla_v2/response.rb
161
162
  - lib/dwolla_v2/super_hash.rb