paychex_api 0.0.26 → 0.0.28

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: 2f72a02ebb9077fda3a04a01702c7cc0cb6b2f935922a96f792285456f0c2309
4
- data.tar.gz: 6332d3d87f09fd1e0eaf556ac5571cbbcffa32a8cea53cc1d48ebfd967f95a0a
3
+ metadata.gz: 64d05e8b83a00fd01ba8934f109fc66bcbe1dc92937fed269e100c5557093eef
4
+ data.tar.gz: fb87588d4e5d234b72c5c048553de5b9e9d6a756d863398e1d8dc6792f2286a5
5
5
  SHA512:
6
- metadata.gz: cf887d44b56107c7d554322c9d0c6f5333dbc0b56414f237fb051a5d3fd198320d08f656ebe6b45c9b5e5143d3d6a83515ab3c4ea51fb8c5a0608df0ff2d96e1
7
- data.tar.gz: 898d26059ce7b3068d330b51ef822865c390e52ffbd95bbefee8e95603d17bf399f03c3e332bb52cf57e76c9f495de2b1805ab6b952aefad1c844aa6c272f502
6
+ metadata.gz: d873ee94a663cec68f5ab81e440c2fa1271a4abb3e6f7869e6c0de175ed2b62096346cc6dbee8ea5d83002a4dc9ae598488247fe838826a5b55e829a383de5af
7
+ data.tar.gz: b7a19e1dd16e36dccab4d12934ee678dcd77fef51dca440252dcdaec5ad66b9d2e58c0983a296b18c4a3da483c9c35ecfb119a1121c1b2e2bfc8d51c0b11aa89
@@ -10,9 +10,10 @@ jobs:
10
10
  - name: Setup Ruby # Step 2 (we gave the name 'Setup Ruby' to this step)
11
11
  uses: ruby/setup-ruby@v1
12
12
  with:
13
- ruby-version: 2.5.0
13
+ ruby-version: 3.2.2
14
14
  - name: Install bundle and gems # Step 4
15
15
  run: |
16
+ gem update --system
16
17
  gem install bundler
17
18
  bundle install --jobs 4 --retry 3
18
19
  - if: ${{ failure() }}
data/.rubocop.yml CHANGED
@@ -22,3 +22,5 @@ Metrics/MethodLength:
22
22
  - spec/**/*
23
23
  Naming/AccessorMethodName:
24
24
  Enabled: false
25
+ Gemspec/RequiredRubyVersion:
26
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,71 +1,81 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paychex_api (0.0.26)
5
- faraday (~> 0.9.0)
4
+ paychex_api (0.0.28)
5
+ faraday (~> 0.17.3)
6
6
  faraday_middleware (>= 0.12.2)
7
7
  footrest (>= 0.5.1)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.1.1)
12
+ activesupport (7.1.3.2)
13
+ base64
14
+ bigdecimal
13
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
+ connection_pool (>= 2.2.5)
17
+ drb
14
18
  i18n (>= 1.6, < 2)
15
19
  minitest (>= 5.1)
20
+ mutex_m
16
21
  tzinfo (~> 2.0)
17
- zeitwerk (~> 2.3)
18
- addressable (2.7.0)
19
- public_suffix (>= 2.0.2, < 5.0)
20
- ast (2.4.1)
22
+ addressable (2.8.6)
23
+ public_suffix (>= 2.0.2, < 6.0)
24
+ ast (2.4.2)
25
+ base64 (0.2.0)
26
+ bigdecimal (3.1.6)
21
27
  byebug (11.1.3)
22
28
  coderay (1.1.3)
23
- concurrent-ruby (1.1.7)
24
- crack (0.4.3)
25
- safe_yaml (~> 1.0.0)
26
- diff-lcs (1.4.4)
27
- docile (1.3.2)
28
- faraday (0.9.2)
29
+ concurrent-ruby (1.2.3)
30
+ connection_pool (2.4.1)
31
+ crack (1.0.0)
32
+ bigdecimal
33
+ rexml
34
+ diff-lcs (1.5.1)
35
+ docile (1.4.0)
36
+ drb (2.2.1)
37
+ faraday (0.17.6)
29
38
  multipart-post (>= 1.2, < 3)
30
39
  faraday_middleware (0.14.0)
31
40
  faraday (>= 0.7.4, < 1.0)
