bridge_bankin 0.1.1 → 0.1.6

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: 6ddf1d83e8ae1b1ced919dcc5858be9b8b331f25af05ff26824a462b36f6b240
4
- data.tar.gz: 22c5bc8aa682d00956bc0f1bfe8c4c710f18626dfbc770ce01cee890603061d5
3
+ metadata.gz: 576c19dcf1c1f0187d6e86ff45a731415120f261e9a2495013b845b338ee0c3c
4
+ data.tar.gz: 41d2aba812b11af49117b1cfef28e338f067cb5c296bdaa0090886c74414f61c
5
5
  SHA512:
6
- metadata.gz: b508b5d4c8d3572bd1db5f85282d9b6da7ca7c1a66b84a7acb5eecff2d94ec5d02791ac7421358085acd615aa65e8d65237a6d9ce603673121c0f3090c9705c8
7
- data.tar.gz: fc7df99b3ea68557a473c27d5fd4f6404a3a2cab97cd4ff05cf613f759e8f843d94e9f0fc46213fd7030af231e3380bf11a9e4d06eb7e78dd8c282868c84540f
6
+ metadata.gz: a029a5962a1296a8ce4b40463e08091456771bfef0b2659f16add6e2c92f9b045150d4c39b55f2851e282ba28dde130d2bb51e51c077b930a567ad533b06293f
7
+ data.tar.gz: fb4bea9560b48b5f1aa563140fadf9032dbaa2d62012ecd7276190de922a709031bf0e2a33d51db81ac463669d73f2d38f0efe3a263c1b56b41285bff914017a
@@ -16,7 +16,7 @@ jobs:
16
16
  - name: Set up Ruby
17
17
  uses: ruby/setup-ruby@v1
18
18
  with:
19
- ruby-version: 2.7
19
+ ruby-version: 3.0.0
20
20
  - name: Run the default task
21
21
  run: |
22
22
  gem install bundler
@@ -22,7 +22,7 @@ jobs:
22
22
  - name: Set up Ruby
23
23
  uses: ruby/setup-ruby@v1
24
24
  with:
25
- ruby-version: 2.7
25
+ ruby-version: 3.0.0
26
26
 
27
27
  # This step is not necessary if you add the gem to your Gemfile
28
28
  - name: Install Code Scanning integration
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /tmp/
11
+ /.idea
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ require:
3
3
  - rubocop-rspec
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 2.7
6
+ TargetRubyVersion: 3.0.0
7
7
  NewCops: enable
8
8
 
9
9
  Style/StringLiterals:
@@ -40,3 +40,12 @@ RSpec/SubjectStub:
40
40
 
41
41
  RSpec/MultipleDescribes:
42
42
  Enabled: false
