finix 0.14 → 0.15
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/.ruby-version +1 -1
- data/lib/finix.rb +1 -1
- data/lib/finix/client.rb +2 -2
- data/lib/finix/error.rb +1 -4
- data/lib/finix/resources/payment_instrument.rb +0 -2
- data/lib/finix/response/finix_error_middleware.rb +2 -4
- data/lib/finix/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODliODZiNzMwY2VjMTQ2YzUwMWQ2ZjRjOWE5Mjc1NmY4OTkxNTgyNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDY0NjI3YzM2ZjNmZTVmNjRiZDdmNTA1MzJiNDhkNDZlNWZiN2RjYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjgwYzM1NGZiZmE5YTE3ZjM4ZGEyYTk5OTViNjI2ZDkxYzY1MTlmNzIyMTcw
|
10
|
+
MTE3NDE3OGFjYjM3NGI3MmEwZmM0Y2FjNTBiN2UzZDE3YThiNDY2MWI4ZTYw
|
11
|
+
YzU2MTkwOWQwNWY4NjIzMWJhZmI5NjU0NGFjNzc4MmFhYWIwNDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDNlYWNmOTc5MTkxNzcyYTg1NzE3NzBmNDQ1ZTJhNmJmNDVjZjMzZjQwNmM4
|
14
|
+
NDkxZTc5NjYwMzUxMTQyMGE0YTViYWY4ZWZlMjJiY2FlOGFkMDgxNDA5ZmE3
|
15
|
+
MDdjZjIxODhiMTUwMjQ0ZWZlNDNlNzhhNmJlODhlM2I3MGQ4OGY=
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
1.9.3
|
data/lib/finix.rb
CHANGED
@@ -11,7 +11,7 @@ module Finix
|
|
11
11
|
:unknown => Finix::ResourceErrors,
|
12
12
|
400 => Finix::BadRequest,
|
13
13
|
401 => Finix::Unauthorized,
|
14
|
-
402 => Finix::
|
14
|
+
402 => Finix::PaymentRequired,
|
15
15
|
403 => Finix::Forbidden,
|
16
16
|
404 => Finix::NotFound,
|
17
17
|
405 => Finix::MethodNotAllowed,
|
data/lib/finix/client.rb
CHANGED
@@ -8,7 +8,7 @@ require 'finix/response/finix_error_middleware'
|
|
8
8
|
module Finix
|
9
9
|
class Client
|
10
10
|
|
11
|
-
|
11
|
+
DefaultConfig = {
|
12
12
|
:logging_level => 'WARN',
|
13
13
|
:connection_timeout => 60,
|
14
14
|
:read_timeout => 60,
|
@@ -21,7 +21,7 @@ module Finix
|
|
21
21
|
attr_accessor :config
|
22
22
|
|
23
23
|
def initialize(options={})
|
24
|
-
@config =
|
24
|
+
@config = DefaultConfig.merge options
|
25
25
|
build_conn
|
26
26
|
end
|
27
27
|
|
data/lib/finix/error.rb
CHANGED
@@ -18,9 +18,6 @@ module Finix
|
|
18
18
|
"#{@errors}"
|
19
19
|
end
|
20
20
|
|
21
|
-
def inspect
|
22
|
-
to_s
|
23
|
-
end
|
24
21
|
end
|
25
22
|
|
26
23
|
class ResourceError < ::StandardError
|
@@ -38,7 +35,7 @@ module Finix
|
|
38
35
|
|
39
36
|
class BadRequest < ResourceErrors; end
|
40
37
|
class Unauthorized < ResourceErrors; end
|
41
|
-
class
|
38
|
+
class PaymentRequired < ResourceErrors; end
|
42
39
|
class Forbidden < ResourceErrors; end
|
43
40
|
class NotFound < ResourceErrors; end
|
44
41
|
class MethodNotAllowed < ResourceErrors; end
|
@@ -10,13 +10,11 @@ module Finix
|
|
10
10
|
def hypermedia_subtype(response)
|
11
11
|
unless response.nil?
|
12
12
|
type = response['instrument_type'] || response['type']
|
13
|
-
name = self.name.sub! 'PaymentInstrument', 'PaymentCard'
|
14
13
|
if type == 'PAYMENT_CARD'
|
15
14
|
name = self.name.sub! 'PaymentInstrument', 'PaymentCard'
|
16
15
|
elsif type == 'BANK_ACCOUNT'
|
17
16
|
name = self.name.sub! 'PaymentInstrument', 'BankAccount'
|
18
17
|
end
|
19
|
-
|
20
18
|
return self.instance_eval name unless name.nil?
|
21
19
|
end
|
22
20
|
self
|
@@ -4,14 +4,12 @@ require 'finix/error'
|
|
4
4
|
module Faraday
|
5
5
|
|
6
6
|
class Response::RaiseApiError < Response::Middleware
|
7
|
-
|
8
7
|
def on_complete(response)
|
9
8
|
status_code = response[:status].to_i
|
10
9
|
error_class = Finix.errors_registry[status_code]
|
11
|
-
raise Finix.errors_registry[:unknown].new
|
12
|
-
raise error_class.new
|
10
|
+
raise Finix.errors_registry[:unknown].new response if error_class.nil? and status_code >= 400
|
11
|
+
raise error_class.new response if error_class
|
13
12
|
end
|
14
|
-
|
15
13
|
end
|
16
14
|
|
17
15
|
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.15'
|
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-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
148
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
149
|
+
rubygems_version: 2.6.3
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Finix Ruby Client
|