32
- footrest (0.5.3)
41
+ footrest (0.5.5)
33
42
  activesupport (>= 3.0.0)
34
43
  faraday (>= 0.9.0, < 1)
35
44
  link_header (>= 0.0.7)
36
- gergich (1.2.0)
45
+ gergich (1.2.3)
37
46
  httparty (~> 0.17)
38
47
  sqlite3 (~> 1.4)
39
- hashdiff (1.0.1)
40
- httparty (0.18.1)
41
- mime-types (~> 3.0)
48
+ hashdiff (1.1.0)
49
+ httparty (0.21.0)
50
+ mini_mime (>= 1.0.0)
42
51
  multi_xml (>= 0.5.2)
43
- i18n (1.8.7)
52
+ i18n (1.14.4)
44
53
  concurrent-ruby (~> 1.0)
45
54
  link_header (0.0.8)
46
55
  method_source (1.0.0)
47
- mime-types (3.3.1)
48
- mime-types-data (~> 3.2015)
49
- mime-types-data (3.2020.0512)
50
- minitest (5.14.3)
56
+ mini_mime (1.1.5)
57
+ minitest (5.22.2)
51
58
  multi_xml (0.6.0)
52
- multipart-post (2.1.1)
53
- mustermann (1.1.1)
59
+ multipart-post (2.4.0)
60
+ mustermann (2.0.2)
54
61
  ruby2_keywords (~> 0.0.1)
55
- parallel (1.19.2)
56
- parser (2.7.1.4)
62
+ mutex_m (0.2.0)
63
+ parallel (1.24.0)
64
+ parser (3.3.0.5)
57
65
  ast (~> 2.4.1)
58
- pry (0.13.1)
66
+ racc
67
+ pry (0.14.2)
59
68
  coderay (~> 1.1)
60
69
  method_source (~> 1.0)
61
- public_suffix (4.0.5)
62
- rack (2.2.3)
63
- rack-protection (2.0.8.1)
70
+ public_suffix (5.0.4)
71
+ racc (1.7.3)
72
+ rack (2.2.8.1)
73
+ rack-protection (2.2.4)
64
74
  rack
65
- rainbow (3.0.0)
66
- rake (13.0.1)
67
- regexp_parser (1.7.1)
68
- rexml (3.2.4)
75
+ rainbow (3.1.1)
76
+ rake (13.1.0)
77
+ regexp_parser (2.9.0)
78
+ rexml (3.2.6)
69
79
  rspec (2.99.0)
70
80
  rspec-core (~> 2.99.0)
71
81
  rspec-expectations (~> 2.99.0)
@@ -74,42 +84,42 @@ GEM
74
84
  rspec-expectations (2.99.2)
75
85
  diff-lcs (>= 1.1.3, < 2.0)
76
86
  rspec-mocks (2.99.4)
77
- rubocop (0.88.0)
87
+ rubocop (0.93.1)
78
88
  parallel (~> 1.10)
79
- parser (>= 2.7.1.1)
89
+ parser (>= 2.7.1.5)
80
90
  rainbow (>= 2.2.2, < 4.0)
81
- regexp_parser (>= 1.7)
91
+ regexp_parser (>= 1.8)
82
92
  rexml
83
- rubocop-ast (>= 0.1.0, < 1.0)
93
+ rubocop-ast (>= 0.6.0)
84
94
  ruby-progressbar (~> 1.7)
85
95
  unicode-display_width (>= 1.4.0, < 2.0)
86
- rubocop-ast (0.2.0)
87
- parser (>= 2.7.0.1)
88
- ruby-progressbar (1.10.1)
89
- ruby2_keywords (0.0.2)
90
- safe_yaml (1.0.5)
91
- simplecov (0.18.5)
96
+ rubocop-ast (1.31.2)
97
+ parser (>= 3.3.0.4)
98
+ ruby-progressbar (1.13.0)
99
+ ruby2_keywords (0.0.5)
100
+ simplecov (0.22.0)
92
101
  docile (~> 1.1)
93
102
  simplecov-html (~> 0.11)