43
+
44
+ RSpec/StubbedMock:
45
+ Enabled: false
46
+
47
+ RSpec/MultipleExpectations:
48
+ Enabled: false
49
+
50
+ Metrics/ClassLength:
51
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bridge_bankin (0.1.1)
4
+ bridge_bankin (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -12,7 +12,7 @@ GEM
12
12
  minitest (>= 5.1)
13
13
  tzinfo (~> 2.0)
14
14
  zeitwerk (~> 2.3)
15
- addressable (2.7.0)
15
+ addressable (2.8.0)
16
16
  public_suffix (>= 2.0.2, < 5.0)
17
17
  ast (2.4.1)
18
18
  awesome_print (1.8.0)
@@ -36,7 +36,7 @@ GEM
36
36
  rainbow (3.0.0)
37
37
  rake (13.0.3)
38
38
  regexp_parser (2.0.3)
39
- rexml (3.2.4)
39
+ rexml (3.2.5)
40
40
  rspec (3.10.0)
41
41
  rspec-core (~> 3.10.0)
42
42
  rspec-expectations (~> 3.10.0)
@@ -80,6 +80,7 @@ GEM
80
80
  zeitwerk (2.4.2)
81
81
 
82
82
  PLATFORMS
83
+ ruby
83
84
  x86_64-darwin-19
84
85
 
85
86
  DEPENDENCIES
@@ -96,4 +97,4 @@ DEPENDENCIES
96
97
  webmock
97
98
 
98
99
  BUNDLED WITH
99
- 2.2.1
100
+ 2.2.3
data/README.md CHANGED
@@ -1,5 +1,20 @@
1
1
  <p align="center">
2
- <img width="500" src="https://user-images.githubusercontent.com/112219/103307983-5fe04500-49df-11eb-9618-1f9704b2f460.png">
2
+ <img width="500" src="https://user-images.githubusercontent.com/112219/103307983-5fe04500-49df-11eb-9618-1f9704b2f460.png" alt="Bankin Bridge Logo">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://badge.fury.io/rb/bridge_bankin">
7
+ <img src="https://badge.fury.io/rb/bridge_bankin.svg" alt="Gem Version">
8
+ </a>
9
+ <a href="https://github.com/neatops/bridge_bankin/actions?query=workflow%3ACI">
10
+ <img src="https://github.com/neatops/bridge_bankin/workflows/CI/badge.svg" alt="CI Status">
11
+ </a>
12
+ <a href="https://github.com/neatops/bridge_bankin/actions?query=workflow%3ARuboCop">
13
+ <img src="https://github.com/neatops/bridge_bankin/workflows/RuboCop/badge.svg" alt="Rubocop Status">
14
+ </a>
15
+ <a href="https://rubydoc.info/github/neatops/bridge_bankin/main">
16
+ <img src="https://img.shields.io/badge/yard-docs-blue.svg" alt="RubyDoc Link">
17
+ </a>
3
18
  </p>
4
19
 
5
20
  <br />
@@ -43,6 +58,7 @@ One you have your valid API credential you can now create an initializer in your
43
58
  BridgeBankin.configure do |config|
44
59
  config.api_client_id = ENV["BRIDGE_API_CLIENT_ID"]
45
60
  config.api_client_secret = ENV["BRIDGE_API_CLIENT_SECRET"]
61
+ config.follow_pages = true
46
62
  end
47
63
  ```
48
64
 
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
 
16
16
  spec.homepage = "https://github.com/neatops/bridge_bankin"
17
17
  spec.license = "MIT"
18
- spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
18
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
19
19
 
20
20
  spec.metadata["homepage_uri"] = spec.homepage
21
21
  spec.metadata["source_code_uri"] = spec.homepage
@@ -20,8 +20,9 @@ module BridgeBankin
20
20
  #
21
21
  def list(access_token:, **params)
22
22
  protected_resource(access_token) do
23
- data = api_client.get("/v2/accounts", params)
24
- convert_to_bridge_object(data)
23
+ data = api_client.get("/v2/accounts", **params)
24
+ # binding.pry
25
+ convert_to_bridge_object(**data)
25
26
  end
26
27
  end
27
28
 
@@ -36,8 +37,8 @@ module BridgeBankin
36
37
  #
37
38
  def find(id:, access_token:, **params)
38
39
  protected_resource(access_token) do
39
- data = api_client.get("/v2/accounts/#{id}", params)
40
- convert_to_bridge_object(data)
40
+ data = api_client.get("/v2/accounts/#{id}", **params)
41
+ convert_to_bridge_object(**data)
41
42
  end
42
43
  end
43
44
  end
@@ -91,8 +91,14 @@ module BridgeBankin
91
91
 
92
92
  case api_response.code
93
93
  when "200", "201"
94
- parse_response_body(api_response.body)
95
- when "204"
94
+ data = parse_response_body(api_response.body)
95
+
96
+ if data.dig(:pagination, :next_uri) && follow_pages
97
+ handle_paging(data)
98
+ else
99
+ data
100
+ end
101
+ when "204", "202"
96
102
  {}
97
103
  else
98
104
  handle_error(api_response)
@@ -108,6 +114,25 @@ module BridgeBankin
108
114
  @uri ||= URI.parse(BridgeBankin.configuration.api_base_url)
109
115
  end
110
116
 
117
+ def follow_pages
118
+ BridgeBankin.configuration.follow_pages
119
+ end
120
+
121
+ def handle_paging(data)
122
+ if follow_pages && data[:pagination][:next_uri]
123
+ page_uri = URI.parse(data[:pagination][:next_uri])
124
+
125
+ params = URI.decode_www_form(page_uri.query).to_h
126
+
127
+ next_page_data = get(page_uri.path, **params)
128
+ end
129
+
130
+ next_page_data[:resources] << data[:resources]
131
+ next_page_data[:resources] = next_page_data[:resources].flatten
132
+
133
+ next_page_data
134
+ end
135
+
111
136
  def headers
112
137
  headers =
113
138
  {
@@ -18,8 +18,8 @@ module BridgeBankin
18
18
  # @return [Array<Bank>] the supported banks list
19
19
  #
20
20
  def list(**params)
21
- data = api_client.get("/v2/banks", params)
22
- convert_to_bridge_object(data)
21
+ data = api_client.get("/v2/banks", **params)
22
+ convert_to_bridge_object(**data)
23
23
  end
24
24
 
25
25
  #
@@ -31,8 +31,8 @@ module BridgeBankin
31
31
  # @return [Bank] the requested bank
32
32
  #
33
33
  def find(id:, **params)
34
- data = api_client.get("/v2/banks/#{id}", params)
35
- convert_to_bridge_object(data)
34
+ data = api_client.get("/v2/banks/#{id}", **params)
35
+ convert_to_bridge_object(**data)
36
36
  end
37
37
  end
38
38
  end
@@ -24,7 +24,7 @@ module BridgeBankin
24
24
  #
25
25
  # @return [Account, Bank, Category, Item, Stock, Transaction, Transfer, User, BridgeObject] a resource object
26
26
  #
27
- def convert_to_bridge_object(**data)
27
+ def convert_to_bridge_object(data)
28
28
  if data[:resources]
29
29
  data[:resources].map { |resource| convert_to_bridge_object(resource) }
30
30
  elsif data.is_a?(Array)
@@ -41,7 +41,7 @@ module BridgeBankin
41
41
  end
42
42
 
43
43
  def object_from_resource_type(data)
44
- object_classes.fetch(data[:resource_type], BridgeObject).new(data)
44
+ object_classes.fetch(data[:resource_type], BridgeObject).new(**data)
45
45
  end
46
46
  end
47
47
 
@@ -18,8 +18,8 @@ module BridgeBankin
18
18
  # @return [Array<Category>] the supported categories list
19
19
  #
20
20
  def list(**params)
21
- data = api_client.get("/v2/categories", params)
22
- convert_to_bridge_object(data)
21
+ data = api_client.get("/v2/categories", **params)
22
+ convert_to_bridge_object(**data)
23
23
  end
24
24
 
25
25
  #
@@ -31,8 +31,8 @@ module BridgeBankin
31
31
  # @return [Category] the requested category
32
32
  #
33
33
  def find(id:, **params)
34
- data = api_client.get("/v2/categories/#{id}", params)
35
- convert_to_bridge_object(data)
34
+ data = api_client.get("/v2/categories/#{id}", **params)
35
+ convert_to_bridge_object(**data)
36
36
  end
37
37
  end
38
38
  end
@@ -21,7 +21,7 @@ module BridgeBankin
21
21
  #
22
22
  class Configuration
23
23
  attr_reader :api_base_url, :api_version
24
- attr_accessor :api_client_id, :api_client_secret
24
+ attr_accessor :api_client_id, :api_client_secret, :follow_pages
25
25
 
26
26
  #
27
27
  # Initializes Configuration
@@ -29,8 +29,9 @@ module BridgeBankin
29
29
  def initialize
30
30
  @api_base_url = "https://sync.bankin.com"
31
31
  @api_version = "2019-02-18"
32
- @api_client_id = "d16099aec29e445dbb31cf3966b3821e"
33
- @api_client_secret = "HEb73vHEGB4Hunv5OMXFUDNIgNonYJ89YaHHRSyidVgCPbCtFWqtED5fZYObA0lm"
32
+ @api_client_id = ""
33
+ @api_client_secret = ""
34
+ @follow_pages = false
34
35
  end
35
36
  end
36
37
  end
@@ -18,8 +18,8 @@ module BridgeBankin
18
18
  #
19
19
  def connect_item(access_token:, **params)
20
20
  protected_resource(access_token) do
21
- data = api_client.get("/v2/connect/items/add/url", params)
22
- convert_to_bridge_object(data)
21
+ data = api_client.get("/v2/connect/items/add/url", **params)
22
+ convert_to_bridge_object(**data)
23
23
  end
24
24
  end
25
25
 
@@ -33,8 +33,8 @@ module BridgeBankin
33
33
  #
34
34
  def connect_item_with_iban(access_token:, **params)
35
35
  protected_resource(access_token) do
36
- data = api_client.post("/v2/connect/items/add/url", params)
37
- convert_to_bridge_object(data)
36
+ data = api_client.post("/v2/connect/items/add/url", **params)
37
+ convert_to_bridge_object(**data)
38
38
  end
39
39
  end
40
40
 
@@ -48,8 +48,8 @@ module BridgeBankin
48
48
  #
49
49
  def edit_item(access_token:, **params)
50
50
  protected_resource(access_token) do
51
- data = api_client.get("/v2/connect/items/edit/url", params)
52
- convert_to_bridge_object(data)
51
+ data = api_client.get("/v2/connect/items/edit/url", **params)
52
+ convert_to_bridge_object(**data)
53
53
  end
54
54
  end
55
55
 
@@ -64,8 +64,8 @@ module BridgeBankin
64
64
  #
65
65
  def item_sync(access_token:, **params)
66
66
  protected_resource(access_token) do
67
- data = api_client.get("/v2/connect/items/sync", params)
68
- convert_to_bridge_object(data)
67
+ data = api_client.get("/v2/connect/items/sync", **params)
68
+ convert_to_bridge_object(**data)
69
69
  end
70
70
  end
71
71
 
@@ -79,8 +79,8 @@ module BridgeBankin
79
79
  #
80
80
  def validate_email(access_token:, **params)
81
81
  protected_resource(access_token) do
82
- data = api_client.get("/v2/connect/users/email/confirmation/url", params)
83
- convert_to_bridge_object(data)
82
+ data = api_client.get("/v2/connect/users/email/confirmation/url", **params)
83
+ convert_to_bridge_object(**data)
84
84
  end
85
85
  end
86
86
 
@@ -94,8 +94,8 @@ module BridgeBankin
94
94
  #
95
95
  def validate_pro_items(access_token:, **params)
96
96
  protected_resource(access_token) do
97
- data = api_client.get("/v2/connect/items/pro/confirmation/url", params)
98
- convert_to_bridge_object(data)
97
+ data = api_client.get("/v2/connect/items/pro/confirmation/url", **params)
98
+ convert_to_bridge_object(**data)
99
99
  end
100
100
  end
101
101
  end
@@ -18,8 +18,8 @@ module BridgeBankin
18
18
  #
19
19
  def categories_insights(access_token:, **params)
20
20
  protected_resource(access_token) do
21
- data = api_client.get("/v2/insights/category", params)
22
- convert_to_bridge_object(data)
21
+ data = api_client.get("/v2/insights/category", **params)
22
+ convert_to_bridge_object(**data)
23
23
  end
24
24
  end
25
25
  end
@@ -22,8 +22,8 @@ module BridgeBankin
22
22
  #
23
23
  def list(access_token:, **params)
24
24
  protected_resource(access_token) do
25
- data = api_client.get("/v2/items", params)
26
- convert_to_bridge_object(data)
25
+ data = api_client.get("/v2/items", **params)
26
+ convert_to_bridge_object(**data)
27
27
  end
28
28
  end
29
29
 
@@ -38,8 +38,8 @@ module BridgeBankin
38
38
  #
39
39
  def find(id:, access_token:, **params)
40
40
  protected_resource(access_token) do
41
- data = api_client.get("/v2/items/#{id}", params)
42
- convert_to_bridge_object(data)
41
+ data = api_client.get("/v2/items/#{id}", **params)
42
+ convert_to_bridge_object(**data)
43
43
  end
44
44
  end
45
45
 
@@ -54,8 +54,8 @@ module BridgeBankin
54
54
  #
55
55
  def refresh(id:, access_token:, **params)
56
56
  protected_resource(access_token) do
57
- data = api_client.post("/v2/items/#{id}/refresh", params)
58
- convert_to_bridge_object(data)
57
+ data = api_client.post("/v2/items/#{id}/refresh", **params)
58
+ convert_to_bridge_object(**data)
59
59
  end
60
60
  end
61
61
 
@@ -70,8 +70,8 @@ module BridgeBankin
70
70
  #
71
71
  def refresh_status(id:, access_token:, **params)
72
72
  protected_resource(access_token) do
73
- data = api_client.get("/v2/items/#{id}/refresh/status", params)
74
- convert_to_bridge_object(data)
73
+ data = api_client.get("/v2/items/#{id}/refresh/status", **params)
74
+ convert_to_bridge_object(**data)
75
75
  end
76
76
  end
77
77
 
@@ -86,7 +86,7 @@ module BridgeBankin
86
86
  #
87
87
  def delete(id:, access_token:, **params)
88
88
  protected_resource(access_token) do
89
- api_client.delete("/v2/items/#{id}", params)
89
+ api_client.delete("/v2/items/#{id}", **params)
90
90
  true
91
91
  end
92
92
  end
@@ -20,8 +20,8 @@ module BridgeBankin
20
20
  #
21
21
  def list(access_token:, **params)
22
22
  protected_resource(access_token) do
23
- data = api_client.get("/v2/stocks", params)
24
- convert_to_bridge_object(data)
23
+ data = api_client.get("/v2/stocks", **params)
24
+ convert_to_bridge_object(**data)
25
25
  end
26
26
  end
27
27
 
@@ -35,8 +35,8 @@ module BridgeBankin
35
35
  #
36
36
  def list_updated(access_token:, **params)
37
37
  protected_resource(access_token) do
38
- data = api_client.get("/v2/stocks/updated", params)
39
- convert_to_bridge_object(data)
38
+ data = api_client.get("/v2/stocks/updated", **params)
39
+ convert_to_bridge_object(**data)
40
40
  end
41
41
  end
42
42
 
@@ -51,8 +51,8 @@ module BridgeBankin
51
51
  #
52
52
  def find(id:, access_token:, **params)
53
53
  protected_resource(access_token) do
54
- data = api_client.get("/v2/stocks/#{id}", params)
55
- convert_to_bridge_object(data)
54
+ data = api_client.get("/v2/stocks/#{id}", **params)
55
+ convert_to_bridge_object(**data)
56
56
  end
57
57
  end
58
58
  end
@@ -20,8 +20,8 @@ module BridgeBankin
20
20
  #
21
21
  def list(access_token:, **params)
22
22
  protected_resource(access_token) do
23
- data = api_client.get("/v2/transactions", params)
24
- convert_to_bridge_object(data)
23
+ data = api_client.get("/v2/transactions", **params)
24
+ convert_to_bridge_object(**data)
25
25
  end
26
26
  end
27
27
 
@@ -35,8 +35,8 @@ module BridgeBankin
35
35
  #
36
36
  def list_updated(access_token:, **params)
37
37
  protected_resource(access_token) do
38
- data = api_client.get("/v2/transactions/updated", params)
39
- convert_to_bridge_object(data)
38
+ data = api_client.get("/v2/transactions/updated", **params)
39
+ convert_to_bridge_object(**data)
40
40
  end
41
41
  end
42
42
 
@@ -51,8 +51,8 @@ module BridgeBankin
51
51
  #
52
52
  def find(id:, access_token:, **params)
53
53
  protected_resource(access_token) do
54
- data = api_client.get("/v2/transactions/#{id}", params)
55
- convert_to_bridge_object(data)
54
+ data = api_client.get("/v2/transactions/#{id}", **params)
55
+ convert_to_bridge_object(**data)
56
56
  end
57
57
  end
58
58
 
@@ -66,8 +66,8 @@ module BridgeBankin
66
66
  #
67
67
  def list_by_account(account_id:, access_token:, **params)
68
68
  protected_resource(access_token) do
69
- data = api_client.get("/v2/accounts/#{account_id}/transactions", params)
70
- convert_to_bridge_object(data)
69
+ data = api_client.get("/v2/accounts/#{account_id}/transactions", **params)
70
+ convert_to_bridge_object(**data)
71
71
  end
72
72
  end
73
73
 
@@ -81,8 +81,8 @@ module BridgeBankin
81
81
  #
82
82
  def list_updated_by_account(account_id:, access_token:, **params)
83
83
  protected_resource(access_token) do
84
- data = api_client.get("/v2/accounts/#{account_id}/transactions/updated", params)
85
- convert_to_bridge_object(data)
84
+ data = api_client.get("/v2/accounts/#{account_id}/transactions/updated", **params)
85
+ convert_to_bridge_object(**data)
86
86
  end
87
87
  end
88
88
 
@@ -96,8 +96,8 @@ module BridgeBankin
96
96
  #
97
97
  def list_by_iban(access_token:, **params)
98
98
  protected_resource(access_token) do
99
- data = api_client.post("/v2/transactions/search", params)
100
- convert_to_bridge_object(data)
99
+ data = api_client.post("/v2/transactions/search", **params)
100
+ convert_to_bridge_object(**data)
101
101
  end
102
102
  end
103
103
  end
@@ -20,8 +20,8 @@ module BridgeBankin
20
20
  #
21
21
  def send(access_token:, **params)
22
22
  protected_resource(access_token) do
23
- data = api_client.post("/v2/pay/transfer/url", params)
24
- convert_to_bridge_object(data)
23
+ data = api_client.post("/v2/pay/transfer/url", **params)
24
+ convert_to_bridge_object(**data)
25
25
  end
26
26
  end
27
27
 
@@ -35,8 +35,8 @@ module BridgeBankin
35
35
  #
36
36
  def list(access_token:, **params)
37
37
  protected_resource(access_token) do
38
- data = api_client.get("/v2/transfers", params)
39
- convert_to_bridge_object(data)
38
+ data = api_client.get("/v2/transfers", **params)
39
+ convert_to_bridge_object(**data)
40
40
  end
41
41
  end
42
42
 
@@ -51,8 +51,8 @@ module BridgeBankin
51
51
  #
52
52
  def find(uuid:, access_token:, **params)
53
53
  protected_resource(access_token) do
54
- data = api_client.get("/v2/transfers/#{uuid}", params)
55
- convert_to_bridge_object(data)
54
+ data = api_client.get("/v2/transfers/#{uuid}", **params)
55
+ convert_to_bridge_object(**data)
56
56
  end
57
57
  end
58
58
 
@@ -66,8 +66,8 @@ module BridgeBankin
66
66
  #
67
67
  def list_all_sender_accounts(access_token:, **params)
68
68
  protected_resource(access_token) do
69
- data = api_client.get("/v2/transfers/accounts/senders", params)
70
- convert_to_bridge_object(data)
69
+ data = api_client.get("/v2/transfers/accounts/senders", **params)
70
+ convert_to_bridge_object(**data)
71
71
  end
72
72
  end
73
73
 
@@ -81,8 +81,8 @@ module BridgeBankin
81
81
  #
82
82
  def list_all_receiver_accounts(access_token:, **params)
83
83
  protected_resource(access_token) do
84
- data = api_client.get("/v2/transfers/accounts/receivers", params)
85
- convert_to_bridge_object(data)
84
+ data = api_client.get("/v2/transfers/accounts/receivers", **params)
85
+ convert_to_bridge_object(**data)
86
86
  end
87
87
  end
88
88
 
@@ -97,8 +97,8 @@ module BridgeBankin
97
97
  #
98
98
  def list_receiver_accounts_for_sender(sender_account_id:, access_token:, **params)
99
99
  protected_resource(access_token) do
100
- data = api_client.get("/v2/transfers/accounts/#{sender_account_id}/receivers", params)
101
- convert_to_bridge_object(data)
100
+ data = api_client.get("/v2/transfers/accounts/#{sender_account_id}/receivers", **params)
101
+ convert_to_bridge_object(**data)
102
102
  end
103
103
  end
104
104
  end
@@ -18,8 +18,8 @@ module BridgeBankin
18
18
  # @return [Array<User>] the registered users list
19
19
  #
20
20
  def list(**params)
21
- data = api_client.get("/v2/users", params)
22
- convert_to_bridge_object(data)
21
+ data = api_client.get("/v2/users", **params)
22
+ convert_to_bridge_object(**data)
23
23
  end
24
24
 
25
25
  #
@@ -31,8 +31,8 @@ module BridgeBankin
31
31
  # @return [User] the requested user
32
32
  #
33
33
  def find(uuid:, **params)
34
- data = api_client.get("/v2/users/#{uuid}", params)
35
- convert_to_bridge_object(data)
34
+ data = api_client.get("/v2/users/#{uuid}", **params)
35
+ convert_to_bridge_object(**data)
36
36
  end
37
37
 
38
38
  #
@@ -43,8 +43,8 @@ module BridgeBankin
43
43
  # @return [User] the newly created user
44
44
  #
45
45
  def create(**params)
46
- data = api_client.post("/v2/users", params)
47
- convert_to_bridge_object(data)
46
+ data = api_client.post("/v2/users", **params)
47
+ convert_to_bridge_object(**data)
48
48
  end
49
49
 
50
50
  #
@@ -56,8 +56,8 @@ module BridgeBankin
56
56
  # @return [User] the updated user
57
57
  #
58
58
  def update_email(uuid:, **params)
59
- data = api_client.put("/v2/users/#{uuid}/email", params)
60
- convert_to_bridge_object(data)
59
+ data = api_client.put("/v2/users/#{uuid}/email", **params)
60
+ convert_to_bridge_object(**data)
61
61
  end
62
62
 
63
63
  #
@@ -69,8 +69,8 @@ module BridgeBankin
69
69
  # @return [User] the updated user
70
70
  #
71
71
  def update_password(uuid:, **params)
72
- data = api_client.put("/v2/users/#{uuid}/password", params)
73
- convert_to_bridge_object(data)
72
+ data = api_client.put("/v2/users/#{uuid}/password", **params)
73
+ convert_to_bridge_object(**data)
74
74
  end
75
75
 
76
76
  #
@@ -82,7 +82,7 @@ module BridgeBankin
82
82
  # @return [Boolean] the request success status
83
83
  #
84
84
  def delete_user(uuid:, **params)
85
- api_client.delete("/v2/users/#{uuid}", params)
85
+ api_client.delete("/v2/users/#{uuid}", **params)
86
86
  true
87
87
  end
88
88
 
@@ -94,7 +94,7 @@ module BridgeBankin
94
94
  # @return [Boolean] the request success status
95
95
  #
96
96
  def delete_all_users(**params)
97
- api_client.delete("/v2/users", params)
97
+ api_client.delete("/v2/users", **params)
98
98
  true
99
99
  end
100
100
 
@@ -108,8 +108,8 @@ module BridgeBankin
108
108
  #
109
109
  def check_email_confirmation(access_token:, **params)
110
110
  protected_resource(access_token) do
111
- data = api_client.get("/v2/users/me/email/confirmation", params)
112
- convert_to_bridge_object(data)
111
+ data = api_client.get("/v2/users/me/email/confirmation", **params)
112
+ convert_to_bridge_object(**data)
113
113
  end
114
114
  end
115
115
 
@@ -123,8 +123,8 @@ module BridgeBankin
123
123
  #
124
124
  def manage_accounts(access_token:, **params)
125
125
  protected_resource(access_token) do
126
- data = api_client.get("/v2/users/manage/accounts/iban", params)
127
- convert_to_bridge_object(data)
126
+ data = api_client.get("/v2/users/manage/accounts/iban", **params)
127
+ convert_to_bridge_object(**data)
128
128
  end
129
129
  end
130
130
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgeBankin
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_bankin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Buffon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-30 00:00:00.000000000 Z
11
+ date: 2021-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -207,14 +207,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
207
  requirements:
208
208
  - - ">="
209
209
  - !ruby/object:Gem::Version
210
- version: 2.7.0
210
+ version: 3.0.0
211
211
  required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - ">="
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubygems_version: 3.1.4
217
+ rubygems_version: 3.2.3
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: Unofficial Ruby client to consume Bridge by Bankin’ API