paysio 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/paysio/errors.rb +25 -5
- data/lib/paysio/json.rb +1 -1
- data/lib/paysio/version.rb +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.9
|
data/lib/paysio/errors.rb
CHANGED
@@ -1,9 +1,29 @@
|
|
1
1
|
module Paysio
|
2
2
|
module Errors
|
3
|
-
class
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
class Base < Exception
|
4
|
+
alias_method :exception_body, :message
|
5
|
+
def attributes
|
6
|
+
@attributes ||= Paysio::JSON.decode(exception_body)['error']
|
7
|
+
end
|
8
|
+
|
9
|
+
def type
|
10
|
+
attributes['type']
|
11
|
+
end
|
12
|
+
|
13
|
+
def message
|
14
|
+
attributes['message']
|
15
|
+
rescue
|
16
|
+
exception_body
|
17
|
+
end
|
18
|
+
|
19
|
+
def params
|
20
|
+
attributes['params']
|
21
|
+
end
|
22
|
+
end
|
23
|
+
class Unauthorized < Base; end;
|
24
|
+
class InternalError < Base; end;
|
25
|
+
class Forbidden < Base; end;
|
26
|
+
class BadRequest < Base; end;
|
27
|
+
class NotFound < Base; end;
|
8
28
|
end
|
9
29
|
end
|
data/lib/paysio/json.rb
CHANGED
data/lib/paysio/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paysio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|