94
- simplecov-html (0.12.2)
95
- sinatra (2.0.8.1)
96
- mustermann (~> 1.0)
97
- rack (~> 2.0)
98
- rack-protection (= 2.0.8.1)
103
+ simplecov_json_formatter (~> 0.1)
104
+ simplecov-html (0.12.3)
105
+ simplecov_json_formatter (0.1.4)
106
+ sinatra (2.2.4)
107
+ mustermann (~> 2.0)
108
+ rack (~> 2.2)
109
+ rack-protection (= 2.2.4)
99
110
  tilt (~> 2.0)
100
- sqlite3 (1.4.2)
101
- tilt (2.0.10)
102
- tzinfo (2.0.4)
111
+ sqlite3 (1.7.2-arm64-darwin)
112
+ tilt (2.3.0)
113
+ tzinfo (2.0.6)
103
114
  concurrent-ruby (~> 1.0)
104
- unicode-display_width (1.7.0)
105
- webmock (3.8.3)
106
- addressable (>= 2.3.6)
115
+ unicode-display_width (1.8.0)
116
+ webmock (3.23.0)
117
+ addressable (>= 2.8.0)
107
118
  crack (>= 0.3.2)
108
119
  hashdiff (>= 0.4.0, < 2.0.0)
109
- zeitwerk (2.4.2)
110
120
 
111
121
  PLATFORMS
112
- ruby
122
+ arm64-darwin-22
113
123
 
114
124
  DEPENDENCIES
115
125
  bundler (>= 1.0)
@@ -125,4 +135,4 @@ DEPENDENCIES
125
135
  webmock (>= 1.22)
126
136
 
127
137
  BUNDLED WITH
128
- 1.17.3
138
+ 2.4.22
@@ -22,6 +22,14 @@ module PaychexAPI
22
22
  get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}#{WORKERS_PATH}", params)
23
23
  end
24
24
 
25
+ def get_company_locations(company_id, params = {})
26
+ get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}/#{LOCATIONS_PATH}", params)
27
+ end
28
+
29
+ def get_company_location(company_id, location_id, params = {})
30
+ get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}/#{LOCATIONS_PATH}/#{location_id}", params)
31
+ end
32
+
25
33
  def get_company_by_display_id(display_id, params = {})
26
34
  params = params.merge(displayid: display_id)
27
35
  get("#{API_PATH}#{COMPANIES_PATH}", params)
@@ -1,11 +1,9 @@
1
- # rubocop:disable Lint/UriEscapeUnescape
2
1
  module PaychexAPI
3
2
  class Client
4
3
  module Notifications
5
4
  def send_notification(notification_id, params = {})
6
- post("#{API_PATH}#{NOTIFICATIONS_PATH}/#{URI.escape(notification_id)}", params)
5
+ post("#{API_PATH}#{NOTIFICATIONS_PATH}/#{CGI.escape(notification_id).gsub('+', '%20')}", params)
7
6
  end
8
7
  end
9
8
  end
10
9
  end
11
- # rubocop:enable Lint/UriEscapeUnescape
@@ -32,6 +32,7 @@ module PaychexAPI
32
32
  OAUTH_TOKEN_PATH = '/auth/oauth/v2/token'.freeze
33
33
  USERS_PATH = '/users'.freeze
34
34
  PURCHASES_PATH = '/purchases'.freeze
35
+ LOCATIONS_PATH = '/locations'.freeze
35
36
 
36
37
  attr_reader :authorization
37
38
 
@@ -1,3 +1,3 @@
1
1
  module PaychexAPI
2
- VERSION = '0.0.26'.freeze unless defined?(PaychexAPI::VERSION)
2
+ VERSION = '0.0.28'.freeze unless defined?(PaychexAPI::VERSION)
3
3
  end
data/paychex_api.gemspec CHANGED
@@ -3,8 +3,8 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)
3
3
  require 'paychex_api/version'
4
4
 
5
5
  Gem::Specification.new do |gem|
6
- gem.authors = ['Jay Shaffer']
7
- gem.email = ['jshaffer@instructure.com']
6
+ gem.authors = ['Cody Tanner']
7
+ gem.email = ['cody.tanner@getbridge.com']
8
8
  gem.description = 'Interface for interacting with the paychex enterprise API'
9
9
  gem.summary = 'Paychex API'
10
10
  gem.homepage = ''
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
29
29
  gem.add_development_dependency 'sinatra', '>= 1.0', '< 3'
30
30
  gem.add_development_dependency 'webmock', '>= 1.22'
31
31
 
