tipalti-ruby 0.4.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c31c8896d94b7f278e2b9dbd549e41a491d99a2321ea35d6589672325575e59
4
- data.tar.gz: df548617c330afde839ea4029a3df016a2547646d2dd9441b8be8e8ba395f16b
3
+ metadata.gz: eac628b8ad69fa51e9fb1237c1af4d7e89ec75fa44c435277585a5b05e63c170
4
+ data.tar.gz: a6e0be5ebc8e4b12bcf0a252c578c39beadc949b45894b7961db58a30c813825
5
5
  SHA512:
6
- metadata.gz: 0f593b4f11033f7340b46c441a673ff8e4df3b05ed7331f46ac8dbaa771aa2a0737bbf37eb2a67102960159dd57d1d63f6623320fe3dc410a4636df57dde75d7
7
- data.tar.gz: c8589eb5007b3ec5e0f60342ea65902d8de7b40367f9a509ed3dae6b12bfdf197f485f65759d72da3ce6badff6186fd2564e56981ee9f2e01ac68f8756320a9e
6
+ metadata.gz: f9bdde7deb7ffe93f640772f02ef2e180ce21ca7b5e20c834db0e3e1ed9093b77597f76de3b2ef152045cb86eda75f4e993a5b56ef3c31ed7fa539b3f8e96088
7
+ data.tar.gz: 9981685f5ed74ed5b7b1512b961c53e7fa1024b8906941115113e313d454a92b1e62d5ab86ecf9524846003a56bab4bc47a3f15ee6778743861c172768cad6fc
data/Gemfile CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "faraday", "~> 1.0", ">= 1.0.0"
5
+ gemspec
6
+
7
+ gem "faraday", "~> 2.0"
6
8
  gem "oauth2", "~> 2.0"
7
9
 
8
10
  group :development, :test do
data/Gemfile.lock CHANGED
@@ -1,41 +1,34 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ tipalti-ruby (0.5.1)
5
+ faraday (~> 2.0)
6
+ oauth2 (~> 2.0)
7
+
1
8
  GEM
2
9
  remote: https://rubygems.org/
3
10
  specs:
4
- addressable (2.8.5)
11
+ addressable (2.8.6)
5
12
  public_suffix (>= 2.0.2, < 6.0)
6
13
  ast (2.4.2)
7
- crack (0.4.5)
14
+ base64 (0.2.0)
15
+ bigdecimal (3.1.6)
16
+ crack (1.0.0)
17
+ bigdecimal
8
18
  rexml
9
- diff-lcs (1.5.0)
10
- faraday (1.10.3)
11
- faraday-em_http (~> 1.0)
12
- faraday-em_synchrony (~> 1.0)
13
- faraday-excon (~> 1.1)
14
- faraday-httpclient (~> 1.0)
15
- faraday-multipart (~> 1.0)
16
- faraday-net_http (~> 1.0)
17
- faraday-net_http_persistent (~> 1.0)
18
- faraday-patron (~> 1.0)
19
- faraday-rack (~> 1.0)
20
- faraday-retry (~> 1.0)
21
- ruby2_keywords (>= 0.0.4)
22
- faraday-em_http (1.0.0)
23
- faraday-em_synchrony (1.0.0)
24
- faraday-excon (1.1.0)
25
- faraday-httpclient (1.0.1)
26
- faraday-multipart (1.0.4)
27
- multipart-post (~> 2)
28
- faraday-net_http (1.0.1)
29
- faraday-net_http_persistent (1.2.0)
30
- faraday-patron (1.0.0)
31
- faraday-rack (1.0.0)
32
- faraday-retry (1.0.3)
33
- hashdiff (1.0.1)
19
+ diff-lcs (1.5.1)
20
+ faraday (2.9.0)
21
+ faraday-net_http (>= 2.0, < 3.2)
22
+ faraday-net_http (3.1.0)
23
+ net-http
24
+ hashdiff (1.1.0)
34
25
  hashie (5.0.0)
35
- json (2.6.3)
36
- jwt (2.7.1)
26
+ json (2.7.1)
27
+ jwt (2.8.1)
28
+ base64
37
29
  multi_xml (0.6.0)
