finix 0.12 → 0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/finix.rb +2 -1
- data/lib/finix/error.rb +7 -2
- data/lib/finix/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODNmZGZiNzc0NGE2NWI5NTlmMzUyZDA4NWIxZmFjZjdmM2Q2ODFmZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGVjZWQ5NDgwNTBhZmFlNGJjODZiZjZhM2M4YTBiYmY3ODk3NDI3NQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDQ3MzBjOTQ0ZDg5OTRlZGIxYmJjYWY0OWMzYmM3MmU4NjZkYzJkZWU2MDIz
|
10
|
+
OTNhNWZlOTg2MzkyZTA4OWZjNDhiZTk4ZGEzMzEzN2RjMGM0MzAzZGM2Zjhi
|
11
|
+
MGU4YjRmMWQwYzE3ZDhhMWIxZmE5ZTU1ZjkwYzBkMGQ2MTRlYjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjFkOGQ5M2E3NzMxYjg1ZDg4NjZjYmJhNmJmNjFjOWMzZTRmNGUxMWQyMjBk
|
14
|
+
NWI2ZWE3MDcyMThhYzVlNWMwM2UyY2FiZGJhZDdjODBkNjliZWQxNWFmMjkz
|
15
|
+
MGFjNjczYTI0ODVkYWU0OWU4ZGUzNzA2ZmRhNWY2ZjljYThhNTI=
|
data/lib/finix.rb
CHANGED
@@ -11,11 +11,12 @@ module Finix
|
|
11
11
|
:unknown => Finix::ResourceErrors,
|
12
12
|
400 => Finix::BadRequest,
|
13
13
|
401 => Finix::Unauthorized,
|
14
|
+
402 => Finix::UpstreamProcessorError,
|
14
15
|
403 => Finix::Forbidden,
|
15
16
|
404 => Finix::NotFound,
|
16
17
|
405 => Finix::MethodNotAllowed,
|
17
18
|
422 => Finix::UnprocessableEntity,
|
18
|
-
500 => Finix::
|
19
|
+
500 => Finix::InternalServerError
|
19
20
|
}
|
20
21
|
|
21
22
|
class << self
|
data/lib/finix/error.rb
CHANGED
@@ -3,11 +3,15 @@ module Finix
|
|
3
3
|
class ResourceErrors < ::StandardError
|
4
4
|
attr_reader :response
|
5
5
|
attr_reader :errors
|
6
|
+
attr_reader :code
|
6
7
|
|
7
8
|
def initialize(response=nil)
|
8
9
|
@response = response
|
9
10
|
@errors = []
|
10
|
-
|
11
|
+
unless response.nil?
|
12
|
+
@code = response[:status].to_i
|
13
|
+
@response[:body]['_embedded']['errors'].each { |error| @errors.push Utils.eval_class(self, 'ResourceError').new error}
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
def to_s
|
@@ -34,9 +38,10 @@ module Finix
|
|
34
38
|
|
35
39
|
class BadRequest < ResourceErrors; end
|
36
40
|
class Unauthorized < ResourceErrors; end
|
41
|
+
class UpstreamProcessorError < ResourceErrors; end
|
37
42
|
class Forbidden < ResourceErrors; end
|
38
43
|
class NotFound < ResourceErrors; end
|
39
44
|
class MethodNotAllowed < ResourceErrors; end
|
40
45
|
class UnprocessableEntity < ResourceErrors; end
|
41
|
-
class
|
46
|
+
class InternalServerError < ResourceErrors; end
|
42
47
|
end
|
data/lib/finix/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.13'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- finix-payments
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|