dwolla_v2 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/dwolla_v2/error.rb +15 -14
- 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: 811f43c8507739f9ba53fbd843f3d38c7d9554e7
|
4
|
+
data.tar.gz: 6f90eb874890c98cb2045de7ec2f107ca329ac07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3d569ab13c930ca10eb2ce1d1ed077d08416cdaa020049929e1739d1ebb21a48f0950fad72091158656e05bb2b92ab55411b979d4a389f84d39aa15bdb7db03
|
7
|
+
data.tar.gz: 0f1af22dfb1dca2db0855c16b50907f8ae0839431d5cfdaa8b03e0e851d5fb26a18e6aed6be4856cfdf84a71b95da088be7d5c8811e38775f039f114eb9ee832
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ end
|
|
44
44
|
Get an application token:
|
45
45
|
|
46
46
|
```ruby
|
47
|
-
$dwolla.auths.client scope: "
|
47
|
+
$dwolla.auths.client scope: "ManageCustomers|Funding"
|
48
48
|
```
|
49
49
|
|
50
50
|
Get an account token:
|
@@ -64,7 +64,7 @@ class YourAuthController < ApplicationController
|
|
64
64
|
|
65
65
|
def auth
|
66
66
|
$dwolla.auths.new redirect_uri: "https://yoursite.com/callback",
|
67
|
-
scope: "
|
67
|
+
scope: "ManageCustomers|Funding"
|
68
68
|
end
|
69
69
|
end
|
70
70
|
```
|
@@ -165,6 +165,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
165
165
|
|
166
166
|
## Changelog
|
167
167
|
|
168
|
+
- **0.3.1** - better `DwollaV2::Error` error messages
|
168
169
|
- **0.3.0** - ISO8601 values in response body are converted to `Time` objects
|
169
170
|
- **0.2.0** - Works with `attr_encrypted`
|
170
171
|
- **0.1.1** - Handle 500 error with HTML response body when requesting a token
|
data/lib/dwolla_v2/error.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
module DwollaV2
|
2
2
|
class Error < StandardError
|
3
|
-
attr_reader :error, :error_description, :error_uri, :code, :message, :_links, :_embedded
|
4
|
-
|
5
3
|
def self.raise! error
|
6
4
|
raise self.new unless error.is_a? Hash
|
7
5
|
if klass = error_class(error[:error] || error[:code])
|
@@ -11,21 +9,24 @@ module DwollaV2
|
|
11
9
|
end
|
12
10
|
end
|
13
11
|
|
14
|
-
def initialize
|
15
|
-
@error =
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
@
|
20
|
-
|
21
|
-
|
12
|
+
def initialize error = nil
|
13
|
+
@error = error
|
14
|
+
end
|
15
|
+
|
16
|
+
def message
|
17
|
+
@error[:message]
|
18
|
+
end
|
19
|
+
|
20
|
+
def [] key
|
21
|
+
@error[key] rescue nil
|
22
|
+
end
|
23
|
+
|
24
|
+
def method_missing method
|
25
|
+
@error[method] rescue nil
|
22
26
|
end
|
23
27
|
|
24
28
|
def to_s
|
25
|
-
|
26
|
-
.map {|a| "#{a}: \"#{public_send(a)}\"" if public_send(a) }
|
27
|
-
.compact
|
28
|
-
.join ", "
|
29
|
+
@error.to_s
|
29
30
|
end
|
30
31
|
|
31
32
|
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: 0.3.
|
4
|
+
version: 0.3.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-
|
11
|
+
date: 2016-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|