38
- multipart-post (2.3.0)
30
+ net-http (0.4.1)
31
+ uri
39
32
  oauth2 (2.0.9)
40
33
  faraday (>= 0.17.3, < 3.0)
41
34
  jwt (>= 1.0, < 3.0)
@@ -43,30 +36,30 @@ GEM
43
36
  rack (>= 1.2, < 4)
44
37
  snaky_hash (~> 2.0)
45
38
  version_gem (~> 1.1)
46
- parallel (1.23.0)
47
- parser (3.2.2.3)
39
+ parallel (1.24.0)
40
+ parser (3.3.0.5)
48
41
  ast (~> 2.4.1)
49
42
  racc
50
- public_suffix (5.0.3)
51
- racc (1.7.1)
52
- rack (3.0.8)
43
+ public_suffix (5.0.4)
44
+ racc (1.7.3)
45
+ rack (3.0.9.1)
53
46
  rainbow (3.1.1)
54
47
  rake (13.0.6)
55
- regexp_parser (2.8.1)
48
+ regexp_parser (2.9.0)
56
49
  rexml (3.2.6)
57
50
  rspec (3.12.0)
58
51
  rspec-core (~> 3.12.0)
59
52
  rspec-expectations (~> 3.12.0)
60
53
  rspec-mocks (~> 3.12.0)
61
- rspec-core (3.12.2)
54
+ rspec-core (3.12.3)
62
55
  rspec-support (~> 3.12.0)
63
- rspec-expectations (3.12.3)
56
+ rspec-expectations (3.12.4)
64
57
  diff-lcs (>= 1.2.0, < 2.0)
65
58
  rspec-support (~> 3.12.0)
66
- rspec-mocks (3.12.6)
59
+ rspec-mocks (3.12.7)
67
60
  diff-lcs (>= 1.2.0, < 2.0)
68
61
  rspec-support (~> 3.12.0)
69
- rspec-support (3.12.1)
62
+ rspec-support (3.12.2)
70
63
  rspec_junit_formatter (0.6.0)
71
64
  rspec-core (>= 2, < 4, != 2.12.0)
72
65
  rubocop (1.52.1)
@@ -79,22 +72,22 @@ GEM
79
72
  rubocop-ast (>= 1.28.0, < 2.0)
80
73
  ruby-progressbar (~> 1.7)
81
74
  unicode-display_width (>= 2.4.0, < 3.0)
82
- rubocop-ast (1.29.0)
83
- parser (>= 3.2.1.0)
84
- rubocop-capybara (2.18.0)
75
+ rubocop-ast (1.31.2)
76
+ parser (>= 3.3.0.4)
77
+ rubocop-capybara (2.20.0)
78
+ rubocop (~> 1.41)
79
+ rubocop-factory_bot (2.25.1)
85
80
  rubocop (~> 1.41)
86
- rubocop-factory_bot (2.23.1)
87
- rubocop (~> 1.33)
88
81
  rubocop-rspec (2.22.0)
89
82
  rubocop (~> 1.33)
90
83
  rubocop-capybara (~> 2.17)
91
84
  rubocop-factory_bot (~> 2.22)
92
85
  ruby-progressbar (1.13.0)
93
- ruby2_keywords (0.0.5)
94
86
  snaky_hash (2.0.1)
95
87
  hashie
96
88
  version_gem (~> 1.1, >= 1.1.1)
97
- unicode-display_width (2.4.2)
89
+ unicode-display_width (2.5.0)
90
+ uri (0.13.0)
98
91
  version_gem (1.1.3)
99
92
  webmock (3.18.1)
100
93
  addressable (>= 2.8.0)
@@ -102,17 +95,19 @@ GEM
102
95
  hashdiff (>= 0.4.0, < 2.0.0)
103
96
 
104
97
  PLATFORMS
98
+ ruby
105
99
  x86_64-linux
106
100
 
107
101
  DEPENDENCIES
108
- faraday (~> 1.0, >= 1.0.0)
102
+ faraday (~> 2.0)
109
103
  oauth2 (~> 2.0)
110
104
  rake (~> 13.0.6)
111
105
  rspec (~> 3.12.0)
112
106
  rspec_junit_formatter (~> 0.6.0)