32
- gem.add_dependency 'faraday', '~> 0.9.0'
32
+ gem.add_dependency 'faraday', '~> 0.17.3'
33
33
  gem.add_dependency 'faraday_middleware', '>= 0.12.2'
34
34
  gem.add_dependency 'footrest', '>= 0.5.1'
35
35
  end
@@ -0,0 +1,17 @@
1
+ {
2
+ "content": [
3
+ {
4
+ "locationId": "1040011892857651",
5
+ "name": "Location_110207",
6
+ "address": {
7
+ "streetLineOne": "886 Queen Avenue",
8
+ "streetLineTwo": "866 Euclid Gate",
9
+ "city": "Buffalo",
10
+ "postalCode": "14202",
11
+ "countrySubdivisionCode": "NY",
12
+ "countryCode": "US"
13
+ }
14
+ }
15
+ ],
16
+ "links": []
17
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "metadata": {
3
+ "contentItemCount": 6
4
+ },
5
+ "content": [
6
+ {
7
+ "locationId": "1040011892857651",
8
+ "name": "Location_110207",
9
+ "address": {
10
+ "streetLineOne": "886 Queen Avenue",
11
+ "streetLineTwo": "866 Euclid Gate",
12
+ "city": "Buffalo",
13
+ "postalCode": "14202",
14
+ "countrySubdivisionCode": "NY",
15
+ "countryCode": "US"
16
+ }
17
+ },
18
+ {
19
+ "locationId": "1040011892857657",
20
+ "name": "Location_830745",
21
+ "address": {
22
+ "streetLineOne": "540 Cardinal Court",
23
+ "streetLineTwo": "347 Jackson Trail",
24
+ "city": "Bridgeport",
25
+ "postalCode": "06601",
26
+ "countrySubdivisionCode": "CT",
27
+ "countryCode": "US"
28
+ }
29
+ },
30
+ {
31
+ "locationId": "1040011892857681",
32
+ "name": "Location_965274",
33
+ "address": {
34
+ "streetLineOne": "700 Sixth Street",
35
+ "streetLineTwo": "948 Cypress Circle",
36
+ "city": "Portsmouth",
37
+ "postalCode": "03802",
38
+ "countrySubdivisionCode": "NH",
39
+ "countryCode": "US"
40
+ }
41
+ },
42
+ {
43
+ "locationId": "1040011892857669",
44
+ "name": "Location_933960",
45
+ "address": {
46
+ "streetLineOne": "91 Orchard Freeway",
47
+ "streetLineTwo": "386 Second Court",
48
+ "city": "Bangor",
49
+ "postalCode": "04402",
50
+ "countrySubdivisionCode": "ME",
51
+ "countryCode": "US"
52
+ }
53
+ },
54
+ {
55
+ "locationId": "1040011892857675",
56
+ "name": "Location_223814",
57
+ "address": {
58
+ "streetLineOne": "696 Bridle Highway",
59
+ "streetLineTwo": "238 Standish Heights",
60
+ "city": "Boston",
61
+ "postalCode": "02113",
62
+ "countrySubdivisionCode": "MA",
63
+ "countryCode": "US"
64
+ }
65
+ },
66
+ {
67
+ "locationId": "1040011892857663",
68
+ "name": "Location_882082",
69
+ "address": {
70
+ "streetLineOne": "367 Tanglewood Bay",
71
+ "streetLineTwo": "739 Nineth Freeway",
72
+ "city": "Burlington",
73
+ "postalCode": "05401",
74
+ "countrySubdivisionCode": "VT",
75
+ "countryCode": "US"
76
+ }
77
+ }
78
+ ],
79
+ "links": []
80
+ }
@@ -31,6 +31,16 @@ describe PaychexAPI::Client::Companies do
31
31
  expect(response.first['workerId']).to(eq('00Z5V9BTIHRQF2CF7BTH'))
32
32
  end
33
33
 
34
+ it 'should get company locations' do
35
+ response = @client.get_company_locations(1)
36
+ expect(response.first['locationId']).to(eq('1040011892857651'))
37
+ end
38
+
39
+ it 'should get a company location' do
40
+ response = @client.get_company_location(1, 1)
41
+ expect(response.first['locationId']).to(eq('1040011892857651'))
42
+ end
43
+
34
44
  it 'should get company associations with association type' do
35
45
  response = @client.get_company_associations_by_regex_type(1, /LMS.*/)
