ibanity 1.11.0 → 2.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0b9e9d3d5bd37f738613c1e77292d6cee3fcbf5016d3d5200d7f4715d673735
4
- data.tar.gz: a757cd1e70e6588174e56de7584d10f04b1b2023c6cf9e0c02e5377c8b6a226b
3
+ metadata.gz: fc2cf04d1de0868831487eb4923e738c4484f536f3e4a2749d326e0a18cc3f23
4
+ data.tar.gz: 2e4706bc1712469f99ebfac2afd3a8a8c56f50d97544a31cb9356f50a91bb5f8
5
5
  SHA512:
6
- metadata.gz: 6c9b41e71c94eac22e8416d5689bb1c02c6cee7c1ba73a0fad1da4d6154a3bd18e7ae16baf154b3e5d881a72e18d77e991580f3dd3486ceb5a5fa157b1b652cd
7
- data.tar.gz: 6fbd44ba0f4d06bb8e890728311bdf8f28e00008688f6d9005e9da6c55377e98644f1e0d8890543a69de7884a83ed6cfabe1e97f01cf381067ad84a801878bd6
6
+ metadata.gz: 2cc32d999ac1ce54089ef7be839778017a204efa1e0fea3e900c6934f653c9646ab837c60b2105b0f67b552ad96742448c68d9b884f4ab888eb14fb580fe15ae
7
+ data.tar.gz: 47f4dd5ba11dafe5018a85404bf377dac5fc81ec666674f96c8d6e8f2acddb3fc9c653aef8954890108646fde1409ccef4459845ccc88069a11dfb7e58efcb91
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0
4
+
5
+ * [Isabel Connect] Upgrade to version 2 of the API.
6
+
3
7
  ## 1.11
4
8
 
5
9
  * Allow to tweak RestClient's timeout.
data/README.md CHANGED
@@ -4,6 +4,17 @@
4
4
 
5
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
6
 
7
+ Supported API version per product:
8
+
9
+ Product | Version
10
+ -- | --
11
+ XS2A | 1
12
+ Ponto Connect | 1
13
+ Isabel Connect | 2
14
+ Consent | 1
15
+
16
+ In case you need to connect to an older version of an API, please consult `CHANGELOG.md` for more info on which version of the gem supports which version of the API.
17
+
7
18
  ## Documentation
8
19
 
9
20
  Visit our [Ruby API docs](https://documentation.ibanity.com/api/ruby).
@@ -7,32 +7,39 @@ module Ibanity
7
7
  if refresh_token
8
8
  [
9
9
  ["grant_type", "refresh_token"],
10
- ["refresh_token", refresh_token],
11
- ["client_id", Ibanity.client.isabel_connect_client_id],
12
- ["client_secret", Ibanity.client.isabel_connect_client_secret]
10
+ ["refresh_token", refresh_token]
13
11
  ]
14
12
  elsif authorization_code
15
13
  [
16
14
  ["grant_type", "authorization_code"],
17
15
  ["code", authorization_code],
18
- ["client_id", Ibanity.client.isabel_connect_client_id],
19
- ["client_secret", Ibanity.client.isabel_connect_client_secret],
20
16
  ["redirect_uri", redirect_uri]
21
17
  ]
22
18
  end
23
- payload = URI.encode_www_form(arguments)
24
- create_by_uri(uri: uri, payload: payload, idempotency_key: idempotency_key)
19
+ create_by_uri(
20
+ uri: uri,
21
+ payload: URI.encode_www_form(arguments),
22
+ idempotency_key: idempotency_key,
23
+ headers: self.headers
24
+ )
25
25
  end
26
26
 
27
- def self.delete(token:)
27
+ def self.delete(refresh_token:)
28
28
  uri = Ibanity.isabel_connect_api_schema["oAuth2"]["revoke"]
29
29
  arguments = [
30
- ["token", token],
31
- ["client_id", Ibanity.client.isabel_connect_client_id],
32
- ["client_secret", Ibanity.client.isabel_connect_client_secret]
30
+ ["token", refresh_token]
33
31
  ]
34
32
  payload = URI.encode_www_form(arguments)
35
- create_by_uri(uri: uri, payload: payload)
33
+ create_by_uri(uri: uri, payload: payload, headers: self.headers)
34
+ end
35
+
36
+ private
37
+
38
+ def self.headers
39
+ {
40
+ "Authorization": "Basic " + Base64.strict_encode64("#{Ibanity.client.isabel_connect_client_id}:#{Ibanity.client.isabel_connect_client_secret}"),
41
+ "Content-Type": "application/x-www-form-urlencoded"
42
+ }
36
43
  end
37
44
  end
38
45
  end
@@ -14,8 +14,8 @@ module Ibanity
14
14
  api_scheme: "https",
15
15
  api_host: "api.ibanity.com",
16
16
  ssl_ca_file: nil,
17
- isabel_connect_client_id: "valid_client_id",
18
- isabel_connect_client_secret: "valid_client_secret",
17
+ isabel_connect_client_id: nil,
18
+ isabel_connect_client_secret: nil,
19
19
  ponto_connect_client_id: nil,
20
20
  ponto_connect_client_secret: nil,
21
21
  application_id: nil,
@@ -124,7 +124,7 @@ module Ibanity
124
124
 
125
125
  def build_headers(customer_access_token: nil, idempotency_key: nil, extra_headers: nil, json:, payload: nil)
126
126
  headers = {
127
- accept: :json,
127
+ accept: :json
128
128
  }
129
129
  headers["Transfer-Encoding"] = "chunked" if payload.is_a?(Pathname)
130
130
  headers[:content_type] = :json if json
@@ -1,3 +1,3 @@
1
1
  module Ibanity
2
- VERSION = "1.11.0"
2
+ VERSION = "2.0.0"
3
3
  end
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: 1.11.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ibanity
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-20 00:00:00.000000000 Z
11
+ date: 2022-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client