finix 0.14 → 0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODc0MGI2NjMyODJhZmJkZWYyZDIzODcwNWQzYzEyZmYyODI1YWRjMA==
4
+ ODliODZiNzMwY2VjMTQ2YzUwMWQ2ZjRjOWE5Mjc1NmY4OTkxNTgyNQ==
5
5
  data.tar.gz: !binary |-
6
- NzE3MjE0N2E2OGU4ZWI5N2EzZDZjY2E1NjY0MmJlZjE1NWNhOThmZQ==
6
+ NDY0NjI3YzM2ZjNmZTVmNjRiZDdmNTA1MzJiNDhkNDZlNWZiN2RjYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTM1YTBlYTU0ZTJhMDlkNzU2NTcwN2I5ZjdjMzI1MmYzYTU0YmI5NjRkZjU0
10
- MTY4MjYyYzg5NDEyNzYxMWY0MTdmODkzZDE4NjkzMDFiYWJiMTE1NDQzN2Ez
11
- OWZlMTIyYzM0MjEwZmUyYmJkZWIwYzY1ZWRjMjhkODg2N2RiYmU=
9
+ ZjgwYzM1NGZiZmE5YTE3ZjM4ZGEyYTk5OTViNjI2ZDkxYzY1MTlmNzIyMTcw
10
+ MTE3NDE3OGFjYjM3NGI3MmEwZmM0Y2FjNTBiN2UzZDE3YThiNDY2MWI4ZTYw
11
+ YzU2MTkwOWQwNWY4NjIzMWJhZmI5NjU0NGFjNzc4MmFhYWIwNDc=
12
12
  data.tar.gz: !binary |-
13
- Yjc1MjYyMjI3YWMyYjIzMWVkYjAzNjkyNWY4NGUwNzZlMzhjNTc0Yzk5YWNh
14
- MTM5OTZjMWEzZDQ0NzYwZTQzZTc5Mjg5OTg1NDQ1ZjI3ZGI3M2ZhMjIzYTk4
15
- MmUxNWM3Nzk5ZGMwNDMzMmFiMGZmODg5ODE4YTgzNzJjNzFlYjY=
13
+ NDNlYWNmOTc5MTkxNzcyYTg1NzE3NzBmNDQ1ZTJhNmJmNDVjZjMzZjQwNmM4
14
+ NDkxZTc5NjYwMzUxMTQyMGE0YTViYWY4ZWZlMjJiY2FlOGFkMDgxNDA5ZmE3
15
+ MDdjZjIxODhiMTUwMjQ0ZWZlNDNlNzhhNmJlODhlM2I3MGQ4OGY=
@@ -1 +1 @@
1
- ruby-1.9.3
1
+ 1.9.3
@@ -11,7 +11,7 @@ module Finix
11
11
  :unknown => Finix::ResourceErrors,
12
12
  400 => Finix::BadRequest,
13
13
  401 => Finix::Unauthorized,
14
- 402 => Finix::UpstreamProcessorError,
14
+ 402 => Finix::PaymentRequired,
15
15
  403 => Finix::Forbidden,
16
16
  404 => Finix::NotFound,
17
17
  405 => Finix::MethodNotAllowed,
@@ -8,7 +8,7 @@ require 'finix/response/finix_error_middleware'
8
8
  module Finix
9
9
  class Client
10
10
 
11
- DEFAULTS = {
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 = DEFAULTS.merge options
24
+ @config = DefaultConfig.merge options
25
25
  build_conn
26
26
  end
27
27
 
@@ -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 UpstreamProcessorError < ResourceErrors; end
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(response) if error_class.nil? and status_code >= 400
12
- raise error_class.new(response) if error_class
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
@@ -1,3 +1,3 @@
1
1
  module Finix
2
- VERSION = '0.14'
2
+ VERSION = '0.15'
3
3
  end
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.14'
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 00:00:00.000000000 Z
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.4.8
149
+ rubygems_version: 2.6.3
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: Finix Ruby Client