113
107
  rubocop (~> 1.52.1)
114
108
  rubocop-rspec (~> 2.22.0)
109
+ tipalti-ruby!
115
110
  webmock (~> 3.18.1)
116
111
 
117
112
  BUNDLED WITH
118
- 2.4.10
113
+ 2.5.3
data/README.md CHANGED
@@ -31,7 +31,7 @@ client = Tipalti::Client.new(
31
31
  client_id: 'client_id', # Tipalti developer app client id
32
32
  client_secret: 'client_secret', # Tipalti developer app client id
33
33
  access_token: 'access_token', # Access token from authorization flow
34
- refresh_token: 'refresh_token', # Frefresh token from authorization flow
34
+ refresh_token: 'refresh_token', # Refresh token from authorization flow
35
35
  code_verifier: 'secret', # Code verifier from authorization flow
36
36
  )
37
37
  ```
@@ -3,13 +3,19 @@
3
3
  module Tipalti
4
4
  module Actions
5
5
  module Token
6
- def token_refresh
6
+ def token_refresh # rubocop:disable Metrics/MethodLength
7
7
  response = connection_token.post("/connect/token",
8
- client_id: @client_id,
9
- client_secret: @client_secret,
10
- grant_type: "refresh_token",
11
- refresh_token: @refresh_token,
12
- code_verifier: @code_verifier)
8
+ {
9
+ client_id: @client_id,
10
+ client_secret: @client_secret,
11
+ grant_type: "refresh_token",
12
+ refresh_token: @refresh_token,
13
+ code_verifier: @code_verifier
14
+ },
15
+ {
16
+ body: :form,
17
+ content_type: "application/x-www-form-urlencoded"
18
+ })
13
19
 
14
20
  # Refresh the client values inline
15
21
  @access_token = response["access_token"]
@@ -32,7 +32,7 @@ module Tipalti
32
32
  end
33
33
 
34
34
  def connection_token
35
- Connection.new(access_token: @access_token, url: token_url)
35
+ Connection.new(url: token_url)
36
36
  end
37
37
 
38
38
  def token_url
@@ -23,18 +23,23 @@ module Tipalti
23
23
  request(:head, path, params)
24
24
  end
25
25
 
26
- def post(path, **params)
27
- request(:post, path, params)
26
+ def post(path, params = {}, options = {})
27
+ request(:post, path, params, options)
28
28
  end
29
29
 
30
30
  def put(path, **params)
31
31
  request(:put, path, params)
32
32
  end
33
33
 
34
- def request(method, path, params)
34
+ def request(method, path, params, options = {}) # rubocop:disable Metrics/MethodLength
35
35
  response = connection.public_send(method, path, params) do |request|
36
36
  request.headers["accept"] = "application/json"
37
37
  request.headers["authorization"] = "Bearer #{@access_token}" if @access_token
38
+
39
+ if options[:body] == :form
40
+ request.headers["Content-Type"] = "application/x-www-form-urlencoded"
41
+ request.body = URI.encode_www_form(params)
42
+ end
38
43
  end
39
44
 
40
45
  error = Error.from_response(response)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tipalti
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tipalti-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Ell
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-21 00:00:00.000000000 Z
11
+ date: 2024-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 1.0.0
19
+ version: '2.0'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '1.0'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 1.0.0
26
+ version: '2.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: oauth2
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -78,7 +72,7 @@ metadata:
78
72
  source_code_uri: https://github.com/riipen/tipalti-ruby
79
73
  changelog_uri: https://github.com/riipen/tipalti-ruby/blob/master/CHANGELOG.md
80
74
  rubygems_mfa_required: 'true'
81
- post_install_message:
75
+ post_install_message:
82
76
  rdoc_options: []
83
77
  require_paths:
84
78
  - lib
@@ -93,8 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
87
  - !ruby/object:Gem::Version
94
88
  version: '0'
95
89
  requirements: []
96
- rubygems_version: 3.3.26
97
- signing_key:
90
+ rubygems_version: 3.5.3
91
+ signing_key:
98
92
  specification_version: 4
99
93
  summary: An API client for Tipalti in ruby.
100
94
  test_files: []