modulr-api 0.0.48 → 0.1.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: 1ca930d3b546bcbb757139678544570bc83d2cc6503326e6d63edcf2fcc6466a
4
- data.tar.gz: 918f36ba8ee50005ba51018e0cdfb66c823cc6223fc4a9a0f12e632381c31ad8
3
+ metadata.gz: 74ae383224066ca2c23a4ed5ff8ce00b17302be52f923fc5349a1c36238f7a21
4
+ data.tar.gz: 94a51811a985fcd5157fdeebe5421896aa59e6ce4a03f543059666b78b7b948b
5
5
  SHA512:
6
- metadata.gz: 14a434481e2c23bc2eff552068e2b71f37f83d06ee69b510daf9094d04bb16bf672ca0ffe5d72b75229d3d2a9792809e3eb8b7bf4a999807dc5137b6038c6c89
7
- data.tar.gz: d28b6784863fd6e19420d84f5e2a6d1bdfd2cf1cdd50438bcd5c231a5cab1fa7c03cbc2a34e1708672891713f34a0055a49a2abcca2358546938d6c2654d6840
6
+ metadata.gz: 037cd42388aa616629dadaacfcc5de0fafe45f17ab2b36b087694fa7000bfa6caef1a6cdf80de35ef79a257a5cf8fbfc14667a1232e4fd75aaba1751599614f0
7
+ data.tar.gz: 693edc99b458dc09d936147cb249d19c36bb8c4e320fcd980a198a6c477b64d8dbd2df27c4144c7d9312dc838f15bc37e6978cad834e2410954b516370e254a2
data/.rubocop_devengo.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  AllCops:
3
3
  DisplayCopNames: true
4
- TargetRubyVersion: 2.7
4
+ TargetRubyVersion: 3.2
5
5
  SuggestExtensions: false
6
6
  NewCops: enable
7
7
  Exclude:
@@ -11,8 +11,8 @@ AllCops:
11
11
  - node_modules/**/*
12
12
  - Procfile
13
13
 
14
- require:
15
- - "test_prof/rubocop"
14
+ plugins:
15
+ - test-prof
16
16
  - rubocop-rspec
17
17
  - rubocop-performance
