ibanity 1.1 → 1.1.1
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 +4 -4
- data/.travis.yml +10 -0
- data/CHANGELOG.md +7 -0
- data/README.md +2 -0
- data/lib/ibanity/api/ponto_connect/financial_institution.rb +1 -1
- data/lib/ibanity/client.rb +2 -1
- data/lib/ibanity/error.rb +7 -4
- data/lib/ibanity/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58760dd2b572c44765101af4d96b7549a8af0403d161690c43e6ca61630f3903
|
4
|
+
data.tar.gz: 6d12cec2d46f49470c7e5a30d381bd4d1685e74d65407c1cfd47c059efeb7c25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe4f9a8a9a267d188a6e8276d55d3775f4873007c04bd3e9974db9622b17192c9e03047bf35828932cf7c0d0ca33dd1fa97305d4b47ea0d1701e2c79cb8c9fc8
|
7
|
+
data.tar.gz: 481aa49242a63f94a2a4494bd4f645cbb891b129260bfe10b334585cd283e2cbdb0d7d8ea439495eb914ef43e0e88e84f127788544e84496705b7321bcd9da75
|
data/.travis.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
language: ruby
|
2
|
+
script: bundle exec rspec
|
3
|
+
deploy:
|
4
|
+
provider: rubygems
|
5
|
+
api_key:
|
6
|
+
secure: pfXgGXH/AZEG3HMiaJPmJ7fck6Z3Hj0y7TU5TwvLAtKuBy6hlLT67ne/VfeBZQKa9d7eerr9PFP1hvLjZppScZMMOTtjBTvwpchkcUDwCxHx5GzS/jRnBF+uYHIza2p4Wq8yIPug7UrZ0qyq5VOG45R/nC/fPm2Ht2T7heqF5VgRaDGrN7Fq3zXn7duiYhTy02nDXorZ/kEAjnwdwDtXWyVFq8wr4inTExYrDP9/M57qx5TrkgWmcQ7JrvO2KfLDMJqAxI8lNoaPl5dAi7q1XWqqSVay7h9OAnP4UfvnvAc106lG6nHfTQig1krTfxRAvtHlPQjSlFkL+0qfBPBz1C/ex221O3NsNBYmI/mJ45lcNhqJbnkV2VEAEgUoe4ZFfKUUczLfnVxIPjoQmHMwLwfEO4g8/Hz/I3L7bvebgfzGGMDpmN6ERZRJmhutE6K5cL80ghoLs6ExJLoqHi1qvdBSkM2IyE4Yo+lob/hKU1IBL1w13T2h3EHapBh3kKn+jBzu/y5nXTEteBHbMP8j2zxFiihVBJEKPXhg/iU8WHLI6HZgWJkOc9ZH3hS7CN3VELK7fVZp9jaPAKaKihdvxQ0z3gCPFL+E6rYKsBPYqXE6qDsSQswhqTN15W0eVQqK8fDXkZmW0lSGvi2IJvL0CjIaahfB2GaapTtqOwar7sc=
|
7
|
+
on:
|
8
|
+
tags: true
|
9
|
+
gem: ibanity
|
10
|
+
skip_cleanup: true
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://travis-ci.org/ibanity/ibanity-ruby)
|
2
|
+
|
1
3
|
# Ibanity Ruby Library
|
2
4
|
|
3
5
|
The Ibanity Ruby Library provides convenient wrappers around the Ibanity API. The object attributes are dynamically defined based on the API response, supporting minor API changes seamlessly.
|
@@ -6,7 +6,7 @@ module Ibanity
|
|
6
6
|
list_by_uri(uri: uri, query_params: query_params, customer_access_token: access_token)
|
7
7
|
end
|
8
8
|
|
9
|
-
def self.find(access_token
|
9
|
+
def self.find(access_token: nil, id:)
|
10
10
|
uri = Ibanity.ponto_connect_api_schema["financialInstitutions"].sub("{financialInstitutionId}", id)
|
11
11
|
find_by_uri(uri: uri, customer_access_token: access_token)
|
12
12
|
end
|
data/lib/ibanity/client.rb
CHANGED
@@ -70,8 +70,9 @@ module Ibanity
|
|
70
70
|
}
|
71
71
|
raw_response = RestClient::Request.execute(query) do |response, request, result, &block|
|
72
72
|
if response.code >= 400
|
73
|
+
ibanity_request_id = response.headers[:ibanity_request_id]
|
73
74
|
body = JSON.parse(response.body)
|
74
|
-
raise Ibanity::Error.new(body["errors"] || body), "Ibanity request failed."
|
75
|
+
raise Ibanity::Error.new(body["errors"] || body, ibanity_request_id), "Ibanity request failed."
|
75
76
|
else
|
76
77
|
response.return!(&block)
|
77
78
|
end
|
data/lib/ibanity/error.rb
CHANGED
@@ -2,13 +2,14 @@ module Ibanity
|
|
2
2
|
class Error < StandardError
|
3
3
|
attr_reader :errors
|
4
4
|
|
5
|
-
def initialize(errors)
|
5
|
+
def initialize(errors, ibanity_request_id)
|
6
6
|
@errors = errors
|
7
|
+
@ibanity_request_id = ibanity_request_id
|
7
8
|
end
|
8
9
|
|
9
10
|
def to_s
|
10
11
|
if @errors.is_a?(Array) && @errors.size > 0
|
11
|
-
@errors.map do |error|
|
12
|
+
formatted_errors = @errors.map do |error|
|
12
13
|
if error["meta"] && error["meta"]["attribute"]
|
13
14
|
"* #{error["code"]}: '#{error["meta"]["attribute"]}' #{error["detail"]}"
|
14
15
|
elsif error["meta"] && error["meta"]["resource"]
|
@@ -16,9 +17,11 @@ module Ibanity
|
|
16
17
|
else
|
17
18
|
"* #{error["code"]}: #{error["detail"]}"
|
18
19
|
end
|
19
|
-
end
|
20
|
+
end
|
21
|
+
formatted_errors << "* ibanity_request_id: #{@ibanity_request_id}"
|
22
|
+
formatted_errors.join("\n")
|
20
23
|
elsif @errors.is_a?(Hash)
|
21
|
-
"* #{@errors["error"]}: #{@errors["error_description"]}"
|
24
|
+
"* #{@errors["error"]}: #{@errors["error_description"]}\n * Error hint: #{@errors["error_hint"]}\n * ibanity_request_id: #{@ibanity_request_id}"
|
22
25
|
else
|
23
26
|
super
|
24
27
|
end
|
data/lib/ibanity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibanity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ibanity
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -61,6 +61,8 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- ".gitkeep"
|
64
|
+
- ".travis.yml"
|
65
|
+
- CHANGELOG.md
|
64
66
|
- Gemfile
|
65
67
|
- LICENSE.txt
|
66
68
|
- README.md
|
@@ -125,7 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
127
|
- !ruby/object:Gem::Version
|
126
128
|
version: '0'
|
127
129
|
requirements: []
|
128
|
-
|
130
|
+
rubyforge_project:
|
131
|
+
rubygems_version: 2.7.7
|
129
132
|
signing_key:
|
130
133
|
specification_version: 4
|
131
134
|
summary: Ibanity Ruby Client
|