36
46
  expect(response.first['associations'].length).to(eq(1))
@@ -21,6 +21,15 @@ class FakePaychex < Sinatra::Base
21
21
  get_json_data 200, 'workers.json'
22
22
  end
23
23
 
24
+ # locations
25
+ get %r{/companies/.*/locations} do
26
+ get_json_data 200, 'company_locations.json'
27
+ end
28
+
29
+ get %r{/companies/.*/locations/\+d+} do
30
+ get_json_data 200, 'company_location.json'
31
+ end
32
+
24
33
  get %r{/workers/\d+/users} do
25
34
  case request.env['HTTP_ACCEPT']
26
35
  when "application/json;profile='http://api.paychex.com/profiles/users/v1'"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paychex_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
- - Jay Shaffer
7
+ - Cody Tanner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-13 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -162,14 +162,14 @@ dependencies:
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: 0.9.0
165
+ version: 0.17.3
166
166
  type: :runtime
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: 0.9.0
172
+ version: 0.17.3
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: faraday_middleware
175
175
  requirement: !ruby/object:Gem::Requirement
@@ -200,7 +200,7 @@ dependencies:
200
200
  version: 0.5.1
201
201
  description: Interface for interacting with the paychex enterprise API
202
202
  email:
203
- - jshaffer@instructure.com
203
+ - cody.tanner@getbridge.com
204
204
  executables: []
205
205
  extensions: []
206
206
  extra_rdoc_files: []
@@ -234,6 +234,8 @@ files:
234
234
  - spec/fixtures/communications.json
235
235
  - spec/fixtures/companies.json
236
236
  - spec/fixtures/companies_associations.json
237
+ - spec/fixtures/company_location.json
238
+ - spec/fixtures/company_locations.json
237
239
  - spec/fixtures/messages.json
238
240
  - spec/fixtures/organizations.json
239
241
  - spec/fixtures/status.json
@@ -271,31 +273,33 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
273
  - !ruby/object:Gem::Version
272
274
  version: '0'
273
275
  requirements: []
274
- rubygems_version: 3.0.3
276
+ rubygems_version: 3.4.19
275
277
  signing_key:
276
278
  specification_version: 4
277
279
  summary: Paychex API
278
280
  test_files:
279
- - spec/paychex_api/paychex_api_spec.rb
280
- - spec/paychex_api/client_spec.rb
281
+ - spec/fixtures/association_companies.json
282
+ - spec/fixtures/auth.json
283
+ - spec/fixtures/communications.json
284
+ - spec/fixtures/companies.json
285
+ - spec/fixtures/companies_associations.json
286
+ - spec/fixtures/company_location.json
287
+ - spec/fixtures/company_locations.json
288
+ - spec/fixtures/messages.json
289
+ - spec/fixtures/organizations.json
290
+ - spec/fixtures/status.json
291
+ - spec/fixtures/users.json
292
+ - spec/fixtures/workers.json
281
293
  - spec/paychex_api/api_array_spec.rb
282
- - spec/paychex_api/client/companies_spec.rb
283
294
  - spec/paychex_api/client/associations_spec.rb
295
+ - spec/paychex_api/client/companies_spec.rb
296
+ - spec/paychex_api/client/messages_spec.rb
297
+ - spec/paychex_api/client/notifications_spec.rb
284
298
  - spec/paychex_api/client/purchases_spec.rb
285
299
  - spec/paychex_api/client/statuses_spec.rb
286
300
  - spec/paychex_api/client/users_spec.rb
287
- - spec/paychex_api/client/messages_spec.rb
288
301
  - spec/paychex_api/client/workers_spec.rb
289
- - spec/paychex_api/client/notifications_spec.rb
302
+ - spec/paychex_api/client_spec.rb
303
+ - spec/paychex_api/paychex_api_spec.rb
290
304
  - spec/support/fake_paychex.rb
291
- - spec/fixtures/messages.json
292
- - spec/fixtures/organizations.json
293
- - spec/fixtures/users.json
294
- - spec/fixtures/companies.json
295
- - spec/fixtures/workers.json
296
- - spec/fixtures/auth.json
297
- - spec/fixtures/communications.json
298
- - spec/fixtures/association_companies.json
299
- - spec/fixtures/status.json
300
- - spec/fixtures/companies_associations.json
301
305
  - spec/test_helper.rb