18
18
  - rubocop-rake
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.4
1
+ 3.4.12
data/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ All notable changes to this gem are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
5
+ [Semantic Versioning](https://semver.org).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 2026-11-10
10
+
11
+ ### Changed
12
+
13
+ - **Breaking:** requires Ruby 3.2 or later ([#53](https://github.com/devengoapp/modulr-ruby/pull/53)).
14
+ - **Breaking:** depends on Faraday 2 (`>= 2.0, < 3`) instead of Faraday 1, and no longer on `faraday_middleware` ([#53](https://github.com/devengoapp/modulr-ruby/pull/53)).
15
+ - Releases are published with trusted publishing and a Sigstore attestation ([#54](https://github.com/devengoapp/modulr-ruby/pull/54)).
16
+
17
+ ### Security
18
+
19
+ - The request logger filters the `Authorization` header ([#58](https://github.com/devengoapp/modulr-ruby/pull/58)).
20
+ - `Modulr::Client#inspect` no longer prints the API key, secret or proxy credentials ([#51](https://github.com/devengoapp/modulr-ruby/pull/51)).
21
+
22
+ ### Dependencies
23
+
24
+ - Adds `base64` as a runtime dependency, needed from Ruby 3.4 ([#53](https://github.com/devengoapp/modulr-ruby/pull/53)).
25
+
26
+ [Unreleased]: https://github.com/devengoapp/modulr-ruby/compare/v0.1.0...HEAD
27
+ [0.1.0]: https://github.com/devengoapp/modulr-ruby/compare/v0.0.49...v0.1.0
data/CODE_OF_CONDUCT.md CHANGED
@@ -39,7 +39,7 @@ This Code of Conduct applies within all community spaces, and also applies when
39
39
 
40
40
  ## Enforcement
41
41
 
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at aitor@devengo.com. All complaints will be reviewed and investigated promptly and fairly.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at <dev@devengo.com>. All complaints will be reviewed and investigated promptly and fairly.
43
43
 
44
44
  All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
45
 
data/Gemfile CHANGED
@@ -4,3 +4,17 @@ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in modulr.gemspec
6
6
  gemspec
7
+
8
+ gem "debug", "~> 1.11"
9
+ gem "guard", "~> 2.19"
10
+ gem "guard-rspec", "~> 4.7"
11
+ gem "rake", "~> 13.3"
12
+ gem "rspec", "~> 3.13"
13
+ gem "rubocop", "~> 1.81"
14
+ gem "rubocop-performance", "~> 1.26"
15
+ gem "rubocop-rake", "~> 0.7"
16
+ gem "rubocop-rspec", "~> 3.7"
17
+ # 1.3 requires Ruby 3.3; this gem still supports 3.2.
18
+ gem "simplecov", "~> 1.2.0", require: false
19
+ gem "test-prof", "~> 1.4"
20
+ gem "webmock", "~> 3.26"
data/Gemfile.lock CHANGED
@@ -1,51 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- modulr-api (0.0.48)
5
- faraday (~> 1.0)
6
- faraday_middleware (~> 1.0)
4
+ modulr-api (0.1.0)
5
+ base64 (~> 0.2)
6
+ faraday (>= 2.0, < 3)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.8.1)
12
- public_suffix (>= 2.0.2, < 6.0)
13
- ast (2.4.2)
14
- byebug (11.1.3)
11
+ addressable (2.9.2)
12
+ public_suffix (>= 2.0.2, < 8.0)
13
+ ast (2.4.3)
14
+ base64 (0.3.0)
15
+ bigdecimal (4.1.3)
15
16
  coderay (1.1.3)
16
- crack (0.4.5)
17
+ crack (1.0.1)
18
+ bigdecimal
17
19
  rexml
18
- diff-lcs (1.5.0)
19
- faraday (1.10.3)
20
- faraday-em_http (~> 1.0)
21
- faraday-em_synchrony (~> 1.0)
22
- faraday-excon (~> 1.1)
23
- faraday-httpclient (~> 1.0)
24
- faraday-multipart (~> 1.0)
25
- faraday-net_http (~> 1.0)
26
- faraday-net_http_persistent (~> 1.0)
27
- faraday-patron (~> 1.0)
28
- faraday-rack (~> 1.0)
29
- faraday-retry (~> 1.0)
30
- ruby2_keywords (>= 0.0.4)
31
- faraday-em_http (1.0.0)
32
- faraday-em_synchrony (1.0.0)
33
- faraday-excon (1.1.0)
34
- faraday-httpclient (1.0.1)
35
- faraday-multipart (1.0.4)
36
- multipart-post (~> 2)
37
- faraday-net_http (1.0.1)
38
- faraday-net_http_persistent (1.2.0)
39
- faraday-patron (1.0.0)
40
- faraday-rack (1.0.0)
41
- faraday-retry (1.0.3)
42
- faraday_middleware (1.2.0)
43
- faraday (~> 1.0)
44
- ffi (1.15.5)
45
- formatador (1.1.0)
46
- guard (2.18.0)
20
+ debug (1.11.1)
21
+ irb (~> 1.10)
22
+ reline (>= 0.3.8)
23
+ diff-lcs (1.6.2)
24
+ erb (6.0.7)
25
+ faraday (2.15.1)
26
+ faraday-net_http (>= 2.0, < 3.6)
27
+ json
28
+ logger
29
+ faraday-net_http (3.5.0)
30
+ net-http (~> 0.5)
31
+ ffi (1.17.4)
32
+ ffi (1.17.4-arm64-darwin)
33
+ ffi (1.17.4-x86_64-darwin)
34
+ ffi (1.17.4-x86_64-linux-gnu)
35
+ formatador (1.2.3)
36
+ reline
37
+ guard (2.20.2)
47
38
  formatador (>= 0.2.4)
48
39
  listen (>= 2.7, < 4.0)
40
+ logger (~> 1.6)
49
41
  lumberjack (>= 1.0.12, < 2.0)
50
42
  nenv (~> 0.1)
51
43
  notiffany (~> 0.0)
@@ -57,98 +49,139 @@ GEM
57
49
  guard (~> 2.1)
58
50
  guard-compat (~> 1.1)
59
51
  rspec (>= 2.99.0, < 4.0)
60
- hashdiff (1.0.1)
61
- json (2.6.2)
62
- listen (3.7.1)
52
+ hashdiff (1.2.1)
53
+ io-console (0.9.5)
54
+ irb (1.18.0)
55
+ pp (>= 0.6.0)
56
+ prism (>= 1.3.0)
57
+ rdoc (>= 4.0.0)
58
+ reline (>= 0.4.2)
59
+ json (3.1.0)
60
+ language_server-protocol (3.17.0.6)
61
+ lint_roller (1.1.0)
62
+ listen (3.10.1)
63
+ logger
63
64
  rb-fsevent (~> 0.10, >= 0.10.3)
64
65
  rb-inotify (~> 0.9, >= 0.9.10)
65
- lumberjack (1.2.8)
66
- method_source (1.0.0)
67
- multipart-post (2.3.0)
66
+ logger (1.7.0)
67
+ lumberjack (1.4.2)
68
+ method_source (1.1.0)
68
69
  nenv (0.3.0)
70
+ net-http (0.10.0)
71
+ net-protocol (>= 0.3.0)
72
+ uri (>= 0.11.1)
73
+ net-protocol (0.4.0)
74
+ timeout
69
75
  notiffany (0.1.3)
70
76
  nenv (~> 0.1)
71
77
  shellany (~> 0.0)
72
- parallel (1.22.1)
73
- parser (3.1.2.0)
78
+ parallel (1.28.0)
79
+ parser (3.3.13.0)
74
80
  ast (~> 2.4.1)
75
- pry (0.14.1)
81
+ racc
82
+ pp (0.6.4)
83
+ prettyprint
84
+ prettyprint (0.2.1)
85
+ prism (1.9.0)
86
+ pry (0.16.1)
76
87
  coderay (~> 1.1)
77
88
  method_source (~> 1.0)
78
- public_suffix (5.0.0)
89
+ reline (>= 0.6.0)
90
+ public_suffix (7.0.5)
91
+ racc (1.8.1)
79
92
  rainbow (3.1.1)
80
- rake (12.3.3)
81
- rb-fsevent (0.11.1)
82
- rb-inotify (0.10.1)
93
+ rake (13.4.2)
94
+ rb-fsevent (0.11.2)
95
+ rb-inotify (0.11.1)
83
96
  ffi (~> 1.0)
84
- regexp_parser (2.5.0)
85
- rexml (3.4.2)
86
- rspec (3.10.0)
87
- rspec-core (~> 3.10.0)
88
- rspec-expectations (~> 3.10.0)
89
- rspec-mocks (~> 3.10.0)
90
- rspec-core (3.10.1)
91
- rspec-support (~> 3.10.0)
92
- rspec-expectations (3.10.1)
97
+ rbs (4.1.3)
98
+ logger
99
+ prism (>= 1.6.0)
100
+ tsort
101
+ rdoc (8.1.0)
102
+ erb
103
+ prism (>= 1.6.0)
104
+ rbs (>= 4.0.0)
105
+ tsort
106
+ regexp_parser (2.13.1)
107
+ reline (0.7.0)
108
+ io-console (~> 0.5)
109
+ rexml (3.4.4)
110
+ rspec (3.13.2)
111
+ rspec-core (~> 3.13.0)
112
+ rspec-expectations (~> 3.13.0)
113
+ rspec-mocks (~> 3.13.0)
114
+ rspec-core (3.13.6)
115
+ rspec-support (~> 3.13.0)
116
+ rspec-expectations (3.13.5)
93
117
  diff-lcs (>= 1.2.0, < 2.0)
94
- rspec-support (~> 3.10.0)
95
- rspec-mocks (3.10.2)
118
+ rspec-support (~> 3.13.0)
119
+ rspec-mocks (3.13.8)
96
120
  diff-lcs (>= 1.2.0, < 2.0)
97
- rspec-support (~> 3.10.0)
98
- rspec-support (3.10.3)
99
- rubocop (1.31.2)
100
- json (~> 2.3)
101
- parallel (~> 1.10)
102
- parser (>= 3.1.0.0)
121
+ rspec-support (~> 3.13.0)
122
+ rspec-support (3.13.7)
123
+ rubocop (1.92.2)
124
+ json (>= 2.3)
125
+ language_server-protocol (~> 3.17.0.2)
126
+ lint_roller (~> 1.1.0)
127
+ parallel (>= 1.10)
128
+ parser (>= 3.3.0.2)
103
129
  rainbow (>= 2.2.2, < 4.0)
104
- regexp_parser (>= 1.8, < 3.0)
105
- rexml (>= 3.2.5, < 4.0)
106
- rubocop-ast (>= 1.18.0, < 2.0)
130
+ regexp_parser (>= 2.11.3, < 3.0)
131
+ rubocop-ast (>= 1.49.0, < 2.0)
107
132
  ruby-progressbar (~> 1.7)
108
- unicode-display_width (>= 1.4.0, < 3.0)
109
- rubocop-ast (1.19.1)
110
- parser (>= 3.1.1.0)
111
- rubocop-performance (1.14.2)
112
- rubocop (>= 1.7.0, < 2.0)
113
- rubocop-ast (>= 0.4.0)
114
- rubocop-rake (0.6.0)
115
- rubocop (~> 1.0)
116
- rubocop-rspec (2.11.1)
117
- rubocop (~> 1.19)
118
- ruby-progressbar (1.11.0)
119
- ruby2_keywords (0.0.5)
133
+ unicode-display_width (>= 2.4.0, < 4.0)
134
+ rubocop-ast (1.50.0)
135
+ parser (>= 3.3.7.2)
136
+ prism (~> 1.7)
137
+ rubocop-performance (1.27.0)
138
+ lint_roller (~> 1.1)
139
+ rubocop (>= 1.89.0, < 2.0)
140
+ rubocop-ast (>= 1.47.1, < 2.0)
141
+ rubocop-rake (0.7.1)
142
+ lint_roller (~> 1.1)
143
+ rubocop (>= 1.72.1)
144
+ rubocop-rspec (3.10.2)
145
+ lint_roller (~> 1.1)
146
+ regexp_parser (>= 2.0)
147
+ rubocop (~> 1.86, >= 1.86.2)
148
+ ruby-progressbar (1.13.0)
120
149
  shellany (0.0.1)
121
- test-prof (1.0.9)
122
- thor (1.2.1)
123
- unicode-display_width (2.2.0)
124
- webmock (2.3.2)
125
- addressable (>= 2.3.6)
150
+ simplecov (1.2.0)
151
+ test-prof (1.6.4)
152
+ logger
153
+ thor (1.5.0)
154
+ timeout (0.6.1)
155
+ tsort (0.2.0)
156
+ unicode-display_width (3.3.0)
157
+ unicode-emoji (~> 4.3)
158
+ unicode-emoji (4.3.0)
159
+ uri (1.1.2)
160
+ webmock (3.34.0)
161
+ addressable (>= 2.8.0)
126
162
  crack (>= 0.3.2)
127
- hashdiff
163
+ hashdiff (>= 0.4.0, < 2.0.0)
128
164
 
129
165
  PLATFORMS
130
- arm64-darwin-20
131
- arm64-darwin-21
132
- arm64-darwin-22
133
- arm64-darwin-23
134
- arm64-darwin-25
135
- x86_64-darwin-20
136
- x86_64-darwin-22
166
+ arm64-darwin
167
+ ruby
168
+ x86_64-darwin
137
169
  x86_64-linux
138
170
 
139
171
  DEPENDENCIES
140
- byebug (~> 11.1)
141
- guard (~> 2.0)
142
- guard-rspec (~> 4.0)
172
+ debug (~> 1.11)
173
+ guard (~> 2.19)
174
+ guard-rspec (~> 4.7)
143
175
  modulr-api!
144
- rake (~> 12.0)
145
- rspec (~> 3.0)
146
- rubocop (~> 1.0)
147
- rubocop-performance (~> 1.0)
148
- rubocop-rake (~> 0.1)
149
- rubocop-rspec (~> 2.0)
150
- test-prof (~> 1.0)
151
- webmock (~> 2.1)
176
+ rake (~> 13.3)
177
+ rspec (~> 3.13)
178
+ rubocop (~> 1.81)
179
+ rubocop-performance (~> 1.26)
180
+ rubocop-rake (~> 0.7)
181
+ rubocop-rspec (~> 3.7)
182
+ simplecov (~> 1.2.0)
183
+ test-prof (~> 1.4)
184
+ webmock (~> 3.26)
152
185
 
153
186
  BUNDLED WITH
154
- 2.4.19
187
+ 2.7.2
data/README.md CHANGED
@@ -26,6 +26,18 @@ gem install modulr-api
26
26
 
27
27
  Run `bin/console` for an interactive prompt to experiment with the code.
28
28
 
29
+ HTTP logging is enabled by default through `Faraday::Response::Logger`. You can replace that middleware and pass extra options to it:
30
+
31
+ ```rb
32
+ client = Modulr::Client.new(
33
+ apikey: "YOUR_API_KEY",
34
+ logger_middleware: CustomMiddleware,
35
+ logger_options: { log_level: :debug }
36
+ )
37
+ ```
38
+
39
+ `logger_options` are merged over `{ headers: true, bodies: true }`. The middleware is initialized as `Middleware.new(app, nil, options)` and receives the existing password filter block. Set `logger_enabled: false` to skip logging.
40
+
29
41
  ### Customers
30
42
 
31
43
  ```rb
@@ -171,18 +183,28 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
171
183
 
172
184
  To install this gem onto your local machine, run `bundle exec rake install`.
173
185
 
174
- To release a new version, on main branch update the version number in `version.rb`, then:
186
+ ### Releasing
175
187
 
176
- ```git
177
- bundle install
178
- git add .
179
- git commit -m 'feat(release): Bump to vX.X.X'
180
- git push
181
- git tag vX.X.X main
182
- git push origin vX.X.X
183
- ```
188
+ Anyone with write access can release:
189
+
190
+ 1. Open a PR titled `Bump to vX.Y.Z` that:
191
+ - bumps the version in `lib/modulr/version.rb` and in `Gemfile.lock` (`bundle install`);
192
+ - moves the entries under `## [Unreleased]` in `CHANGELOG.md` into a new `## [X.Y.Z] - YYYY-MM-DD` section, following [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
193
+
194
+ Merge it once CI passes.
195
+ 2. Tag the merge commit on `main` and push the tag:
196
+
197
+ ```sh
198
+ git switch main && git pull
199
+ git tag -m vX.Y.Z vX.Y.Z
200
+ git push origin vX.Y.Z
201
+ ```
202
+
203
+ The tag triggers `release.yml`, which runs CI, fails unless the tag is on `main` and `CHANGELOG.md` has a section for the version, and publishes the gem to [rubygems.org](https://rubygems.org/gems/modulr-api) through [trusted publishing](https://guides.rubygems.org/trusted-publishing/) with a [Sigstore](https://www.sigstore.dev) attestation. No API key is involved.
204
+
205
+ If the `publish` job fails, fix the cause and re-run the failed job; the tag stays as it is.
184
206
 
185
- The tagging will trigger the GitHub action defined in `release.yml`, pushing the gem to [rubygems.org](https://rubygems.org).
207
+ Once published, create a [GitHub release](https://github.com/devengoapp/modulr-ruby/releases) for the tag with the version's changelog section as notes.
186
208
 
187
209
  ## Tooling for manual API testing
188
210
 
data/lib/modulr/client.rb CHANGED
@@ -3,7 +3,6 @@
3
3
  require "base64"
4
4
  require "openssl"
5
5
  require "faraday"
6
- require "faraday_middleware"
7
6
  require "json"
8
7
 
9
8
  require_relative "api/services"
@@ -16,7 +15,7 @@ module Modulr
16
15
  SANDBOX_URL = "https://api-sandbox.modulrfinance.com/api-sandbox-token"
17
16
  BASE_URL = SANDBOX_URL
18
17
 
19
- attr_reader :base_url, :origin, :proxy, :username, :logger_enabled
18
+ attr_reader :base_url, :origin, :proxy, :username, :logger_enabled, :logger_middleware, :logger_options
20
19
 
21
20
  def initialize(options = {})
22
21
  @base_url = options[:base_url] || BASE_URL
@@ -24,10 +23,17 @@ module Modulr
24
23
  @proxy = options[:proxy]
25
24
  @apikey = options[:apikey] || ENV["MODULR_APIKEY"]
26
25
  @apisecret = options[:apisecret] || ENV["MODULR_APISECRET"]
27
- @logger_enabled = options[:logger_enabled].nil? ? true : options[:logger_enabled]
26
+ @logger_enabled = options[:logger_enabled].nil? || options[:logger_enabled]
27
+ @logger_middleware = options.fetch(:logger_middleware, Faraday::Response::Logger)
28
+ @logger_options = options.fetch(:logger_options, {})
28
29
  @services = {}
29
30
  end
30
31
 
32
+ # The default prints every instance variable, the API key and secret and the proxy credentials included.
33
+ def inspect
34
+ "#<#{self.class.name}>"
35
+ end
36
+
31
37
  def connection
32
38
  @connection ||= Faraday.new do |builder|
33
39
  builder.use Faraday::Response::RaiseError
@@ -37,8 +43,9 @@ module Modulr
37
43
  parser_options: { symbolize_names: true }
38
44
  builder.proxy = @proxy if proxy
39
45
  if @logger_enabled
40
- builder.response :logger, nil, { headers: true, bodies: true } do |logger|
46
+ builder.use @logger_middleware, nil, { headers: true, bodies: true }.merge(@logger_options) do |logger|
41
47
  logger.filter(/("password":)"(\w+)"/, '\1[FILTERED]')
48
+ logger.filter(/(Authorization: ).*$/, '\1[FILTERED]')
42
49
  end
43
50
  end
44
51
  builder.adapter :net_http
@@ -121,7 +128,7 @@ module Modulr
121
128
  return unless options
122
129
  return unless method == :get
123
130
 
124
- request.params.update(options.reject { |k, _| k == :idempotency_key })
131
+ request.params.update(options.except(:idempotency_key))
125
132
  end
126
133
 
127
134
  def handle_request_error(error)
@@ -9,7 +9,7 @@ module Modulr
9
9
  @response = response
10
10
 
11
11
  attributes.each do |key, value|
12
- m = "#{key}=".to_sym
12
+ m = :"#{key}="
13
13
  send(m, value) if respond_to?(m)
14
14
  end
15
15
  end
@@ -12,8 +12,8 @@ module Modulr
12
12
  @items = attributes_collection.map { |attributes| item_klass.new(nil, attributes) }
13
13
  end
14
14
 
15
- def each(&block)
16
- @items.each(&block)
15
+ def each(&)
16
+ @items.each(&)
17
17
  end
18
18
  end
19
19
  end
@@ -13,7 +13,7 @@ module Modulr
13
13
  map :destinations
14
14
 
15
15
  def initialize(response, attributes = {})
16
- super(response, attributes)
16
+ super
17
17
 
18
18
  @config = Config.new(nil, attributes[:config])
19
19
  end
@@ -10,7 +10,7 @@ module Modulr
10
10
  map :address
11
11
 
12
12
  def initialize(response, attributes = {})
13
- super(response, attributes)
13
+ super
14
14
 
15
15
  @identifier = Accounts::Identifier.new(nil, attributes[:identifier])
16
16
  end
@@ -10,7 +10,7 @@ module Modulr
10
10
  map :name
11
11
 
12
12
  def initialize(response, attributes = {})
13
- super(response, attributes)
13
+ super
14
14
 
15
15
  @identifier = Accounts::Identifier.new(nil, attributes)
16
16
  end
@@ -28,7 +28,7 @@ module Modulr
28
28
  map :details, :raw_details
29
29
 
30
30
  def initialize(response, attributes = {})
31
- super(response, attributes)
31
+ super
32
32
 
33
33
  @payer = Counterparty.new(nil, attributes[:payer])
34
34
  @payee = Counterparty.new(nil, attributes[:payee])
@@ -14,7 +14,7 @@ module Modulr
14
14
  map :reference
15
15
 
16
16
  def initialize(response, attributes = {})
17
- super(response, attributes)
17
+ super
18
18
 
19
19
  @destination = Destination.new(nil, attributes[:destination])
20
20
  end
@@ -14,7 +14,7 @@ module Modulr
14
14
  map :reference
15
15
 
16
16
  def initialize(response, attributes = {})
17
- super(response, attributes)
17
+ super
18
18
  @destination = Destination.new(nil, attributes[:destination])
19
19
  end
20
20
  end
@@ -166,7 +166,7 @@ module Modulr
166
166
 
167
167
  private def internal?
168
168
  (@attr_details[:sourceAccountId] && @attr_details.key?(:destinationId)) ||
169
- (@attributes.key?(:schemeInfo) && @attributes[:schemeInfo].empty?)
169
+ (@attributes.key?(:schemeInfo) && @attributes[:schemeInfo].empty?)
170
170
  end
171
171
  end
172
172
  end
@@ -19,7 +19,7 @@ module Modulr
19
19
  map :additionalInfo, :additional_info
20
20
 
21
21
  def initialize(response, attributes = {})
22
- super(response, attributes)
22
+ super
23
23
 
24
24
  @balance = attributes[:account][:balance]
25
25
  @available_balance = attributes[:account][:availableBalance]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Modulr
4
- VERSION = "0.0.48"
4
+ VERSION = "0.1.0"
5
5
  end
data/modulr.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.homepage = "https://github.com/devengoapp/modulr-ruby"
20
20
 
21
21
  spec.license = "MIT"
22
- spec.required_ruby_version = ">= 2.7.0"
22
+ spec.required_ruby_version = ">= 3.2"
23
23
 
24
24
  spec.metadata["homepage_uri"] = spec.homepage
25
25
  spec.metadata["source_code_uri"] = "https://github.com/devengoapp/modulr-ruby"
@@ -37,17 +37,6 @@ Gem::Specification.new do |spec|
37
37
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
38
38
  spec.require_paths = ["lib"]
39
39
 
40
- spec.add_dependency "faraday", "~> 1.0"
41
- spec.add_dependency "faraday_middleware", "~> 1.0"
42
- spec.add_development_dependency "byebug", "~> 11.1"
43
- spec.add_development_dependency "guard", "~> 2.0"
44
- spec.add_development_dependency "guard-rspec", "~> 4.0"
45
- spec.add_development_dependency "rake", "~> 12.0"
46
- spec.add_development_dependency "rspec", "~> 3.0"
47
- spec.add_development_dependency "rubocop", "~> 1.0"
48
- spec.add_development_dependency "rubocop-performance", "~> 1.0"
49
- spec.add_development_dependency "rubocop-rake", "~> 0.1"
50
- spec.add_development_dependency "rubocop-rspec", "~> 2.0"
51
- spec.add_development_dependency "test-prof", "~> 1.0"
52
- spec.add_development_dependency "webmock", "~> 2.1"
40
+ spec.add_dependency "base64", "~> 0.2"
41
+ spec.add_dependency "faraday", ">= 2.0", "< 3"
53
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modulr-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.48
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aitor García Rey
@@ -15,187 +15,39 @@ cert_chain: []
15
15
  date: 1980-01-02 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
- name: faraday
18
+ name: base64
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - "~>"
22
22
  - !ruby/object:Gem::Version
23
- version: '1.0'
23
+ version: '0.2'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - "~>"
29
29
  - !ruby/object:Gem::Version
30
- version: '1.0'
30
+ version: '0.2'
31
31
  - !ruby/object:Gem::Dependency
32
- name: faraday_middleware
33
- requirement: !ruby/object:Gem::Requirement
34
- requirements:
35
- - - "~>"
36
- - !ruby/object:Gem::Version
37
- version: '1.0'
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- requirements:
42
- - - "~>"
43
- - !ruby/object:Gem::Version
44
- version: '1.0'
45
- - !ruby/object:Gem::Dependency
46
- name: byebug
47
- requirement: !ruby/object:Gem::Requirement
48
- requirements:
49
- - - "~>"
50
- - !ruby/object:Gem::Version
51
- version: '11.1'
52
- type: :development
53
- prerelease: false
54
- version_requirements: !ruby/object:Gem::Requirement
55
- requirements:
56
- - - "~>"
57
- - !ruby/object:Gem::Version
58
- version: '11.1'
59
- - !ruby/object:Gem::Dependency
60
- name: guard
32
+ name: faraday
61
33
  requirement: !ruby/object:Gem::Requirement
62
34
  requirements:
63
- - - "~>"
64
- - !ruby/object:Gem::Version
65
- version: '2.0'
66
- type: :development
67
- prerelease: false
68
- version_requirements: !ruby/object:Gem::Requirement
69
- requirements:
70
- - - "~>"
35
+ - - ">="
71
36
  - !ruby/object:Gem::Version
72
37
  version: '2.0'
73
- - !ruby/object:Gem::Dependency
74
- name: guard-rspec
75
- requirement: !ruby/object:Gem::Requirement
76
- requirements:
77
- - - "~>"
78
- - !ruby/object:Gem::Version
79
- version: '4.0'
80
- type: :development
81
- prerelease: false
82
- version_requirements: !ruby/object:Gem::Requirement
83
- requirements:
84
- - - "~>"
85
- - !ruby/object:Gem::Version
86
- version: '4.0'
87
- - !ruby/object:Gem::Dependency
88
- name: rake
89
- requirement: !ruby/object:Gem::Requirement
90
- requirements:
91
- - - "~>"
92
- - !ruby/object:Gem::Version
93
- version: '12.0'
94
- type: :development
95
- prerelease: false
96
- version_requirements: !ruby/object:Gem::Requirement
97
- requirements:
98
- - - "~>"
99
- - !ruby/object:Gem::Version
100
- version: '12.0'
101
- - !ruby/object:Gem::Dependency
102
- name: rspec
103
- requirement: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - "~>"
106
- - !ruby/object:Gem::Version
107
- version: '3.0'
108
- type: :development
109
- prerelease: false
110
- version_requirements: !ruby/object:Gem::Requirement
111
- requirements:
112
- - - "~>"
113
- - !ruby/object:Gem::Version
114
- version: '3.0'
115
- - !ruby/object:Gem::Dependency
116
- name: rubocop
117
- requirement: !ruby/object:Gem::Requirement
118
- requirements:
119
- - - "~>"
120
- - !ruby/object:Gem::Version
121
- version: '1.0'
122
- type: :development
123
- prerelease: false
124
- version_requirements: !ruby/object:Gem::Requirement
125
- requirements:
126
- - - "~>"
127
- - !ruby/object:Gem::Version
128
- version: '1.0'
129
- - !ruby/object:Gem::Dependency
130
- name: rubocop-performance
131
- requirement: !ruby/object:Gem::Requirement
132
- requirements:
133
- - - "~>"
134
- - !ruby/object:Gem::Version
135
- version: '1.0'
136
- type: :development
137
- prerelease: false
138
- version_requirements: !ruby/object:Gem::Requirement
139
- requirements:
140
- - - "~>"
141
- - !ruby/object:Gem::Version
142
- version: '1.0'
143
- - !ruby/object:Gem::Dependency
144
- name: rubocop-rake
145
- requirement: !ruby/object:Gem::Requirement
146
- requirements:
147
- - - "~>"
148
- - !ruby/object:Gem::Version
149
- version: '0.1'
150
- type: :development
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- requirements:
154
- - - "~>"
155
- - !ruby/object:Gem::Version
156
- version: '0.1'
157
- - !ruby/object:Gem::Dependency
158
- name: rubocop-rspec
159
- requirement: !ruby/object:Gem::Requirement
160
- requirements:
161
- - - "~>"
38
+ - - "<"
162
39
  - !ruby/object:Gem::Version
163
- version: '2.0'
164
- type: :development
40
+ version: '3'
41
+ type: :runtime
165
42
  prerelease: false
166
43
  version_requirements: !ruby/object:Gem::Requirement
167
44
  requirements:
168
- - - "~>"
45
+ - - ">="
169
46
  - !ruby/object:Gem::Version
170
47
  version: '2.0'
171
- - !ruby/object:Gem::Dependency
172
- name: test-prof
173
- requirement: !ruby/object:Gem::Requirement
174
- requirements:
175
- - - "~>"
176
- - !ruby/object:Gem::Version
177
- version: '1.0'
178
- type: :development
179
- prerelease: false
180
- version_requirements: !ruby/object:Gem::Requirement
181
- requirements:
182
- - - "~>"
183
- - !ruby/object:Gem::Version
184
- version: '1.0'
185
- - !ruby/object:Gem::Dependency
186
- name: webmock
187
- requirement: !ruby/object:Gem::Requirement
188
- requirements:
189
- - - "~>"
190
- - !ruby/object:Gem::Version
191
- version: '2.1'
192
- type: :development
193
- prerelease: false
194
- version_requirements: !ruby/object:Gem::Requirement
195
- requirements:
196
- - - "~>"
48
+ - - "<"
197
49
  - !ruby/object:Gem::Version
198
- version: '2.1'
50
+ version: '3'
199
51
  description: Ruby client for Modulr Finance API.
200
52
  email:
201
53
  - aitor@devengo.com
@@ -213,6 +65,7 @@ files:
213
65
  - ".rubocop.yml"
214
66
  - ".rubocop_devengo.yml"
215
67
  - ".ruby-version"
68
+ - CHANGELOG.md
216
69
  - CODE_OF_CONDUCT.md
217
70
  - Gemfile
218
71
  - Gemfile.lock
@@ -273,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
273
126
  requirements:
274
127
  - - ">="
275
128
  - !ruby/object:Gem::Version
276
- version: 2.7.0
129
+ version: '3.2'
277
130
  required_rubygems_version: !ruby/object:Gem::Requirement
278
131
  requirements:
279
132
  - - ">="