xero-ruby 2.7.0 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/lib/xero-ruby/api_client.rb +2 -1
- data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +9 -2
- data/lib/xero-ruby/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03abd466e114decb262bf28248c8d7b28d41ca70fbf094e47e1fb60c03200fb1
|
4
|
+
data.tar.gz: acbcb6c935d37121c80ad71ceeed1c1df5aaf4c6be86454db356f34792558aac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 577ffd5fb0b0fdc652ad12167826b03110e65298870a2a35bd0b128c4ad8714316c37a3c7cfa748ef6a6235ec71a25cb2653d6e5f299e6f45fb4b494ecd5dd15
|
7
|
+
data.tar.gz: 78ec12b893964c7c0b523e3e4b3e42ce2987ef0fea6bb9c524aa1ac732a2d987551bd252b78f06c0eb99774e8af9385194e17ddee2c19475aa1501a52b3389f2
|
data/README.md
CHANGED
@@ -138,6 +138,11 @@ connections = xero_client.connections
|
|
138
138
|
"updatedDateUtc" => "2020-04-15T22:37:10.4943410"
|
139
139
|
}]
|
140
140
|
|
141
|
+
# To completely Revoke a user's access token and all their connections
|
142
|
+
# pass in the users token set to the #revoke_token api_client method
|
143
|
+
|
144
|
+
xero_client.revoke_token(user.token_set)
|
145
|
+
|
141
146
|
# disconnect an org from a user's connections. Pass the connection ['id'] not ['tenantId'].
|
142
147
|
# Useful if you want to enforce only a single org connection per token.
|
143
148
|
remaining_connections = xero_client.disconnect(connections[0]['id'])
|
@@ -155,7 +160,7 @@ require 'jwt'
|
|
155
160
|
|
156
161
|
def token_expired?
|
157
162
|
token_expiry = Time.at(decoded_access_token['exp'])
|
158
|
-
token_expiry
|
163
|
+
token_expiry < Time.now
|
159
164
|
end
|
160
165
|
|
161
166
|
def decoded_access_token
|
data/lib/xero-ruby/api_client.rb
CHANGED
@@ -15,6 +15,7 @@ require 'logger'
|
|
15
15
|
require 'tempfile'
|
16
16
|
require 'find'
|
17
17
|
require 'faraday'
|
18
|
+
require 'base64'
|
18
19
|
|
19
20
|
module XeroRuby
|
20
21
|
class ApiClient
|
@@ -136,7 +137,7 @@ module XeroRuby
|
|
136
137
|
req.body = URI.encode_www_form(data)
|
137
138
|
end
|
138
139
|
return_error(response) unless response.success?
|
139
|
-
if !response.body.
|
140
|
+
if !response.body.nil? && !response.body.empty?
|
140
141
|
body = JSON.parse(response.body)
|
141
142
|
set_token_set(body)
|
142
143
|
else
|
@@ -33,10 +33,17 @@ module XeroRuby::PayrollUk
|
|
33
33
|
OVERTIME_EARNINGS = "OvertimeEarnings".freeze
|
34
34
|
REGULAR_EARNINGS = "RegularEarnings".freeze
|
35
35
|
STATUTORY_ADOPTION_PAY = "StatutoryAdoptionPay".freeze
|
36
|
+
STATUTORY_ADOPTION_PAY_NON_PENSIONABLE = "StatutoryAdoptionPayNonPensionable".freeze
|
37
|
+
STATUTORY_BEREAVEMENT_PAY = "StatutoryBereavementPay".freeze
|
36
38
|
STATUTORY_MATERNITY_PAY = "StatutoryMaternityPay".freeze
|
39
|
+
STATUTORY_MATERNITY_PAY_NON_PENSIONABLE = "StatutoryMaternityPayNonPensionable".freeze
|
37
40
|
STATUTORY_PATERNITY_PAY = "StatutoryPaternityPay".freeze
|
41
|
+
STATUTORY_PATERNITY_PAY_NON_PENSIONABLE = "StatutoryPaternityPayNonPensionable".freeze
|
42
|
+
STATUTORY_PARENTAL_BEREAVEMENT_PAY_NON_PENSIONABLE = "StatutoryParentalBereavementPayNonPensionable".freeze
|
38
43
|
STATUTORY_SHARED_PARENTAL_PAY = "StatutorySharedParentalPay".freeze
|
44
|
+
STATUTORY_SHARED_PARENTAL_PAY_NON_PENSIONABLE = "StatutorySharedParentalPayNonPensionable".freeze
|
39
45
|
STATUTORY_SICK_PAY = "StatutorySickPay".freeze
|
46
|
+
STATUTORY_SICK_PAY_NON_PENSIONABLE = "StatutorySickPayNonPensionable".freeze
|
40
47
|
TIPS_DIRECT = "Tips(Direct)".freeze
|
41
48
|
TIPS_NON_DIRECT = "Tips(Non-Direct)".freeze
|
42
49
|
|
@@ -206,7 +213,7 @@ module XeroRuby::PayrollUk
|
|
206
213
|
def valid?
|
207
214
|
return false if @name.nil?
|
208
215
|
return false if @earnings_type.nil?
|
209
|
-
earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryMaternityPay", "StatutoryPaternityPay", "StatutorySharedParentalPay", "StatutorySickPay", "Tips(Direct)", "Tips(Non-Direct)"])
|
216
|
+
earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "Tips(Direct)", "Tips(Non-Direct)"])
|
210
217
|
return false unless earnings_type_validator.valid?(@earnings_type)
|
211
218
|
return false if @rate_type.nil?
|
212
219
|
rate_type_validator = EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"])
|
@@ -219,7 +226,7 @@ module XeroRuby::PayrollUk
|
|
219
226
|
# Custom attribute writer method checking allowed values (enum).
|
220
227
|
# @param [Object] earnings_type Object to be assigned
|
221
228
|
def earnings_type=(earnings_type)
|
222
|
-
validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryMaternityPay", "StatutoryPaternityPay", "StatutorySharedParentalPay", "StatutorySickPay", "Tips(Direct)", "Tips(Non-Direct)"])
|
229
|
+
validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "Tips(Direct)", "Tips(Non-Direct)"])
|
223
230
|
unless validator.valid?(earnings_type)
|
224
231
|
fail ArgumentError, "invalid value for \"earnings_type\", must be one of #{validator.allowable_values}."
|
225
232
|
end
|
data/lib/xero-ruby/version.rb
CHANGED
@@ -7,9 +7,9 @@ Contact: api@xero.com
|
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
8
|
OpenAPI Generator version: 4.3.1
|
9
9
|
|
10
|
-
The version of the XeroOpenAPI document: 2.9.
|
10
|
+
The version of the XeroOpenAPI document: 2.9.4
|
11
11
|
=end
|
12
12
|
|
13
13
|
module XeroRuby
|
14
|
-
VERSION = '2.7.
|
14
|
+
VERSION = '2.7.1'
|
15
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xero-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xero API Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|